Home
Explore
Exams
Search for anything
Search for anything
Login
Get started
Home
Engineering
Computer Science
Compiler Construction Quizlet
Studied by 2 people
0.0
(0)
Add a rating
Learn
A personalized and smart learning plan
Practice Test
Take a test on your terms and definitions
Spaced Repetition
Scientifically backed study method
Matching Game
How quick can you match all your cards?
Flashcards
Study terms and definitions
1 / 146
Earn XP
Description and Tags
Computer Science
Add tags
147 Terms
View all (147)
Star these 147
1
Every compiler converts a \_____ program to a \_____ program
source
New cards
2
What type of compilers do many Java interpreters use?
just-in-time
New cards
3
What do macros get converted into?
source language statements
New cards
4
What does the assembler do?
converts assembly code into machine code
New cards
5
What are the two main parts of a compiler?
analysis and synthesis
New cards
6
What does the analysis part of the compiler pass to the synthesis part?
a symbol table and intermediate representation
New cards
7
The synthesis part of a compiler is also called the \_____
back end
New cards
8
The symbol table is...
used by all phases of the compiler
New cards
9
Another name for scanning is
lexical analysis
New cards
10
Another name for parsing is...
syntax analysis
New cards
11
In a syntax tree an interior node represents...
an operation
New cards
12
During what stage of analysis is the syntax tree built?
syntax analysis
New cards
13
In what stage of analysis does type checking occur?
semantic analysis
New cards
14
How can we support multiple target machines for a single source language?
develop multiple backends
New cards
15
What is the most important objective of compiler optimizations?
correctness
New cards
16
What do finite-state machines and regular expressions model?
keywords and identifiers
New cards
17
What is true of programming language features that make programming easier?
they incur run-time overhead
New cards
18
What can be found in most computers both at the instruction level and at the processor level?
parallelism
New cards
19
What is the most important problem in optimizing a program?
using registers effectively
New cards
20
What maps names to locations (variables) in memory (the store)?
environment
New cards
21
What maps memory locations to values?
state
New cards
22
A procedure...
is like a function but doesn't return a value
New cards
23
The proper form of a program is called...
syntax
New cards
24
What a program means is called...
semantics
New cards
25
Sytnax trees and three-address code are both
intermediate representations
New cards
26
In a context free grammar the -\> in A -\> B(C) means...
can have the form
New cards
27
In a grammer A -\> B(C) is called a...
production
New cards
28
In a grammer the elementary symbols
thos not defined by other symbols are called...
New cards
29
The left side of a production is called the...
head
New cards
30
What appears on the right side of grammer productions?
terminals and nonterminals
New cards
31
In all but trivial grammars the start symbol is a...
nonterminal
New cards
32
If multiple productions have the same nonterminal on the left side...
they con be combined into 1 production with the right sides separated by |
New cards
33
What does epsilon stand for in grammars?
the empty string
New cards
34
What is the input to parsing?
a string of terminals
New cards
35
What is the output of parsing?
a parse tree
New cards
36
A parse tree shows how a start symbol derives a
string in the language
New cards
37
The root of a parse tree is...
the start symbol
New cards
38
How do you show that a grammar is ambiguous?
show that a terminal string has more than one parse tree
New cards
39
Parse trees for left-associative oparators grow
down to the left
New cards
40
Precendence of operators...
can be encoded into grammars
New cards
41
What attaches rules or program fragments to grammar productions?
syntax directed translation.
New cards
42
In a sytax directed translation an attribute for a node N that can be determined by N and N's children is called....
synthesized
New cards
43
Program fragmenst imbedded within production boddies are...
ematic actions
New cards
44
What is the process of determining how a string of terminals can be generated by a grammar?
parsing
New cards
45
The current symbol being scanned is called...
the lookahead symbol
New cards
46
Sometimes there are multiple productions we could use
how do we determine if a production is not suitable?
New cards
47
What is FIRST(X)?
the set of symbols that appear first in the strings of terminals generated from x
New cards
48
Given multiple productions how does a predictive parser choose one?
comparing the FIRST of each right hand side
New cards
49
In a predictive parser
if a terminal in the body of a production doesn't match the lookahead
New cards
50
In lexical analysis
a token is...
New cards
51
What does the lexical analyzer allow to appear within expressions?
white space
New cards
52
The symbol table is constructed during \_____ and used during \_____
analysis
New cards
53
Parsers are better at \_____ than lexical analyzers
distinguishing between different declarations of an identifier
New cards
54
Technically scope refers to... (operators
identifiers
New cards
55
All the symbol tables for a program form a...
tree
New cards
56
What are the two most important intermediate representations?
linear representations and trees
New cards
57
Is static checking done at runtime or compile time?
compile time
New cards
58
Making sure that an identifier is not declared multiple times in a scope is an example of...
syntactic checking
New cards
59
What are two types of static checking?
syntactic checking and type checking
New cards
60
In the expression 2 * 3.14
converting 2 to 2.0 is an example of...
New cards
61
A symbol with different meanings base don its context is said to be...
overloaded
New cards
62
An if statement in 3 address code needs...
a jump instruction
New cards
63
Many compilers attempt to generate code that is as good as or better than assembly code produced by...
experts
New cards
64
One task of the lexical analyzer is to...
group input characters into lexemes
New cards
65
For what type of lexemes does the lexeme need to be added to the symbol table?
identifiers
New cards
66
What function on the lexical analyzer is commonly called by the parser?
getNextToken
New cards
67
Correlating error messages with the source program is a function of the...
lexical alyzer
New cards
68
What are two reasons the analysis portion of the compiler is split into lexical analysis and syntax analysis?
compiler efficiency and simplicity of design
New cards
69
What is a pair consisting of a token name and an optional attribute called?
a token
New cards
70
A pointer is generally the attribute for an identifier
why?
New cards
71
A proper prefix of string s....
cannot be equal to s
New cards
72
What do we call a language that can be defined by a regular expression?
a regular set
New cards
73
What does + operator represent in a regular expression?
one or more
New cards
74
What does ? represent in a regular expression?
one or zero
New cards
75
What is [a-z] shorthand for?
a|b|c|...|z
New cards
76
What are the nodes in a transition diagram?
states
New cards
77
If a transition diagram is deterministic
there is never more than one...
New cards
78
An accepting state is indicated by...
a double circle
New cards
79
The start state is indicated by...
an edge from nowhere leading to it
New cards
80
In a lexical analyzer each state has...
a piece of code
New cards
81
The set of languages recognized by DFAs and NFAs are what? (the same
NFA represents more than DFA
New cards
82
In an NFA
the same symbol can label edges...
New cards
83
In a NFA
the set of strings labeling some path from the start to an accepting state defines...
New cards
84
What is the difference between an NFA and a DFA?
There are no epsilon transitions
New cards
85
What does the parser get from the lexical analyzer?
a string of tokens
New cards
86
What are some kinds of parsers?
bottum-up
New cards
87
The input the the parser is scanned
one symbol at a time
New cards
88
What kind of error is a misspelling?
lexical erorr
New cards
89
What kind of error is a misplaced semicolon?
syntactic error
New cards
90
What kind of error is a mismatch between an operator and its operands?
semantic error
New cards
91
What kind of error is incorrect reasoning?
logical error
New cards
92
The simplest error recovery strategy for a parser is...
to quit on the first error
New cards
93
When creating a derivation each rewriting step replaces a nonterminal with
the body of a production
New cards
94
In generating a derivation from the start symbol what symbol what does \=\> mean?
derives in one step
New cards
95
Given a \=\> b \=\> c what is true?
a derives c
New cards
96
In a parse tree what does each interior node represent?
the application of a production
New cards
97
If more than one leftmost derivation for a sentence exists then
the grammar is ambiguous
New cards
98
What is the relationship between grammars and regular expression? (They are as expressive as each other
regular expressions are more expressive than grammars
New cards
99
Which of the following languages cannot be accepted by a finite automaton? ab^n
a^nb^n
New cards
100
Bottom-up parsing can be though of as...
reducing a string to the start symbol
New cards
Load more
Explore top notes
3.8: economic development
Note
Studied by 11 people
830 days ago
5.0
(1)
Preview
Gallbladder and Extrahepatic Biliary System
Note
Studied by 10 people
235 days ago
5.0
(1)
Preview
4.6 The extended marketing mix of seven Ps
Note
Studied by 10 people
956 days ago
5.0
(1)
Preview
Untitled
Note
Studied by 1 person
20 days ago
5.0
(1)
Preview
Poetry
Note
Studied by 16 people
827 days ago
5.0
(1)
Preview
🗞️
Unit 3: Complex Rhetorical Modes
Note
Studied by 1238 people
709 days ago
5.0
(3)
Preview
🏛️
Unit III - Interest Group Notes
Note
Studied by 11 people
779 days ago
5.0
(1)
Preview
🗺️
ALL OF HEIMLER'S VIDEOS (APWH)
Note
Studied by 27696 people
158 days ago
4.9
(63)
Preview
Explore top flashcards
PSC 140 Exam 1
Flashcard (134)
Studied by 5 people
696 days ago
5.0
(1)
Preview
verbs with Da/wo compounds
Flashcard (24)
Studied by 2 people
121 days ago
5.0
(1)
Preview
Englisch - Umwelt
Flashcard (132)
Studied by 12 people
846 days ago
5.0
(1)
Preview
SKIN PUNCTURE/ CAPILLARY PUNCTURE
Flashcard (45)
Studied by 18 people
392 days ago
5.0
(1)
Preview
psych vocab #1
Flashcard (57)
Studied by 7 people
60 days ago
5.0
(1)
Preview
Exam 1
Flashcard (44)
Studied by 1 person
773 days ago
5.0
(1)
Preview
Intro to Animals
Flashcard (43)
Studied by 2 people
717 days ago
5.0
(1)
Preview
Quiz #1 Term 2 2/06/2024
Flashcard (43)
Studied by 276 people
406 days ago
5.0
(5)
Preview