Question
1-Design a deterministic finite automaton (DFA) to recognize tokens in the following language: a)Identifiers start with letter and continue with letters and digits b)Keywords when
1-Design a deterministic finite automaton (DFA) to recognize tokens in the following language:
a)Identifiers start with letter and continue with letters and digits
b)Keywords when, while, where are reserved and recognized in the FSA as individual tokens each (different from work done in class)
c)Make sure to start with listing alphabet, and then tokens (4 tokens)
2-Design a DFA to recognize valid identifiers, separated by WS, according to the following, or argue why it cannot be done
a)Identifiers must start with letter
b)Every letter must be followed by at least one digit
c)Every digit can be followed by either letter or digit or nothing (WS)
3-Design a DFA to recognize valid identifies, separated by WS, according to the following, or argue why it cannot be done
a)Identifiers must start with letter and can be followed by digits or letters
b)The total number of letters and digits must equal
4-Now redo above assuming identifier length <=8
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