MCQ Bank
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
LR(1) parsing table for even a simple language can be extremely large with thousands of entries.
- A) True
- B) False
- C)
- D)
Stack-machine code is also called _______________ code.
- A) Three-address
- B) Two-address
- C) Zero-address
- D) One-address
In stack-machine code, how are operands typically accessed for operations?
- A) By using index-based addressing
- B) Through explicit register allocations
- C) By pushing them onto a stack
- D) Through memory loads and stores
What is the purpose of analyzing attribute rules in the rule-based methodology of attribute grammar evaluation?
- A) To optimize the attribute computation process
- B) To generate the parse tree
- C) To establish a fixed ordering of attribute evaluation
- D) To determine the syntax of the source code