This is exactly why you shouldn't let interns give talks, they give really bad advice, because they don't know any better. When new to parsers, the absolute worst thing you can do is to use regular expressions you copy-pasta'd off of stack overflow, and outsource your own job to a tool like YACC. Here's an amazing video on building a parser using recursive descent, and you'll learn how to create and describe your own grammar if you ever end up doing something like this in an actual production application. ruclips.net/video/SToUyjAsaFk/видео.html
With respect to using YACC: that is exactly what you should do. Writing a lexer is more straight forward. Writing a parser is more complicated. That is why compiler compilers (the CC in "YACC") were created. Sure, if you use a recursive descent parser on a simple grammar you can probably succeed, but YACC is a better option if you are using, say, an LR parser. "Rolling your own" parser is a great way to learn something, but if you are actually creating a non-trivial language and you want production quality, you should be using a parse generator like YACC.
@@nonconsensualopinion It depends on the project, but I've written such a thing for General Electric that is in production, and surprise is that it wasn't that hard. Using YACC is just overengineering for most projects and you're now dependent on YACC when you don't need to be .
This is exactly why you shouldn't let interns give talks, they give really bad advice, because they don't know any better. When new to parsers, the absolute worst thing you can do is to use regular expressions you copy-pasta'd off of stack overflow, and outsource your own job to a tool like YACC. Here's an amazing video on building a parser using recursive descent, and you'll learn how to create and describe your own grammar if you ever end up doing something like this in an actual production application. ruclips.net/video/SToUyjAsaFk/видео.html
Thanks for sharing that link, it's a really good resource!!
With respect to using YACC: that is exactly what you should do. Writing a lexer is more straight forward. Writing a parser is more complicated. That is why compiler compilers (the CC in "YACC") were created. Sure, if you use a recursive descent parser on a simple grammar you can probably succeed, but YACC is a better option if you are using, say, an LR parser. "Rolling your own" parser is a great way to learn something, but if you are actually creating a non-trivial language and you want production quality, you should be using a parse generator like YACC.
@@nonconsensualopinion It depends on the project, but I've written such a thing for General Electric that is in production, and surprise is that it wasn't that hard. Using YACC is just overengineering for most projects and you're now dependent on YACC when you don't need to be
.
Not a bad talk, I would have appreciated a talk more from a standpoint of someone who doesn't have a history of writing parsers though.
GitHub: github.com/slrtbtfs/goyacc-tutorial
Bruh