-
Book Overview & Buying
-
Table Of Contents
Building Programming Language Interpreters
By :
As with lexers, there are various options of libraries that implement grammar engines. Those libraries offer different trade-offs, and it’s important to consider which one is going to be most beneficial to your project.
The first library I want us to consider is ANTLR, because it is a very sophisticated framework for building lexers and parsers. If you think that your language will evolve into a lot more complexity, it may be beneficial to consider it. Its main drawback is the additional complexity involving code generators, which may also make debugging more challenging.
ANTLR will also implement its own lexer, and it will produce its own parse tree based on the grammar. If you want to increase the semantic meaning of the parse tree, such as transforming a list into a map, that will need to happen as a postprocessing step.
You also need to know about Bison, the counterpart to Flex. It is probably one of the most mature grammar...
Change the font size
Change margin width
Change background colour