Class TruffleJSONParser
java.lang.Object
com.oracle.truffle.js.builtins.json.TruffleJSONParser
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final JSContextprotected intprotected static final intprotected final TruffleJSONParser.Modeprotected intprotected com.oracle.truffle.api.strings.TruffleStringprotected intprotected final boolean -
Constructor Summary
ConstructorsConstructorDescriptionTruffleJSONParser(JSContext context) TruffleJSONParser(JSContext context, TruffleJSONParser.Mode mode) -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddecDepth()protected RuntimeExceptionprotected voidexpectChar(char expected) protected charget()protected charget(int posParam) protected booleanprotected Numberprotected com.oracle.truffle.api.strings.TruffleStringprotected Objectprotected inthexDigitValue(char c) protected static booleanisArrayStart(char c) protected booleanisBooleanLiteral(char c) protected static booleanisDigit(char c) protected booleanprotected booleanisLiteral(com.oracle.truffle.api.strings.TruffleString literalStr, int literalPos) protected booleanisNullLiteral(char c) protected static booleanisNumber(char cur) protected static booleanisObjectOrArrayStart(char c) protected static booleanisObjectStart(char c) protected static booleanisStringQuote(char c) protected static booleanisWhitespace(char c) protected NumberparseAsDouble(int sign, com.oracle.truffle.api.strings.TruffleString valueStr) protected Objectprotected voidparseJSONElementList(JSArrayObject arrayObject, JSRealm realm, JSONParseRecord parseRecord) protected Objectprotected Objectprotected com.oracle.truffle.api.strings.TruffleStringprotected ObjectparseJSONValue(JSRealm realm) protected Objectprotected booleanposValid()protected voidskipChar()protected voidskipChar(char expected) protected voidprotected voidskipString(com.oracle.truffle.api.strings.TruffleString expected) protected voidprotected static RuntimeExceptionprotected static RuntimeExceptionsyntaxError(String msg) protected com.oracle.truffle.api.strings.TruffleStringunquoteJSON(com.oracle.truffle.api.strings.TruffleString string, int sLength, int posFirstBackslash) protected voidunquoteJSONUnicode(com.oracle.truffle.api.strings.TruffleString string, int posBackslash, com.oracle.truffle.api.strings.TruffleStringBuilderUTF16 builder)
-
Field Details
-
mode
-
withSource
protected final boolean withSource -
context
-
pos
protected int pos -
len
protected int len -
parseStr
protected com.oracle.truffle.api.strings.TruffleString parseStr -
parseDepth
protected int parseDepth -
MAX_PARSE_DEPTH
protected static final int MAX_PARSE_DEPTH- See Also:
-
-
Constructor Details
-
TruffleJSONParser
-
TruffleJSONParser
-
-
Method Details
-
parse
-
parseJSONValue
-
isNumber
protected static boolean isNumber(char cur) -
isObjectStart
protected static boolean isObjectStart(char c) -
isArrayStart
protected static boolean isArrayStart(char c) -
isObjectOrArrayStart
protected static boolean isObjectOrArrayStart(char c) -
stackOverflowError
-
syntaxError
-
decDepth
protected void decDepth() -
parseJSONElementList
protected void parseJSONElementList(JSArrayObject arrayObject, JSRealm realm, JSONParseRecord parseRecord) -
parseJSONString
-
getJSONString
protected com.oracle.truffle.api.strings.TruffleString getJSONString() -
isStringQuote
protected static boolean isStringQuote(char c) -
isDigit
protected static boolean isDigit(char c) -
parseJSONStringCharacters
protected com.oracle.truffle.api.strings.TruffleString parseJSONStringCharacters() -
unquoteJSON
protected com.oracle.truffle.api.strings.TruffleString unquoteJSON(com.oracle.truffle.api.strings.TruffleString string, int sLength, int posFirstBackslash) -
hexDigitValue
protected int hexDigitValue(char c) -
unquoteJSONUnicode
protected void unquoteJSONUnicode(com.oracle.truffle.api.strings.TruffleString string, int posBackslash, com.oracle.truffle.api.strings.TruffleStringBuilderUTF16 builder) -
parseJSONNumber
-
getJSONNumber
-
parseAsDouble
-
skipExponent
protected void skipExponent() -
isExponentPart
protected boolean isExponentPart() -
isNullLiteral
protected boolean isNullLiteral(char c) -
parseNullLiteral
-
getNullLiteral
-
isBooleanLiteral
protected boolean isBooleanLiteral(char c) -
parseBooleanLiteral
-
getBooleanLiteral
protected boolean getBooleanLiteral() -
isWhitespace
protected static boolean isWhitespace(char c) -
error
-
get
protected char get() -
get
protected char get(int posParam) -
skipString
protected void skipString(com.oracle.truffle.api.strings.TruffleString expected) -
expectChar
protected void expectChar(char expected) -
skipChar
protected void skipChar() -
skipChar
protected void skipChar(char expected) -
skipWhitespace
protected void skipWhitespace() -
posValid
protected boolean posValid() -
isLiteral
protected boolean isLiteral(com.oracle.truffle.api.strings.TruffleString literalStr, int literalPos)
-