A LOLCODE interpreter written in C++ using Flex and Bison
$ mkdir build
$ cd build
$ cmake ..
$ make
$ ./lolbison {{path/to/file.lol}}
Use flag -p
to output the abstract syntax tree instead of interpreting.
- Types: NUMBR (int), YARN (string), TROOF (bool) and NOOB (nil)
- Binary math operators
- Boolean operators
- if-then-else statement (without MEBBE)
- Loops
- VISIBLE (print to stdout)
- SMOOSH (string concatenation)
- ENUF (as break in a loop, as exit outside loops)
- Arrays (reduced functionality)
The difference from lolcode specification v1.2
- There is only one variable scope
- A variable can be declared multiple times. Just like a function in C++
- Arrays work like dictionaries with integer keys
The grammar is described here: reference/grammar.txt