[antlr-interest] HOWTO: C++ generation: Prefix of generated enum names in ParserTokenType

Ric Klaren klaren at cs.utwente.nl
Wed Aug 18 03:29:18 PDT 2004


On Tue, Aug 17, 2004 at 01:39:10PM -0000, Francis ANDRE wrote:
> I am using ANTLR 2.7.4 for generated parser/lexer in C++. I got name 
> clashes between tokens defined as enum values in the 
> MyParserTokenTypes and external class names I have to use.
> 
> Is there anyway to specify a prefix for the generated enums (but not 
> as mangleLiteralprefix) like :

If you don't want to use mangleLiteralPrefix.
a) manually construct the tokentypes files and importvocab them
b) wrap either clashing part in a different namespace and do the right
   'using' magic or qualify everything.

Cheers,

Ric
-- 
-----+++++*****************************************************+++++++++-------
    ---- Ric Klaren ----- j.klaren at utwente.nl ----- +31 53 4893755  ----
-----+++++*****************************************************+++++++++-------
 'And this 'rebooting' business? Give it a good kicking, do you?' 'Oh, no,
  of course, we ... that is ... well, yes, in fact,' said Ponder. 'Adrian
    goes round the back and ... er ... prods it with his foot. But in a
     technical way,' he added. --- From: Hogfather by Terry Pratchett.



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list