Skip to content

thergh/jftt-compiler

Repository files navigation

JFTT Compiler

A compiler for a custom procedural language, generating machine code for a dedicated virtual machine.

Python SLY

Features

  • Lexical Analysis: Tokenization of source code using Sly Lex-Yacc.
  • Syntax Parsing: Grammar validation and AST construction.
  • Symbol Management: Symbol table for tracking variables and scope.
  • Machine Code Generation: Translation of high-level constructs into low-level instructions.
Component Technology
Language Python 3.6+
Parser Generator SLY (Sly Lex-Yacc)
Architecture Modular Compiler Design
Target Virtual Machine Assembly

Local Installation and Execution

  1. Environment Setup: Ensure you have Python 3 installed.

    apt install python3
  2. Dependencies: Install the required sly library:

    pip3 install sly
  3. Compilation: To compile a source file, provide the input and output paths:

    python3 src/kompilator.py tests/exampleA.imp output.mr
  4. Testing: Run the provided test scripts to verify the compiler:

    ./run-tests.sh

About

Compiler for a procedural language. Translates a program to machine code that can be run using the provided virtual machine.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors