@Test public void testGreaterThanExpression() throws IOException { Optional<ASTExpression> a = parser.parse_StringExpression("a"); Optional<ASTExpression> b = parser.parse_StringExpression("b"); assertFalse(parser.hasErrors()); assertTrue(a.isPresent()); assertTrue(b.isPresent()); ASTGreaterThanExpression result = CommonExpressionsMill.greaterThanExpressionBuilder() .setLeft(a.get()) .setOperator(">") .setRight(b.get()) .build(); String output = prettyPrinter.prettyprint(result); assertEquals("a > b", output); }
public String prettyprint(ASTExpression node) { getPrinter().clearBuffer(); node.accept(getRealThis()); return getPrinter().getContent(); }
CommonExpressionsPrettyPrinter extends ExpressionsBasisPrettyPrinter implements CommonExpressionsVisitor { public String prettyprint(ASTExpression node) { getPrinter().clearBuffer(); node.accept(getRealThis()); return getPrinter().getContent(); } }
CommonExpressionsPrettyPrinter extends ExpressionsBasisPrettyPrinter implements CommonExpressionsVisitor { public String prettyprint(ASTExpression node) { getPrinter().clearBuffer(); node.accept(getRealThis()); return getPrinter().getContent(); } CommonExpressionsPrettyPrinter(IndentPrinter printer); }
CommonExpressionsPrettyPrinter extends ExpressionsBasisPrettyPrinter implements CommonExpressionsVisitor { public String prettyprint(ASTExpression node) { getPrinter().clearBuffer(); node.accept(getRealThis()); return getPrinter().getContent(); } CommonExpressionsPrettyPrinter(IndentPrinter printer); @Override void handle(ASTPlusPrefixExpression node); @Override void handle(ASTMinusPrefixExpression node); @Override void handle(ASTFieldAccessExpression node); @Override void handle(ASTMultExpression node); @Override void handle(ASTDivideExpression node); @Override void handle(ASTModuloExpression node); @Override void handle(ASTPlusExpression node); @Override void handle(ASTMinusExpression node); @Override void handle(ASTLessEqualExpression node); @Override void handle(ASTGreaterEqualExpression node); @Override void handle(ASTLessThanExpression node); @Override void handle(ASTGreaterThanExpression node); @Override void handle(ASTBooleanAndOpExpression node); @Override void handle(ASTBooleanOrOpExpression node); @Override void handle(ASTEqualsExpression node); @Override void handle(ASTNotEqualsExpression node); @Override void handle(ASTConditionalExpression node); @Override void handle(ASTBracketExpression node); @Override void handle(ASTBooleanNotExpression node); @Override void handle(ASTLogicalNotExpression node); @Override void handle(ASTLiteralExpression node); @Override void handle(ASTCallExpression node); IndentPrinter getPrinter(); String prettyprint(ASTExpression node); String prettyprint(ASTArguments node); @Override void setRealThis(CommonExpressionsVisitor realThis); @Override CommonExpressionsVisitor getRealThis(); }
CommonExpressionsPrettyPrinter extends ExpressionsBasisPrettyPrinter implements CommonExpressionsVisitor { public String prettyprint(ASTExpression node) { getPrinter().clearBuffer(); node.accept(getRealThis()); return getPrinter().getContent(); } CommonExpressionsPrettyPrinter(IndentPrinter printer); @Override void handle(ASTPlusPrefixExpression node); @Override void handle(ASTMinusPrefixExpression node); @Override void handle(ASTFieldAccessExpression node); @Override void handle(ASTMultExpression node); @Override void handle(ASTDivideExpression node); @Override void handle(ASTModuloExpression node); @Override void handle(ASTPlusExpression node); @Override void handle(ASTMinusExpression node); @Override void handle(ASTLessEqualExpression node); @Override void handle(ASTGreaterEqualExpression node); @Override void handle(ASTLessThanExpression node); @Override void handle(ASTGreaterThanExpression node); @Override void handle(ASTBooleanAndOpExpression node); @Override void handle(ASTBooleanOrOpExpression node); @Override void handle(ASTEqualsExpression node); @Override void handle(ASTNotEqualsExpression node); @Override void handle(ASTConditionalExpression node); @Override void handle(ASTBracketExpression node); @Override void handle(ASTBooleanNotExpression node); @Override void handle(ASTLogicalNotExpression node); @Override void handle(ASTLiteralExpression node); @Override void handle(ASTCallExpression node); IndentPrinter getPrinter(); String prettyprint(ASTExpression node); String prettyprint(ASTArguments node); @Override void setRealThis(CommonExpressionsVisitor realThis); @Override CommonExpressionsVisitor getRealThis();  }