Created
June 14, 2013 00:39
-
-
Save samuraisam/5778599 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
grammar PB::Grammar { | |
token TOP { ^ [\s+]? <proto> [\s+]? $ } | |
token proto { [<message> | ';'] } | |
token message { 'message' \s+ <ident> \s+ <message-body> [\s+]? } | |
token ident { \w+ } | |
token message-body { '{' [\s+]? [<message>+]? [\s+]? '}' } | |
} | |
say PB::Grammar.parse(' | |
message fart { | |
message butt {} | |
message butt2 { | |
message inner_butt {} | |
} | |
}' | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment