In this chapter, we discussed grammars, the leading new feature of Perl 6. Grammars allow building parsers for your own domain-specific languages and are already built-in to the language, so no external modules are required to start using them.
Using the example of a compiler of the subset of Perl 6, we created a grammar and looked at its elements—rules and tokens. Later we updated the grammar with actions and finally moved the actions into a separate class to make the code more maintainable and clean.
In the next chapters, we will talk about concurrent, reactive, and functional programming in Perl 6.