java.lang.Object
at.syntaxerror.syntaxnbt.internal.SNBTParser
- Direct Known Subclasses:
PathParser
A utility class for parsing SNBT tags
- Author:
- SyntaxError404
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final recordRange for an integer type -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Map<String,SNBTParser.Range> Ranges for integer typesprotected static final PatternRegEx pattern for matching integers -
Method Summary
Modifier and TypeMethodDescriptionprotected voidback()Force to re-read the last characterprotected static booleanisValuePart(char c) Checks whether a character is valid for string-like objectsprotected booleanisValuePartAlt(char c) Checks whether a character is valid for string-like objectsprotected booleanmore()Whether there are still characters leftprotected charnext()Returns the next characterprotected charReturns the next non-whitespace characterprotected TagCompoundParses and returns the next TAG_Compoundprotected StringnextString(boolean alt) Returns the next string-like objectstatic TagCompoundRead a compound tag from a stringprotected charpeek()Returns the next character is without actually incrementing the positionprotected NBTExceptionsyntaxError(String message) Constructs a new NBT exceptiontoString()
-
Field Details
-
PATTERN_INTEGER
RegEx pattern for matching integers -
INTEGER_BOUNDS
Ranges for integer types
-
-
Method Details
-
more
protected boolean more()Whether there are still characters left- Returns:
- whether there are still characters left
-
back
protected void back()Force to re-read the last character -
peek
protected char peek()Returns the next character is without actually incrementing the position- Returns:
- the next character
-
next
protected char next()Returns the next character- Returns:
- the next character
-
nextClean
protected char nextClean()Returns the next non-whitespace character- Returns:
- the next character
-
nextString
Returns the next string-like object- Parameters:
alt- use alternative validation check- Returns:
- the next string
-
nextCompound
Parses and returns the next TAG_Compound- Returns:
- the next TAG_Compound
-
isValuePartAlt
protected boolean isValuePartAlt(char c) Checks whether a character is valid for string-like objects- Parameters:
c- a character- Returns:
- whether the character is valid
-
isValuePart
protected static boolean isValuePart(char c) Checks whether a character is valid for string-like objects- Parameters:
c- a character- Returns:
- whether the character is valid
-
parse
Read a compound tag from a string- Parameters:
input- an input string- Returns:
- the parsed compound tag
-
syntaxError
Constructs a new NBT exception- Parameters:
message- the exception message- Returns:
- an exception
-
toString
-