Skip to content

shivangi1299/Compiler-Design-Project

Repository files navigation

Compiler for C++ using C

A simple C++ compiler built using lex and yacc tools for basic C++ statements. The following control constructs are handled :-

  • IF ELSE
  • WHILE
  • FOR

Description

Phase_1:

  1. Generation of tokens
  2. Construction of Symbol table
  3. Expression Evaluation
  4. Syntax validation
  5. Error handling

Phase_2_AST:

  1. Abstract Syntax Tree Generation

Phase_3_ICG:

  1. Intermediate Code Generation in Quadruple format

Phase_4_CodeOptimization

  1. Implementation of Constant Folding & Constant Propogation code optimization techniques

Code

Each phase expects a '.cpp' input file to run. Please input the 'inputfile.cpp' to the lex and yacc code of all phases to see an output.

Report

Find a detailed report here.

About

A simple C++ compiler built using lex and yacc tools.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages