antlr / antlr4

ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files.
http://antlr.org
BSD 3-Clause "New" or "Revised" License
17.28k stars 3.3k forks source link

Is it possible to tell antlr c++ generator to create library export tokens? #4527

Open Zeks opened 9 months ago

Zeks commented 9 months ago

So that instead of class ReportGrammarLexer it will generate class EXPORT_TOKEN ReportGrammarLexer ? It's possible to do it with sed, but I remember grpc generator having an option like that so I am wondering if I am missing something.

mike-lischke commented 8 months ago

You can specify your own macro. Read the C++ target documentation for details.