[antlr-interest] Examples of semantic predicates with extremely long generated code

Terence Parr parrt at cs.usfca.edu
Mon Apr 4 11:18:08 PDT 2011


If Click, it definitely tries to avoid or/and of known identity operations. They just don't work ;)
Ter
On Apr 4, 2011, at 10:49 AM, Loring Craymer wrote:

> Sam--
> 
> Are you working on the SemanticContext classes for this?  That seems to be where 
> the problem originates--no effort is made to refactor generated trees.
> 
> --Loring
> 
> 
> 
> ----- Original Message ----
>> From: Sam Harwell <sharwell at pixelminegames.com>
>> To: Terence Parr <parrt at cs.usfca.edu>; antlr-interest Interest 
>> <antlr-interest at antlr.org>
>> Sent: Mon, April 4, 2011 10:23:40 AM
>> Subject: Re: [antlr-interest] Examples of semantic predicates with extremely 
>> long generated code
>> 
>> For the example at the bottom of ANTLR-245, I get the following condition  in
>> args, element, and element2  (respectively):
>> 
>> !((((true)||(false))))
>> 
>> !((false))
>> 
>> !((true))
>> 
>> The  tool doesn't have target language analysis, so true and false here might
>> as  well be X and Y.
>> 
>> I'll work on getting this into the Java version after  some more testing.
>> 
>> Sam
>> 
>> -----Original Message-----
>> From: antlr-interest-bounces at antlr.org
>> [mailto:antlr-interest-bounces at antlr.org]  On Behalf Of Terence Parr
>> Sent: Monday, April 04, 2011 12:02 PM
>> To:  antlr-interest Interest
>> Subject: Re: [antlr-interest] Examples of semantic  predicates with extremely
>> long generated code
>> 
>> Looks like I have three  different bugs entered
>> 
>> http://www.antlr.org/jira/browse/ANTLR-393
>> http://www.antlr.org/jira/browse/ANTLR-430
>> http://www.antlr.org/jira/browse/ANTLR-245
>> 
>> I recall that at least  one of them had a small example.
>> T
>> On Apr 4, 2011, at 9:58 AM, Sam Harwell  wrote:
>> 
>>> Hi everyone,
>>> 
>>> For certain cases of semantic  predicates, ANTLR generates some 
>>> *extremely* long, complicated, and  redundant conditionals in the 
>>> output code. I've been working on  resolving this issue, and I'm 
>>> looking for some examples of these  grammars to make sure my updates 
>>> properly reduce these conditionals.  Does anyone have a sample they can
>> send me?
>>> 
>>> Thanks!
>>> Sam
>>> 
>>> 
>>> 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
>> 



More information about the antlr-interest mailing list