zafarkhaja / jsemver

Java implementation of the SemVer Specification
MIT License
429 stars 82 forks source link

Experiment with scannerless parsing for VersionParser #9

Closed zafarkhaja closed 6 months ago

zafarkhaja commented 10 years ago

Character-based parsing is a tedious and error-prone process. It also makes it difficult to handle lexical ambiguities and implement a good error handling especially in a LL(k) parser. So, need to try a different approach (Scannerless GLR Parsing?) to this which seems more suitable.

RobertFischer commented 8 years ago

If I were to build you a JAVACC-based parser, would you be interested?

zafarkhaja commented 8 years ago

Hey @RobertFischer, I appreciate your reaching out. But...

I had thought about parser generators before when I started writing the library and I gave it some more thoughts last weekend. Honestly, back then and still now it feels like parser generators are overkill for this kind of grammar, I mean small and simple. So, I'm leaning towards defining regular expressions for each non-terminal and implementing a LL(1) parser on those non-terminals. This would spare me character-based parsing and lexical ambiguities, plus this would still allow for some sane error messages.

zafarkhaja commented 6 months ago

Closing for now. Will revisit when it comes to refactoring the parsers.