Home
Links
Download
Documentation PDF
Mailing list

Last update: 2008-01-15

APaGeD - Attributed Parser Generator for D

The latest release is v0.4.2 beta (2007-12-27)

APaGeD - Attributed Parser Generator for the D programming language

Features

  • generates fast LALR(1)-based GLR parsers and LL parsers
  • generates linear-time first-longest-match lexical analyzers
  • intuitive, curly-brace-style grammar syntax with embedded D code
  • XML export of grammar specification for convenient documentation
  • supports non-regular whitespace grammar (e.g. nested comments)
  • allows for custom code in lexer for context-sensitive lexical grammars
  • tracks line- and column numbers
  • precedence rules to resolve conflicts
  • conflict profiler
  • semantic analysis allows inherited and synthetic attributes, multiple passes, etc.
  • supports imports for structuring of large grammars
  • extensive debugging facilities
  • supports error recovery
  • explicit error messages or...
  • automatically generated error messages: "file(line:column): found A, expected B, C or D"
  • optional detailed LR error messages:
    Error: src\parser.apd(27): found ";", expected DCodeBlock
    input: ;\n{\n class LexemeSet\n {\n Set!(
    lookahead: ;
    lexeme: ;
    AST node stack:
    Prolog
    LR stack:
    ---- State 2 (1) ----
    Start -> Prolog . Grammar
    Prolog -> Prolog . import FQIdent ;
    Prolog -> Prolog . Properties \{ Props \}
    Prolog -> Prolog . Lexemes \{ Lexs \}
    Prolog -> Prolog . Declaration DCodeBlock
    ---- State 39 (27) ----
    Prolog -> Prolog Declaration . DCodeBlock
    
See the documentation for details.

Here is an example grammar.
The SEATD project includes a D grammar for APaGeD.