Midterm Questions Flashcards
What machine does a lexical analyzer use?
Deterministic Finite Automaton
What kind of language does a DFA recognize?
Regular Languages
What makes context free grammar ambiguous?
More than one parse tree for a string
What do we call a computer where the compiled code runs?
Target machine
What is a sentential form?
A string of terminals and non terminals
What kind of machine does a parser use?
PDA (Pushdown Automata)
Can an NFA be simulated by a DFA?
Yes
What do we call the input of the compiler?
Source program
What is the input of a lexical analyzer? Output?
Input: character stream
Output: token stream
Why do we need/use first and follow sets?
To form lookahead, to avoid backtracking
Can a regular language contain(as a proper subset of it) a non regular language?
Yes
Which parse method recognizes the most CFGs?
Generalized parsing, CYK
Does lexical analyzer need lookahead?
Yes
Why is regular expression to mDFA pipeline important?
Automates a very tedious, error prone procedure. We want automatic language translation
What are the compiler stages in order?
Lexical Analysis
Syntax Analysis
Semantic Analysis
Intermediate code generation
Code optimization
Code Generation