用户输入的格式为 a:b>c>d>e... 等等。我想将输入解析为 :(a,>(b,>(c,>(d,e))) 这可能吗?有什么建议吗?我用这个进行了测试
prepare:-
op(750,xfx,user:(:)), % change the default priority of : and >
op(700,xfx,user:(>)),
display(a: b > c),%this one worked fine and
%the display value is :(a,>(b,c))
display(a: b > c > d ). % I cannot have this works,
%the error ERROR:
%Syntax error:
%Operator priority clash is thrown.
无法修改输入。任何建议都值得赞赏。谢谢!