Created
June 14, 2013 00:05
-
-
Save samuraisam/5778469 to your computer and use it in GitHub Desktop.
This file contains 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
TOP | |
| proto | |
| | message | |
| | | ident | |
| | | * MATCH "fart" | |
| | | message-body | |
| | | | ident | |
| | | | * MATCH "ass" | |
| | | * MATCH "\{ass }" | |
| | * MATCH "message fart \{ass }" | |
| * MATCH "message fart \{ass }" | |
* MATCH "message fart \{ass }" | |
No such method 'from' for invocant of type 'Any' | |
in method caps at src/gen/CORE.setting:10127 | |
in method gist at src/gen/CORE.setting:10158 | |
in method gist at src/gen/CORE.setting:893 | |
in method gist at src/gen/CORE.setting:10159 | |
in method gist at src/gen/CORE.setting:893 | |
in method gist at src/gen/CORE.setting:10159 | |
in method gist at src/gen/CORE.setting:893 | |
in method gist at src/gen/CORE.setting:10159 | |
in method gist at src/gen/CORE.setting:893 | |
in sub say at src/gen/CORE.setting:10963 | |
in block at ./pb.pl:42 |
This file contains 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 Grammar::Tracer; | |
grammar PB::Grammar { | |
token TOP { ^ <proto> $ } | |
token proto { [<message> | ';'] } | |
token message { 'message' \s+ <ident> \s+ <message-body> } | |
token ident { \w+ } | |
token message-body { '{' (\s+)? <ident> (\s+)? '}' } | |
} | |
say PB::Grammar.parse('message fart {ass }') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment