CAP/MiniC/README-codegen.md
2024-10-21 23:10:10 +02:00

1008 B

MiniC Compiler

LAB4 (simple code generation), MIF08 / CAP 2022-23

Authors

Augustin LUCAS

Contents

Test design

Design choices

Booleans are implemented as integers behind the scenes, but type-checking before compilation disables any casting mechanism.
As for the previous lab, the Fortran-like for-loop extension has been implemented.

Known bugs

Checklists

A check ([X]) means that the feature is implemented and tested with appropriate test cases.

Code generation

  • Number Atom
  • Boolean Atom
  • Id Atom
  • Additive expression
  • Multiplicative expression
  • UnaryMinus expression
  • Or expression
  • And expression
  • Equality expression
  • Relational expression (! many cases -> many tests)
  • Not expression

Statements

  • Prog, assignements
  • While
  • Cond Block
  • If
  • Nested ifs
  • Nested whiles

Allocation

  • Naive allocation
  • All in memory allocation
  • Massive tests of memory allocation