Question

Design state transition diagram (finite automata) for the following 1. Key words (else, while, begin, main,...

Design state transition diagram (finite automata) for the following

1. Key words (else, while, begin, main, switch, struct)

2. Identifiers

3. Integers

4. White spaces

5. Phone number

6. Email address

7. Unsigned numbers

Homework Answers

Answer #1

The idea is fairly simple for all of these DFA. We need to know the constraints for each of these.

1. Keywords should be exactly the same. If they are lowercase it should be lowercase in the checking of the DFA as well.

2. Identifiers are variable names. We can start an identifier name with underscore or letter but not a number. we can then include a number though.

3. Integers are whole numbers that do not contain a decimal point , If any decimal is represented it goes into the trap state.

4. White spaces are easy to identify it should just be plain whitespace, anything else and it goes into trap state.

5. Phone number of 10 digit has been represented. Each should be a digit between 0-9 anything else is an invalid phone number.

6. Email id's should be of the format [email protected] numbers,letters underscores can be included.

7. Unsinged numbers are those that are not negative .Unsigned integer number has been represented if a decimal number needs to be represented we can add a dot and loop over the rest part again.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Do the following problems. 1. Each of three barrels from a manufacturing line are classified as...
Do the following problems. 1. Each of three barrels from a manufacturing line are classified as either above (a) or below (b) the target weight. Provide the ordered sample space. 2. The heat on each of two soldered parts is measured and labeled as either low (l), medium (m), or high (h). State the number of elements in the ordered sample space. 3. Consider the set of Beatles songs with a primary writer as either Paul McCartney (P) or John...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary rivals? How will the acquisition of Reebok by Adidas impact the structure of the athletic shoe industry? Is this likely to be favorable or unfavorable for New Balance? 2- What issues does New Balance management need to address? 3-What recommendations would you make to New Balance Management? What does New Balance need to do to continue to be successful? Should management continue to invest...
Sign In INNOVATION Deep Change: How Operational Innovation Can Transform Your Company by Michael Hammer From...
Sign In INNOVATION Deep Change: How Operational Innovation Can Transform Your Company by Michael Hammer From the April 2004 Issue Save Share 8.95 In 1991, Progressive Insurance, an automobile insurer based in Mayfield Village, Ohio, had approximately $1.3 billion in sales. By 2002, that figure had grown to $9.5 billion. What fashionable strategies did Progressive employ to achieve sevenfold growth in just over a decade? Was it positioned in a high-growth industry? Hardly. Auto insurance is a mature, 100-year-old industry...
What tools could AA leaders have used to increase their awareness of internal and external issues?...
What tools could AA leaders have used to increase their awareness of internal and external issues? ???ALASKA AIRLINES: NAVIGATING CHANGE In the autumn of 2007, Alaska Airlines executives adjourned at the end of a long and stressful day in the midst of a multi-day strategic planning session. Most headed outside to relax, unwind and enjoy a bonfire on the shore of Semiahmoo Spit, outside the meeting venue in Blaine, a seaport town in northwest Washington state. Meanwhile, several members of...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT