[antlr-interest] How to implement implicit concatenation operator (for Regular Expressions)

Manuel Kirschner kirschner at inf.unibz.it
Mon Oct 2 05:44:47 PDT 2006


OK, found the solution by turning off standard tree construction.

> basicRE : simpleRE ((CONCAT^) simpleRE)*;

Now, instead of expecting a CONCAT operator, a CONC node is inserted
into the AST:

basicRE : a:simpleRE (! b:simpleRE {#basicRE = #([CONC,"conc"], #a, #b); } )* ;


More information about the antlr-interest mailing list