Compiler Flashcards
When viewing programming languages as natural languages, the word ANSWER is used instead of `words’.
tokens
The routine in a compiler that takes as input a sequence of characters outputs these characters grouped into meaningful units is called ANSWER.
a lexical analyzer
The specifications for how to group characters into meaningful units are traditionally written as ANSWER.
regular expressions
The specifications of how to group characters into meaningful basic units of a programming language are generally implemented in code that has the abstract form of ANSWER.
a finite state machine
When viewed abstractly, a language is defined as a set of ANSWER.
strings
The Greek letter epsilon, when talking about languages, is used to represent ANSWER.
the empty string
In automatically generating the code that reads characters and outputs the part of a programming language that is analogous to its words, we start with a specification and then traditionally convert it into code in two stages. In the first stage, we produce ANSWER.
a nondeterministic finite state machine
In automatically generating the code that reads characters and outputs the part of a programming language that is analogous to its words, we start with a specification and then traditionally convert it into code in two stages. The main problem that can arise in moving from the first stage to the second stage is ANSWER.
an exponential explosion in the number of states needed
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}