2025-05-27 08:21:17 +00:00
2025-05-27 08:21:17 +00:00
2025-05-24 22:13:16 +01:00
2025-05-24 22:13:16 +01:00
2025-05-24 22:13:16 +01:00
2025-05-24 22:13:16 +01:00
2025-05-24 21:20:50 +00:00

Wacc Compiler

A compiler for the Wacc language built in Scala, supporting lexical analysis, parsing, semantic analysis, and AArch64 assembly code generation.

Pipeline

The Wacc compiler uses the Parsley library to parse the source file into an abstract syntax tree (AST). It then performs semantic analysis in two stages: variable renaming for scope resolution, followed by type checking. In the backend, the AST is translated into an intermediate representation (IR) designed for control-flow and optimisation. Finally, the optimised IR is converted into AArch64 assembly instructions, which are written to an output file ready for compilation and execution.

Additional Features

  • If Expressions: Supports embedding conditional expressions within larger expressions.
  • Parallel Imports: Optimises compilation by handling multiple imports in parallel.
  • Function Overloading: Allows functions with different parameter types to share names.
  • Peephole Optimiser: Removes redundant instruction pairs and simplifies moves.
Description
No description provided
Readme 909 KiB
Languages
Scala 99.3%
Makefile 0.6%
Shell 0.1%