MCQ Bank
Which type of intermediate representation is typically used in compilers for advanced optimization techniques?
- A) Three-address code
- B) Byte code
- C) Stack-machine code
- D) Assembly code
Abstract Syntax Tree is less concise than a parse tree.
- A) False
- B) True
- C)
- D)
In three-address code, how many bytes are typically used to represent operations?
- A) 3 to 4 bytes
- B) 7 to 8 bytes
- C) 5 to 6 bytes
- D) 1 to 2 bytes
Which section in a YACC specification file contains the "tokens definitions"?
- A) Fourth Section
- B) First Section
- C) Third Section
- D) Second Section
S --> A B A --> ∈ | aA B --> ∈ | bB. FIRST(S) contains ___ elements.
- A) 5
- B) 4
- C) 6
- D) 3
LALR(1) parsing reduces the size of the parsing tables by:
- A) Ignoring reduce actions.
- B) Merging states with identical cores.
- C) Limiting the number of lookahead tokens.
- D) Using an enhanced parsing algorithm.
What is the size, in bytes, typically allocated for addresses in three-address code?
- A) 1 byte
- B) 8 bytes
- C) 2 bytes
- D) 4 bytes
Compared to an LALR(1) parsing table, the size of an LR(1) parsing table is:
- A) Equal
- B) Larger
- C) Smaller
- D) Same
In YACC specification file, different sections are separated by ____________ symbol.
- A) @@
- B) &&
- C) ##
- D) %%
It is mandatory to deliver efficient target code by lowering the number of instructions in a program.
- A) False
- B) True
- C)
- D)
It is impossible to reduce the size of a large LR(1) table.
- A) True
- B) False
- C)
- D)
In attribute grammars, values used to compute synthesized attributes flow ____________ in the parse tree.
- A) Bottom-up
- B) Bottom-down
- C) Top-up
- D) Top-down
CLR(1) has become a standard for programming languages and for parser generators.
- A) False
- B) True
- C)
- D)
What does the "sizeof" operator return in C++?
- A) The size of a variable in megabytes.
- B) The size of a variable in kilobytes.
- C) The size of a variable in bits.
- D) The size of a variable in bytes.
In the context of the ad-hoc scheme for semantic analysis, which notation is adopted for specifying snippets and passing values?
- A) RE notation
- B) NFA notation
- C) BNF notation
- D) YACC notation
Which of the following attributes flows from parent nodes to child nodes in an attributed tree?
- A) Structural attributes
- B) Semantic attributes
- C) Inherited attributes
- D) Synthesized attributes
If "A → B C D" is a production, then A is a/an ____________ node of B, C and D nodes.
- A) Parent
- B) Child
- C) Sibling
- D) Kid
YACC is often used in combination with Lex, a lexical analyzer generator, to create complete language processors.
- A) True
- B) False
- C)
- D)
What consideration might influence the choice of the attribute evaluation order in the oblivious methodology?
- A) Dynamic attribute dependencies
- B) Optimization goals
- C) Syntax tree generation algorithms
- D) Attribute propagation rules
Which file extension is commonly used for YACC specification file?
- A) .bin
- B) .bnf
- C) .y
- D) .lex