NFA - Two issues in lexical analysis Specifying tokens...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Two issues in lexical analysis Specifying tokens (regular expression) – last lecture Identifying tokens specified by regular expression – today’s topic
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
How to recognize tokens specified by regular expressions? A recognizer for a language is a program that takes a string x as input and answers “yes” if x is a sentence of the language and “no” otherwise. In the context of lexical analysis, given a string and a regular expression, a recognizer of the language specified by the regular expression answer “yes” if the string is in the language. A regular expression can be compiled into a recognizer (automatically) by constructing a finite automata which can be deterministic or non-deterministic.
Background image of page 2
Non-deterministic finite automata (NFA) A non-deterministic finite automata (NFA) is a mathematical model that consists of: (a 5-tuple a set of states Q a set of input symbols
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 7

NFA - Two issues in lexical analysis Specifying tokens...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online