3 ms·
Do you know of similar types of tutorials / repos except for language parsers (like markdown or json) ? How difficult would it be to implement in comparison to
by zabana 7y ago
Do you know of similar types of tutorials / repos except for language parsers (like markdown or json) ?
How difficult would it be to implement in comparison to a compiler ?
Where should I start looking ? (I want to build a compiler at some point but I want to get my feet wet building a simple language parser first)
Thanks in advance
- GuB-42 7y agoJust 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.
- abecedarius 7y agoTry the first few chapters of https://inf.ethz.ch/personal/wirth/CompilerConstruction/CompilerConstruction1.pdf https://inf.ethz.ch/personal/wirth/CompilerConstruction/Comp... and apply it to the grammar at https://www.json.org/json-en.html https://www.json.org/json-en.html
- zabana 7y agoThanks for the resources !!