Lexical and Syntactic Analysis — an example
Example: We would like to recognize a language of arithmetic expressions containing expressions such as: 34 x+1
- x * 2 + 128 * (y - z / 3)
The expressions can contain number constants — sequences of digits 0, 1, . . . , 9. The expressions can contain names of variables — sequences consisting of letters, digits, and symbol “ ”, which do not start with a digit. The expressions can contain basic arithmetic operations — “+”, “-”, “*”, “/”, and unary “-”. It is possible to use parentheses — “(” and “)”, and to use a standard priority of arithmetic operations.
- Z. Sawa (TU Ostrava)
Theoretical Computer Science November 26, 2020 1 / 54