Divide the following C++ program into appropriate lexemes: Describe the language denoted by the following regular expressions and provide transition diagrams:
-
Divide the following C++ program into appropriate lexemes:
float limitedSquare(x) float x; {
/* returns x-squared, but never more than 100*/
return (x <= -10.0 || x >= 10) ? 100 : x*x;
}
-
Describe the language denoted by the following regular expressions and provide transition diagrams:
-
a(a | b)*a
-
((ε | a)b*)*
-
(a | b)*a(a | b)(a | b)
-
a*ba*ba*ba*
-
-
Write regular definitions for the following language:
-
All strings of lowercase letters that contain the five vowels in order.
-
All strings of lowercase letters in which the letters are in ascending lexicographic order.
-
-
Give DFA’s accepting the following languages over the alphabet {0, 1}
-
The set of all strings ending in 00.
-
The set of all strings with three consecutive 0’s (not necessarily at the end).
-
The set of strings with 011 as a substring.
-
The set of strings that either begin or end (or both) with 01.
-
The set of strings that the number of 0’s is divisible by five, and the number of 1’s is divisible by 3.
-
Design finite automata (deterministic or non-deterministic) for each of the language in exercise number (3).
-
Give the transition table for:
DETAILED ASSIGNMENT