Created
August 20, 2016 13:44
-
-
Save zoffixznet/1e4e52152e906470531f7ab8b92d6f21 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 G { | |
rule TOP { ^ <definition>* $ } | |
rule definition { | |
'block' '{' <line>+ '}' | |
} | |
rule line { | |
['line' ]+ % "&" | |
} | |
} | |
my $text = q< | |
block { | |
line | |
line & line | |
line | |
} | |
>; | |
say G.parse($text); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment