Class SyntaxHighlighter.Parser

java.lang.Object
org.jline.builtins.SyntaxHighlighter.Parser
Enclosing class:
SyntaxHighlighter

private static class SyntaxHighlighter.Parser extends Object
  • Field Details

    • escapeChar

      private static final char escapeChar
      See Also:
    • blockCommentTokenName

      private String blockCommentTokenName
    • blockCommentDelimiters

      private SyntaxHighlighter.BlockCommentDelimiters blockCommentDelimiters
    • lineCommentTokenName

      private String lineCommentTokenName
    • lineCommentDelimiters

      private String[] lineCommentDelimiters
    • balancedDelimiterTokenName

      private String balancedDelimiterTokenName
    • balancedDelimiters

      private String[] balancedDelimiters
    • balancedDelimiter

      private String balancedDelimiter
    • tokens

    • startWith

      private CharSequence 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

      public void setBlockCommentDelimiters(String tokenName, String[] args)
    • setLineCommentDelimiters

      public void setLineCommentDelimiters(String tokenName, String[] args)
    • setBalancedDelimiters

      public void setBalancedDelimiters(String tokenName, String[] args)
    • reset

      public void reset()
    • parse

      public void parse(CharSequence line)
    • startWithSubstring

      private CharSequence startWithSubstring(CharSequence line, int pos)
    • getTokens

      public List<SyntaxHighlighter.ParsedToken> getTokens()
    • balancedDelimiter

      private String balancedDelimiter(CharSequence buffer, int pos)
    • isDelimiter

      private boolean isDelimiter(CharSequence buffer, int pos, String delimiter)
    • isLineCommentDelimiter

      private boolean isLineCommentDelimiter(CharSequence buffer, int pos)
    • isEscapeChar

      private boolean isEscapeChar(char ch)
    • isEscapeChar

      private boolean isEscapeChar(CharSequence buffer, int pos)
      Check if this character is a valid escape char (i.e. one that has not been escaped)
      Parameters:
      buffer - the buffer to check in
      pos - 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

      private boolean isEscaped(CharSequence buffer, int pos)
      Check if a character is escaped (i.e. if the previous character is an escape)
      Parameters:
      buffer - the buffer to check in
      pos - 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.