Class DyadicExpression

  • All Implemented Interfaces:
    Serializable

    public class DyadicExpression
    extends Expression
    Expression between two other expressions and an operation. For example, "this.myField < myValue" will become left = PrimaryExpression, right = Literal, op = Expression.OP_LT. A special case is where we have an expression like "!(condition)". In this case we become left = expression, right = null, op = Expression.OP_NOT.
    See Also:
    Serialized Form
    • Constructor Detail

      • DyadicExpression

        public DyadicExpression​(Expression operand1,
                                Expression.DyadicOperator op,
                                Expression operand2)
        Performs a function on two arguments. op(operand1,operand2) operand1 op operand2
        Parameters:
        operand1 - the first expression
        op - the operator between operands
        operand2 - the second expression
    • Method Detail

      • evaluate

        public Object evaluate​(ExpressionEvaluator eval)
        Method to evaluate this expression, using the passed evaluator.
        Overrides:
        evaluate in class Expression
        Parameters:
        eval - Evaluator
        Returns:
        The result
      • bind

        public Symbol bind​(SymbolTable symtbl)
        Method to bind the expression to the symbol table as appropriate.
        Specified by:
        bind in class Expression
        Parameters:
        symtbl - Symbol table
        Returns:
        The symbol for this expression