Пример #1
0
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
Пример #2
0
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
Пример #3
0
def eval(exp):
  exp = preparse(exp)
  sexp = to_sexpression(exp)
  return make_solver().eval(sexp)
Пример #4
0
def parse(grammar, text):
    solver = make_solver()
    exp = make_parse_statement(grammar, text)
    sexp = to_sexpression(exp)
    return solver.eval(exp)
Пример #5
0
def parse(grammar, text):
  solver = make_solver()
  exp = make_parse_statement(grammar, text)
  sexp = to_sexpression(exp)
  return solver.eval(exp)
Пример #6
0
def eval(exp):
    exp = preparse(exp)
    sexp = to_sexpression(exp)
    return make_solver().eval(sexp)
Пример #7
0
def teval(text):
  solver = make_solver(global_env, global_env.extend(), None, None)
  exp = parse_text(grammar, text)
  return solver.eval(exp)