teverett / antlr4-cpp-example

Example of Antlr4 C++ Target

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CI

Antlr4 C++ Example

A simple example of using Antlr4 to generate a C++ Parser / Lexer, for Modelica. The Modelica grammar for Antlr4 is from here.

To run the example, simply run ./run.sh or make

The example presumes that the java executable is on your path.

The output includes

modelicaLexer.*: Antlr4 Lexer for Modelica

modelicaParser.*: Antlr4 Parser for Modelica

modelicaListener.*: Antlr4 Listener implementation for Modelica

Note that the Listener classes are optional: not every application of Antlr4 requires a listener.

About

Example of Antlr4 C++ Target


Languages

Language:C++ 98.1%Language:ANTLR 1.7%Language:Makefile 0.2%Language:Shell 0.0%