ANTLR v4 Wish list

Analysis

v4 uses adaptive LL(*) or ALL(*). It is pronounced "all star". (smile)

Parsing

  • Left recursion elimination and expression grammar simplification [ANTLR4:DONE] (Actually tested in v3 playground, not in v4 yet)
  • Adaptive LL(*), ALL(*) "all star", parsing DONE
  • Scannerless parsing
  • Error alternatives
  • Maybe ambiguous alt parsing, yielding parse forest
  • Improve tree pattern matching, rewrites; e.g., <"0":primary>
  • syntactic predicates ala PEGs; needed in token rules. ~ and ! are taken at the moment. perhaps the negate operator '-LetterOrDigit'; might as well at the positive version also: &LetterOrDigit.

Lexing

  • DFA-based / NFA-based Lexers
  • Lexer modes / contexts. "context STRING"
  • Long int based tokens instead of objects; use token adaptor
  • Unbuffered I/O

Templates

  • Generate code that uses ST v4 [ANTLR4:DONE]
  • Make default output=template action for single rule ref to be that rule's return value then perhaps $text for more complicated alts w/o -> actions.

Actions

  • Allow $FIRST, $FOLLOW, $LOOK

Runtime

  • Improve error messages when backtracking or using arbitrary lookahead
  • Add Jim Idle's sync rule concept
  • Make a real interpreter using NFA; allow access as library from Java code
  • Tokens and Trees should both know their start/stop line, start/stop char position to make IDEs easier.
  • Tree parser error handling should skip subtrees not nodes; these are programming errors not input errors. The flat stream makes it hard to resync.

Miscellaneous

  • Default rule parameter values, same for scope fields.

Implementation

  • Use ST v4 to generate code [ANTLR4:DONE]
  • Create new code generation mechanism

Tools

  • new gUnit
  • Widgets
    • AST viewer
    • generate syntax aware editor from ANTLR grammar
    • parse tree viewer