Skip to content

cham-d/miniCompiler

Repository files navigation

A source to source compiler made for the purposes of Theory of Computation course.

General Info


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.

I. FILES

  • 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).

II. INSTALLATION AND INSTRUCTIONS

  1. Just run make command.
  2. 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)
  3. 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.

About

Project for the purposes of the course Theory of Computation course

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published