Now that we’ve completed our introduction to parsing, let’s start to see how a real grammar looks like. In this post we’re going to write a grammar for about the simplest “language” I could think of: JSON. I’m going to use ANTLR v4’s syntax. ANTLR is a great tool for generating parsers from grammars, used in a lot of real world projects. From the ANTLR about page: ANTLR is a powerful parser generator that you can use to read, process, execute, or translate structured text or bin...| andreabergia.com
This post is part of the Introduction to parsing series. In the last post we have started working on our parser for our very simple mathematical language. Specifically, we focused on the lexer, the part of code that divides the input into tokens. In this part, we are going to extend our lexer a bit and start writing the parser. Let’s dive in!| Andrea Bergia's Website
This post is part of the Introduction to parsing series. In this posts series, we’re going to dive a bit into parsing. The idea is to eventually build a very simple language that can calculate mathematical derivative. That is, we want to be able to write things like:| Andrea Bergia's Website