JSON
Properties
The grammar has 11 terminals, 7 nonterminals, 17 productions, 27 LALR states and 36 DFA states.
It is case-sensitive.
Whitespace characters are ignored.
It was generated by Farkle 0.0.0-local on .
Syntax
- JSON
-
Object
-
- {
- Object Optional
- }
-
-
Array
-
- [
- Array Optional
- ]
-
-
Object Optional
-
- Nothing
-
Array Optional
-
- Nothing
-
Object Element
-
- Object Element
- ,
- String
- :
- JSON
-
- String
- :
- JSON
-
- Array Reversed
LALR States
| Symbol | Action |
|---|---|
| String | Shift to State 2 |
| Number | Shift to State 3 |
| true | Shift to State 6 |
| false | Shift to State 7 |
| null | Shift to State 8 |
| { | Shift to State 9 |
| [ | Shift to State 10 |
| JSON | Go to State 1 |
| Object | Go to State 4 |
| Array | Go to State 5 |
| Symbol | Action |
|---|---|
| EOF | Accept |
| Symbol | Action |
|---|---|
| } | Reduce <JSON> ::= String |
| ] | Reduce <JSON> ::= String |
| , | Reduce <JSON> ::= String |
| EOF | Reduce <JSON> ::= String |
| Symbol | Action |
|---|---|
| } | Reduce <JSON> ::= Number |
| ] | Reduce <JSON> ::= Number |
| , | Reduce <JSON> ::= Number |
| EOF | Reduce <JSON> ::= Number |
| Symbol | Action |
|---|---|
| } | Reduce <JSON> ::= <Object> |
| ] | Reduce <JSON> ::= <Object> |
| , | Reduce <JSON> ::= <Object> |
| EOF | Reduce <JSON> ::= <Object> |
| Symbol | Action |
|---|---|
| } | Reduce <JSON> ::= <Array> |
| ] | Reduce <JSON> ::= <Array> |
| , | Reduce <JSON> ::= <Array> |
| EOF | Reduce <JSON> ::= <Array> |
| Symbol | Action |
|---|---|
| } | Reduce <JSON> ::= true |
| ] | Reduce <JSON> ::= true |
| , | Reduce <JSON> ::= true |
| EOF | Reduce <JSON> ::= true |
| Symbol | Action |
|---|---|
| } | Reduce <JSON> ::= false |
| ] | Reduce <JSON> ::= false |
| , | Reduce <JSON> ::= false |
| EOF | Reduce <JSON> ::= false |
| Symbol | Action |
|---|---|
| } | Reduce <JSON> ::= null |
| ] | Reduce <JSON> ::= null |
| , | Reduce <JSON> ::= null |
| EOF | Reduce <JSON> ::= null |
| Symbol | Action |
|---|---|
| String | Shift to State 13 |
| } | Reduce <Object Optional> ::= |
| Object Optional | Go to State 11 |
| Object Element | Go to State 12 |
| Symbol | Action |
|---|---|
| String | Shift to State 2 |
| Number | Shift to State 3 |
| true | Shift to State 6 |
| false | Shift to State 7 |
| null | Shift to State 8 |
| { | Shift to State 9 |
| [ | Shift to State 10 |
| ] | Reduce <Array Optional> ::= |
| JSON | Go to State 16 |
| Object | Go to State 4 |
| Array | Go to State 5 |
| Array Optional | Go to State 14 |
| Array Reversed | Go to State 15 |
| Symbol | Action |
|---|---|
| } | Shift to State 17 |
| Symbol | Action |
|---|---|
| } | Reduce <Object Optional> ::= <Object Element> |
| , | Shift to State 18 |
| Symbol | Action |
|---|---|
| : | Shift to State 19 |
| Symbol | Action |
|---|---|
| ] | Shift to State 20 |
| Symbol | Action |
|---|---|
| ] | Reduce <Array Optional> ::= <Array Reversed> |
| , | Shift to State 21 |
| Symbol | Action |
|---|---|
| ] | Reduce <Array Reversed> ::= <JSON> |
| , | Reduce <Array Reversed> ::= <JSON> |
| Symbol | Action |
|---|---|
| } | Reduce <Object> ::= '{' <Object Optional> '}' |
| ] | Reduce <Object> ::= '{' <Object Optional> '}' |
| , | Reduce <Object> ::= '{' <Object Optional> '}' |
| EOF | Reduce <Object> ::= '{' <Object Optional> '}' |
| Symbol | Action |
|---|---|
| String | Shift to State 22 |
| Symbol | Action |
|---|---|
| String | Shift to State 2 |
| Number | Shift to State 3 |
| true | Shift to State 6 |
| false | Shift to State 7 |
| null | Shift to State 8 |
| { | Shift to State 9 |
| [ | Shift to State 10 |
| JSON | Go to State 23 |
| Object | Go to State 4 |
| Array | Go to State 5 |
| Symbol | Action |
|---|---|
| } | Reduce <Array> ::= '[' <Array Optional> ']' |
| ] | Reduce <Array> ::= '[' <Array Optional> ']' |
| , | Reduce <Array> ::= '[' <Array Optional> ']' |
| EOF | Reduce <Array> ::= '[' <Array Optional> ']' |
| Symbol | Action |
|---|---|
| String | Shift to State 2 |
| Number | Shift to State 3 |
| true | Shift to State 6 |
| false | Shift to State 7 |
| null | Shift to State 8 |
| { | Shift to State 9 |
| [ | Shift to State 10 |
| JSON | Go to State 24 |
| Object | Go to State 4 |
| Array | Go to State 5 |
| Symbol | Action |
|---|---|
| : | Shift to State 25 |
| Symbol | Action |
|---|---|
| } | Reduce <Object Element> ::= String ':' <JSON> |
| , | Reduce <Object Element> ::= String ':' <JSON> |
| Symbol | Action |
|---|---|
| ] | Reduce <Array Reversed> ::= <Array Reversed> ',' <JSON> |
| , | Reduce <Array Reversed> ::= <Array Reversed> ',' <JSON> |
| Symbol | Action |
|---|---|
| String | Shift to State 2 |
| Number | Shift to State 3 |
| true | Shift to State 6 |
| false | Shift to State 7 |
| null | Shift to State 8 |
| { | Shift to State 9 |
| [ | Shift to State 10 |
| JSON | Go to State 26 |
| Object | Go to State 4 |
| Array | Go to State 5 |
| Symbol | Action |
|---|---|
| } | Reduce <Object Element> ::= <Object Element> ',' String ':' <JSON> |
| , | Reduce <Object Element> ::= <Object Element> ',' String ':' <JSON> |
DFA States
| Characters | Action |
|---|---|
| Tab, Line Feed, Carriage Return, Space | Go to State 1 |
| " | Go to State 2 |
| Comma | Go to State 3 |
| - | Go to State 4 |
| 0 | Go to State 5 |
| 1…9 | Go to State 6 |
| : | Go to State 7 |
| [ | Go to State 8 |
| ] | Go to State 9 |
| f | Go to State 10 |
| n | Go to State 11 |
| t | Go to State 12 |
| { | Go to State 13 |
| } | Go to State 14 |
| Characters | Action |
|---|---|
| Tab, Line Feed, Carriage Return, Space | Go to State 1 |
| Accept Whitespace (Noise) | |
| Characters | Action |
|---|---|
| " | Go to State 30 |
| \ | Go to State 31 |
| In all other cases | Go to State 2 |
| Accept , |
| Characters | Action |
|---|---|
| 0 | Go to State 5 |
| 1…9 | Go to State 6 |
| Characters | Action |
|---|---|
| . | Go to State 25 |
| E, e | Go to State 26 |
| Accept Number | |
| Characters | Action |
|---|---|
| 0…9 | Go to State 6 |
| . | Go to State 25 |
| E, e | Go to State 26 |
| Accept Number | |
| Accept : |
| Accept [ |
| Accept ] |
| Characters | Action |
|---|---|
| a | Go to State 21 |
| Characters | Action |
|---|---|
| u | Go to State 18 |
| Characters | Action |
|---|---|
| r | Go to State 15 |
| Accept { |
| Accept } |
| Characters | Action |
|---|---|
| u | Go to State 16 |
| Characters | Action |
|---|---|
| e | Go to State 17 |
| Accept true |
| Characters | Action |
|---|---|
| l | Go to State 19 |
| Characters | Action |
|---|---|
| l | Go to State 20 |
| Accept null |
| Characters | Action |
|---|---|
| l | Go to State 22 |
| Characters | Action |
|---|---|
| s | Go to State 23 |
| Characters | Action |
|---|---|
| e | Go to State 24 |
| Accept false |
| Characters | Action |
|---|---|
| 0…9 | Go to State 29 |
| Characters | Action |
|---|---|
| +, - | Go to State 27 |
| 0…9 | Go to State 28 |
| Characters | Action |
|---|---|
| 0…9 | Go to State 28 |
| Characters | Action |
|---|---|
| 0…9 | Go to State 28 |
| Accept Number | |
| Characters | Action |
|---|---|
| E, e | Go to State 26 |
| 0…9 | Go to State 29 |
| Accept Number | |
| Accept String |
| Characters | Action |
|---|---|
| ", /, \, b, f, n, r, t | Go to State 2 |
| u | Go to State 32 |
| Characters | Action |
|---|---|
| 0…9, A…F, a…f | Go to State 33 |
| Characters | Action |
|---|---|
| 0…9, A…F, a…f | Go to State 34 |
| Characters | Action |
|---|---|
| 0…9, A…F, a…f | Go to State 35 |
| Characters | Action |
|---|---|
| 0…9, A…F, a…f | Go to State 2 |