Skip to content

FB-interpreter is logic-arithmetic interpreter with variable and string support, build with Flex and Bison.

License

Notifications You must be signed in to change notification settings

ahmed-BH/FB-interpreter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FB-interpreter

FB-interpreter is logic-arithmetic interpreter with variable and string support, build with Flex and Bison.

Running with Docker

docker run -it ahbenmed/fbinterpreter <examples/input_1.txt>

Running manually

Prerequisites

  • C++ compiler should be installed GNU Compiler

  • C++ Boost library should be installed boost

Run

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>

Scrots

Testing basic string and fonction support

Adding new features

  • 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

Included Features

  • 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

To Do List

  • Better memory management, like Garbage Collector
  • Include other features like if-else and loops
  • Add user fonction support
  • Use of Dynamically typed variables

About

FB-interpreter is logic-arithmetic interpreter with variable and string support, build with Flex and Bison.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published