GithubHelp home page GithubHelp logo

Comments (4)

cartermp avatar cartermp commented on June 7, 2024 1

@siddharth-krishna as others have mentioned here, a bespoke parser is the best approach if you want good error recovery. F# uses a generated parser but also has a layer that sits atop it that provides a lot of these kinds of things, in addition to a tooling host that can introspect things at different points when compared to a batch compilation process. It's not really a goal of this project to offer more intricate error recovery, so I'll close this one out.

from fslexyacc.

nshibano avatar nshibano commented on June 7, 2024

Hi,

First of all I am not expert in this area. This is just my opinions.

I think your understanding is correct. It throws exception. When parser encounters error, it can not recognize further tokens.

If you want to count number of errors, you can restart parsing from next token of the point first error was occur, or next semicolon, newline or something.

from fslexyacc.

siddharth-krishna avatar siddharth-krishna commented on June 7, 2024

from fslexyacc.

ihavenonickname avatar ihavenonickname commented on June 7, 2024

Rich error reporting/recovery (which is what you're asking for) is probably the most common reason for writing your own, custom parser. Parser generators usually don't provide rich error reporting and error recovery.

Note: I've never used this specific parser generator so what I just said is a general advice.

from fslexyacc.

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.