ICD2 - Parsing Flashcards
The central idea of context-free grammars is to define a language by productions. These productions say that a nonterminal symbol can be replaced by ANSWER.
a sequence of terminals and nonterminals
a sequence of symbols
The specific type of grammar that was the main focus of the portion of the Syntax Analysis chapter that was assigned was ANSWER.
LL(1)
In a context-free grammar, the nonterminal that derives an entire member of the language being defined is called ANSWER.
a start symbol
Using the context-free grammar based on the two rules A -> b A and A -> b, ANSWER would be the derivation sequence for bbb.
A => Ab => Abb => bbb
ANSWER is the regular expression that corresponds to the language defined by the context-free grammar with the three rules A -> A a, A -> A b, A -> a.
a (a | b)*
That’s the bar, not a letter in between
ANSWER would be the derivation of ((1)) in the language defined by the context-free grammar consisting of the two rules E -> ( E ) and E -> 1.
E => (E) => ((E)) => ((1))
ANSWER are two derivations of the string cc that produce distinct syntax trees from the context-free grammar X -> X c Y , Y -> X, Y -> and X -> .
X => XcY => XcYcY => cYcY => ccY => cc
AND
X => XcY => XcX => XcXcY => cXcY => ccY => cc
When a grammar can produce two distinct syntax trees for the same string, the grammar is said to be ANSWER.
ambiguous
If I wanted to fix the grammar E -> E + E and E -> id, so that it would only produce one syntax, which is left recursive, the new grammar would be ANSWER.
E -> E + F and E -> F and F -> id
E -> E + F and E -> id and F -> id
One aspect of the if then else end syntax of Ruby is that it avoids the ANSWER problem.
dangling else
In the context-free grammar A -> B A , B -> A B, A -> B, A -> a, B -> b, and B -> the value of Nullable(A) is ANSWER.
true
In the context-free grammar A -> B A , B -> A B, A -> a, B -> b, B -> the value of Nullable(A) is ANSWER.
false
In the context-free grammar A -> B A , B -> A B, A -> B, A -> a, B -> b, and B -> the value of FIRST(A) is ANSWER.
{a,b}
In the context-free grammar A -> B A , B -> A B, A -> a, B -> b, B -> the value of FIRST(A) is ANSWER.
{a,b}
In the context-free grammar A -> B A , B -> A B, A -> B, A -> a, B -> b, and B -> the value of FOLLOW(A) is ANSWER.
{a,b}