def parse_eval(grammar, text): solver = make_solver() exp = make_parse_statement(grammar, text) sexp = to_sexpression(exp) exp = solver.eval(sexp) # Do not need the second eval any more, with the rule 'eval_parse_result'. if isinstance(exp, Cons): exp = cons2tuple(exp) return solver.eval(exp) #sexpression2daoexpression
def parse_eval(grammar, text): solver = make_solver() exp = make_parse_statement(grammar, text) sexp = to_sexpression(exp) exp = solver.eval(sexp) # Do not need the second eval any more, with the rule 'eval_parse_result'. if isinstance(exp, Cons): exp = cons2tuple(exp) return solver.eval(exp)#sexpression2daoexpression
def eval(exp): exp = preparse(exp) sexp = to_sexpression(exp) return make_solver().eval(sexp)
def parse(grammar, text): solver = make_solver() exp = make_parse_statement(grammar, text) sexp = to_sexpression(exp) return solver.eval(exp)
def teval(text): solver = make_solver(global_env, global_env.extend(), None, None) exp = parse_text(grammar, text) return solver.eval(exp)