[antlr-interest] ANTLR-based Java grammar for javac compiler
George S. Cowan
cowang at comcast.net
Sat Nov 15 08:12:41 PST 2008
Just reminding everyone that if you attempt to generate a parser for Yang
Jiang's Java.g from the command line and get the message:
ANTLR Parser Generator Version 3.1.1
warning(205): Java.g:1:8: ANTLR could not analyze this decision in rule
Tokens; often this is because of recursive rule references visible from the
left edge of alternatives. ANTLR will re-analyze the decision with a fixed
lookahead of k=1. Consider using options {k=1;}" for that decision and
possibly adding a syntactic predicate.
error(10): internal error:
org.antlr.tool.Grammar.createLookaheadDFA(Grammar.java:1228): could not even
do k=1 for decision 33; reason: timed out (>1000ms)
You can add the ANTLR extended command line option
-Xconversiontimeout 100000
(Jiang gives instructions for using his Java.g under ANTLRworks at
<http://openjdk.java.net/projects/compiler-grammar/antlrworks/>
http://openjdk.java.net/projects/compiler-grammar/antlrworks/
)
Now that warning(205) is very interesting, and I would like to work on
factoring out the recursion, but, of course, there is no rule "Tokens" in
the grammar. Does this message give me a clue about where to look that I am
missing?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20081115/98ed6149/attachment.html
More information about the antlr-interest
mailing list