Antlr4: Using C++ target for ANTLR 4

Created on 24 May 2019  路  2Comments  路  Source: antlr/antlr4

I have been using Python target for Antlr4. Now I am planning to move to cpp as Antlr4 has support for cpp as the target language. Wanted to know if there are any major bugs/ performance issues etc with using cpp as the target language (since it's just been introduced recently)?

Links I have referred so far,

http://blorente.me//Antlr-,-C++-and-CMake-Wait-what.html
https://github.com/DanMcLaughlin/antlr4/tree/master/runtime/Cpp

Most helpful comment

I recently wrote an entire programming language using ANTLR. It took quite a bit of work upfront, but my grammar became very flexible afterwards. I haven't noticed any performance issues.

If you want a more gentle introduction to ANTLR on C++, I wrote a simple calculator example that has all of the set-up.

All 2 comments

I recently wrote an entire programming language using ANTLR. It took quite a bit of work upfront, but my grammar became very flexible afterwards. I haven't noticed any performance issues.

If you want a more gentle introduction to ANTLR on C++, I wrote a simple calculator example that has all of the set-up.

The cmake in antlr repository is not perfect, if you can use Linux packages. I do remember seeing many suboptimal and potentially broken things in cpp runtime year ago.

However as a user I did not experience any problems, performance issues only from wrong grammars.
If you are planing to use cmake this may come handy (cmake script for automatic generating of a parser from .g4).

Was this page helpful?
0 / 5 - 0 ratings