Chapter 3: Lexical Analysis

Finite Automata

. Regular expression are declarative specifications

. Finite automata is an implementation

. A finite automata consists of

- An input alphabet belonging to S

- A set of states S

- A set of transitions statei statej

- A set of final states F

- A start state n

. Transition s1 s2 is read:

in state s1 on input a go to state s2

. If end of input is reached in a final state then accept

A recognizer for language is a program that takes as input a string x and answers yes if x is the sentence of the language and no otherwise. We compile a regular expression into a recognizer by constructing a generalized transition diagram called a finite automaton. Regular expressions are declarative specifications and finite automaton is the implementation. It can be deterministic or non deterministic, both are capable of recognizing precisely the regular sets. Mathematical model of finite automata consists of:

- An input alphabet belonging to S - The set of input symbols,

- A set of states S ,

- A set of transitions statei statej , i.e., a transition function move that maps states symbol pairs to the set of states,

- A set of final states F or accepting states, and

- A start state n . If end of input is reached in a final state then we accept the string, otherwise reject it.

. Otherwise, reject