[antlr-interest] Remove left recursion function
Terence Parr
parrt at cs.usfca.edu
Sun Sep 28 12:45:31 PDT 2008
Which version of AW?
Ter
On Sep 28, 2008, at 10:31 AM, Markus Stoeger wrote:
> Hello,
>
> I tried to use the "Refactor" -> "Remove left recursion" function but
> couldn't get it to work. When generating the parser ANTLR detects the
> left recursion. But when I place the cursor on the offending symbol
> and
> try to start the "Remove left recursion" function it says "The rule
> doesn't have a left recursion.".
>
> Also ANTLR spits out the following exception in the console whenever
> it
> detects a left recursion while generating a grammar:
>
> java.lang.ClassCastException: org.antlr.tool.Rule cannot be cast to
> java.lang.String
> at
> org
> .antlr
> .works
> .grammar.antlr.ANTLRGrammarEngineImpl.markLeftRecursiveRules(Unknown
> Source)
> at
> org.antlr.works.grammar.antlr.ANTLRGrammarEngineImpl.analyze(Unknown
> Source)
> at org.antlr.works.grammar.engine.GrammarEngineImpl.analyze(Unknown
> Source)
> at org.antlr.works.grammar.CheckGrammar.run(Unknown Source)
> at java.lang.Thread.run(Unknown Source)
>
> I'm not sure if this has anything to do with the "Remove left
> recursion"
> function not working.
>
> These problems seem to happen with every grammar that has a left
> recursion.
>
> Max
>
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>
More information about the antlr-interest
mailing list