@Test public void checkAdditionParse() { final String EXPECTED_RESULT = "(1 + 2)"; QLParser parser = ASTBuilder.getQlParser("1+2"); Addition expression = (Addition) ASTBuilder.getExpression(parser); assertEquals(EXPECTED_RESULT, expression.toString()); }
@Override public String toString() { return "(" + getLeft() + " + " + getRight() + ")"; }
Addition extends BinaryOperation { @Override public String toString() { return "(" + getLeft() + " + " + getRight() + ")"; } }
Addition extends BinaryOperation { @Override public String toString() { return "(" + getLeft() + " + " + getRight() + ")"; } Addition(Expression left, Expression right, int line, int charPositionInLine); }
Addition extends BinaryOperation { @Override public String toString() { return "(" + getLeft() + " + " + getRight() + ")"; } Addition(Expression left, Expression right, int line, int charPositionInLine); @Override String toString(); @Override T accept(ExpressionVisitor<T, C> visitor, C context); }
Addition extends BinaryOperation { @Override public String toString() { return "(" + getLeft() + " + " + getRight() + ")"; } Addition(Expression left, Expression right, int line, int charPositionInLine); @Override String toString(); @Override T accept(ExpressionVisitor<T, C> visitor, C context);  }