public final class TruffleJSONParser extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
TruffleJSONParser.Mode |
| Modifier and Type | Field and Description |
|---|---|
protected JSContext |
context |
protected int |
len |
protected static int |
MAX_PARSE_DEPTH |
protected TruffleJSONParser.Mode |
mode |
protected int |
parseDepth |
protected com.oracle.truffle.api.strings.TruffleString |
parseStr |
protected int |
pos |
protected boolean |
withSource |
| Constructor and Description |
|---|
TruffleJSONParser(JSContext context) |
TruffleJSONParser(JSContext context,
TruffleJSONParser.Mode mode) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
decDepth() |
protected RuntimeException |
error(String message) |
protected void |
expectChar(char expected) |
protected char |
get() |
protected char |
get(int posParam) |
protected boolean |
getBooleanLiteral() |
protected Number |
getJSONNumber() |
protected com.oracle.truffle.api.strings.TruffleString |
getJSONString() |
protected Object |
getNullLiteral() |
protected int |
hexDigitValue(char c) |
protected static boolean |
isArrayStart(char c) |
protected boolean |
isBooleanLiteral(char c) |
protected static boolean |
isDigit(char c) |
protected boolean |
isExponentPart() |
protected boolean |
isLiteral(com.oracle.truffle.api.strings.TruffleString literalStr,
int literalPos) |
protected boolean |
isNullLiteral(char c) |
protected static boolean |
isNumber(char cur) |
protected static boolean |
isObjectOrArrayStart(char c) |
protected static boolean |
isObjectStart(char c) |
protected static boolean |
isStringQuote(char c) |
protected static boolean |
isWhitespace(char c) |
Object |
parse(com.oracle.truffle.api.strings.TruffleString value,
JSRealm realm) |
protected Number |
parseAsDouble(int sign,
com.oracle.truffle.api.strings.TruffleString valueStr) |
protected Object |
parseBooleanLiteral() |
protected ScriptArray |
parseJSONElementList(JSArrayObject arrayObject,
JSRealm realm,
JSONParseRecord parseRecord) |
protected Object |
parseJSONNumber() |
protected Object |
parseJSONString() |
protected com.oracle.truffle.api.strings.TruffleString |
parseJSONStringCharacters() |
protected Object |
parseJSONValue(JSRealm realm) |
protected Object |
parseNullLiteral() |
protected boolean |
posValid() |
protected void |
skipChar() |
protected void |
skipChar(char expected) |
protected void |
skipExponent() |
protected void |
skipString(com.oracle.truffle.api.strings.TruffleString expected) |
protected void |
skipWhitespace() |
protected static RuntimeException |
stackOverflowError() |
protected static RuntimeException |
syntaxError(String msg) |
protected com.oracle.truffle.api.strings.TruffleString |
unquoteJSON(com.oracle.truffle.api.strings.TruffleString string,
int sLength,
int posFirstBackslash) |
protected void |
unquoteJSONUnicode(com.oracle.truffle.api.strings.TruffleString string,
int posBackslash,
com.oracle.truffle.api.strings.TruffleStringBuilderUTF16 builder) |
protected final TruffleJSONParser.Mode mode
protected final boolean withSource
protected final JSContext context
protected int pos
protected int len
protected com.oracle.truffle.api.strings.TruffleString parseStr
protected int parseDepth
protected static final int MAX_PARSE_DEPTH
public TruffleJSONParser(JSContext context)
public TruffleJSONParser(JSContext context, TruffleJSONParser.Mode mode)
protected static boolean isNumber(char cur)
protected static boolean isObjectStart(char c)
protected static boolean isArrayStart(char c)
protected static boolean isObjectOrArrayStart(char c)
protected static RuntimeException stackOverflowError()
protected static RuntimeException syntaxError(String msg)
protected void decDepth()
protected ScriptArray parseJSONElementList(JSArrayObject arrayObject, JSRealm realm, JSONParseRecord parseRecord)
protected Object parseJSONString()
protected com.oracle.truffle.api.strings.TruffleString getJSONString()
protected static boolean isStringQuote(char c)
protected static boolean isDigit(char c)
protected com.oracle.truffle.api.strings.TruffleString parseJSONStringCharacters()
protected com.oracle.truffle.api.strings.TruffleString unquoteJSON(com.oracle.truffle.api.strings.TruffleString string,
int sLength,
int posFirstBackslash)
protected int hexDigitValue(char c)
protected void unquoteJSONUnicode(com.oracle.truffle.api.strings.TruffleString string,
int posBackslash,
com.oracle.truffle.api.strings.TruffleStringBuilderUTF16 builder)
protected Object parseJSONNumber()
protected Number getJSONNumber()
protected Number parseAsDouble(int sign, com.oracle.truffle.api.strings.TruffleString valueStr)
protected void skipExponent()
protected boolean isExponentPart()
protected boolean isNullLiteral(char c)
protected Object parseNullLiteral()
protected Object getNullLiteral()
protected boolean isBooleanLiteral(char c)
protected Object parseBooleanLiteral()
protected boolean getBooleanLiteral()
protected static boolean isWhitespace(char c)
protected RuntimeException error(String message)
protected char get()
protected char get(int posParam)
protected void skipString(com.oracle.truffle.api.strings.TruffleString expected)
protected void expectChar(char expected)
protected void skipChar()
protected void skipChar(char expected)
protected void skipWhitespace()
protected boolean posValid()
protected boolean isLiteral(com.oracle.truffle.api.strings.TruffleString literalStr,
int literalPos)