Class TokenStream.BasicTokenizer

  • All Implemented Interfaces:
    TokenStream.Tokenizer
    Enclosing class:
    TokenStream

    public static class TokenStream.BasicTokenizer
    extends Object
    implements TokenStream.Tokenizer
    A basic TokenStream.Tokenizer implementation that ignores whitespace but includes tokens for individual symbols, the period ('.'), single-quoted strings, double-quoted strings, whitespace-delimited words, and optionally comments.

    Note this Tokenizer may not be appropriate in many situations, but is provided merely as a convenience for those situations that happen to be able to use it.

    • Field Detail

      • WORD

        public static final int WORD
        The token type for tokens that represent an unquoted string containing a character sequence made up of non-whitespace and non-symbol characters.
        See Also:
        Constant Field Values
      • SYMBOL

        public static final int SYMBOL
        The token type for tokens that consist of an individual "symbol" character. The set of characters includes: -(){}*,;+%?$[]!<>|=:
        See Also:
        Constant Field Values
      • SINGLE_QUOTED_STRING

        public static final int SINGLE_QUOTED_STRING
        The token type for tokens that consist of all the characters within single-quotes. Single quote characters are included if they are preceded (escaped) by a '\' character.
        See Also:
        Constant Field Values
      • DOUBLE_QUOTED_STRING

        public static final int DOUBLE_QUOTED_STRING
        The token type for tokens that consist of all the characters within double-quotes. Double quote characters are included if they are preceded (escaped) by a '\' character.
        See Also:
        Constant Field Values
      • COMMENT

        public static final int COMMENT
        The token type for tokens that consist of all the characters between "/*" and "*/" or between "//" and the next line terminator (e.g., '\n', '\r' or "\r\n").
        See Also:
        Constant Field Values
      • useComments

        private final boolean useComments
    • Constructor Detail

      • BasicTokenizer

        protected BasicTokenizer​(boolean useComments)