FB-interpreter is logic-arithmetic interpreter with variable and string support, build with Flex and Bison.
docker run -it ahbenmed/fbinterpreter <examples/input_1.txt>
-
C++ compiler should be installed GNU Compiler
-
C++ Boost library should be installed boost
cd FB-interpreter/
Compiling and generating the executable (interpreter.tab.c, interpreter.tab.h and lex.yy.c are auto-generated files produced by Bison and Flex from interpreter.y and interpreter.l)
g++ src/interpreter.tab.c -o fb-interpreter
The example folder contains some input_files, to test an example, run :
fb-interpreter <examples/input_1.txt>
-
Flex : Fast Lexical Analyzer should be installed
-
Bison : General-purpose parser generator should be installed
Generate interpreter.tab.h(is included in interpreter.l) and interpreter.tab.c
bison -d interpreter.y
Generate lex.yy.c (included in interpreter.y)
flex interpreter.l
- Basic arithmetic and logic interpreter
- Basic string operation
- Support Variable storage (only double C++ type)
- Basic Error(lexical and syntaxe) handling
- Detect semantic errors such as Division by Zero and Undefined Variable...
- Support inline and multiline comments
- Add built-in C-math functions support
- Better memory management, like Garbage Collector
- Include other features like if-else and loops
- Add user fonction support
- Use of Dynamically typed variables