public final class GrammarUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
COMMENT
Represents comment type in the TYPE_TABLE
|
static int |
CONTROL
Represents control type in the TYPE_TABLE
|
static boolean[] |
IS_TOKEN
convenience table mapping chars to true if they are tokens
|
static boolean[] |
IS_WHITE_SPACE
Convenience table mapping chars to true if they are white space chars
|
static int |
QUOTED_STRING
Represents quotes type in the TYPE_TABLE
|
static int |
SEPARATOR
Represents separator type in the TYPE_TABLE
|
static char[] |
SEPARATORS
Array of chars representing separators
|
static int |
TOKEN
Represents token type in the TYPE_TABLE
|
static int[] |
TYPE_TABLE
Mapping of chars to types
|
static char[] |
WHITE_SPACE
Array of chars representing white spaces
|
Constructor and Description |
---|
GrammarUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
containsWhiteSpace(java.lang.String s)
Returns true if string s contains a white space char.
|
static java.lang.String |
filterToken(java.lang.String s,
int start,
int end) |
static java.lang.String |
filterToken(java.lang.String s,
int start,
int end,
boolean preserveBackslash) |
static boolean |
isToken(char c)
Returns true if the provided char is a token.
|
static boolean |
isTokenString(java.lang.String s)
Returns true if all chars in string s are tokens.
|
static boolean |
isWhiteSpace(char c)
Returns true if the provided char is a white space.
|
public static final int TOKEN
public static final int QUOTED_STRING
public static final int COMMENT
public static final int SEPARATOR
public static final int CONTROL
public static final char[] WHITE_SPACE
public static final char[] SEPARATORS
public static final int[] TYPE_TABLE
public static final boolean[] IS_WHITE_SPACE
public static final boolean[] IS_TOKEN
public static boolean isWhiteSpace(char c)
c
- char to checkpublic static boolean isToken(char c)
c
- char to checkpublic static boolean isTokenString(java.lang.String s)
s
- string to check for tokenspublic static boolean containsWhiteSpace(java.lang.String s)
s
- string to check for white spacespublic static java.lang.String filterToken(java.lang.String s, int start, int end)
public static java.lang.String filterToken(java.lang.String s, int start, int end, boolean preserveBackslash)
Copyright © 2016 Oracle Corporation. All Rights Reserved.