[antlr-interest] void* conversion in C runtime

Robert Soule robert.soule at gmail.com
Fri Feb 20 12:48:57 PST 2009


I am using antlr-3.1.1.jar and libantlr3c-3.1.2.b1.

If this change doesn't get into the official release, can I get
a copy from cvs or something?

thanks,
Robert

On Fri, Feb 20, 2009 at 3:40 PM, Jim Idle <jimi at temporal-wave.com> wrote:
> Robert Soule wrote:
>> Hi Jim,
>>
>> I am trying to write a tree grammar that recognizes an AST
>> and produces a second AST, using the C runtime, but compiling
>> with a C++ compiler.
>>
>> In the generated code, I get a problem at lines that look like:
>>
>>       retval.tree = ADAPTOR->rulePostProcessing(ADAPTOR, root_0);
>>
>> In my grammar file which produces the first AST, the generated
>> code has the cast to let this be C++ compliant:
>>
>>       retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR,
>> root_0));
>>
>> Would it be possible to add the casts for tree grammars as well please?
>>
> Yes - though I am a little unsure if I will get these changes in before
> 3.1.2 now :-( You are using the very latest ANTLR tool and C runtime right?
>> Also, does the C runtime support AST to AST rewrite rules? So something like:
>>
>> myrule: ^(A foo bar) -> ^(B bar foo);
>>
> Yes.
>
> Jim
>
> 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