Answered step by step
Verified Expert Solution
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,
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started