Course of Raku / Regexes and grammars / Grammars / Action classes / Exercises

An upper-case action

Problem

Write a grammar that matches a single word (one or more word characters). Write an action class whose TOP method makes the upper-case form of the word. Parse 'hello' with the action class and print .made.

Example

The program prints:

HELLO

Solution

See the solution

Course navigation

Solution: One grammar, two actions   |   Solution: An upper-case action