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

CPP Compilation #4392

Open lijuwen opened 1 year ago

lijuwen commented 1 year ago

I want to use cpp to refactor g4 of postgres. g4 can use cpp, but linking with main will result in a bunch of errors. Thank you for asking for help

mk file java -jar /usr/local/lib64/antlr-4.13.0-complete.jar SqlLexer.g4 java -jar /usr/local/lib64/antlr-4.13.0-complete.jar SqlParser.g4

g++ -std=c++11 main.cpp SqlLexer.cpp SqlParserParser.cpp SqlParserListener.cpp SqlParserBaseListener.cpp \ -I/usr/local/include/antlr4-runtime -L/usr/local/lib64/ \ -Wl,-rpath=/usr/local/lib64/ -lantlr4-runtime -o main
t.txt

error in file

wipe2238 commented 12 months ago

You need to compile as (at least) C++17