MCLowLevelStatementsPrettyPrinter extends MCBasicsPrettyPrinter implements MCLowLevelStatementsVisitor { public String prettyprint(ASTMCLowLevelStatementsNode a) { getPrinter().clearBuffer(); a.accept(getRealThis()); return getPrinter().getContent(); } MCLowLevelStatementsPrettyPrinter(IndentPrinter out); IndentPrinter getPrinter(); @Override void handle(ASTLabel a); @Override void handle(ASTLabelledBreakStatement a); @Override void handle(ASTContinueStatement a); String prettyprint(ASTMCLowLevelStatementsNode a); @Override void setRealThis(MCLowLevelStatementsVisitor realThis); @Override MCLowLevelStatementsVisitor getRealThis();  }
@Test public void testBreakStatement() throws IOException { Optional<ASTLabelledBreakStatement> result = parser.parse_StringLabelledBreakStatement("break a ;"); assertFalse(parser.hasErrors()); assertTrue(result.isPresent()); ASTLabelledBreakStatement ast = result.get(); String output = prettyPrinter.prettyprint(ast); result = parser.parse_StringLabelledBreakStatement(output); assertFalse(parser.hasErrors()); assertTrue(result.isPresent()); assertTrue(ast.deepEquals(result.get())); }
@Test public void testLabeledStatement() throws IOException { Optional<ASTLabel> result = parser.parse_StringLabel("a : break foo;"); assertFalse(parser.hasErrors()); assertTrue(result.isPresent()); ASTLabel ast = result.get(); String output = prettyPrinter.prettyprint(ast); result = parser.parse_StringLabel(output); assertFalse(parser.hasErrors()); assertTrue(result.isPresent()); assertTrue(ast.deepEquals(result.get())); }
@Test public void testContinueStatement() throws IOException { Optional<ASTContinueStatement> result = parser.parse_StringContinueStatement("continue foo;"); assertFalse(parser.hasErrors()); assertTrue(result.isPresent()); ASTContinueStatement ast = result.get(); String output = prettyPrinter.prettyprint(ast); result = parser.parse_StringContinueStatement(output); assertFalse(parser.hasErrors()); assertTrue(result.isPresent()); assertTrue(ast.deepEquals(result.get())); }