Quiz
Study Guide
Create a free account to finish this quiz
Save your progress and see your final score.
Already have an account? Sign in
Questions in this quiz (16)
1Which of the following is NOT a top-down parsing?
- ARecursive descent parsing
- BBacktracking
- CLL(1) parsing
- DNone of above
2Which of the following is true for parser generator?
- AThe input of a parser generator is a token stream
- Bthe output of a parser generator is a abstract syntax tree(AST)
- CCFG of a programming language is part of the input to a parser generator.
- DFlex is a parser generator
3Which of the following is NOT true for parser
i. the parser is to process a token stream.
ii. One of the major responsibilities of parser is to detect syntax error.
ii. The output of parser is an abstract syntax tree.- Ai
- Bi,ii
- Ci,ii,iii
- Dii,iii
- Eiii
- FNone of above
4Grammer that produce more than one parse tree for same sentence:
- Ais ambiguous
- Bis unambiguous
- Chas syntax errors
- Dis no LL(1) grammer
5Which of the following is WRONG?
- AA CFG grammar is said to be ambiguous if for a sentence, there is a leftmost derivation and a rightmost derivation.
- BA CFG grammar is said to be ambiguous if for a sentence, there are two leftmost derivations.
- CA CFG grammar is said to be ambiguous if for a sentence, there are two rightmost derivations.
- DA CFG grammar is said to be ambiguous if for a sentence, there are two different parse tree representation.
6The context free grammer S --> SS|0S1|1SO|e generates
- AEqual number of 0's and 1's
- BUnequal number of 0's and 1's
- CNumber of 0's followed by any number of 1's
- DNone of the mentioned.
7Which of these does not belong to CFG?
- ATerminal Symbol
- BNon-Terminal Symbol
- CStart Symbol
- DEnd Symbol
8Which of the following derivations does a LL(1) parser use while parsing an input string? The input is assumed to be scanned in left to right order?
- ALeftmost derivation
- BRightmost derivation
- CNone of above
9Assume X (terminal or non-terminal) is the top symbol in the stack, and c is the next symbol in the input in LL(1) parsing, which of the following indicates an syntax error?
i.X is any terminal other and c
ii.X is a non-terminal, but the cell M[X,c] in the parsing table is empty.
iii.X is any non-terminal other than c,
iv.X is a non-terminal, but the cell M[X,c] in the parsing table is not empty.- Ai
- Bi and iii
- Ciii and iv
- Di. ii. iii. and iv
- ENone of above
10Assume FIRST (A) = {b,c,d,epsilon} for a non-terminal A, what's the result of FIRST(aAe) where a and e are terminals?
- A{a,b,c,d,e}
- B{b,c,d}
- C{a,e}
- D{a}
11Assume FIRST (A) = {c,d,e,epsilon} for a non-terminal A, what's the result of FIRST(Ab) where b is a terminal?
- A{b,c,d,e}
- B{c, d, e}
- C{e}
- D{b, c, d, e, epsilon}
12Assume FIRST (A) = {1,2,3,epsilon} and FIRST(B) = {b,c,d} for a non-terminal A and B, what's the result of FIRST(AB)?
- A{b,c,d,epsilon}
- B{1,2,3}
- C{b,c,d,1,2,3}
- D{1,2,3,epsilon}
- E{b,c,d,1,2,3,epsilon}
13Assume FIRST (A) = {1,2,3,epsilon} and FIRST(B) = {b,c,d} for a non-terminal A and B, what's the result of FIRST(BA)?
- A{b,c,d,epsilon}
- B{1,2,3}
- C{b,c,d}
- D{1,2,3,epsilon}
- E{b,c,d,1,2,3,epsilon}
14Assume FIRST (A) = {1,2,3,epsilon} and FIRST(B) = {b,c,d,epsilon} for a non-terminal A and B, what's the result of FIRST(AB)?
- A{b,c,d,epsilon}
- B{1,2,3}
- C{b,c,d,1,2,3,}
- D{1,2,3,epsilon}
- E{b,c,d,1,2,3,epsilon}
15Assume FIRST (A) = {b,c,d} and FIRST(B) = {1,2,3} for a non-terminal A and B, which of the following statements is correct for a production: A -> ABgh where g and h are terminals.
- AFOLLOW(B) contains g
- BFOLLOW(B) contains h
- CFOLLOW(B) contains both g and h
- Dg and h are not in FOLLOW(B)
- EFOLLOW(B) contains b,c, and d
16Assume FIRST (A) = {b,c,d} and FIRST(B) = {1,2,3,epsilon} for a non-terminal A and B, which of the following statements is correct for a production: A -> ACB where C is non-terminal?
- AFOLLOW(C) contains {1,2,3,epsilon}
- BFOLLOW(C) contains{b,c,d}
- CFOLLOW(C) contains{1,2,3,b,c,d,epsilon}
- DFOLLOW(C) contains {1,2,3,b,c,d}
Information
- Description
- Quiz on Study Guide, created by Patrick Clarke on 30/10/2018.
- Author
- Patrick Clarke
- Language
- English
- Views
- 29
- Rating
- No ratings yet Rate this quiz