Answered step by step
Verified Expert Solution
Question
1 Approved Answer
you are required to complete the implementation of the C++ file tokeniser.cpp which is used to compile the program tokeniser . You will implement a
you are required to complete the implementation of the C++ file tokeniser.cpp which is used to compile the program tokeniser. You will implement a function, next_token(), that will read text character by character using the static function nextch(), and return the next recognised token in the input.
C++ programming
This is the question
This is the tokeniser.h file, you cannot edit this file
I need you to edit this file.
Your milestone submission will be marked using tests that require the correct recognition of the following tokens Token Definition Example Token he82mUch 17 :- letter (letter | digit)" IDENTIFIER INT SYMBOL Additional Rules letter digit19 digit 'O' digit19 digit) ..= | ';' I ':' I '!' I 1 'z' .(' I ')' I '(' I ')' I '(' I ')' I '@. | ; Definition Example Text 1" Notes all input must be read using the function nextch0 if the end of input is reached, return the token EOl it a character is found that cannot be part of a token or is not a space " ", tab "\t", carriage return " " or newline "In", return the token BAD letter, digit19 and digit are never returned as token classes all tokens must be contiguous characters in the input when searching for the start of the next token all spaces and newlines are ignored in a definition the or operator separates alternative components in a definition the round brackets () which are not inside single quotes are for grouping components of token in a definition the square brackets [] which indicates that the enclosed components may appear O or once in a definition the star character indicates that the preceding component of a token may appear O or more times Your milestone submission will be marked using tests that require the correct recognition of the following tokens Token Definition Example Token he82mUch 17 :- letter (letter | digit)" IDENTIFIER INT SYMBOL Additional Rules letter digit19 digit 'O' digit19 digit) ..= | ';' I ':' I '!' I 1 'z' .(' I ')' I '(' I ')' I '(' I ')' I '@. | ; Definition Example Text 1" Notes all input must be read using the function nextch0 if the end of input is reached, return the token EOl it a character is found that cannot be part of a token or is not a space " ", tab "\t", carriage return " " or newline "In", return the token BAD letter, digit19 and digit are never returned as token classes all tokens must be contiguous characters in the input when searching for the start of the next token all spaces and newlines are ignored in a definition the or operator separates alternative components in a definition the round brackets () which are not inside single quotes are for grouping components of token in a definition the square brackets [] which indicates that the enclosed components may appear O or once in a definition the star character indicates that the preceding component of a token may appear O or more times
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