Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part 2: [4 Marks] Consider the following lexical requirements for a very simple language: the alphabet includes the digits 0-9, characters P, R, I, N,

image text in transcribed

Part 2: [4 Marks] Consider the following lexical requirements for a very simple language: the alphabet includes the digits 0-9, characters P, R, I, N, T, and the period (.) there is one keyword: PRINT identifiers can be any other sequence of the P, R, I, N, T characters numbers can be any sequence of digits, with an optional decimal point. If there is a decimal point, there must be at least one digit before the decimal. . a. Show the tokens resulting from a lexical scan of the following input string (1.5 marks): PRINT03 30PRINTTO.3 PRINTPRINT PRI NT Output : b. What would the following input string produce as output (0.5 mark)? PRI.NT c. Design a state diagram to recognize the lexical requirements of this language as described above (2 marks)

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 Systems A Practical Approach To Design Implementation And Management

Authors: THOMAS CONNOLLY

6th Edition

9353438918, 978-9353438913

More Books

Students also viewed these Databases questions

Question

=+ Why do some seem like a personalized, individual message?

Answered: 1 week ago