@Test public void testMCQualifiedName() throws IOException { MCBasicTypesTestParser parser = new MCBasicTypesTestParser(); Optional<ASTMCQualifiedName> ast = parser.parse_StringMCQualifiedName("Name1.Name2.Name3"); assertTrue(ast.isPresent()); assertFalse(parser.hasErrors()); ASTMCQualifiedName qualifiedName = ast.get(); MCBasicTypesPrettyPrinter printer = new MCBasicTypesPrettyPrinter(new IndentPrinter()); String output = printer.prettyprint(ast.get()); ast = parser.parse_StringMCQualifiedName(output); assertFalse(parser.hasErrors()); assertTrue(ast.isPresent()); assertTrue(qualifiedName.deepEquals(ast.get())); }
public String prettyprint(ASTMCBasicTypesNode a) { getPrinter().clearBuffer(); a.accept(getRealThis()); return getPrinter().getContent(); }
MCBasicTypesPrettyPrinter implements MCBasicTypesVisitor { public String prettyprint(ASTMCBasicTypesNode a) { getPrinter().clearBuffer(); a.accept(getRealThis()); return getPrinter().getContent(); } }
MCBasicTypesPrettyPrinter implements MCBasicTypesVisitor { public String prettyprint(ASTMCBasicTypesNode a) { getPrinter().clearBuffer(); a.accept(getRealThis()); return getPrinter().getContent(); } MCBasicTypesPrettyPrinter(IndentPrinter printer); }
MCBasicTypesPrettyPrinter implements MCBasicTypesVisitor { public String prettyprint(ASTMCBasicTypesNode a) { getPrinter().clearBuffer(); a.accept(getRealThis()); return getPrinter().getContent(); } MCBasicTypesPrettyPrinter(IndentPrinter printer); IndentPrinter getPrinter(); void setPrinter(IndentPrinter printer); @Override void handle(ASTMCQualifiedName a); @Override void handle(ASTMCVoidType a); @Override void handle(ASTMCPrimitiveType a); @Override void handle(ASTMCImportStatement a); String prettyprint(ASTMCBasicTypesNode a); void setRealThis(MCBasicTypesVisitor realThis); @Override MCBasicTypesVisitor getRealThis(); }
MCBasicTypesPrettyPrinter implements MCBasicTypesVisitor { public String prettyprint(ASTMCBasicTypesNode a) { getPrinter().clearBuffer(); a.accept(getRealThis()); return getPrinter().getContent(); } MCBasicTypesPrettyPrinter(IndentPrinter printer); IndentPrinter getPrinter(); void setPrinter(IndentPrinter printer); @Override void handle(ASTMCQualifiedName a); @Override void handle(ASTMCVoidType a); @Override void handle(ASTMCPrimitiveType a); @Override void handle(ASTMCImportStatement a); String prettyprint(ASTMCBasicTypesNode a); void setRealThis(MCBasicTypesVisitor realThis); @Override MCBasicTypesVisitor getRealThis();  }