Compiler Flashcards

1
Q

When viewing programming languages as natural languages, the word ANSWER is used instead of `words’.

A

tokens

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

The routine in a compiler that takes as input a sequence of characters outputs these characters grouped into meaningful units is called ANSWER.

A

a lexical analyzer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

The specifications for how to group characters into meaningful units are traditionally written as ANSWER.

A

regular expressions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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

a finite state machine

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

When viewed abstractly, a language is defined as a set of ANSWER.

A

strings

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

The Greek letter epsilon, when talking about languages, is used to represent ANSWER.

A

the empty string

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

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

a nondeterministic finite state machine

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

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.

A

an exponential explosion in the number of states needed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

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

a sequence of terminals and nonterminals

a sequence of symbols

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

The specific type of grammar that was the main focus of the portion of the Syntax Analysis chapter that was assigned was ANSWER.

A

LL(1)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

In a context-free grammar, the nonterminal that derives an entire member of the language being defined is called ANSWER.

A

a start symbol

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

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

A => Ab => Abb => bbb

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

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 (a | b)*

That’s the bar, not a letter in between

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

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.

A

E => (E) => ((E)) => ((1))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

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 -> .

A

X => XcY => XcYcY => cYcY => ccY => cc
AND
X => XcY => XcX => XcXcY => cXcY => ccY => cc

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

When a grammar can produce two distinct syntax trees for the same string, the grammar is said to be ANSWER.

A

ambiguous

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

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.

A

E -> E + F and E -> F and F -> id

E -> E + F and E -> id and F -> id

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

One aspect of the if then else end syntax of Ruby is that it avoids the ANSWER problem.

A

dangling else

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

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.

A

true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

In the context-free grammar A -> B A , B -> A B, A -> a, B -> b, B -> the value of Nullable(A) is ANSWER.

A

false

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

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

{a,b}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

In the context-free grammar A -> B A , B -> A B, A -> a, B -> b, B -> the value of FIRST(A) is ANSWER.

A

{a,b}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

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

{a,b}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

In the context-free grammar A -> B A , B -> A B, A -> a, B -> b, B -> the value of FOLLOW(A) is ANSWER.

A

{b}

25
Q

The context-free grammar A -> B A , B -> A B, A -> a, B -> b, B -> is not LL(1) specifically because ANSWER.

A

FIRST(BA) and FIRST(a) both include a, so we do not know which A rule to use

26
Q

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

a recursive descent parser

27
Q

Programming languages that view programming as describing a step-by-step process to do something are called ANSWER languages.

A

imperative

28
Q

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.

A

declarative

29
Q

Each named object will have ANSWER, where the name is defined as a synonym for the object.

A

a declaration

30
Q

The technical term for connecting a name with an object is called ANSWER.

A

binding

31
Q

The portion of the program where the name is visible is called its ANSWER.

A

scope

32
Q

When the structure of the syntax tree is used to determine which object corresponds to a name, this is called ANSWER.

A

static scoping

33
Q

A compiler typically keeps track of which names are associated with which objects by using ANSWER.

A

a symbol table

34
Q

ANSWER data structures have the property that no operation on the structure will destroy or modify it.

A

immutable

35
Q

ANSWER data structures have the property that there are operations on the structure can destroy or modify it.

A

mutable

36
Q

Since a compiler may have to look up what object is associated with a name many times, it is typical to use ANSWER to avoid linear search times.

A

hash tables

37
Q

In the example interpreter for evaluating expressions, in the row labelled id, we have the code: v = lookup(vtable, getname(id)) ; if v = unbound then error() else v. It says getname(id) instead of id, because ANSWER.

A

id indicates a token with a type and value field

38
Q

In the example interpreter for evaluating expressions, in the row labelled id, we have the code: v = lookup(vtable, getname(id)) ; if v = unbound then error() else v. The value of v would be unbound in the situation that ANSWER.

A

getname(id) was not bound

39
Q

In the ICD textbook’s example interpreter for evaluating expressions, in the row labelled id(Exps), we have the code: args = EvalExps(Exps,vtable,ftable). We pass vtable to EvalExps to handle ANSWER.

A

expressions that contain identifiers

40
Q

In the ICD textbook’s example interpreter for evaluating expressions, in the row labelled id(Exps), we have the code: args = EvalExps(Exps,vtable,ftable). We pass ftable to EvalExps to handle ANSWER.

A

expressions that contain function usages

41
Q

In the ICD textbook’s example interpreter for evaluating expressions, in the row labelled let id = Exp1 in Exp2, we have the code: v1 = EvalExp(Exp1, vtable, ftable); vtableP = bind(vtable, getname(id), v1), EvalExp(Exp2, vtableP, ftable). The bind function changes vtable into vtableP by ANSWER.

A

inserting the binding of getname(id) with the value v1 into the table

42
Q

One approach to speeding up an interpreter is to translate pieces of the code being interpreted directly into machine code during program execution, this is called ANSWER.

A

just-in-time compilation

43
Q

The technical term for the compiler design methodology where the translation closely follows the syntax of the language is ANSWER.

A

syntax-directed translation

44
Q

Using the straightfoward expression translation scheme in the ICD 2nd edition textbook, if I were to TransExp(‘3 * x + 1’, vtable, ftable), newvar() will be invoked ANSWER times.

A

5

45
Q

Using the straightfoward statement translation scheme in the ICD textbook, if I were to TransStat(‘if true then z := 1 else z := 2’, vtable, ftable), newlabel() will be invoked ANSWER times.

A

3

46
Q

Using the straightfoward statement translation scheme in the ICD textbook, if I were to TransStat(‘while true do z := 1 + z’, vtable, ftable), newlabel() will be invoked ANSWER times.

A

3

47
Q

Using the straightfoward statement translation scheme in the ICD textbook, if I were to TransStat(‘while z < 3 do z := 1 + z’, vtable, ftable), newvar() will be invoked ANSWER times.

A

5

48
Q

When type checking done during program execution, the type system is called ANSWER.

A

dynamic typing

49
Q

When type checking done during program compilation, the type system is called ANSWER.

A

static typing

50
Q

ANSWER typing is when the language implementation ensures that the arguments of an operation are of the type the operation is defined for.

A

Strong

51
Q

ANSWER is the data structure used in language translation to track the binding of variables and functions to their type.

A

A symbol table

52
Q

The different traversals of a syntax tree done during compilation associate information with the nodes of the tree. The technical term for this kind of information is ANSWER.

A

attributes

53
Q

ANSWER means that the language allows the same name to be used for different operations over different types.

A

Overloading

54
Q

Some languages allow a function to be ANSWER, that is to be defined over a large class of similar types, e.g., over arrays no matter what type their elements are.

A

polymorphic

generic

55
Q

When a function is invoked, if the language passes a copy of the value of each parameter to the code that performs the function, this is called ANSWER.

A

pass-by-value

56
Q

If the system stack is used for a call stack, then it becomes important for the caller to update the top of the stack before copying items into it. The reason is because we are worried about the top of the stack being changed by ANSWER after we have copied in information but before we updated the stack top.

A

an interrupt

57
Q

The portion of the call stack associated with a single function invocation and execution is called ANSWER.

A

an activation record

58
Q

Another method of parameter passing, whose technical name is ANSWER, is implemented by passing the address of the variable (or whatever the given parameter is). Assigning to such a parameter would then change the value stored at the address.

A

pass-by-reference

59
Q

In C, when you pass a function as a parameter to another function, it is implemented as passing ANSWER.

A

the address of the start of the function code