Its syntax, which define the structure of the components of the language, e.g., the structures of programs, statements (e.g., assignment), expression, terms etc.

[1] A low-level part called a lexical analyzer (mathematically, a finite automaton based on a regular grammar) [2] A high-level part called a syntax analyzer, or parser (mathematically, a push-down automaton based on a context-free grammar)

[1] It identifies substrings of the source program that belong together - lexemes [2] Lexemes match character patterns, which are associated with a lexical category called a token [3] sum is a lexeme; its token may be IDENT

[1] An alphabet Σ is a finite non-empty set(of symbols) eg:[2] set Σab={a, b} is an alphabet comprising symbols a and b; [3] the set Σaz = {a, ..., z} is the alphabet of lowercase English letters; [4] the set Σasc of all ASCII characters is an alphabet.

[1] A string or word over an alphabet Σ is a finite concatenation (or juxtaposition) of symbols from Σ. [2] abba, aaa and baaaa are strings over Σab; [3] hello, abacab, and baaaa are strings over Σaz; [4] h$(e′lo, PjM#;, and baaaa are strings over Σasc.

[1] The length of a string w (that is, the number of symbols it has) is denoted |w|. E.g., |abba| = 4. [2] The empty or null string is denoted ε, and so |ε| = 0.

The set of strings matched by a RE r is denoted L(r) ⊆ Σ∗ (all the strings over the alphabet Σ) and is called the language determined or generated by r

When does a regular expression match a set of strings?

We say a regular expression r matches (or is matched by) a set of strings if the patterns of the strings are those specified by the regular expression.

assuming the alphabet is Σasc (the set of all ASCII characters) what is a typical programs pattern(regular expression) for (a|...|z|A|···|Z)(_|a|...|z|A|···|Z|0|···|9)∗

an algorithm such that a language L over some alphabet Σ is able to take any input stringw ∈ Σ∗, and: 1. outputs ‘Yes’ if w ∈ L and 2. outputs ‘No’ if w not ∈ L.

Languages that can be denoted by a RE, and can have a DFA/NFA as a decision procedure, are known as _____ ______.

An NFA is a Nondeterministic Finite Automaton. Nondeterministic means it can transition to, and be in, multiple states at once (i.e. for some given input).

A DFA is a Deterministic Finite Automaton. Deterministic means that it can only be in, and transition to, one state at a time (i.e. for some given input).