Introduction

APaGeD stands for Attributed Parser Generator for D. It let's you write easy-to-read grammars and integrate semantic code for syntax tree traversal right with the syntactical rules.

Although it can generate GLR as well as LL parsers, the emphasis is now on the GLR parsers. This is mainly because they allow more flexible grammars, they have better performance and they provide good error handling with little effort. On the other hand, APaGeD does a lot to tackle the most stated disadvantage of LR parsers, which is the difficulty of debugging them.

This has come to a point where I feel, that debugging the LR parsers can even be easier than debugging an LL parser, because there is more, but not too much information available to analyze the situation. Of course, you need to understand how LR parsers work in order to be able to effectively debug them. And LR parsers are more difficult to understand.

Here is an overview of the features:

Unlike many other parser generators that allow semantic actions, APaGeD parses the input completely before applying any semantic code. That is a limitation, because you cannot change the parse tree depending on semantics. APaGeD follows D's philosophy of a strict separation of syntax and semantics here. It is generally favorable to have that separation, as it makes dealing with the grammar significantly easier and faster.