Comments (4)
@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.
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.
from fslexyacc.
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)
- Variables in supplied ".target" file seems undefined leading to compilation error HOT 6
- Activating case insensitive option crash the lexer generator HOT 12
- Building a project which uses FsLex/FsYacc fails when building with Visual Studio 2019 HOT 2
- Publish the ASTs and parsers for the ASTs for the FsLex and FsYacc tools to enable more robust editor tooling HOT 13
- Not an issue more like an optimization HOT 2
- Can't find the FSharp.Text.Lexing and FSharp.Text.Parsing lib? HOT 1
- Invite you to try a new series of Lex/Yacc tools HOT 9
- a syntax highlighter for fslex, fsyacc, F#
- Question: Can we get FSLex to embed a comment with the date-time that the outputs were generated? HOT 1
- Invite you to try FslexFsyacc HOT 7
- How to turn on runtime debug output
- How to get a position of a token from ParseErrorContext HOT 1
- API Documentation issues
- %% Trailer seems not supported
- LexBuffer<char>.LexemeSpan
- removing the need for explicit numbering of enums in F#, possible fixing problem with struct decorated DU's without fields.
- Online grammar editor/tester
- "unrecognized input" after upgrade HOT 1
- Question: possible to run this as a CLI tool or as a dotnet tool? HOT 1
- Check for output already built ignores -o flag HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fslexyacc.