GithubHelp home page GithubHelp logo

Joop Leo's optimization? about yaep HOT 1 OPEN

vnmakarov avatar vnmakarov commented on June 12, 2024
Joop Leo's optimization?

from yaep.

Comments (1)

vnmakarov avatar vnmakarov commented on June 12, 2024 1

Thank you for your feedback.

Yes, in brief, I consider implementation of Joop Leo's optimization
or something similar.

In fact, I believe Joop Leo's work is more important that one
described in Practical Earley Parser article. Saying that I don't
know when I actually will start to work on it and when it could be
ready. It is not a high priority project for me.

I tried to implement an Earley Parser which could be useful for
programming languages implementation. Therefore I spend more efforts
on implementing simple direct translation and a good error recovery. I
also don't believe that LR(k) parsers (where k > 1) are useful for such
tasks. Usually, if a programming language grammar is not LR(1), it is
also not LR(k) k > 2 (e.g. C or C++).

But still it would be nice to parse LR(k > 1)-language by Earley
parser in linear time.

Although I wanted to implement my Earley parser as a swiss knife for
parser implementations, I found that its usage requires a lot of
expertise for non-trivial parsers. It is easy to write an ambiguous
grammar (e.g. during modification of an original grammar) when you
have not intention to do this.

By the way, I have also yacc-like parser MSTA
(https://github.com/dino-lang/dino/tree/master/MSTA) which can
generates effective LR(k), k > 1 parsers. This compiler-compiler does
a lot optimizations, like extracting LALR and regular parts of grammar
and implements parsing of them more effectively. Deterministic parser
generators are more safe for the problem I mentioned above. So I'd
prefer to use MSTA than my Earley parser for a typical programming
language implementation.

But even more I prefer to write manual parsers with backtracking if
necessary because I like to use original grammars from the programming
language definition. Other approaches require a lot of grammar
modifications (e.g. original Javascript grammar is actually a grammar
generator or can be considered as context sensitive one).

from yaep.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.