Docsity

scanning and parscing, Lecture notes of System Programming

Partial preview of the text

Download scanning and parscing and more Lecture notes System Programming in PDF only on Docsity!

System Programming

Awadhesh Dixit, Assistant Professor Information Technology

Scanning and Parsing

CHAPTER-

Programming Language Grammars

Some Basics…..

Symbol = 0, 1, a, b, A, B.…. String: Sequence of the symbols… String = a, b, aa, ab, ba, bb, abb….

Regular Expression

  • A regular expression is a sequence of characters that define a pattern.

One or More Occurrences Zero or More Occurrences

L1=One or More Occurrences of a=

a

aa

aaaa

aaaaa…..

Infinite …..

a

aaa

Regular Expression

L1 = Zero or More Occurrences of a= a*

aa

aaaa

aaaaa…..

Infinite …..

aaa

a

Regular Expression Examples

Regular Expression Examples

Definition: Finite Automata

  • C a, a B a A b

Types of Finite Automata

RE to NFA (Thompson’s construction)

Ex: (a|b)

RE to NFA (Thompson’s construction)

Conversion from NFA to DFA

Subset construction algorithm

OPERATION DESCRIPTION