Beruflich Dokumente
Kultur Dokumente
15. Give the rules for generating regular expression for describing
languages.
is a regular expression
Precedence and associativity of operators
UNIT II
SYNTAX ANALYSIS
1. Explain in detail about the role of parser.
Syntax Error Handling
Error Recovery Strategies
Panic Mode Recovery
Phrase level Recovery
Error Productions
2. Explain in detail about CFG.
Notational Conventions of CFG
Derivations
Parse tree
Ambiguity
3. Explain how to write the CFG.
Regular Expression vs. CFG
Eliminating Ambiguity
Elimination of left recursion
Left factoring
4. Explain in detail about top down parsing.
Backtracking Parser / Recursive Descent Parsing
Predictive Parser
Recursive Predictive Parser
Working of Predictive Parser
Error Recovery modes.
5. Explain in detail about the error recovery modes in Predictive Parser.
Panic Mode Error Recovery
Phrase level recovery
6. Explain about Non Recursive Predictive Parser.
Input buffer
Stack
Parsing Table
Output Stream
7. Write the steps for Non Recursive Predictive Parser.
Eliminate left recursion or left factoring
Computation of FIRST
Computation FOLLOW
Parsing Table
UNIT-IV
CODE GENERATION
1. Explain in detail about the issues in the design of code generator.
Input to the code generator
Target program
Memory management
Instruction selection
Register allocation
Choice of evaluation order
2. Explain in detail about the target language
A simple target machine model
o Load operation
o Store operation
o Computation operation
o Unconditional jumps
o Conditional jumps
Program and instruction cost
3. Explain in detail about basic blocks and flow graphics.
Basic blocks
Algorithm for partitioning blocks
Structure preserving transformations
Algebraic transformation
Floe graph
Loops
4. Explain the steps for Structure preserving transformations.
Common sub expression elimination
Dead code elimination
Renaming of temporary variables
Interchange of two independent adjacent statements
5. Explain in detail about next use information
Consider the instruction sequence
Find the next use of variables
Take the statements with numbers
12. What are the different addressing modes for a target machine?
Load operation
Store operation
Computation operation
Unconditional jumps
Conditional jumps
13. Explain how declarations are done in a procedure using syntax directed
Translation.
Grammar function
Translation scheme
Syntax directed translation
14. Explain code generation phase with simple code generation
algorithm.
Register Descriptor
Address Descriptor
Code generation algorithm
The getreg() function
Code generation for other statements
UNIT V
CODE OPTIMIZATION
1. List the criteria for code improving transformations.
Factors for code transformations
Forms of the programs
Compiler improving methods
Machine resources
2. Explain in detail about code optimizer organizer
Front end
Code generator
Control flow analysis
Data flow analysis
Transformations
3. Explain in detail about principle sources of optimization.
Function preserving transformations
o Common sub expression elimination
o Copy propagation
o Dead code elimination
o Constant folding
Loop optimization
o Code motion
o Induction variable elimination
o Reduction in strength
4. Explain in detail about function preserving transformations.
Common sub expression elimination
Copy propagation