Created
March 8, 2017 22:33
-
-
Save anonymous/2c04533cb3a61a00b8822ea20237ba7e 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
use Grammar::Tracer; | |
grammar TEST { | |
rule TEST { <from> <where> } | |
rule from {:i FROM <selectedtable> [',' <selectedtable>]* } | |
rule selectedtable {[<shema_name>'.']?<tablename>['@'<linkname>]? [<alias>]? } | |
token shema_name { <identifier> } | |
regex tablename { <identifier> } | |
token linkname { <identifier> } | |
regex alias { <identifier> } | |
token identifier {:i <ident>+ } | |
rule where {:i WHERE .* } | |
regex comma {',' } | |
} | |
my $fic = q:to/FIN_INI/; | |
FROM table1 ,table2 WHERE t1 = t2(+) | |
FIN_INI | |
say TEST.parse($fic, rule => 'TEST'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment