@Test public void testExistsExpression() throws IOException { Optional<ASTExistsExpr> result = parser.parse_StringExistsExpr("exists a, b, c in foo : bla"); assertFalse(parser.hasErrors()); assertTrue(result.isPresent()); ASTExistsExpr ast = result.get(); String output = prettyPrinter.prettyprint(ast); result = parser.parse_StringExistsExpr(output); assertFalse(parser.hasErrors()); assertTrue(result.isPresent()); assertTrue(ast.deepEquals(result.get())); }
public String prettyprint(ASTExpression node) { getPrinter().clearBuffer(); node.accept(getRealThis()); return getPrinter().getContent(); }
OCLExpressionsPrettyPrinter extends ExpressionsBasisPrettyPrinter implements OCLExpressionsVisitor { public String prettyprint(ASTExpression node) { getPrinter().clearBuffer(); node.accept(getRealThis()); return getPrinter().getContent(); } }
OCLExpressionsPrettyPrinter extends ExpressionsBasisPrettyPrinter implements OCLExpressionsVisitor { public String prettyprint(ASTExpression node) { getPrinter().clearBuffer(); node.accept(getRealThis()); return getPrinter().getContent(); } OCLExpressionsPrettyPrinter(IndentPrinter printer); }
OCLExpressionsPrettyPrinter extends ExpressionsBasisPrettyPrinter implements OCLExpressionsVisitor { public String prettyprint(ASTExpression node) { getPrinter().clearBuffer(); node.accept(getRealThis()); return getPrinter().getContent(); } OCLExpressionsPrettyPrinter(IndentPrinter printer); @Override void handle(ASTInExpr node); @Override void handle(ASTImpliesExpression node); @Override void handle(ASTSingleLogicalORExpr node); @Override void handle(ASTSingleLogicalANDExpr node); @Override void handle(ASTForallExpr node); @Override void handle(ASTExistsExpr node); @Override void handle(ASTAnyExpr node); @Override void handle(ASTLetinExpr node); @Override void handle(ASTIterateExpr node); @Override void handle(ASTInstanceOfExpression node); @Override void handle(ASTThenExpressionPart node); @Override void handle(ASTElseExpressionPart node); @Override void handle(ASTIfThenElseExpr node); @Override void handle(ASTParenthizedExpression node); @Override void handle(ASTTypeCastExpression node); @Override void handle(ASTOCLComprehensionPrimary node); @Override void handle(ASTOCLIsNewPrimary node); @Override void handle(ASTOCLDefinedPrimary node); @Override void handle(ASTOCLArrayQualification node); @Override void handle(ASTOCLArgumentQualification node); @Override void handle(ASTOCLAtPreQualification node); @Override void handle(ASTOCLTransitiveQualification node); @Override void handle(ASTOCLQualifiedPrimary node); @Override void handle(ASTOCLComprehensionExpressionStyle node); @Override void handle(ASTOCLComprehensionItem node); @Override void handle(ASTOCLComprehensionEnumerationStyle node); @Override void handle(ASTOCLCollectionItem node); @Override void handle(ASTOCLEquivalentExpression node); IndentPrinter getPrinter(); String prettyprint(ASTExpression node); String prettyprint(ASTThenExpressionPart node); String prettyprint(ASTElseExpressionPart node); String prettyprint(ASTOCLQualification node); String prettyprint(ASTOCLComprehensionExpr node); String prettyprint(ASTOCLCollectionItem node); @Override void setRealThis(OCLExpressionsVisitor realThis); @Override OCLExpressionsVisitor getRealThis(); }
OCLExpressionsPrettyPrinter extends ExpressionsBasisPrettyPrinter implements OCLExpressionsVisitor { public String prettyprint(ASTExpression node) { getPrinter().clearBuffer(); node.accept(getRealThis()); return getPrinter().getContent(); } OCLExpressionsPrettyPrinter(IndentPrinter printer); @Override void handle(ASTInExpr node); @Override void handle(ASTImpliesExpression node); @Override void handle(ASTSingleLogicalORExpr node); @Override void handle(ASTSingleLogicalANDExpr node); @Override void handle(ASTForallExpr node); @Override void handle(ASTExistsExpr node); @Override void handle(ASTAnyExpr node); @Override void handle(ASTLetinExpr node); @Override void handle(ASTIterateExpr node); @Override void handle(ASTInstanceOfExpression node); @Override void handle(ASTThenExpressionPart node); @Override void handle(ASTElseExpressionPart node); @Override void handle(ASTIfThenElseExpr node); @Override void handle(ASTParenthizedExpression node); @Override void handle(ASTTypeCastExpression node); @Override void handle(ASTOCLComprehensionPrimary node); @Override void handle(ASTOCLIsNewPrimary node); @Override void handle(ASTOCLDefinedPrimary node); @Override void handle(ASTOCLArrayQualification node); @Override void handle(ASTOCLArgumentQualification node); @Override void handle(ASTOCLAtPreQualification node); @Override void handle(ASTOCLTransitiveQualification node); @Override void handle(ASTOCLQualifiedPrimary node); @Override void handle(ASTOCLComprehensionExpressionStyle node); @Override void handle(ASTOCLComprehensionItem node); @Override void handle(ASTOCLComprehensionEnumerationStyle node); @Override void handle(ASTOCLCollectionItem node); @Override void handle(ASTOCLEquivalentExpression node); IndentPrinter getPrinter(); String prettyprint(ASTExpression node); String prettyprint(ASTThenExpressionPart node); String prettyprint(ASTElseExpressionPart node); String prettyprint(ASTOCLQualification node); String prettyprint(ASTOCLComprehensionExpr node); String prettyprint(ASTOCLCollectionItem node); @Override void setRealThis(OCLExpressionsVisitor realThis); @Override OCLExpressionsVisitor getRealThis();  }