public interface WhitespacesAndCommentsBinder
Modifier and Type | Interface and Description |
---|---|
static interface |
WhitespacesAndCommentsBinder.RecursiveBinder
Recursive binder is allowed to adjust nested elements positions.
|
static interface |
WhitespacesAndCommentsBinder.TokenTextGetter
Provides an ability for the processor to get a text of any of given tokens.
|
Modifier and Type | Method and Description |
---|---|
int |
getEdgePosition(java.util.List<IElementType> tokens,
boolean atStreamEdge,
WhitespacesAndCommentsBinder.TokenTextGetter getter)
Analyzes whitespace and comment tokens at element's edge and returns element's edge position relative to these tokens.
|
int getEdgePosition(java.util.List<IElementType> tokens, boolean atStreamEdge, WhitespacesAndCommentsBinder.TokenTextGetter getter)
Example 1: if a processor for left edge wants to leave all whitespaces and comments out of element's scope
(before it's start) it should return value of tokens.size()
placing element's start pointer to a first
token after series of whitespaces/comments.
Example 2: if a processor for right edge wants to leave all whitespaces and comments out of element's scope
(after its end) it should return value of 0
placing element's end pointer to a first
whitespace or comment after element's end.
tokens
- sequence of whitespace and comment tokens at the element's edge.atStreamEdge
- true
if sequence of tokens is located at the beginning or the end of token stream.getter
- token text getter.