这与
this question on accesing the POD有关,但它远不止于此.你可以使用
easily access the Abstract Syntax Tree of a Perl 6 program:
perl6 --target=ast -e '"Þor is mighty!".say'
这将打印整个Q抽象语法树.如何从你自己的程序中做到这一点还不太清楚,或者我还没有找到如何做到这一点.实际上,the CoreHackers::Q
module将其作为外部脚本运行.但是能够从你自己的程序中访问它,比如
use QAST; # It does not exist my $this-qast = QAST::Load("some-external-file.p6") # Would want something like this
会很好.我很确定它应该是可能的,在NQP级别并且可能以Rakudo依赖的方式.有人知道热吗?