Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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)
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions

Question

What are the purposes of promotion ?

Answered: 1 week ago

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago