public class Unparser extends Object
Writer. See main(String[]) for a usage example.| Modifier and Type | Field and Description |
|---|---|
protected PrintWriter |
pw
Where the
visit...() methods print their text. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Flushes all generated code.
|
static void |
main(String[] args)
Testing of parsing/unparsing.
|
static void |
unparse(Java.AbstractCompilationUnit acu,
Writer w)
Unparses the given
Java.AbstractCompilationUnit to the given Writer. |
void |
unparseAbstractCompilationUnit(Java.AbstractCompilationUnit cu) |
void |
unparseAtom(Java.Atom a) |
void |
unparseBlock(Java.Block b) |
void |
unparseBlockStatement(Java.BlockStatement bs) |
void |
unparseClassDeclarationBody(Java.AbstractClassDeclaration cd) |
void |
unparseImportDeclaration(Java.AbstractCompilationUnit.ImportDeclaration id) |
void |
unparseLambdaBody(Java.LambdaBody body) |
void |
unparseLambdaParameters(Java.LambdaParameters lp) |
void |
unparseStatements(List<? extends Java.BlockStatement> statements) |
void |
unparseType(Java.Type t) |
void |
unparseTypeDeclaration(Java.TypeDeclaration td) |
protected final PrintWriter pw
visit...() methods print their text. Notice that this PrintWriter does not print to
the output directly, but through an AutoIndentWriter.public Unparser(Writer w)
public static void main(String[] args) throws Exception
Reads compilation units from the files named on the command line and unparses them to System.out.
Exceptionpublic static void unparse(Java.AbstractCompilationUnit acu, Writer w)
Java.AbstractCompilationUnit to the given Writer.public void close()
public void unparseAbstractCompilationUnit(Java.AbstractCompilationUnit cu)
cu - The compilation unit to unparsepublic void unparseImportDeclaration(Java.AbstractCompilationUnit.ImportDeclaration id)
public void unparseStatements(List<? extends Java.BlockStatement> statements)
public void unparseLambdaParameters(Java.LambdaParameters lp)
public void unparseLambdaBody(Java.LambdaBody body)
public void unparseBlock(Java.Block b)
public void unparseBlockStatement(Java.BlockStatement bs)
public void unparseTypeDeclaration(Java.TypeDeclaration td)
public void unparseType(Java.Type t)
public void unparseAtom(Java.Atom a)
public void unparseClassDeclarationBody(Java.AbstractClassDeclaration cd)
Copyright © 2019. All rights reserved.