Skip to content

Latest commit

 

History

History
44 lines (31 loc) · 2.24 KB

readme.md

File metadata and controls

44 lines (31 loc) · 2.24 KB

Language Processors

Development of a custom c-style language processor. It includes lexical, syntactical and static-semantics analyzers including error recovery techniques and code generation for the abstract p-machine.

Repository structure

  • Session1: Lexical analyzer construction with JLex.
  • Session2: Syntactical analyzer construction with CUP.
  • frabit: Custom full language processor.

frabit language specifications

Frabit is our language processor. It reads from a file a program, checks its lexical, syntactical and semantical correction and, if correct, generates the code for the abstract p-machine of the program. If the program given is not correct error recovery techniques are applied in order to continue the analysis and detect as much errors as possible.

The rules applied by the analyzers as well as the format of the generated resulting code is given by:

frabit execution

# Clone the repo
git clone https://github.com/frblazquez/PL.git

# Place JLex and CUP jars in PL/frabit/ and then run the analyzers generation scripts
cd PL/frabit/
./jlex.sh 
./cup.sh

# Compile the java code (requires JLex and CUP in the classpath) and run the tests
./run_testfiles.sh

It's strictly necessary to run the test script for generating the p-machine interpreter. After this, the configuration is complete and it's possible to compile frabit code running the Main, it accepts as arguments the input and desired output files. This output file can be run in the p-machine interpreter.