Compiler Design Notes.
Compiler Design Notes.
Preprocessor
Source program
Compiler
Assembler
↓
Absolute machine code
1. Lexical Analyzer
2. Syntax Analyzer
3. Semantic Analyzer
4. Intermediate code generator
5. Code optimizer
6. Code generator
Single- pass
Multi-pass
Load-and-go
Debugging or optimizing
8. What is a symbol table?
Preprocessors
Assemblers
Loaders and Link-Editors
1. Code optimization
2. Code generation, along with error handling and symbol-
table operations.
Parser generators
Scanner generators
Syntax-directed translation engines
Automatic code generators
Data-flow engines
Union – L U M ={s | s is in L or s is in M}
Concatenation – LM ={st | s is in L and t is in M}
Kleene Closure – L* (zero or more concatenations of L)
Positive Closure – L+ ( one or more concatenations of L)
Specification of syntax
Representation of input after parsing.
1. Simpler design.
2. Compiler efficiency is improved.
3. Compiler portability is enhanced.
i.e. both leftmost and rightmost derivations are same for the
given sentence.
Backtracking
Left recursion
Left factoring
Ambiguity
FIRST
FOLLOW
Disadvantages
A→.XYZ
A→X.YZ
A→XY.Z
A→XYZ.
Syntax tree
Postfix
Three address code
t1 := not c
t2 := b and t1
t3 := a or t2
E.true := new_label()
E.false :=S.next
S1.next :=S.next
2. S → if E then S1 else S2
E.true := new_label()
E.false := new_label()
S1.next :=S.next
S2.next :=S.next
DAG is used in
MOV R0,R1 1
MOV R1,M 2
SUB 5(R0),*10(R1) 3
Eg. t1:=a*5
t2:=t1+7
t3:=t2-5
t4:=t1+t3
t5:=t2+b
Static allocation
Stack allocation
Heap allocation
Temporary variables
Local variables
Saved machine registers
Control link
Access link
Actual parameters
Return values
Call by value
Call by reference
Copy-restore
Call by name
------>>[MOST IMPORTANT]<<------
LEAVE A REPLY
Your email address will not be published. Required fields are marked *
Comment *
Name *
Email *
Website
Post Comment
Engineering 2023 , FAQs Interview Questions , Theme by Engineering|| Privacy Policy|| Terms and
Conditions|| ABOUT US|| Contact US||
Engineering interview questions,Mcqs,Objective Questions,Class Lecture Notes,Seminor topics,Lab Viva
Pdf PPT Doc Book free download. Most Asked Technical Basic CIVIL | Mechanical | CSE | EEE | ECE | IT |
Chemical | Medical MBBS Jobs Online Quiz Tests for Freshers Experienced .