Skip to content

Latest commit

 

History

History
46 lines (38 loc) · 2.53 KB

File metadata and controls

46 lines (38 loc) · 2.53 KB

Nice features

  • Parser show tags of failed results as the "expected" if parsing can't continue.
  • Demo of segmenting parser: break input into (lines|expressions|statements), then parse each of those. Example of recovering parser if one line is bad.
    • This should really be a 'BadLine' / 'BadBlock' part of the main pattern?
  • Generate a BNF graphic (display of parser structure) -- maybe Mermaid syntax?
  • Generate parser result graphic (like https://dubroy.com/blog/visualizing-packrat-parsing/ )
  • "Immediate stop" parser? If this is successful, we stop any other parsing and return the result up-to the stop parser.
  • "Context" parser? Function that takes parser match tree so far, gives a new BNF. This continues as parser match, then continues to next result after the context parser.
  • More extensive read-me that covers all of BNF with examples
  • Ability to turn off auto-advance within a specific parser and its children.
  • Attempt a low-GC way of doing ParserMatch
    • Also tried turning of GC collection during parse. No measurable benefit.
  • Try to remove the new BNF(new Parser()) wrapping layer.
    • tried: does not provide measurable benefit, at the cost of flexibility and complexity.

Examples

Huge repo of grammars here: https://github.com/antlr/grammars-v4

Sources for more examples:

Diagrams: