











Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!












Two-pass CompilerTwo-pass CompilerTwo-pass Compiler Two-pass Compiler Front End Back End source code IR (^) machine code errors
Two-pass CompilerTwo-pass CompilerTwo-pass Compiler Two-pass Compiler ๏ง Back end maps IR into target machine code ๏ง Admits multiple front ends & multiple passes
Front EndFront EndFront End Front End
ScannerScannerScanner Scanner
scanner parser source code tokens IR errors
ScannerScannerScanner Scanner
ScannerScannerScanner Scanner
ParserParserParser Parser scanner parser source code tokens IR errors
Context-Free GrammarsContext-Free GrammarsContext-Free Grammars Context-Free Grammars ๏ง (^) Context-free syntax is specified with a grammar G= ( S,N,T,P ) ๏ง (^) S is the start symbol ๏ง (^) N is a set of non-terminal symbols ๏ง (^) T is set of terminal symbols or words ๏ง (^) P is a set of productions or rewrite rules
Context-Free GrammarsContext-Free GrammarsContext-Free Grammars Context-Free Grammars Grammar for expressions
Context-Free GrammarsContext-Free GrammarsContext-Free Grammars Context-Free Grammars
DerivationDerivationDerivation Derivation Production Result goal 1 expr 2 expr^ op term 5 expr op^ y 7 expr^ โ y 2 expr op term^ โ y 4 expr op^ 2 โ y 6 expr^ + 2 โ y 3 term + 2 โ y 5 x + 2 โ y
ParseParseParse Parse Production Result goal 1 expr 2 expr^ op term 5 expr op^ y 7 expr^ โ y 2 expr op term^ โ y 4 expr op^ 2 โ y 6 expr^ + 2 โ y 3 term + 2 โ y 5 x + 2 โ y