LATEST UPDATE (ALREADY GRADED A+)
lexeme
The sequence characters matching a pattern
tokens
In lexical analysis, the compiler scans the source code from left ‐to ‐right, character ‐by ‐character, and
groups these characters into lexemes, and outputs a sequence of ______ to the syntax analyzer
keywords
lexeme: if, while, ...
operators
lexeme: <=, ||, *, +, ...
identifiers
lexeme: i, i1, j1, sum...
numbers
lexeme constants: 12, 3.14...
(a|b)*
regex: All strings of a's and b's (e.g., aba, ababa)
x?= x | e
denotes L(x)U{e}, (where e is empty string) -- zero or one occurrence of x.
Example: (0|1)?, 0?|1?
transition function d
Maps state/symbol pairs to states: S(set of states) x E (set of input symbols (an alphabet)) -> state
DFA Simulation
Start in state s0 and follow transitions on each input character (state doesn't change if no input
character is read
syntax analyzer, parser
___, or ____, groups sequences of tokens from the lexical analysis phase into phrases, each with an
associated phrase type