This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
What Are The Various Types Of Intermediate Code Representation? |
|
Answer» There are MAINLY three TYPES of INTERMEDIATE CODE REPRESENTATIONS.
There are mainly three types of intermediate code representations. |
|
| 2. |
What Are The Benefits Of Intermediate Code Generation? |
Answer»
|
|
| 3. |
What Is Phrase Level Error Recovery? |
|
Answer» Phrase level error recovery is implemented by FILLING in the blank entries in the predictive parsing table with POINTERS to error routines. These routines MAY change, insert, or delete symbols on the input and ISSUE appropriate error messages. They may also pop from the stack. Phrase level error recovery is implemented by filling in the blank entries in the predictive parsing table with pointers to error routines. These routines may change, insert, or delete symbols on the input and issue appropriate error messages. They may also pop from the stack. |
|
| 4. |
What Are Kernel & Non-kernel Items? |
|
Answer» Kernel items, whish include the INITIAL ITEM, S’→ .S, and all items WHOSE dots are not at the left end. Kernel items, whish include the initial item, S’→ .S, and all items whose dots are not at the left end. |
|
| 5. |
Define Handle ? |
|
Answer» 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 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. |
|
| 6. |
What Is Meant By Viable Prefixes? |
|
Answer» The set of prefixes of right sentential forms that can appear on the STACK of a shift-reduce parser are CALLED viable prefixes. An equivalent definition of a viable PREFIX is that it is a prefix of a right sentential form that does not continue past the right end of the rightmost handle of that sentential form. The set of prefixes of right sentential forms that can appear on the stack of a shift-reduce parser are called viable prefixes. An equivalent definition of a viable prefix is that it is a prefix of a right sentential form that does not continue past the right end of the rightmost handle of that sentential form. |
|
| 7. |
Write Short Notes On Yacc ? |
Answer»
|
|
| 8. |
What Are The Problems With Top Down Parsing? |
|
Answer» The following are the problems ASSOCIATED with top down parsing: The following are the problems associated with top down parsing: |
|
| 9. |
Mention The Types Of Lr Parser ? |
| Answer» | |
| 10. |
List The Properties Of Lr Parser ? |
|
Answer» 1. LR PARSERS can be constructed to RECOGNIZE most of the PROGRAMMING languages for which the context FREE grammar can be written. 1. LR parsers can be constructed to recognize most of the programming languages for which the context free grammar can be written. |
|
| 11. |
What Is A Operator Precedence Parser? |
|
Answer» A grammar is said to be OPERATOR precedence if it possess the following properties: A grammar is said to be operator precedence if it possess the following properties: |
|
| 12. |
Define Ambiguous Grammar. |
|
Answer» A grammar G is said to be ambiguous if it generates more than one PARSE tree for some sentence of LANGUAGE L(G). A grammar G is said to be ambiguous if it generates more than one parse tree for some sentence of language L(G). |
|
| 13. |
Briefly Explain The Concept Of Derivation. |
|
Answer» Derivation from S means generation of string w from S. For constructing derivation two things are important. Derivation from S means generation of string w from S. For constructing derivation two things are important. |
|
| 14. |
Define A Context Free Grammar. |
|
Answer» A context FREE grammar G is a COLLECTION of the following A context free grammar G is a collection of the following |
|
| 15. |
Why Lexical And Syntax Analysers Are Separated Out? |
|
Answer» Reasons for SEPARATING the ANALYSIS PHASE into lexical and syntax analyzers:
Reasons for separating the analysis phase into lexical and syntax analyzers: |
|
| 16. |
Mention The Basic Issues In Parsing. |
|
Answer» There are two IMPORTANT ISSUES in parsing.
There are two important issues in parsing. |
|
| 17. |
List The Various Error Recovery Strategies For A Lexical Analysis. |
|
Answer» POSSIBLE error recovery ACTIONS are:
Possible error recovery actions are: |
|
| 18. |
What Does A Semantic Analysis Do? |
|
Answer» Semantic analysis is one in which certain checks are performed to ENSURE that components of a program fit TOGETHER meaningfully.Mainly PERFORMS type checking. Semantic analysis is one in which certain checks are performed to ensure that components of a program fit together meaningfully.Mainly performs type checking. |
|
| 19. |
What Is The Function Of A Hierarchical Analysis? |
|
Answer» Hierarchical analysis is one in which the TOKENS are GROUPED hierarchically into nested collections with COLLECTIVE meaning.Also TERMED as Parsing. Hierarchical analysis is one in which the tokens are grouped hierarchically into nested collections with collective meaning.Also termed as Parsing. |
|
| 20. |
Mention The Various Notational Short Hands For Representing Regular Expressions. |
| Answer» | |
| 21. |
Write A Regular Expression For An Identifier. |
|
Answer» An identifier is defined as a letter followed by ZERO or more letters or digits. An identifier is defined as a letter followed by zero or more letters or digits. |
|
| 22. |
List The Operations On Languages. |
Answer»
|
|
| 23. |
Differentiate Tokens, Patterns, Lexeme. |
|
Answer» Tokens- Sequence of characters that have a COLLECTIVE meaning. Tokens- Sequence of characters that have a collective meaning. |
|
| 24. |
List The Various Compiler Construction Tools. |
|
Answer» The following is a LIST of some COMPILER construction tools:
The following is a list of some compiler construction tools: |
|
| 25. |
Define Compiler-compiler. |
|
Answer» Systems to help with the compiler-writing PROCESS are often been referred to as compiler-compilers, compiler-generators or translator-writing systems. Systems to help with the compiler-writing process are often been referred to as compiler-compilers, compiler-generators or translator-writing systems. |
|
| 26. |
Mention The Back-end Phases Of A Compiler. |
|
Answer» The back end of compiler includes those portions that DEPEND on the TARGET machine and GENERALLY those portions do not depend on the SOURCE language, just the intermediate language. These include The back end of compiler includes those portions that depend on the target machine and generally those portions do not depend on the source language, just the intermediate language. These include |
|
| 27. |
List The Phases That Constitute The Front End Of A Compiler. |
|
Answer» The FRONT end consists of those phases or PARTS of phases that depend PRIMARILY on the source language and are largely independent of the target machine. These include The front end consists of those phases or parts of phases that depend primarily on the source language and are largely independent of the target machine. These include |
|
| 28. |
Mention Some Of The Cousins Of A Compiler. |
Answer»
Cousins of the compiler are: |
|
| 29. |
What Is A Symbol Table? |
|
Answer» A symbol table is a data structure containing a record for each identifier, with FIELDS for the attributes of the identifier. The data structure allows US to find the record for each identifier quickly and to STORE or RETRIEVE data from that record quickly. A symbol table is a data structure containing a record for each identifier, with fields for the attributes of the identifier. The data structure allows us to find the record for each identifier quickly and to store or retrieve data from that record quickly. |
|
| 30. |
What Are The Classifications Of A Compiler? |
|
Answer» COMPILERS are CLASSIFIED as:
Compilers are classified as: |
|
| 31. |
List The Various Phases Of A Compiler ? |
|
Answer» The following are the VARIOUS phases of a COMPILER:
The following are the various phases of a compiler: |
|
| 32. |
What Is Linear Analysis? |
|
Answer» LINEAR ANALYSIS is one in which the stream of characters making up the SOURCE program is read from left to right and grouped into tokens that are sequences of characters having a collective meaning.Also CALLED lexical analysis or scanning. Linear analysis is one in which the stream of characters making up the source program is read from left to right and grouped into tokens that are sequences of characters having a collective meaning.Also called lexical analysis or scanning. |
|
| 33. |
Define Symbol Table. |
|
Answer» Symbol table is a DATA STRUCTURE used by the compiler to keep TRACK of semantics of the variables. It stores information about SCOPE and binding information about NAMES. Symbol table is a data structure used by the compiler to keep track of semantics of the variables. It stores information about scope and binding information about names. |
|
| 34. |
What Is Dynamic Scoping? |
|
Answer» In dynamic scoping a use of non-LOCAL variable refers to the non-local data declared in most recently called and still active procedure. THEREFORE each time NEW FINDINGS are set up for local names called procedure. In dynamic scoping symbol tables can be required at run time. In dynamic scoping a use of non-local variable refers to the non-local data declared in most recently called and still active procedure. Therefore each time new findings are set up for local names called procedure. In dynamic scoping symbol tables can be required at run time. |
|
| 35. |
What Are The Contents Of Activation Record? |
|
Answer» The activation record is a block of memory used for MANAGING the information needed by a single execution of a procedure. Various fields F activation record are:
The activation record is a block of memory used for managing the information needed by a single execution of a procedure. Various fields f activation record are: |
|
| 36. |
List The Different Storage Allocation Strategies ? |
|
Answer» The STRATEGIES are:
The strategies are: |
|
| 37. |
What Are The Basic Goals Of Code Movement? |
|
Answer» •To REDUCE the SIZE of the CODE i.e. to OBTAIN the space complexity. •To reduce the size of the code i.e. to obtain the space complexity. |
|
| 38. |
Mention The Issues To Be Considered While Applying The Techniques For Code Optimization. |
Answer»
|
|
| 39. |
What Are The Various Ways To Pass A Parameter In A Function? |
| Answer» | |
| 40. |
What Are The Properties Of Optimizing Compiler? |
|
Answer» The source code should be such that it should produce MINIMUM amount of target code. The source code should be such that it should produce minimum amount of target code. |
|
| 41. |
What Is Code Motion? |
|
Answer» CODE motion is an optimization technique in which amount of code in a loop is DECREASED. This transformation is applicable to the expression that YIELDS the same RESULT independent of the number of times the loop is executed. Such an expression is placed before the loop. Code motion is an optimization technique in which amount of code in a loop is decreased. This transformation is applicable to the expression that yields the same result independent of the number of times the loop is executed. Such an expression is placed before the loop. |
|
| 42. |
Suggest A Suitable Approach For Computing Hash Function? |
Answer»
|
|
| 43. |
List The Sub Parts Or Phases Of Analysis Part ? |
|
Answer» ANALYSIS consists of THREE phases:
Analysis consists of three phases: |
|
| 44. |
What Are The Two Parts Of A Compilation? Explain Briefly. |
|
Answer» Analysis and Synthesis are the TWO parts of compilation.
Analysis and Synthesis are the two parts of compilation. |
|
| 45. |
What Is A Compiler? |
|
Answer» 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. 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. |
|