You are given a copy of “lex.h” from Programming Assignment 1, and a file called “tokensListing.cpp” as a driver program.
DO NOT CHANGE neither “lex.h” nor “tokensListing.cpp”.
Your implementation should include the following in another file, called “RA5.cpp”:
LexItem id_or_kw(const string& lexeme, int linenum);
id_or_kw () function accepts a reference to a string of a lexeme and a line number and returns a LexItem object. It searches for the lexeme in a directory that maps a string value of a keyword to its corresponding Token value, and it returns a LexItem object containing either the keyword Token if it is found, or the identifier token IDENT if not.
ostream& operator
The operator
Note that the implementation of operator
Use the given driver program in “tokensListing.cpp” for testing your implementations. The driver program accepts two command line arguments, “-othertok” and “-idsonly”.
The “-othertok” flag is used to test your implementation of the overloaded operator
ucid pp222
password- Princep411$
since its auto grade tool you have to run there program make sure all cases successfully run in that tool. im attaching a video which navigate you which and where you have to run
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here