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, []).
%%数学解析器 例:"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, []).