Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Idiots don't know how to parse...

Name: Cudder !cXCudderUE 2015-11-13 8:45

http://stackoverflow.com/questions/28256/equation-expression-parser-with-precedence

WTF? The accepted answer is from someone who thinks recursive descent is "hard" and a ridiculously bloated parser-generator is "easy"? Pure bisonshit! Almost every real (and toy) compiler uses some variant of recursive-descent. Even GCC, which would probably be the biggest user of Bison, moved to recursive-descent years ago.

These aren't even programmers, these are Java-sipping codemonkeys who know next to nothing about how anything really works and can only parrow "reinventing the wheel" and other "enterprise best practices" bullshit.

Name: Anonymous 2015-12-04 11:08

>>47
The only tractable way to generate meaningful error messages giving suggested fixes in a non-accusatory tone (I EXPECTED A CLOSING BRACE HERE YOU FUCKING MEATBAG) is to special-case them. By definition you cannot do that generically.

At the very least you can collect _all_ things you could have expected, annotated with human-readable production names and sorted by priority (for example the rule that just consumed a terminal like "+" should be given priority).

Of course you could be doing that in your recursive descent parser too, in an ad-hoc, verbose, and awkward manner. I'm not sure I'd describe it as "tractable".

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List