Tag Archives: antlr

Using antlr3 to generate C++ code

Need to parse SQL query to C++ code in project, so I had to learn antlr these days. Let’s write a small sample file “Calc.g” for antlr3:

Then add “antlr-3.5.2-complete.jar” (run “mvn package” on source code path of antlr3 will generate this jar) to CLASSPATH and run:

It… Read more »