[antlr-interest] AntlrWorks 1.2b2 and Incompatible Grammar with sample code
Sebastian Mattsson
zebabez at gmail.com
Thu May 29 05:11:02 PDT 2008
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080529/59e0b424/attachment.html
More information about the antlr-interest
mailing list