Compiler Lab Viva Quetions and Answers
Compiler Lab Viva Quetions and Answers
What Is A Compiler?
A compiler is a program that reads a program written in one language
the source language and translates it into an equivalent program in
another language-the target language. The compiler reports to its user
the presence of errors in the source program.
1. Linear Analysis.
2. Hierarchical Analysis.
3. Semantic Analysis.
3. code movement
4. strength reduction
o Call by reference
o Copy-restore
o Call by name
o Available expressions.
o Reaching definitions.
o Live variables.
o Busy variables.
o Static allocation
o Stack allocation
o Heap allocation
o Control link
o Access link
o Actual parameters
o Return values
o Lexical Analyzer
o Syntax Analyzer
o Semantic Analyzer
o Code generator
o Single- pass
o Multi-pass
o Load-and-go
o Debugging or optimizing
o Preprocessors
o Assemblers
Define Compiler-compiler.
Systems to help with the compiler-writing process are often been
referred to as compiler-compilers, compiler-generators or translator-
writing systems.
Largely they are oriented around a particular model of languages , and
they are suitable for generating compilers of languages similar model.
o Parser generators
o Scanner generators
o Data-flow engines
1. Specification of syntax
2. Representation of input after parsing.
o Simpler design.
o Compiler efficiency is improved.
Define Handle.
A handle of a string is a substring that matches the right side of a
production, and whose reduction to the nonterminal on the left side of
the production represents one step along the reverse of a rightmost
derivation.
A handle of a right sentential form is a production A and a
position of where the string may be found and replaced by A to
produce the previous right-sentential form in a rightmost derivation of
. That is , if S =>Aw =>w,then A in the position following is a
handle of w.
1. Syntax tree
2. Postfix