[antlr-interest] AntlrWorks 1.2b2 and Incompatible Grammar with sample code
Jean Bovet
antlr-list at arizona-software.ch
Fri May 30 22:50:18 PDT 2008
This has been fixed in the beta 3 that I just released.
Regards,
Jean
On May 29, 2008, at 5:11 AM, Sebastian Mattsson wrote:
> Hi,
>
> Installed 3.1b to get to try out the nice new features.
> However when I pasted the simple example from the wiki:
> grammar T;
> options {output=AST;}
> @members {
> static class V extends CommonTree {
>
> public int x,y,z;
> public V(int ttype, int x, int y, int z) {
> this.x=x; this.y=y; this.z=z; token=new CommonToken(ttype,"");
> }
> public V(int ttype, Token t, int x) { token=t; this.x=x; }
>
> public String toString() {
> return (token!=null?token.getText():"")+"<V>;"+x+y+z;
> }
> }
> }
> a : ID -> ID<V>[42,19,30] ID<V>[$ID,99] ;
> ID : 'a'..'z'+ ;
>
> WS : (' '|'\\n') {$channel=HIDDEN;} ;
> AntlrWorks first tells my that it's an Incompatible Grammar, and
> then it can't find the class V, just says 'undefined reference'
> about <V>.
> After debugging the console outputs:
> [org.antlr.works.debugger.tree.DBASTModel - event 12] Warning:
> [addChild] Child node 2 not found, ignoring.
> [org.antlr.works.debugger.tree.DBASTModel - event 14] Warning:
> [addChild] Child node 3 not found, ignoring.
>
>
> Are these some kind of problems to be expected with the beta-version
> or have I done something wrong?
>
> Thank You,
> Sebastian
More information about the antlr-interest
mailing list