[antlr-interest] error in antlrv3.g? missing suffixes in tree

Terence Parr parrt at cs.usfca.edu
Wed Jul 2 10:21:28 PDT 2008


thereAre indeed some issues without as I have not done anything but an  
initial work on that. I have some graduate students that are looking  
into this as they build another project.
Ter
On Jul 2, 2008, at 1:17 AM, Jens Boeykens wrote:

> Hi,
>
> I'm on a project where I need to parse grammars. Therefor I use  
> antlrv3.g which can be fount here:
> http://www.antlr.org/grammar/ANTLR/
>
> The problem is this:
> consider the example
>
> grammar T;
>
> a : p+;
>
> If I parse this grammar I get the following tree:
>
> (grammar T (RULE a (BLOCK (ALT (BLOCK (ALT p EOA) EOB) EOA) EOB) EOR))
>
> As you can see there is no '+' in the tree. I need the '+' so I can  
> regenerate the original grammar.
> When using parentheses it works:
>
> grammar T;
>
> a : (p)+;
>
> (grammar T (RULE a (BLOCK (ALT (+ (BLOCK (ALT p EOA) EOB)) EOA) EOB)  
> EOR))
>
> Now the '+' has been added to the tree.
>
> My question is: what is to be changed in antlrv3.g so that it also  
> works with the parentheses?
>
> Thanx!



More information about the antlr-interest mailing list