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
16.89k stars 3.25k forks source link

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

Open Zeks opened 6 months ago

Zeks commented 6 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 5 months ago

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