Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Antlr4 C++ target

Tags:

c++

antlr

antlr4

We're starting a project where we will need to parse python source files in a C++ application. I've used Antlr2 a while back to generate a few compilers, but this is the first time I'm using Antlr4.

It looks like the c++ antlr4 target is fairly active at https://github.com/antlr/antlr4-cpp

So, my question is basically what is the status of the Antlr4 C++ target, is it ready to start being used? To use the C++ target, what just grab the Antlr4 source, and copy the Antlr4-cpp into this tree and build?

Note, I don't need something that's absolutely stable and guaranteed never to change, just something thats basically stable enough to start being used, if there are small/moderate API changes in the future, thats perfectly fine, I understand that it looks fairly early.

If the antlr4-c++ target is NOT really ready, what parser generator would you recommend for generating a C++ target python parser?

thanks

like image 337
Andy Somogyi Avatar asked May 12 '15 00:05

Andy Somogyi


People also ask

What is antlr4 used for?

What is ANTLR? ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files.

What languages use Antlr?

It turns out ANTLR4 lets you generate parser code in a variety of languages: Java, C#, Python, Go, C++, Swift, JavaScript and even TypeScript!

How do I download antlr4?

Python Targets Or, you can download and untar the appropriate package from: https://pypi.python.org/pypi/antlr4-python2-runtime. https://pypi.python.org/pypi/antlr4-python3-runtime. The runtimes are provided in the form of source code, so no additional installation is required.


2 Answers

The ANTLR4 C++ target is now ready for use: https://soft-gems.net/the-antlr4-c-target-is-here/. Only needs some minor organizational stuff and must be merged to main repo.

like image 198
Mike Lischke Avatar answered Sep 18 '22 13:09

Mike Lischke


This repository has the latest source code for the ANTLR 4 C++ target.

https://github.com/antlr/antlr4-cpp

Here is a good discussion about the status of the target.

https://groups.google.com/forum/#!topic/antlr-discussion/HV2QpwwjtLg

like image 22
MacGyver Avatar answered Sep 18 '22 13:09

MacGyver