Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bidirectional parsing #13

Open
eddyb opened this issue Aug 21, 2018 · 0 comments
Open

Bidirectional parsing #13

eddyb opened this issue Aug 21, 2018 · 0 comments

Comments

@eddyb
Copy link
Member

eddyb commented Aug 21, 2018

Right now only "forward" parsing is supported but some infrastructure exists for "backward" parsing.
Everything is the same except:

  • A B changes order
  • lookahead turns into lookbehind and vice-versa
  • cons lists become snoc lists
    • can probably avoid doing this, at a performance cost
    • can't use iterator API for a snoc list (since only "reverse" iteration exists)
  • GSS ranges would be input_start..rule_end instead of rule_start..input_end

If we use the same SPPF nodes (keeping e.g. cons lists), then we can reuse SPPF nodes between forward and backward parsing, but the GSS would still have to be separate.

N.B.: "LTR"/"RTL" would be convenient terms but as per rust-lang/rust#30459 they're incorrect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant