Package groovy.console.ui.text
Class StructuredSyntaxDocumentFilter.LexerNode
java.lang.Object
groovy.console.ui.text.StructuredSyntaxDocumentFilter.LexerNode
- Enclosing class:
- StructuredSyntaxDocumentFilter
Regex-driven lexer node that applies styles and nested lexers.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the fallback style for unmatched text.booleanvoidparse(CharBuffer buffer, int offset, int length) Parses the supplied buffer and applies styles to matching ranges.voidputChild(String[] regexps, StructuredSyntaxDocumentFilter.LexerNode node) Registers a child lexer for matches of any supplied expression.voidputChild(String regexp, StructuredSyntaxDocumentFilter.LexerNode node) Registers a child lexer for matches of the supplied expression.voidAssociates a style with matches of any supplied expression.voidAssociates a style with matches of the supplied expression.voidremoveChild(String regexp) Removes the child lexer registered for the supplied expression.voidremoveStyle(String regexp) Removes the style associated with the supplied expression.voidremoveStyle(String[] regexps) Removes the style associated with any of the supplied expressions.voidsetDefaultStyle(Style style) Sets the fallback style for unmatched text.
-
Method Details
-
getDefaultStyle
Returns the fallback style for unmatched text.- Returns:
- the default style
-
isInitialized
public boolean isInitialized()- Returns:
- true if initialised
-
parse
Parses the supplied buffer and applies styles to matching ranges.- Parameters:
buffer- the character buffer to parseoffset- the starting offsetlength- the number of characters to parse- Throws:
BadLocationException- if document positions cannot be resolved
-
putChild
Registers a child lexer for matches of the supplied expression.- Parameters:
regexp- the expression to matchnode- the child lexer to apply within matching text
-
putChild
Registers a child lexer for matches of any supplied expression.- Parameters:
regexps- the expressions to matchnode- the child lexer to apply within matching text
-
putStyle
Associates a style with matches of the supplied expression.- Parameters:
regexp- the expression to matchstyle- the style to apply
-
putStyle
Associates a style with matches of any supplied expression.- Parameters:
regexps- the expressions to matchstyle- the style to apply
-
removeChild
Removes the child lexer registered for the supplied expression.- Parameters:
regexp- the expression whose child lexer should be removed
-
removeStyle
Removes the style associated with the supplied expression.- Parameters:
regexp- the expression whose style should be removed
-
removeStyle
Removes the style associated with any of the supplied expressions.- Parameters:
regexps- the expressions whose combined style should be removed
-
setDefaultStyle
Sets the fallback style for unmatched text.- Parameters:
style- the default style to use
-