ponderToolkit.compiler.semantics.expressions
Class AddOp

java.lang.Object
  |
  +--ponderToolkit.compiler.semantics.expressions.Operator
        |
        +--ponderToolkit.compiler.semantics.expressions.AddOp

public class AddOp
extends Operator

Function: Models an Additive Operator, + or -


Fields inherited from class ponderToolkit.compiler.semantics.expressions.Operator
AND, AT_DOMAIN, CONCURRENCY_AND, CONCURRENCY_OR, CONCURRENCY_PARALLEL, CONCURRENCY_SEQUENTIAL, DIV, DOT, EQUALS, EVENT_OP_AMPER, EVENT_OP_ARROW, EVENT_OP_BAR, EVENT_OP_NO_INTERLEAVE, EVENT_OP_STAR, EVENT_OP_TIME, GREATER_THAN, GREATER_THAN_EQUALS, IMPLIES, LESS_THAN, LESS_THAN_EQUALS, METHOD, MINUS, MULT, NOT, NOT_EQUALS, op, opStr, OR, PLUS, pos, precedence, SET_DIFFERENCE, SET_INTERSECTION, SET_UNION, STAR_DOMAIN, XOR
 
Constructor Summary
AddOp(java.lang.String opStr, int op, TokenPosition pos)
          Constructor
 
Method Summary
 ExprValue evaluate(ExprValue val1, ExprValue val2)
          Calculates the result of val1 PLUS val2 and returns a Value If the evaluation can proceed normally (both values are literals) then the result is returned.
 
Methods inherited from class ponderToolkit.compiler.semantics.expressions.Operator
evaluate, getOpCode, getOpStr, getPos, getPrecedence
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddOp

public AddOp(java.lang.String opStr,
             int op,
             TokenPosition pos)
Constructor
Method Detail

evaluate

public ExprValue evaluate(ExprValue val1,
                          ExprValue val2)
Calculates the result of val1 PLUS val2 and returns a Value If the evaluation can proceed normally (both values are literals) then the result is returned. If not, then an AddExpression is created and returned
Overrides:
evaluate in class Operator