[antlr-interest] Section for C grammar that follow macro definitions

Kieran Simpson kierans777 at gmail.com
Fri Aug 31 04:34:20 PDT 2012

@members worked.  I've never used @members before in a grammar so I 
didn't think of it.



On 31/08/12 8:57 AM, Jim Idle wrote:
> Does @members not work for you?
> Jim
> On Aug 30, 2012, at 3:39 PM, Kieran Simpson<kierans777 at gmail.com>  wrote:
>> I want to insert a static function into the generated grammar code that uses the macros to do some sub tree skipping (since tree pattern matching isn't available).  However because the function is defined before the macros I'm getting compiler errors.
>> If there's no way to insert the function after the macros, I'll just have to put it somewhere else and include it.
>> I did read through the API first and didn't see anything (however in a moment of eye glaziness I might have missed something :p)
>> Cheers,
>> On 30/08/12 6:05 AM, Jim Idle wrote:
>>> I'm sorry, I don't follow what your question is. If you just want to use
>>> the macros, then you don't need to play with postinclude and so on. That's
>>> only if you want to redefine them,
>>> Did you read: http://www.antlr.org/api/C/index.html
>>> Mostly for these inquiries, I ask "What is it you are trying to do,
>>> perhaps you are asking the wrong question?" :)
>>> Jim
>>>> -----Original Message-----
>>>> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
>>>> bounces at antlr.org] On Behalf Of Kieran Simpson
>>>> Sent: Wednesday, August 29, 2012 4:44 AM
>>>> To: antlr-interest Interest
>>>> Subject: [antlr-interest] Section for C grammar that follow macro
>>>> definitions
>>>> In the C target FAQ
>>>> (http://www.antlr.org/wiki/display/ANTLR3/FAQ+-+C+Target) there's a
>>>> question "SKIP() vs skip() in 'C' runtime".  As part of the answer
>>>> there is this:
>>>> "In an @section that follows the macro definition of SKIP"
>>>> What section is that?  In a similar fashion, I want to embed some code
>>>> into my tree grammar that will make use of the macros (eg: MATCHT), but
>>>> using @postinclude results in my static function being inserted before
>>>> the macro definitions.
>>>> How can I get embedded code after the macro definitions please?
>>>> Cheers,
>>>> 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