Starting from:

$25

Assignment 3: Compiler for C-subset

Compiler Lab Assignment 3

The language for the assignment should have the following specifications:

similar to C language in syntax
structures
if else, while loop
data types: int,float, char
multi-dimensional arrays
function definitions and function calls
 

 

Lexical analysis,Syntax Analysis and subsequent phases are to done using the flex and bison/yacc utilities.

 

Semantic analysis should include

Variable declaration checking
Type checking should include type coercibility and operator compatibility.
Scope checking
 

Intermediate code is to be generated in  3 address code in quadraple form.

 

 

 

Expected output:-

Symbol Table

Intermediate code in 3 address code in quadraple form(this code should access the symbol table entries)

 

Bonus:-

For additional bonus marks, dynamic semantics like checking for whether index of array access is within valid range can be performed. This can be done by adding additional code not present in the original source program.
Including pointers in the language will result in additional bonus marks.

More products