0% found this document useful (0 votes)
234 views4 pages

Compiler-Sec3 4 PDF

This document discusses exercises from a chapter on lexical analysis in a compiler design course. It provides regular expressions and asks students to draw transition diagrams that recognize the languages described by the regular expressions. The regular expressions include ones describing strings with vowels in order, strings in alphabetical order, comments in code, and strings of a's and b's without certain substrings. The document was prepared by an instructor for a computer engineering class in March 2014.

Uploaded by

shamim miah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
234 views4 pages

Compiler-Sec3 4 PDF

This document discusses exercises from a chapter on lexical analysis in a compiler design course. It provides regular expressions and asks students to draw transition diagrams that recognize the languages described by the regular expressions. The regular expressions include ones describing strings with vowels in order, strings in alphabetical order, comments in code, and strings of a's and b's without certain substrings. The document was prepared by an instructor for a computer engineering class in March 2014.

Uploaded by

shamim miah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Islamic University – Gaza

Engineering Faculty
Department of Computer Engineering
ECOM 5060: Compiler Design Discussion

Chapter 3
Lexical Analysis
(Section 3.4)

Eng. Eman R. Habib

March, 2014
2 Computer Architecture Discussion

Exercises 3.4.1: provide transition diagrams to recognize the same languages as


each of the regular expressions in Exercises 3.3.2:

a) a(a|b)*a

b) ((|a)b*)*

c) (a|b)*a(a|b)(a|b)

d) a*ba*ba*ba*
3 Computer Architecture Discussion

Exercises 3.4.2: provide transition diagrams to recognize the same languages as


each of the regular expressions in Exercises 3.3.4:

a) All strings of lowercase letters that contain the five vowels (a, e, i, o, or u) in order.

Letter  [b-d f-h j-n p-t v-z]


String  (Letter|a)* (Letter|e)* (Letter|i)* (Letter|o)* (Letter|u)*

b) All strings of lowercase letters in which the letters in are in ascending lexicographic
order.

String  a*b*c*d*…………z*

c) Comments, consisting of a string surrounded by /* and */, without an intervening */,


unless it is inside double-qoutes(“)

Character  [a-zA-Z0-9]
Comment  /* (Character|“*/”|(*|/) Character)* */
4 Computer Architecture Discussion

h) All strings of a’s and b’s that do not contain the substring abb.

b* (a (|b))*

i) All strings of a’s and b’s that do not contain the subsequence abb.

b* a*(|b) a*

 Best Wishes 

You might also like