[antlr-interest] Jim Idle: C-Runtime and C++Builder, E2342 Type mismatch in parameter

Jim Idle jimi at temporal-wave.com
Sat Oct 1 10:09:19 PDT 2011


I don't really know what you are trying to do or what compiler you are
using etc, but remember this is C code not C++ code so if you turn on all
the warnings in the C++ compiler then you may get the odd warning. But
without seeing all the code, I can't guess where that warning is. It isn't
the FOLLOWPUSH macro though. It looks more likely that you are not
including the correct headers and so the prototype is defaulting to int.

As for tabs vs space... well it is generated code. You could always untab
it using any one of a thousand tools, or modify the code generation
template and remake ANTLR.

I don't know anything about C__ builder, but it seems to be more of a
hindrance than a help?

Jim

> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Udo Weik
> Sent: Saturday, October 01, 2011 12:22 AM
> To: Antlr-Interest Antlr.Org
> Subject: [antlr-interest] Jim Idle: C-Runtime and C++Builder, E2342
> Type mismatch in parameter
>
> Hello Jim,
>
> I'm getting some
>    E2342 Type mismatch in parameter 'freeptr' (wanted 'void (*)(void
> *)', got 'int') errors in code lines like
>    FOLLOWPUSH(FOLLOW_subtype_indication_in_access_type_definition730)
> ); Any hint?
>
>
> And in the following functions an analog problem
>    E2342 Type mismatch in parameter 'state' (wanted
> 'ANTLR3_RECOGNIZER_SHARED_STATE_struct *', got 'int')I I just declared
> state and initialized it with NULL:
>
> ANTLR3_API pXYZLexer XYZLexerNew( pANTLR3_INPUT_STREAM instream ) {
>    pANTLR3_RECOGNIZER_SHARED_STATE state ; // UW
>    state = NULL ; // UW
>
>    // See if we can create a new lexer with the standard constructor
>    //
>    // UW  return XYZLexerNewSSD(instream, NULL);
>    return XYZLexerNewSSD(instream, state); // UW }
>
> Same problem with
> ANTLR3_API pXYZParser XYZParserNew( pANTLR3_COMMON_TOKEN_STREAM
> instream ) {
>    pANTLR3_RECOGNIZER_SHARED_STATE state ; // UW
>    state = NULL ; // UW
>
>    // See if we can create a new parser with the standard constructor
>    //
> // UW  return XYZParserNewSSD(instream, NULL);
>    return XYZParserNewSSD(instream, state); // UW }
>
>
> Is it in any way possible to avoid tabs in the generated code?
> I would prefer two spaces for one tab.
>
>
> Many thanks and greetings
> Udo
>
> 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