/Mini-C-Compiler

Compiler Design project on C Compiler Implementation

Primary LanguageC

Compiler-Design

This is Mini-C-Compiler project - SEM 6.

Phase 1 - Lexer/Lexical Analysis

  • Token Generation
  • Line Numbers
  • Lexical Errors
  • Record Lexemes
  • Identify Keywords
  • Symbol Table

Parser/Syntax Analysis

  • Abstract Syntax Tree Construction
  • Global & Local Variables Distinction
  • Class Definition
  • Arrays/Pointers definition
  • Define struct, union
  • Shift Reduce, Reduce Reduce Error correction
  • Valid Actions for grammar productions
  • Error Handing and Error Recovery

Phase 2 - Intermediate Code Generator

  • Generate three address code
  • Quadruple format
  • Insert Temporaries to Symbol Table
  • AST

Intermediate Code Optimization

  • Eliminate dead code
  • Constant Folding, Propagation

Execution Steps

  • Download and go to each phase folder
  • Run ./run.sh
  • For executing each case, check run.sh how to execute single file