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}
In the context-free grammar A -> B A , B -> A B, A -> a, B -> b, B -> the value of FOLLOW(A) is ANSWER.
{b}
The context-free grammar A -> B A , B -> A B, A -> a, B -> b, B -> is not LL(1) specifically because ANSWER.
FIRST(BA) and FIRST(a) both include a, so we do not know which A rule to use
When you write a parser for a context-free grammar that satisfies the LL(1) criteria by representing each non-terminal by a function that chooses what functions to invoke by the LL(1) criteria, this sort of parser is called ANSWER.
a recursive descent parser
Programming languages that view programming as describing a step-by-step process to do something are called ANSWER languages.
imperative
Programming languages that view programming as describing characteristics of the problem domain and characteristics of the solution and leaving it to the language processor to find a solution are called ANSWER languages.
declarative