[antlr-interest] Combining into single token

Joel Shellman jshellman at gmail.com
Wed Aug 1 13:01:03 PDT 2007


This grammar:

grammar SimpleTest;
options {
    output=AST;
}

root	:	'a'+ 'D' 'a'+ 'D';

If you input aaDaaD to this grammar, it will result in a tree of ^(nil
a a D a a D). Each letter is a different node in the tree. How can I
change this so that the above would result in ^(nil aaDaaD), with all
the letters being just one token/node in the tree?

Thanks.


More information about the antlr-interest mailing list