Scanning, LL Parsing, LR Parsing Flashcards
What do the following mean with regards to regular expressions:
- Token
- Alphabet
- Epsilon
The arrow in regular expressions means?
Can be
What is the precedence order for the following in regular expressions:
|
.
*
What is a CFG?
A CFG is a Context Free Grammar
What is a CFG derivation?
A production from a CFG, what can be replaced in the LHS of a sentence (non-terminals) with RHS non-terminals and terminals as productions.
Note in the following example how expr is replaced
What does a parse tree do?
Represents a derivation graphically
What is the difference between right-most derivation and left-most derivation?
When a grammar can have two parse trees for the same sentence, what is it called?
Ambiguous grammar
What is an ambiguous grammar?
When there can be two difference parse trees for the same grammar
What is lexical analysis
Scanning:
Tokenizing the source code
Removing comments
Saving text of identifiers, numbers, strings
Saving source locations
What is ad-hoc
Ad-hoc simply means it was created by a human for the specific purpose of what it is being used for
What is a DFA? What does it mean? What do they look like?
A DFA is a deterministic finite automaton which means each state goes to one other state based on its current state and input.
What is a NFA? What do they look like?
How do you construct DFA from regular expressions?
Build NFA from regular expressions
Convert to DFA
Minimize DFA
Examine this NFA example:
Examine the following example for minimizing an NFA to DFA, dont move on until you understand