erlang %%数学解析器

%%数学解析器 例:"A = 1+2*3+math:sqrt(4)."
test(S) ->
 {ok,Scanned,_} = erl_scan:string(S),
 {ok,Parsed} = erl_parse:parse_exprs(Scanned),
 erl_eval:exprs(Parsed, []).

posted on 2014-08-21 16:23  Vinlan  阅读(193)  评论(0)    收藏  举报

导航