我正在寻找一种编写 Treetop 规则的方法,该规则将以任何顺序找到一些值。所以:
rule top
# ?
end
rule gender
('women'/'men') / ''
end
rule age_under
('under' age) / ''
end
rule age
[0-9]+
end
我想解析这些输入:
"women under 10"
"under 10 women"
"under 10"
"women"
我怎样才能做到这一点?谢谢