如何使用指定的语法解析Java中的String?
我们说我有这个eBNF语法:
object = "O:", natural_number, ":", value, ":", natural_number, ":{", { element }, "}";
value = '"' , character , { character } , '"';
element = string | boolean | array | empty_element, ";" ;
empty_element = "N" ;
string = "s:", natural_number, ":", value ;
boolean = "b:". "0" | "1" ;
array = "a:" ;
etc. etc. won't specify it in full here
如何让Java处理将这样的String解析为可用的树?