lark-parser / lark-parser/lark

Earley recogniser - Leo transitives

Open
#397 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
6k
Forks
523
Avg merge
3d 22h
Merged PRs (30d)
2

Description

Hi, I noticed that there's an implementation of Joop Leo's optimisation for right recursion, but it is commented out.

I'm fairly new to the concept of this algorithm so I'm trying to learn. Is there a reason to omit this, or maybe there's some other way of achieving linear time for LR(k) grammars?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in lark/parsers/earley.py at the commented Leo optimisation around line 81. Read the surrounding Earley recogniser implementation and its tests, then investigate why the optimisation was disabled and whether it can be safely restored for the relevant grammars. Done means the limitation or implementation path is documented and any supported behaviour is covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.