This is an archive of the discontinued LLVM Phabricator instance.

[pseudo] [WIP2] Implement GLR parser
Needs ReviewPublic

Authored by sammccall on Mar 24 2022, 9:15 AM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

Derived from https://reviews.llvm.org/D121150, which I don't want to commandeer
at this point. Rebased against new directory structure.

Diff Detail

Event Timeline

sammccall created this revision.Mar 24 2022, 9:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 24 2022, 9:15 AM
Herald added subscribers: mgrang, mgorny. · View Herald Transcript
sammccall requested review of this revision.Mar 24 2022, 9:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 24 2022, 9:15 AM
sammccall updated this revision to Diff 418044.Mar 24 2022, 2:14 PM

Address comments from D121150, except still need to add:

  • represent tokens as forestnodes
  • GLR parser operates on a range of tokens
  • limit GLR parser public interface
  • GLR parser never returns null
sammccall updated this revision to Diff 418059.Mar 24 2022, 3:43 PM

Parse terminal nodes instead of tokens directly

sammccall updated this revision to Diff 418062.Mar 24 2022, 3:47 PM

Pass terminal range into parser

sammccall updated this revision to Diff 418072.Mar 24 2022, 4:24 PM

Simplify shift, avoid some allocation

sammccall updated this revision to Diff 418127.Mar 24 2022, 9:21 PM

Smarter reduce algorithm