Monday, June 15, 2020
Regular Expression - Free Essay Example
Write a regular expression for binary strings with at least two 0s but not consecutive 0s. 1*01+01* Write a regular expression that matches all strings over the alphabet {a, b, c} that contain: Starts and ends with a a(a*b*c*)a /( a / a(a/b)*a) At most one a b*c*/b*c* a b*c* At least two as b*c* a b*c* a b*c* An even number of as (b*c* a b*c* a b*c*)+ Number of as plus number of bs is even Write a regular expression to describe all dates of the form Month DD, YYYY, where Month consists of any string of upper or lower case letters, the date is 1 or 2 digits, and the year is exactly 4 digits.. The comma and spaces are required. Write a regular expression for each of the following: Strings over the alphabet {a, b, c} where the first a precedes the first b. c*a[ac]*b[abc]* Strings over the alphabets {a, b, c} with an even number of aââ¬â¢s. (b*c* a b*c* a b*c*)+ / (aa/b/c)* Binary numbers that are multiples of four. ( 1/0 1/0 1/0 1/0)* / (0*[01]*00 | 0+) Binary numbers that are greater than 101001. Strings over the alphabet {a, b, c} thar donââ¬â¢t contain the contiguous substring baa. [ac]*b(c/a[^a])[ac]*b*)+/[ac]+ Identify the lexeme that makes up the tokens in the following programs. Give reasonable attribute vcalues for the tokens. Pascal Function max ( i, j : integer) : integer ; { return maximium of integers i and j } begin if i j then max := i else max := j end; C Int max ( i, j) int i, j; /* return maximium of integers I and j */ { return i j? i:j; } Draw the Transition Diagram for relational operators.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.