Package org.jline.builtins
Class SyntaxHighlighter.Parser
java.lang.Object
org.jline.builtins.SyntaxHighlighter.Parser
- Enclosing class:
SyntaxHighlighter
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate String[]private Stringprivate booleanprivate booleanprivate Stringprivate static final charprivate booleanprivate String[]private Stringprivate CharSequenceprivate List<SyntaxHighlighter.ParsedToken> private int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate StringbalancedDelimiter(CharSequence buffer, int pos) private booleanisDelimiter(CharSequence buffer, int pos, String delimiter) private booleanisEscapeChar(char ch) private booleanisEscapeChar(CharSequence buffer, int pos) Check if this character is a valid escape char (i.e.private booleanisEscaped(CharSequence buffer, int pos) Check if a character is escaped (i.e.private booleanisLineCommentDelimiter(CharSequence buffer, int pos) voidparse(CharSequence line) voidreset()voidsetBalancedDelimiters(String tokenName, String[] args) voidsetBlockCommentDelimiters(String tokenName, String[] args) voidsetLineCommentDelimiters(String tokenName, String[] args) private CharSequencestartWithSubstring(CharSequence line, int pos)
-
Field Details
-
escapeChar
private static final char escapeChar- See Also:
-
blockCommentTokenName
-
blockCommentDelimiters
-
lineCommentTokenName
-
lineCommentDelimiters
-
balancedDelimiterTokenName
-
balancedDelimiters
-
balancedDelimiter
-
tokens
-
startWith
-
tokenStart
private int tokenStart -
blockComment
private boolean blockComment -
lineComment
private boolean lineComment -
balancedQuoted
private boolean balancedQuoted
-
-
Constructor Details
-
Parser
public Parser()
-
-
Method Details
-
setBlockCommentDelimiters
-
setLineCommentDelimiters
-
setBalancedDelimiters
-
reset
public void reset() -
parse
-
startWithSubstring
-
getTokens
-
balancedDelimiter
-
isDelimiter
-
isLineCommentDelimiter
-
isEscapeChar
private boolean isEscapeChar(char ch) -
isEscapeChar
Check if this character is a valid escape char (i.e. one that has not been escaped)- Parameters:
buffer- the buffer to check inpos- the position of the character to check- Returns:
- true if the character at the specified position in the given buffer is an escape character and the character immediately preceding it is not an escape character.
-
isEscaped
Check if a character is escaped (i.e. if the previous character is an escape)- Parameters:
buffer- the buffer to check inpos- the position of the character to check- Returns:
- true if the character at the specified position in the given buffer is an escape character and the character immediately preceding it is an escape character.
-