internal

package
v0.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Copy from https://github.com/freddierice/php_source/blob/467ed5d6edff72219afd3e644516f131118ef48e/ext/json/JSON_parser.c Base code: Copyright (c) 2005 JSON.org

Index

Constants

This section is empty.

Variables

View Source
var AsciiClasses = [128]Classes{}/* 128 elements not displayed */

AsciiClasses array maps the 128 ASCII characters into character classes.

View Source
var QuoteAsciiClasses = [128]Classes{}/* 128 elements not displayed */

QuoteAsciiClasses is a HACK for single quote from AsciiClasses

View Source
var StateTransitionTable = [31][31]States{

	{GO, GO, co, __, bo, __, __, __, ST, __, __, __, MI, __, ZE, IN, __, __, __, __, __, F1, __, N1, __, __, T1, __, __, __, __},
	{OK, OK, __, cc, __, bc, __, cm, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __},
	{OB, OB, __, ec, __, __, __, __, ST, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __},
	{KE, KE, __, __, __, __, __, __, ST, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __},
	{CO, CO, __, __, __, __, cl, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __},
	{VA, VA, co, __, bo, __, __, __, ST, __, __, __, MI, __, ZE, IN, __, __, __, __, __, F1, __, N1, __, __, T1, __, __, __, __},
	{AR, AR, co, __, bo, bc, __, __, ST, __, __, __, MI, __, ZE, IN, __, __, __, __, __, F1, __, N1, __, __, T1, __, __, __, __},
	{ST, __, ST, ST, ST, ST, ST, ST, qt, ES, ST, ST, ST, ST, ST, ST, ST, ST, ST, ST, ST, ST, ST, ST, ST, ST, ST, ST, ST, ST, ST},
	{__, __, __, __, __, __, __, __, ST, ST, ST, __, __, __, __, __, __, ST, __, __, __, ST, __, ST, ST, __, ST, U1, __, __, __},
	{__, __, __, __, __, __, __, __, __, __, __, __, __, __, U2, U2, U2, U2, U2, U2, U2, U2, __, __, __, __, __, __, U2, U2, __},
	{__, __, __, __, __, __, __, __, __, __, __, __, __, __, U3, U3, U3, U3, U3, U3, U3, U3, __, __, __, __, __, __, U3, U3, __},
	{__, __, __, __, __, __, __, __, __, __, __, __, __, __, U4, U4, U4, U4, U4, U4, U4, U4, __, __, __, __, __, __, U4, U4, __},
	{__, __, __, __, __, __, __, __, __, __, __, __, __, __, ST, ST, ST, ST, ST, ST, ST, ST, __, __, __, __, __, __, ST, ST, __},
	{__, __, __, __, __, __, __, __, __, __, __, __, __, __, ZE, IN, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __},
	{OK, OK, __, cc, __, bc, __, cm, __, __, __, __, __, DT, __, __, __, __, __, __, E1, __, __, __, __, __, __, __, __, E1, __},
	{OK, OK, __, cc, __, bc, __, cm, __, __, __, __, __, DT, IN, IN, __, __, __, __, E1, __, __, __, __, __, __, __, __, E1, __},
	{__, __, __, __, __, __, __, __, __, __, __, __, __, __, FR, FR, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __},
	{OK, OK, __, cc, __, bc, __, cm, __, __, __, __, __, __, FR, FR, __, __, __, __, E1, __, __, __, __, __, __, __, __, E1, __},
	{__, __, __, __, __, __, __, __, __, __, __, E2, E2, __, E3, E3, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __},
	{__, __, __, __, __, __, __, __, __, __, __, __, __, __, E3, E3, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __},
	{OK, OK, __, cc, __, bc, __, cm, __, __, __, __, __, __, E3, E3, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __},
	{__, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, T2, __, __, __, __, __, __},
	{__, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, T3, __, __, __},
	{__, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, OK, __, __, __, __, __, __, __, __, __, __},
	{__, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, F2, __, __, __, __, __, __, __, __, __, __, __, __, __, __},
	{__, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, F3, __, __, __, __, __, __, __, __},
	{__, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, F4, __, __, __, __, __},
	{__, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, OK, __, __, __, __, __, __, __, __, __, __},
	{__, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, N2, __, __, __},
	{__, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, N3, __, __, __, __, __, __, __, __},
	{__, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, OK, __, __, __, __, __, __, __, __},
}

StateTransitionTable is the state transition table takes the current state and the current symbol, and returns either a new state or an action. An action is represented as a negative number. A JSON text is accepted if at the end of the text the state is OK and if the mode is DONE.

Functions

This section is empty.

Types

type Classes

type Classes int8
const (
	C_SPACE Classes = iota /* space */
	C_WHITE                /* other whitespace */
	C_LCURB                /* {  */
	C_RCURB                /* } */
	C_LSQRB                /* [ */
	C_RSQRB                /* ] */
	C_COLON                /* : */
	C_COMMA                /* , */
	C_QUOTE                /* " */
	C_BACKS                /* \ */
	C_SLASH                /* / */
	C_PLUS                 /* + */
	C_MINUS                /* - */
	C_POINT                /* . */
	C_ZERO                 /* 0 */
	C_DIGIT                /* 123456789 */
	C_LOW_A                /* a */
	C_LOW_B                /* b */
	C_LOW_C                /* c */
	C_LOW_D                /* d */
	C_LOW_E                /* e */
	C_LOW_F                /* f */
	C_LOW_L                /* l */
	C_LOW_N                /* n */
	C_LOW_R                /* r */
	C_LOW_S                /* s */
	C_LOW_T                /* t */
	C_LOW_U                /* u */
	C_ABCDF                /* ABCDF */
	C_E                    /* E */
	C_ETC                  /* everything else */
)

enum classes

type States

type States int8
const (
	GO States = iota /* start    */
	OK               /* ok       */
	OB               /* object   */
	KE               /* key      */
	CO               /* colon    */
	VA               /* value    */
	AR               /* array    */
	ST               /* string   */
	ES               /* escape   */
	U1               /* u1       */
	U2               /* u2       */
	U3               /* u3       */
	U4               /* u4       */
	MI               /* minus    */
	ZE               /* zero     */
	IN               /* integer  */
	DT               /* dot      */
	FR               /* fraction */
	E1               /* e        */
	E2               /* ex       */
	E3               /* exp      */
	T1               /* tr       */
	T2               /* tru      */
	T3               /* true     */
	F1               /* fa       */
	F2               /* fal      */
	F3               /* fals     */
	F4               /* false    */
	N1               /* nu       */
	N2               /* nul      */
	N3               /* null     */
)

The state codes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL