Lec - 2. Scanning (Lexical Analysis) Part 1
Lec - 2. Scanning (Lexical Analysis) Part 1
COMPILER CONSTRUCTION
Kenneth C. Louden
PART ONE
a [ i n d e x ] = 4 + 2
a [ i n d e x ] = 4 + 2 RET
Downloaded by Mamdouh Farghaly ([email protected])
2.2 Regular Expression
Example 2:
– ∑={ a,b,c}
– the set of all strings that contain at most one b.
– (a|c)*|(a|c)*b(a|c)* (a|c)*(b|ε)(a|c)*
– the same language may be generated by many different regular
expressions.
BACK
Downloaded by Mamdouh Farghaly ([email protected])
2.2.2 Extensions to Regular
Expression
/* this is a C comment */
can not written as ba(~(ab))*ab, ~ restricted to single character
one solution for ~(ab) : b*(a*(a|b)b*)*a*