This is a simple interpreter built using bison
and flex
for the a programming language defined by the following grammar:
<expr> := [ <op> <expr> <expr> ] |
<symbol> | <value>
<symbol> := [a-zA-Z]+
<value> := [0-9]+
<op> := ‘+’ | ‘*’ | ‘==‘ | ‘<‘
<prog> := [ = <symbol> <expr> ] |
[ ; <prog> <prog> ] |
[ if <expr> <prog> <prog> ] |
[ while <expr> <prog> ] |
[ return <expr> ]
To build the interpreter you need flex
and bison
installed.
For installing bison and flex on Ubuntu, use the following command:
sudo apt install build-essential bison flex
To build the interpreter use the following command:
bash build
To clear the build files for a new build, use the following:
bash clean
This repository is licensed under the MIT License