/ExampleParser

A simple example of an expression parser using ANTLR

Primary LanguageC#ISC LicenseISC

ExampleParser

A simple expression parser using ANTLR.

Accepts simple arithmetic expressions (+, -, *, /), assignments and variables.

Binaries are downloadable at github.com

Language example

x = 4
y = 16
z = x * (y + 4)

User interface

  • Insert code in the textbox under "Program"
  • Press CTRL+ENTER or click "Execute" to evaluate the program
  • Assigned variables are printed along with their value under "Variables"
  • Parser errors and the result of the program (the last expression) is shown under "Messages"