Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- grammar pq;
- token identifier
- {
- hello
- }
- rule S
- {
- <identifier>
- }
- sub parse ($str) {
- if ($str ~~ /<pq::S>/) {
- #return dumptree($/<XML::Grammar::Document::TOP>);
- #say $/.perl;
- #dump_node($/<easyregexp::TOP><root>);
- say $str;
- } else {
- return "no match";
- }
- }
- parse("hello");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement