Question: 2 . Two additional logical operators should be added. The lexeme for the first should be | and its token should be OROP. The second
Two additional logical operators should be added. The lexeme for the first should be and its token should be OROP. The second logical operator added should be and its token should be NOTOP.
Five relational operators should be added. They are and All of the lexemes should be represented by the single token RELOP.
One additional lexeme should be added for the ADDOP token. It is binary operator that is the subtraction operator.
One additional lexeme should be added for the MULOP token. It is that is the division operator.
A new token REMOP should be added for the remainder operator. Its lexeme should be
A new token EXPOP should be added for the exponentiation operator. Its lexeme should be
A new token NEGOP should be added for the unary minus operator. Its lexeme should be ~
A second type of comment should be added that begins with and ends with the end of line. As with the existing comment, no token should be returned.
The definition for the identifiers should be modified so that underscores can be included, however, no more than two consecutive underscores are permitted, but leading and trailing underscores should not be permitted.
One additional type of integer literal should be added, which are hexadecimal integers. The begin with the # character followed by one of more decimal digits, or the letter AF in either upper or lower case.
A real literal token should be added. It should begin with a sequence of zero or more digits following by a decimal point followed by one or more additional digits. It may optionally end with an exponent. If present, the exponent should begin with an e or E followed by an optional plus or minus sign followed by one or more digits.
The definition for the character literals should be modified so that five
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
