Add the helper method computeValue to the TinyAda parser. This method’s signature is
SymbolEntry computeValue(int v1, int v2, Token op)
The method should apply the operator to the two values to compute a new value, and then create and return a new symbol entry object that contains this value and the role of constant. Remember to provide computations for all of the arithmetic, comparison, and logical operators. In the case of the unary operators, you should assume that the first value is 0 and the second value is the actual operand. Remember also that Boolean operands use the representations 0 for FALSE and 1 for T
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here