Course of Raku / Regexes and grammars / Grammars
Grammars, classes, and inheritance
A grammar is really a kind of class, and its tokens are really methods. That is not just an analogy — it means grammars can use the object-oriented tools you already know: one grammar can inherit from another and override individual tokens.
This section shows that relationship, and introduces proto tokens, the grammar way of writing an alternation across several named variants.
Topics in this section
Practice
Complete the quizzes that cover the contents of this section.
Exercises
This section contains 3 exercises. Examine all the topics of this section before doing the coding practice.