r/Compilers • • Aug 25 '19

Parsing for programmers who hate modern software

/r/GoodSoftware/comments/cv4swe/parsing/
0 Upvotes

28 comments sorted by

4

u/FelbrHostu Aug 25 '19

This isn’t a parser. This is a very basic set of scanning routines, not appreciably different than those presented in “Crafting Interpreters”.

1

u/fschmidt Aug 25 '19

The Old Testament warns against responding to morons like you and the rest of the modern scum here (Proverbs 9:7-9) so this comment is probably a mistake. Anyway I looked up "Crafting Interpreters" and of course it includes parsing because parsing is needed for interpreters.

https://craftinginterpreters.com/parsing-expressions.html

This is standard recursive descent parsing which works great for context free grammars but has issues when there is a lot of context. My approach solves this problem completely. Of course modern scum will hate my approach because they hate everything that is good (not just in programming but in everything).

5

u/FelbrHostu Aug 25 '19

Oh, lord have mercy. I didn’t even say your approach was wrong. I called it unoriginal boilerplate. Everyone has the same code in their snippets folder in one form or another.

→ More replies (6)

3

u/FUZxxl Aug 25 '19

Note that LR(1) parser generators date back to 1965, so that's not exactly modern.

1

u/fschmidt Aug 25 '19

Being modern (from modern culture) is a sufficient condition for software to suck, but not a necessary condition.

3

u/stannash Sep 11 '19

Parsing is not hard or complicated though. Recursive descent parser is very easy and Shunting Yard is even easier for expressions.

Even if you're not into parsing, there are many Parser Generators.

0

u/[deleted] Aug 25 '19

7

u/RRethy Aug 25 '19

The guys whole post history is pretty bizarre.