Context-Free Grammar & JSON
Compiler Principle
JSON
Formal Language
JSON 和 Context-free Grammar 的關係
Copy from JSON.org
object
{}
{ members }
members
pair
pair , members
pair
string : value
array
[]
[ elements ]
elements
value
value , elements
value
string
number
object
array
true
false
null
JSON 可以由 Context-free Grammar 所做成。當中的 rule 都是 non-ambiguous,內裡的 leftmost derivation…