[antlr-interest] ANTLR 3.4 rc3 (aka beta3)

Justin Murray jmurray at aerotech.com
Fri Jun 24 11:03:03 PDT 2011


Here is the attached grammar. I was hoping not to have to subject anyone 
to this horribly designed language. It was conceived in the early 90s, 
and spent nearly 2 decades morphing into its current form before I got 
my hands on it. I was tasked with porting it to ANTLR (from Visual 
Parse++), without breaking backwards compatibility with any screwed up 
syntax that it may have parsed in the past. Anyways, the language is 
inherently ambiguous, and I have not yet been able to untangle it enough 
to be able to turn off the backtracking option. Still, somehow, the 
generated parser is able to out-perform what we had before, so kudos to 
Ter and Jim.

I am most concerned with the issue at hand so that I can eventually move 
to 3.4. As I said, this does work in 3.3, but I would not be surprised 
if I was just getting away with something. Any advice to help me turn 
off backtracking would certainly be appreciated as well, but please 
don't hurt yourself trying to comprehend this grammar.

Thanks,

-- Justin

On 6/24/2011 1:33 PM, Jim Idle wrote:
> You need to attach your grammar.
>
> Jim
>
>> -----Original Message-----
>> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
>> bounces at antlr.org] On Behalf Of Justin Murray
>> Sent: Friday, June 24, 2011 8:06 AM
>> To: antlr-interest at antlr.org
>> Subject: Re: [antlr-interest] ANTLR 3.4 rc3 (aka beta3)
>>
>> Decided to give this a run on my C-target grammar. I'm getting the
>> following error:
>>
>> 1>      [exec] org\antlr\grammar\v3\DefineGrammarItemsWalker.g: node
>> from
>> line 290:15 required (...)+ loop did not match anything at input '<end-
>> of-alt>'
>> 1>      [exec] error(10):  internal error: c:\...\Aerobasic.g :
>> java.lang.ClassCastException: org.antlr.runtime.tree.CommonTree cannot
>> be cast to org.antlr.tool.GrammarAST
>> 1>      [exec]
>> org.antlr.grammar.v3.DefineGrammarItemsWalker.rewrite(DefineGrammarItem
>> sWalker.java:3464)
>> 1>      [exec]
>> org.antlr.grammar.v3.DefineGrammarItemsWalker.block(DefineGrammarItemsW
>> alker.java:2073)
>> 1>      [exec]
>> org.antlr.grammar.v3.DefineGrammarItemsWalker.rule(DefineGrammarItemsWa
>> lker.java:1627)
>> 1>      [exec]
>> org.antlr.grammar.v3.DefineGrammarItemsWalker.rules(DefineGrammarItemsW
>> alker.java:1190)
>> 1>      [exec]
>> org.antlr.grammar.v3.DefineGrammarItemsWalker.grammarSpec(DefineGrammar
>> ItemsWalker.java:623)
>> 1>      [exec]
>> org.antlr.grammar.v3.DefineGrammarItemsWalker.grammar_(DefineGrammarIte
>> msWalker.java:315)
>> 1>      [exec]
>> org.antlr.tool.Grammar.defineGrammarSymbols(Grammar.java:748)
>> 1>      [exec]
>> org.antlr.tool.CompositeGrammar.defineGrammarSymbols(CompositeGrammar.j
>> ava:369)
>> 1>      [exec] org.antlr.Tool.process(Tool.java:465)
>> 1>      [exec] org.antlr.Tool.main(Tool.java:93)
>>
>> I am not sure where to go from here. Note that this grammar does not
>> output an AST, it is just a simple parser. This was working fine with
>> ANTLR v3.3.
>>
>> Thanks,
>>
>> -- Justin
>>
>> On 6/23/2011 7:03 PM, Terence Parr wrote:
>>> hi, Jim fixed up the C runtime. please test it out:
>>>
>>> http://antlr.org/download/antlr-master-3.4-beta3-completejar.jar
>>> http://antlr.org/download/antlr-master-3.4-beta3-src.jar
>>> http://antlr.org/download/antlr-runtime-3.4-beta3-sources.jar
>>> http://antlr.org/download/antlr-runtime-3.4-beta3.jar
>>>
>>> Ter
>>>
>>> List: http://www.antlr.org/mailman/listinfo/antlr-interest
>>> Unsubscribe:
>>> http://www.antlr.org/mailman/options/antlr-interest/your-email-
>> address
>>
>> List: http://www.antlr.org/mailman/listinfo/antlr-interest
>> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-
>> email-address
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Aerobasic.g
Url: http://www.antlr.org/pipermail/antlr-interest/attachments/20110624/f167ada4/attachment-0001.pl 


More information about the antlr-interest mailing list