|
Lombok.ast - v0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SourceFormatter
Field Summary | |
---|---|
static String |
FAIL
|
Method Summary | |
---|---|
void |
addError(int errorStart,
int errorEnd,
String errorMessage)
Registers a parse error with the formatter. |
void |
append(String text)
Add raw text to the output stream. |
void |
buildBlock(Node node)
Opens a new AST level which is normally rendered as a block (example: statements, methods, type bodies). |
void |
buildInline(Node node)
Opens a new AST level which is normally rendered inline (example: expressions, literals, modifiers, identifiers, etc). |
void |
closeBlock()
Closes the previous buildBlock(Node) call. |
void |
closeInline()
Closes the previous buildInline(Node) call. |
void |
endSuppressBlock()
Closes the previous startSuppressBlock() call. |
void |
endSuppressIndent()
Closes the previous startSuppressIndent() call. |
void |
fail(String fail)
The AST is not valid; it applies to the current level. |
String |
finish()
Generate the source representation and return it as a string. |
void |
keyword(String text)
|
void |
nameNextElement(String name)
The next buildInline(Node) or buildBlock(Node) 's relation to the current block is named by this call. |
void |
operator(String text)
|
void |
property(String name,
Object value)
|
void |
setTimeTaken(long taken)
Reports the total time taken in milliseconds by the parser. |
void |
space()
Generate horizontal space. |
void |
startSuppressBlock()
The next buildBlock(Node) call should NOT be rendered in its own vertical area, but should instead be treated as an inline element. |
void |
startSuppressIndent()
The next buildBlock(Node) call should NOT indent. |
void |
verticalSpace()
Generate an extra vertical spacer if the output format allows for it. |
Field Detail |
---|
static final String FAIL
Method Detail |
---|
void fail(String fail)
fail
- Human readable explanation of what's wrong with the AST at this level.void property(String name, Object value)
void keyword(String text)
void operator(String text)
void verticalSpace()
verticalSpace
will be called.
void space()
void append(String text)
text
- The raw text to print. If your output format requires it, it is the implementor's responsibility to escape this text.void buildInline(Node node)
node
- The AST node that this level represents. Can be null
which signals that the current node has an inline substructure.void closeInline()
buildInline(Node)
call.
void startSuppressBlock()
buildBlock(Node)
call should NOT be rendered in its own vertical area, but should instead be treated as an inline
element.
Example: The execution statement is part of an if statement but has to be a statement, which is normally a block element. This call is generated before
the execution statement so that the execution statement is printed inline with the if statement.
void endSuppressBlock()
startSuppressBlock()
call.
void startSuppressIndent()
buildBlock(Node)
call should NOT indent.
Example: The case
or default
statement inside a switch
block.
void endSuppressIndent()
startSuppressIndent()
call.
void buildBlock(Node node)
node
- The AST node that this level represents. Can be null
which signals that the current node has a block substructure.void closeBlock()
buildBlock(Node)
call.
void addError(int errorStart, int errorEnd, String errorMessage)
String finish()
void setTimeTaken(long taken)
void nameNextElement(String name)
buildInline(Node)
or buildBlock(Node)
's relation to the current block is named by this call.
Not all elements will get a name, and the name only applies to the next buildBlock/Inline
call, not to any further calls.
|
Lombok.ast - v0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |