yacc-lex-language
A simple language with an interpreter using yacc/lex.
Building
Requirements
- GNU/Make
- GCC
- Bison
- Flex
How to build?
To build the executable, run:
$ make build
This will generate a
build/
directory with the executablelang.o
.
Running the interpreter
To run the interpreter, type in your terminal:
$ build/lang.o
This language only recognizes a few symbols and operations, such as add, subtract, print, etc.
- Adding
print 1 + 2;
- Subtracting
print 2 - 1;
- Multiplying
print 5 * 2;
- Dividing
print 10 / 2;
- Clearing the screen
clear;
- Assignment
a = 10 + 5;
- Exiting
exit;