public function visitExpressionNode(ExpressionNode $node)
    {
        $leftValue = $node->getLeft()->accept($this);
        $operator = $node->getOperator();

        // The operator and the right side are optional, remember?
        if (!$operator)
            return "$leftValue";

        $right = $node->getRight();

        if ($right) {
            $rightValue = $node->getRight()->accept($this);
            return "($operator, $leftValue, $rightValue)";
        } else {
            return "($operator, $leftValue)";
        }

    }
public function visitExpressionNode(ExpressionNode $node)
    {
        $leftValue = $node->getLeft()->accept($this);
        $operator = $node->getOperator();

        // The operator and the right side are optional, remember?
        if (!$operator)
            return "$leftValue";

        $right = $node->getRight();

        if ($right) {
            $rightValue = $node->getRight()->accept($this);
            return "($operator, $leftValue, $rightValue)";
        } else {
            return "($operator, $leftValue)";
        }

    }
public function visitExpressionNode ( ExpressionNode $ node ) { $ leftValue = $ node -> getLeft ( ) -> accept ( $ this ) ; $ operator = $ node -> getOperator ( ) ; // The operator and the right side are optional, remember? if ( ! $ operator ) return "$leftValue" ; $ right = $ node -> getRight ( ) ; if ( $ right ) { $ rightValue = $ node -> getRight ( ) -> accept ( $ this ) ; return "($operator, $leftValue, $rightValue)" ; } else { return "($operator, $leftValue)" ; } }
Print an ExpressionNode.

@param ExpressionNode $node
Print an ExpressionNode .