OSDN Git Service

on-error option.
[hmh/hhml.git] / lib / expr.h
1 #ifndef EXPR_H
2 #define EXPR_H
3
4 #include "ml.h"
5 #include "ustring.h"
6 #include <vector>
7
8 class  MlEnv;
9 class  MotorVar;
10
11 typedef struct {
12     const char*  name;
13     size_t  namelen;
14     bool  fbool;
15 }  paramList;
16
17 MNode*  eval (MNode* ptr, MlEnv* mlenv);
18 double  eval_double (MNode* ptr, MlEnv* mlenv);
19 int  eval_int (MNode* ptr, MlEnv* mlenv);
20 ustring  eval_str (MNode* ptr, MlEnv* mlenv);
21 ustring  eval_text1 (MNode* cell, MlEnv* mlenv);
22 ustring  eval_asciiword (MNode* cell, MlEnv* mlenv);
23 bool  eval_bool (MNode* ptr, MlEnv* mlenv);
24 ustring  eval_file (MNode* cell, MlEnv* mlenv);
25 MNode*  progn (MNode* arg, MlEnv* mlenv);
26 void  progn_ex (MNode* arg, MlEnv* mlenv);
27 void  checkDefun (MNode* cell, ustring& rname, MNode*& sexp);
28 MNode*  newLambda (MNode* cell);
29 bool  isLambda (MNode* sexp);
30 MNode*  buildArgs (int start, const std::vector<ustring>& args);
31 MNode*  buildArgs (int start, const std::vector<ustring>& args, const ustring& arg2);
32 MNode*  buildArgs (const ustring& arg1);
33 bool  checkDefunArgs (MNode* lambda, MNode* values);
34 MNode*  execDefun (MlEnv* mlenv, MotorVar* pool, const ustring& name, MNode* values);
35 MNode*  execDefun (MlEnv* mlenv, MNode* sexp, MNode* values, const ustring& name);
36 void  onErrorFn (MNode* fn, MlEnv* mlenv);
37 void  setParams (MNode* list, int nparam, std::vector<MNode*>* params, paramList *kwlist, std::vector<MNode*>* keywords, MNode** rest, bool padding = false);
38
39 #endif /* EXPR_H */