Skip to content

A Java-- to Jasmin compiler with ANTLR-based grammar, AST translation, symbol table, semantic analysis, basic optimizations, and code generation, developed for the Compilers course at FEUP.

License

Notifications You must be signed in to change notification settings

AFNeves/JmmCompiler

Repository files navigation

Java-- Compiler

📖 Description

A Java-- compiler targeting Jasmin/JVM bytecode, developed for the Compilers course at FEUP. The compiler implements the major stages of language processing:

  • ANTLR grammar (lexer & parser)
  • AST construction & translation
  • Symbol table management
  • Semantic analysis
  • Optimizations (register allocation, constant folding & propagation)
  • Code generation to Jasmin

The project demonstrates compiler design principles by translating Java-- (a simplified Java-like language) into executable JVM bytecode through Jasmin.

🚀 How to Run

⚠️ This project does not run as a standalone compiler. To explore its functionality, you should run the test suite using IntelliJ.

  1. Open the project in IntelliJ IDEA.

  2. Set JDK versions:

    • Go to File > Project Structure > Project
    • Set Project SDK to Java 21
    • Under Gradle Settings, also set the Gradle JVM to Java 21
  3. Run the tests:

    • Open the test folder in IntelliJ
    • Right-click and select Run 'All Tests'
    • Alternatively, run individual tests for specific compiler components

👥 Group Members

  1. Afonso Machado Neves (up202108884@up.pt)
  2. Francisco Lopes Mendonça (up202006728@up.pt)
  3. João Francisco Costa Cordeiro (up202205682@up.pt)

📎 License

This project is distributed under the terms of the MIT License.

About

A Java-- to Jasmin compiler with ANTLR-based grammar, AST translation, symbol table, semantic analysis, basic optimizations, and code generation, developed for the Compilers course at FEUP.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •