Skip to content

Intermediate code generation-into TAC-, some error checks, and temp variable optimization

Notifications You must be signed in to change notification settings

furkee/CompilerProject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Please see parser.y for the input grammar.

Output grammar for TAC(three address code) is as follows:

Program -> StmtLst

StmtLst -> LStmt StmtLst | LStmt

LStmt -> Lbl: LStmt | Stmt

Stmt -> AsgnStmt | CondJump | Jump | Param | Call | Return

AsgnStmt-> id = Expr

IfStmt -> "if" ( id ) "GOTO" Lbl

Jump -> "GOTO" Lbl

Param -> "param" id

Call -> "call" id

Return -> "return"

Lbl -> id

Expr -> Operand | Operand Op Operand

Operand -> integer | true | false | id

Op -> + | * | < | == | and

About

Intermediate code generation-into TAC-, some error checks, and temp variable optimization

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published