Class TruffleJSONParser

java.lang.Object
com.oracle.truffle.js.builtins.json.TruffleJSONParser

public final class TruffleJSONParser extends Object
  • Field Details

    • mode

      protected final TruffleJSONParser.Mode mode
    • withSource

      protected final boolean withSource
    • context

      protected final JSContext 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

  • Method Details

    • parse

      public Object parse(com.oracle.truffle.api.strings.TruffleString value, JSRealm realm)
    • parseJSONValue

      protected Object parseJSONValue(JSRealm realm)
    • 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

      protected static RuntimeException stackOverflowError()
    • syntaxError

      protected static RuntimeException syntaxError(String msg)
    • decDepth

      protected void decDepth()
    • parseJSONElementList

      protected void parseJSONElementList(JSArrayObject arrayObject, JSRealm realm, JSONParseRecord parseRecord)
    • parseJSONString

      protected Object 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

      protected Object parseJSONNumber()
    • getJSONNumber

      protected Number getJSONNumber()
    • parseAsDouble

      protected Number parseAsDouble(int sign, com.oracle.truffle.api.strings.TruffleString valueStr)
    • skipExponent

      protected void skipExponent()
    • isExponentPart

      protected boolean isExponentPart()
    • isNullLiteral

      protected boolean isNullLiteral(char c)
    • parseNullLiteral

      protected Object parseNullLiteral()
    • getNullLiteral

      protected Object getNullLiteral()
    • isBooleanLiteral

      protected boolean isBooleanLiteral(char c)
    • parseBooleanLiteral

      protected Object parseBooleanLiteral()
    • getBooleanLiteral

      protected boolean getBooleanLiteral()
    • isWhitespace

      protected static boolean isWhitespace(char c)
    • error

      protected RuntimeException error(String message)
    • 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)