Created
March 15, 2016 20:59
-
-
Save anonymous/3a768052cdfd807e6d00 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 BUU { | |
token TOP { <abc>+ }; | |
token abc { 'a' <bc>* }; | |
token bc { [ 'b' <c>* ]+ } | |
token c { 'c' }; | |
}; | |
class BuuAbc0 { | |
method TOP($/) { make $/; } | |
method abc($/) { make $/; } | |
method bc($/) { make $/; } | |
method c($/) { make ~$/; } | |
}; | |
my $r = BUU.parse( "abcabccabbccaababc", :actions( BuuAbc0 ) ); | |
#say $r.ast; | |
say $r; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment