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.CompilationUnit cu,
Writer w)
Unparses the given
Java.CompilationUnit to the given Writer. |
void |
unparseAtom(Java.Atom a) |
void |
unparseBlock(Java.Block b) |
void |
unparseBlockStatement(Java.BlockStatement bs) |
void |
unparseCompilationUnit(Java.CompilationUnit cu) |
void |
unparseImportDeclaration(Java.CompilationUnit.ImportDeclaration id) |
void |
unparseLambdaBody(Java.LambdaBody body) |
void |
unparseLambdaParameters(Java.LambdaParameters lp) |
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.CompilationUnit cu, Writer w)
Java.CompilationUnit to the given Writer.public void close()
public void unparseCompilationUnit(Java.CompilationUnit cu)
cu - The compilation unit to unparsepublic void unparseImportDeclaration(Java.CompilationUnit.ImportDeclaration id)
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)
Copyright © 2019. All rights reserved.