Newick 树格式

作者:Lucien Grondin

参见 https://en.wikipedia.org/wiki/Newick_format

源代码: Newick.pm

use v6;

grammar Newick {
    rule TOP { '(' <subtree>** 2..3 % \, ');' }
    rule subtree { <species> | '(' <subtree>** 2 % \, ')' }
    token species { <.ident>+ }
}