Question: Lexical Analysis The automaton is represented as a table, but note that this table is different from the tables discussed in lecture; The automaton has
Lexical Analysis
The automaton is represented as a table, but note that this table is different from the tables discussed in lecture; The automaton has five states each of which has an associated action for each input ac or endoffile $ For a given state $ and imput or endoffile I:
If the SI entry is a state n then in state S on input I the automaton transitions to state n and advances to the next input character.
If the SI entry is A then in state S on input I the automaton accepts the prefix of the input up to but not including, the current input character. This prefix is removed from the input, and the automaton moves to state and continues, Note the current input character is not conisumed.
If the SI entry is E then in state S on input I the automaton reports an error and halts.
If the S entry is T then in state S on input $ the automaton terminates successfully.
a points Give a lexical specification that tokenizes input strings in the same manner as this automaton. Your lexer should only describe successfully terminating runs of the automaton. For full credit, your specification should be the shortest in total length of rules possible.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
