The grammars of programming languages written for Iguana can be found in this repository. The grammars are extracted from their corresponding language specification manual. For some grammars, we also provide a version of the grammar that has a natural expression grammar which is declaratively disambiguated.
The grammars are written in Rascal. The integration of Iguana into Rascal is a work in progress. To use the Iguana backend for Rascal, you need the Iguana branch of Rascal. We plan to gradually convert the grammars to the reference syntax.If you find a bug in the grammars, or wish to see a specific grammar in this list, please open an issue on Github.
The grammar is extracted from the Haskell 2010 language report.
GHC deals with indentation-sensitive rules in the lexing phase, and the context-free part is
written as if no indentation rules exist. The specification grammar of Haskell does
not capture indentation-sensitive rules. In the Indentation-sensitive grammar,
ignore to express
The grammar of XML is extracted from the Extensible Markup Language (XML) 1.1 (Second Edition). This grammar, or any other context-free grammar of XML, cannot enforce balancing of start and end tags. Our XML grammar uses data-dependency features to enforce balanced tags.
The full data-dependent grammar is under development. For the basic idea behind data-dependent parsing of XML see this example.