Enum Class IniTokens

java.lang.Object
java.lang.Enum<IniTokens>
nz.org.riskscape.ini.IniTokens
All Implemented Interfaces:
Serializable, Comparable<IniTokens>, Constable, TokenType

public enum IniTokens extends Enum<IniTokens> implements TokenType

Tokens and matchers for parsing ini files.

  • Enum Constant Details

    • SECTION

      public static final IniTokens SECTION
    • KEY

      public static final IniTokens KEY
    • HASH_COMMENT

      public static final IniTokens HASH_COMMENT
    • SEMI_COMMENT

      public static final IniTokens SEMI_COMMENT
    • WHITESPACE

      public static final IniTokens WHITESPACE
    • TAB

      public static final IniTokens TAB
    • MULTILINE_VALUE

      public static final IniTokens MULTILINE_VALUE
    • VALUE

      public static final IniTokens VALUE
      Any text terminated by a line ending or EOF ( but don't consume EOF, as it needs to be a distinct character)
    • EOF

      public static final IniTokens EOF
  • Method Details

    • values

      public static IniTokens[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static IniTokens valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • tokens

      public static Lexer.Tokens<IniTokens> tokens()
    • matcher

      public LexingMatcher matcher()
      Specified by:
      matcher in interface TokenType
      Returns:
      a LexingMatcher that is used to match tokens of this type. Note that matchers might actually match other tokens as well - the enum should declare the tokens in order of precedence so that the most specific are first
    • isWhitespace

      public boolean isWhitespace()
      Specified by:
      isWhitespace in interface TokenType
      Returns:
      true if this is a whitespace type token