Created
August 16, 2010 08:24
-
-
Save ingydotnet/526624 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Pegex; | |
use Pegex::Compiler; | |
use XXX; | |
my $grammar = <<'...'; | |
foo: /foo/ <bar>? | |
bar: /bar/ <foo>? | |
... | |
# XXX 'Pegex::Compiler'->compile($grammar); | |
pegex($grammar)->parse("foo bar foo bar foo"); | |
--- !!perl/hash:Pegex::Compiler | |
combined: &1 | |
_FIRST_RULE: foo | |
bar: | |
+all: | |
- +re: bar | |
- +rule: foo | |
<: '?' | |
foo: | |
+all: | |
- +re: foo | |
- +rule: bar | |
<: '?' | |
grammar: *1 | |
... | |
at t.pl line 10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment