Class: BinaryOp

BinaryOp

A node in the abstract syntax tree that represents a binary operation. The semantics of each operator defined in terms of javascript operators is as follows:
  • BinaryOp.AND: lhs && rhs
  • BinaryOp.XOR: lhs ^ rhs
  • BinaryOp.OR: lhs || rhs
  • BinaryOp.EQUALS: lhs == rhs if rhs is a string. /rhs/.test(lhs) if rhs is a regex
  • BinaryOp.NOT_EQUALS: lhs != rhs if rhs is a string. !(/rhs/.test(lhs)) if rhs is a regex
  • Constructor

    new BinaryOp(op, lhs, rhs)

    Constructs a BinaryOp whose operator is op and whose left and right operands are lhs and rhs.
    Parameters:
    Name Type Description
    op * The binary operator associated with this ast. This parameter must be one of the constants defined in the BinaryOp class such as BinaryOp.AND
    lhs AST The left hand side operand
    rhs AST The right hand side operand
    Source:

    Extends

    Members

    (static, constant) AND

    Source:

    (static, constant) EQUALS

    Source:

    (static, constant) NOT_EQUAL

    Source:

    (static, constant) OR

    Source:

    (static, constant) XOR

    Source:

    Methods

    accept()

    Overrides AST#accept
    Overrides:
    Source:

    getLHS() → {AST}

    Gets the left hand side operand associated with this binary operation
    Source:
    Returns:
    The left hand side operand
    Type
    AST

    getOp() → {*}

    Gets the operator associated with this binary operation. The returned value will be one of the constants defined in the BinaryOp class such as BinaryOp.AND
    Source:
    Returns:
    The operator
    Type
    *

    getRHS() → {AST}

    Gets the right hand side operand associated with this binary operation
    Source:
    Returns:
    The right hand side operand
    Type
    AST