public class PrettyPrinter extends java.lang.Object implements IShallowEntityVisitor
Constructor and Description |
---|
PrettyPrinter(java.util.List<IToken> tokens,
ELanguage language)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
endVisit(ShallowEntity entity)
Called after visiting all children of an entity in the backtracking phase
of the DFS.
|
java.lang.String |
format()
Formats and returns the code.
|
static java.lang.String |
format(java.lang.String code,
ELanguage language)
Formats the given code.
|
boolean |
visit(ShallowEntity entity)
Denotes that visiting the entity begins.
|
public PrettyPrinter(java.util.List<IToken> tokens, ELanguage language)
public java.lang.String format() throws ShallowParserException
ShallowParserException
public boolean visit(ShallowEntity entity)
visit
in interface IShallowEntityVisitor
public void endVisit(ShallowEntity entity)
IShallowEntityVisitor.visit(ShallowEntity)
returned true or false. The default
implementation does nothing.endVisit
in interface IShallowEntityVisitor
public static java.lang.String format(java.lang.String code, ELanguage language) throws ShallowParserException
ShallowParserException