PVS-Studio continues a series of webinars on how to create your own programming language using C++.
Previously, we discussed what a programming language is and its overall structure. This time, the talk host, Yuri Minaev, went a level deeper—into grammars.
What's the talk about?
A grammar consists of terminal and non-terminal symbols, production rules, and a starting point. Non-terminals define higher-level constructs in terms of other symbols, while terminals represent basic, indivisible elements like digits or characters.
Yuri explains how the way you design grammar determines how expressions are parsed and evaluated, including the associativity and priority of operations. He also introduces recursive definitions and explains how they form tree-like structures during parsing.
The webinar wraps up by connecting grammar theory to actual implementation, describing recursive descent parsing as a flexible and an easy to implement approach. It mirrors the grammar structure through functions, enabling the parser to process input from the top down and construct meaning step by step.
Learn more: How do compilers work?
Want more?
If you want to learn more and see the whole webinar, follow this link.
You can also sign up for the next webinar in the series: Let's make a programming language. Lexer. During the webinar, Yuri will walk you through what a lexer is and how it's actually implemented in code.
Don't worry if you missed our previous webinar sessions! You can watch them on our YouTube channel or website as well.
We hope to see you there!
Top comments (0)