September 2017
Beginner
402 pages
9h 52m
English
Perl 6 has brought out an extremely useful and powerful mechanism to accomplish regexes—grammars.
Grammars are a mini-language inside Perl 6 that allows you to describe the rules of other languages (including Perl 6 itself). With grammars, it is quite easy to create a parser, a translator, or a compiler of a domain-specific language (DSL) or a programming language, or even a parser that can work with human languages.
In this chapter, we will be learning Perl 6's grammars by way of creating a compiler for the subset of Perl 6. The following topics will be covered in this chapter:
Read now
Unlock full access