[antlr-interest] error(106)

Martin Kohl martin.kohl at gmail.com
Wed Aug 22 17:53:15 PDT 2007


Hello again,

I'm currently trying to get a grammar to compile so as to get an ExprLexer
and ExprParser out of it. The only errors I have left are called
error(106): Expr.g:Line:Pos: reference to undefined rule: ruleName

Every time I try to run the grammar, I get the same references, however
always in a different order. Ie. one time I'll get

C:\Expr\antlr-java>java -Xms32m -Xmx1000m org.antlr.Tool Expr.g
ANTLR Parser Generator  Version 3.0 (May 17, 2007)  1989-2007
error(106): Expr.g:2:1: reference to undefined rule: ruleA
error(106): Expr.g:5:20: reference to undefined rule: ruleB
error(106): Expr.g:4:2: reference to undefined rule: ruleB
error(106): Expr.g:6:30: reference to undefined rule: ruleB
error(106): Expr.g:8:5: reference to undefined rule: ruleC
error(106): Expr.g:10:8: reference to undefined rule: ruleD
error(106): Expr.g:3:16: reference to undefined rule: ruleD
error(106): Expr.g:1:17: reference to undefined rule: ruleB
error(106): Expr.g:9:23: reference to undefined rule: ruleC

the next time I'll get:

C:\Expr\antlr-java>java -Xms32m -Xmx1000m org.antlr.Tool Expr.g
ANTLR Parser Generator  Version 3.0 (May 17, 2007)  1989-2007
error(106): Expr.g:3:16: reference to undefined rule: ruleD
error(106): Expr.g:5:20: reference to undefined rule: ruleB
error(106): Expr.g:1:17: reference to undefined rule: ruleB
error(106): Expr.g:9:23: reference to undefined rule: ruleC
error(106): Expr.g:10:8: reference to undefined rule: ruleD
error(106): Expr.g:2:1: reference to undefined rule: ruleA
error(106): Expr.g:8:5: reference to undefined rule: ruleC
error(106): Expr.g:6:30: reference to undefined rule: ruleB
error(106): Expr.g:4:2: reference to undefined rule: ruleB

I also have references to these rules at other locations in the grammar
file, however these are never marked as erroneous. I always get the same
references, and always in a different order.

I've looked through the mailing list archives and haven't found any
solutions to this particular error. The whole file has the backtrack=true
option set.

I'd appreciate any ideas you guys have as to where this error may stem from
and what I can do to correct it.

Many thanks and kind Regards,
Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070823/23aef93a/attachment-0001.html 


More information about the antlr-interest mailing list