[antlr-interest] Fwd: Reporting a bug in C Target

Jim Idle jimi at temporal-wave.com
Wed Dec 16 06:52:41 PST 2009


The include dependency should be protected because they are all #ifdef'ed, but perhaps I broke something in this incarnation. Argument swaps don't seem to be correct though - I will look at that and see if that is a typo in the template or something.
 
Jim
 
From: Gokulakannan Somasundaram [mailto:gokul007 at gmail.com] 
Sent: Tuesday, December 15, 2009 9:23 PM
To: Jim Idle
Cc: antlr-interest at antlr.org
Subject: Re: [antlr-interest] Fwd: Reporting a bug in C Target
 
Jim,
    The fix worked fine for me, but i see some more bugs specific to composite grammar.
a) I see a kind of circular dependency introduced in the generated header files.. Say i am having three grammar files, 'A', 'B' and 'C' in a way A is importing B which is importing C. I can understand this should mean that in the grammar file, i should see $include for the header files of B and C, but i also see that B is having a statement #include <A.h>. This caused me some issues. Things are working fine, if i compile "A.cpp", but when i touch "A_B.cpp", it is causing problems. The fix i made was to include "A.h" from all the ".cpp" files.
b) In a function call to A_B_CNewSSD from B.cpp, i could see the arguments have been swapped, so it doesn't match the function definition. I changed it and it worked fine. 

Please let me know, if i have articulated the bugs correctly.

Thanks,
Gokul.


On Sun, Dec 13, 2009 at 11:45 PM, Jim Idle <jimi at temporal-wave.com> wrote:
Wrestled Hudson into submission but I have not put all the build parameters in place for it until this afternoon, after which the snapshots and so on will all be working again. Unfortunately we have a chicken and egg situation with a change to the generator and the runtime at the same time, which I must hack my way around to get the build back together.
 
Jim
 
From: Gokulakannan Somasundaram [mailto:gokul007 at gmail.com] 
Sent: Sunday, December 13, 2009 9:48 AM
To: Jim Idle
Cc: antlr-interest at antlr.org
Subject: Re: [antlr-interest] Fwd: Reporting a bug in C Target
 
Thanks a lot Jim.  That was very quick. 
I will check it out and let you know.

Gokul.
On Fri, Dec 11, 2009 at 9:43 PM, Jim Idle <jimi at temporal-wave.com> wrote:
The latest templates process the default parameter values correctly, I fixed that too - I need to fix Hudson so the snapshot gets built, but you can also get the templates from fisheye and just drop them in. The change is obvious and affect C.stg and AST.stg.
 
Jim
 
 
From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-bounces at antlr.org] On Behalf Of Gokulakannan Somasundaram
Sent: Friday, December 11, 2009 1:40 AM
To: antlr-interest at antlr.org
Subject: [antlr-interest] Fwd: Reporting a bug in C Target
 
Missed the group....

Gokul.
---------- Forwarded message ----------
From: Gokulakannan Somasundaram <gokul007 at gmail.com>
Date: Fri, Dec 11, 2009 at 3:08 PM
Subject: Re: [antlr-interest] Reporting a bug in C Target
To: Jim Idle <jimi at temporal-wave.com>


Sure Jim. I have found my way around Maven and now i am able to build the tool.jar alone. I will use the current templates from the snapshot. I have also found that ANTLR is specifically disabling the default parameter values being assigned to the parameters passed to the rules. This functionality is present in C++(as you may know). But is there a reason why we are doing this?

Thanks,
Gokul.
On Thu, Dec 10, 2009 at 10:19 PM, Jim Idle <jimi at temporal-wave.com> wrote:
If you want to try it out then you will be able to download the snapshot release of the ANTLR tool later today, once I upgrade Hudson so that it builds it again. The runtime has not changed, just the templates.
 
Jim
 
From: Gokulakannan Somasundaram [mailto:gokul007 at gmail.com] 
Sent: Thursday, December 10, 2009 2:36 AM
To: Jim Idle
Cc: David-Sarah Hopwood; antlr-interest at antlr.org

Subject: Re: [antlr-interest] Reporting a bug in C Target
 
Jim, 
    I read about the initialization rules and i agree with them. Thanks for fixing it so quickly. 

Gokul.
On Thu, Dec 10, 2009 at 10:15 AM, Jim Idle <jimi at temporal-wave.com> wrote:
On Wed, 09 Dec 2009 19:54:51 -0800

 "Gokulakannan Somasundaram" <gokul007 at gmail.com> wrote:
 

Assigning it to 0, will again cause trouble for C++ folks.


No it won't, because 0 is a valid (indeed, the preferred) way of writing
a null pointer constant in C++.



I think you misunderstood me. I said assigning 0 to a enum in C++ will throw a compiler error. 
 
I didn't though :). See email about new initialization rules. I think that they are much mire in keeping with C and C++. More generally it makes the grammar programmer responsible for behaviour, which is in line with the rest of the C stuff.

David's point about C++ is correct though 0 == NULL is guranteed in ANSI C, evenbthough rhe compiler must work it out. Better to use NULL consistently and try to avoid adding to the billion dollars.

Jim

Gokul.
 
 
 
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 HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20091216/7353b8f7/attachment.html 


More information about the antlr-interest mailing list