Just take any tutorial about writing a compiler and stop at the Abstract Syntax Tree generation.
There is not that much difference between parsing a programming language like C and something like JSON. JSON grammar is smaller but the ideas are the same. In fact, JSON is essentially a subset of JS, and JS has a C-like syntax.
What makes a compiler a compiler is what comes after the parser, i.e. code generation.
There is not that much difference between parsing a programming language like C and something like JSON. JSON grammar is smaller but the ideas are the same. In fact, JSON is essentially a subset of JS, and JS has a C-like syntax.
What makes a compiler a compiler is what comes after the parser, i.e. code generation.