A very simple Interpreter made in Rust that understand this grammar
SCRIPT → LISTINSTR
LISTINSTR → INSTR LISTINSTR
LISTINSTR → ε
INSTR → id = PD_AFF ;
PD_AFF → E
PD_AFF → inv E
PD_AFF → sqrt E
INSTR → loop E { LISTINSTR }
INSTR → afficher E ;
INSTR → aff_ral ; (commentaire : affiche un retour à la ligne)
E → T D
D → + E
D → ε
T → F G
G → * T
G → ε
F → ( E )
F → nb
F → id
Clone this repository:
git clone https://github.com/hectellian/formula-interCompile the binary file
cargo build --releaseThen, in the command line juste type:
./target/release/formula-inter <file.fi>Or (if you already have the binary file)
./formula-inter <file.fi>