Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program that does the following: Tokens for lab 4 will be numerals, iden

ID: 3640238 • Letter: W

Question

Write a program that does the following:

Tokens for lab 4 will be numerals, identifiers, special tokens, and white space tokens, where
a numeral is a string of one or more digits,
an identifier is a string of letters, digits, and underscores, beginning with a letter, and
the allowed special characters are ~ & ^ * + - ( ) [ ] : , < > =
a special token is a string of length 1, whose only member is an allowed special character
a white space token is a string of one or more white space characters (tab, space, line feed, or new line).
For Lab 4, implement the following algorithm or something functionally equivalent to it (i.e., that does the same thing):
input S: a stack of characters (reversed from original input)
initialize: stack(stack(char)) T = [], stack<char> P = []
while(true)
if S is empty, halt and return T
if the last character of S is the first character of some token then
set P to []
while can_push(top(S),P)
remove the last character from S and push it onto the ack of P
If P holds a valid token
push P onto the back of T
else
halt and print 'tokenizing error'
else
halt and print 'tokenizing error'

Explanation / Answer

if this is an assignment your professor will give you a zero for using someone else&#39;s code what specific problems do you have with your program.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote