Skip to content

This repository contains the solutions to assignments done during Compilers Course

License

Notifications You must be signed in to change notification settings

arihantsethia/Sp.Compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Compilers

Assignment 1

Thing you need to run this software :

  1. nasm

  2. Ubuntu 10.04 and above

Aim

To write a compiler for a given grammar which parses any program in the specified grammer and converts it to relevent x86 assembly code.

Grammar

stmt → id := expr | if expr_prime then stmt | while expr_prime do stmt | begin opt_stmts end

opt_stmts → stmt_list |є

stmt_list → stmt_list ; stmt | stmt

expr_prime → expr relation expr

expr → term expression | + term expression' | - term expression' | epsilon

term → term expression | + term expression' | - term expression' | epsilon

factor → term expression | + term expression' | - term expression' | epsilon

relation → > | < | <= | >= | =

id → id [a-zA-Z] | id [0-9]

About

This repository contains the solutions to assignments done during Compilers Course

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published