Question: You are developing a new programming language Jaguar and need to decide how integers should be represented. The following is a specification for a Jaguar

You are developing a new programming language Jaguar and need to decide how integers should be represented. The following is a specification for a Jaguar integer that one of your teammates comes up with.
A Jaguar integer can be unambiguously specified in decimal, octal or hexadecimal form. All of these forms can begin with an optional sign, which can be a "+" or a "-" with no separating characters between it and the rest of the integer.
A decimal integer can be a single zero or a sequence of one or more decimal digits that starts with a non-zero decimal digit. The decimal digits are 0,1,2,3,4,5,6,7,8, and 9.
An octal number starts with a zero and is followed by a single zero or a non-empty sequence of octal digits that starts with a non-zero octal digit. An octal digit is one of 0,1,2,3,4,5,6 or 7.
A hexadecimal number starts with a zero and is followed by an upper or lower case "x", and either a single zero or a non-zero hexadecimal digit and a sequence of zero or more hexadecimal digits. Hexadecimal digits include the decimal digits and the letters a, b, c, d, e and f and their uppercase versions.
Notice how long and confusing this description has to be to ensure that it is unambiguous. You can see that we do not allow "leading zeros" in any of the representations, e.g.,0007 is a bad hex number, and 007 is both a bad octal number and a bad decimal number.
(a) Find the Regular Expression for Jaguar numbers (15 points)
Hint: There are several valid options for numbers (-|)?(octal numbers ||| hex numbers ||| decimal numbers)
Expand each of these pieces into the regular expression
(b) Draw the NFA (15 points)
(c) Draw the DFA State Transition Diagram (15 points)
(d) Draw the DFA diagram (15 points)
 You are developing a new programming language Jaguar and need to

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!