I am looking for source codes of parsers and/or parser generators that could be studied in order to develop further, my skills that I acquired during a school course. Do you know any recommendable parsers of any type?
Examples include LL parsers and recursive-descent parsers. Top-down parsing is also called predictive parsing or recursive parsing. Bottom-Up Parsing: Involves rewriting the input back to the start symbol.
Pantsing (also known as winging it) is the term Wrimos use refer to writing without a fixed outline (an outline that the writer will force themselves to follow). A Wrimo who adopts the pantsing approach to writing is called a pantser.
You should know how to build recursive descent parsers by hand. Here's an SO link to a quick lesson on how to do this: https://stackoverflow.com/a/2336769/120163
If you want to understand how recursive descent parsers can be constructed automatically, you can read a paper (and see a tutorial) on MetaII at this link: https://stackoverflow.com/a/1142034/120163
Check the examples, and good luck.
Edit:
I guess I should comment. A parser
is a program which processes an input and "understands" it. A parser generator
is a tool used to write parsers. I guess you mean you want to learn more about generating parsers, in which case, you should refer to the documentation of parser generators (all of the above).
Parsers themselves are usually not that interesting, it's the generators of parsers that are more of a subject of study.
If LALR(1) interests you, I have a library up on github that tries to do a new number on LALR parsing. Feel free to take a look. It's in C# and I've tried my finest to make the code comprehensible. It's been a learning project for me, but it's smaller than the big tools and a bit easier to penetrate. And definitely feel free to contribute, lots of features to add still.
Otherwise, take a look at the generated code of these tools to see how they build the actual parsers that do the work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With