Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 1 In the programming language Pascal, an identifier is a sequence of Roman letters and Arabic digits. An identifier always starts with a letter.
Question 1 In the programming language Pascal, an identifier is a sequence of Roman letters and Arabic digits. An identifier always starts with a letter. The shortest identifier is a single character. (a) Give a regular expression for Pascal's representation of identifiers, making use ofletter [5\%] and digit as defined below. lc=(abcdefghijklmnopqrstuvwxyz) uc =(ABCDEFGHIJKLMNOPQRSTUVWXYZ) letter =(lcuc) digit =(0123456789) (b) Translate the regular expression given in your answer to (a) into a Non-deterministic [7\%] Finite Automaton (NFA), showing your working. (c) Translate the Non-deterministic Finite Automaton given in your answer to (b) into a [8\%] Deterministic Finite Automaton (DFA), showing your working. (d) Using your answer to part (b) of this question, give a state-transition lookup-table for [5\%] parsing identifiers. Note: Do not unpack or expand the definitions of digit and letter in your answers to (a), (b), (c) and (d)
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