[antlr-interest] Expr.text null?

Oliver B. Fischer o.b.fischer at gmx.de
Thu Aug 14 00:46:03 PDT 2008


Hello,

is SOME_TOKEN a virtual token or a real one from the token stream? If 
not, may you should initialise it from a real token. Did you have a look 
at http://www.antlr.org/wiki/display/ANTLR3/Tree+construction?

Bye

Oliver

Foust schrieb:
> Does it make sense that a matched sub-rule returns null for its text 
> attribute?
> 
>  
> 
> That is, the following rule matches the input AST just fine.
> 
>  
> 
> tree grammar;
> 
> expr : a? b;
> 
>  
> 
> a : ^(SOME_TOKEN someargs)
> 
> b: ^(etc…)


-- 
Oliver B. Fischer, Schönhauser Allee 64, 10437 Berlin
Tel. +49 30 44793251, Mobil: +49 178 7903538
Mail: o.b.fischer at gmx.de Blog: http://www.sw-blog.net



More information about the antlr-interest mailing list