Site icon i2tutorials

Compiler Design-Regular Expressions for Identifiers

Regular Expressions for Identifiers

 

The lexical Analyzer has to only identify a finite set of valid strings or tokens or lexemes. It finds the pattern given by the language rules.

Regular expressions can express finite languages by giving a pattern for the finite strings of symbols.

Regular expressions are used to match a pattern to a set of strings. 

There are different algebraic laws that are followed by regular expressions. These are used to manipulate regular expressions into equivalent forms.

 

Operations:

The different operations that can be performed are:

 

L U M = {s | s is in L or s is in M}

 

LM = {st | s is in L and t is in M}

 

L* = Occurrence of language L more than once.

 

Reference Link

Regular Expressions for Identifiers

Exit mobile version