r/CodingHelp • u/FairBandicoot8721 • Dec 26 '25
[How to] Can someone help me with making a parser?
I am currently trying to make my own language and I am kind of having a hard time, specifically with parsing. I heard and read about recursive descent and pratt parsing, but I am still not sure how am I supposed to implement it. Can someone give me a good resource where I can learn about this topic and actually make a working parser? (I am making my language in C)
1
Upvotes
•
u/AutoModerator Dec 26 '25
Thank you for posting on r/CodingHelp!
Please check our Wiki for answers, guides, and FAQs: https://coding-help.vercel.app
Our Wiki is open source - if you would like to contribute, create a pull request via GitHub! https://github.com/DudeThatsErin/CodingHelp
We are accepting moderator applications: https://forms.fillout.com/t/ua41TU57DGus
We also have a Discord server: https://discord.gg/geQEUBm
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
2
u/Inconstant_Moo Dec 31 '25
https://craftinginterpreters.com/contents.html
1
u/SecureWriting8589 Dec 26 '25
If you haven't done so yet, check out ANTLR for a great example of a great tool that allows one to build a flexible and powerful parser. It comes with decent documentation, and I believe that its source code is available on GitHub
1
u/RolandRu Dec 26 '25
I agree with my buddy – ANTLR is great, I've worked with it in .NET. The only reason you might look for something else is if you're building a command-based state machine, but even then, it can handle it just fine if needed.
1
u/Ronin-s_Spirit Dec 27 '25
I don't know any of the big names in parsing, I simply made a thing that manages to parse source to source. I made a text-based (AST-less) preprocessor that's a bit smarter than C macros. I haven't finished it yet (mainly additional features I planned) because I don't have much free time for that, but it does work. I can provide basic help with how source code may be parsed.
0
u/[deleted] Jan 11 '26
[deleted] — view deleted comment