The main part of this Assignment is to create a tool that:
- Takes as input a program written in a language called miniscript.
- Generates the corresponding programm in C code.
- The Assignment gave us a set of Miniscript's Language rules,so we can check and translate the input to a C programm,that can be compiled and run.
- mylexer.l Implements the tokenization of keywords and basic patterns (i.e. integer pattern)
- myanalyzer.y Implements the expressions and pattern matching so a given a miniscript programm, the transpiler matches the input code with the written patterns and translates it to C code using the expressions.
- correct1.ms,correct2.ms, correct3.ms,correct4.ms Some simple programms written in miniscript language.
- correct1.c,correct2.c, correct3.c,correct4.c The previous miniscript programms,translated in C language(using this tool).
- Just run make command.
- Run the command make compile to run the program in c language.BE SURE THAT debug=0 in the file mylexer.l (The input script must be in the file correct1.ms)
- If you make any changes,run make clean and then goto step 1. If you want to see the c code,open prog.c after.