How can I find programmatically all the classes, grammars, and roles in a Raku package? (Specified with a string.)
I examined discussions/posts similar to the ones linked below, but the code I came up with is very hard to use. (And does not do the job.)
Meta-programming: what, why and how (perl6advent)
Day 19 – Introspection (perl6advent)
How do I access a module's symbol table dynamically at runtime in Raku? (stackoverflow)
Is there a way to get a list of all known types in a Perl 6 program? (stackoverflow)
Motivation
I would like to automatically generate UML class diagrams for Raku packages.
See the PlantUML diagrams for the Raku package: ML::StreamsBlendingRecommender.
I considered the steps:
Design parser(s) of the code of classes in software packages made with languages like C++, Java, Kotlin, Raku
Generate the corresponding PlantUML code over the parsing results
(Such parsers might not be that hard to derive. Probably, the work of DrForr provides good starts.)
But given Raku's introspection abilities, instead of parsing Raku code I should be able to "just" traverse package namespaces and classes. (Instead of making a parser.)
