Skip to content

Latest commit

 

History

History
39 lines (34 loc) · 970 Bytes

File metadata and controls

39 lines (34 loc) · 970 Bytes

compiler

To run the code

make clean
make && ./Test.out < TestInput1.txt

Tech Stack

Programming Language: Python
Tools: YACC (Yet Another Compiler Compiler), Lex (for lexical analysis)
Data Structures: Symbol tables, parse trees, abstract syntax trees (ASTs)

Features implemented

Lexical analysis

Token identification
Lexical error detection
Symbol Table

Parser

Syntax declaration
Indentation and syntactic error detection
Parse Tree
Abstract Syntax Tree

Semantic Analysis

SDD + SDT
Annotated Parse Tree
Semantic Error detection

ICG

3 address code - Quadruples
Backpatching

Code Optimization

Basic blocks
DAG, CFG
Induction Variable elimination
Constant Folding + Copy Propagation
Dead Code Elimination
Peephole Optimization