[antlr-interest] [C Target] @parser::apifuncs ...

Garry Iglesias garry.iglesias at gmail.com
Mon Aug 18 14:28:02 PDT 2008


Hi again :),

Sorry to bother you, but I also just realize that if you do :

@parser::members
{
 static void MY_displayError(pANTLR3_BASE_RECOGNIZER _pRec,
pANTLR3_UINT8* _tokenNames) {
  //do something...
 }
}
@parser::apifuncs
{
 // Install custom error message display:
 RECOGNIZER->displayRecognitionError = MY_displayError;
}

the generated c parser doesn't compile because the 'members' code is
inserted after the parser constructor... So the compiler doesn't know the
function yet...
Of course it could be 'public' in a header and it would works, but if we
want to keep this 'internal stuff' hidden it could be interresting that the
members 'clause'
would be included before. (Or having another clauses to do forward
declarations 'before'... Or I should use an already existing clause like
::includes or something ?).

Thanks, and sorry again to disturb you.

Garry.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080818/503780fe/attachment.html 


More information about the antlr-interest mailing list