Suggested improvements

  • Kay: Can we please use loggers in Tool and related things?
  • Kay: Could open the possibilty to extend ANTLR without forking it. Meaning, I would like to see "extension points" a la Eclipse that let me tweak code gen, for example (think instrumentation or optimizer modules).
  • Sam: Support for ambiguous tree nodes (similar to backtracking=true, except it keeps all viable alts instead of just the first one) USE THREADS TO PARALLELIZE?
  • Graham: integrate symbol table management without need for target specific actions
  • Gerald: more/better tree rewriting stuff; waiting for more details.
  • Do we want to resurrect the idea of some innocuous imperative language that we can translate easily to the various targets? grammars with actions could then be language independent. Could we make an interpreter for it rather than build a translator? Would be easy to have side-effect free exec of code during backtracking this way.
  • Since we're building new templates, I'm going to go back to using exceptions for backtracking.
  • We should manage parameters and return values with a software stack rather than relying on the target language. The primary motivation is to avoid having hoisted predicates break compilation.
  • Lexer modes
  • Lexer backtracking to behave like lex; failure backs up to last accept state.
  • Automatically yield templates from rules
  • LR-style expression parsing. See this and that.
  • semantic rule specification language similar to tree pattern matching?
  • Gerald: Put context back into tree pattern matching and grammars?
    foo : {context("... method var")}? type ID -> blech  // context is "local"
    
  • better tree pattern matching. This isn't good enough:
    ^( RULE name=ID (^(RULEMODIFIERS .+)? .)
    
    I need to match anything (trees too) after ID and before modifiers...don't want to specify grammar. ~RULEMODIFIERS* doesn't seem to work because it doesnt' match DOWN (maybe). Can't match ^(returns ACTION) for example. (options {greedy=false;}:.)* seems to work.
  • Allow $FIRST, $FOLLOW in actions
  • Error hush codes and error alternatives
  • use generics for runtime lib
  • The runtime Exceptions, such as RewriteEmptyStreamException do not carry any grammar line/column information. Hard to provide meaningful error markers back in the editor when doing dynamic analysis.
  • incremental parsing; not sure about incr. lexing though (MUCH harder)
  • sometimes we want to backtrack always such as with error alts, but ANTLR optimizes stuff out and avoids the backtrack, yielding an error. Similar to lexer committing to a path that will fail even though another path (or 2 token matches) would match. Need a way to force backtracking over some alts. How does this fit in hybrid RTN approach? Maybe error alts done only in RTN interp mode?