Class ArgListTokenizer


  • public class ArgListTokenizer
    extends Object
    Splits an input string in tokens, so lists and parameter lists can be recognized. This class recognizes (quoted) Strings with back-slash as an escape character, white space, and as special one-character tokens: "(", ")", ";", "=".
    Author:
    Torsten Hildebrandt
    • Constructor Detail

      • ArgListTokenizer

        public ArgListTokenizer()
      • ArgListTokenizer

        public ArgListTokenizer​(String input)
    • Method Detail

      • reset

        protected void reset()
      • nextTokenNoWhitespace

        public ArgListTokenizer.TokenType nextTokenNoWhitespace()
        Returns the next token that is not whitespace.
        Returns:
        The type of the next token that is not WHITE_SPACE.
      • currTokenText

        public String currTokenText()
        Returns the portion of the input text that is associated with the current token. This method does not return surrounding quotes of a quoted STRING and unescapes any escaped characters.
        Returns:
        The current token's text.
      • currTokenStart

        public int currTokenStart()
      • currTokenEnd

        public int currTokenEnd()
      • pushBackToken

        public void pushBackToken()
        Resets the current reading position back to beginning of the current token, so nextToken() will see the same token again. This is useful, if a parser detects a token he can't handle but has to pass back to a parent parser for proper processing.
      • setInput

        public void setInput​(String input)
        Sets the input string to work on.
        Parameters:
        input - The input string.
      • escapeString

        public static String escapeString​(String raw)
      • quoteString

        public static String quoteString​(String raw)