OSDN Git Service

save point.
[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 MNode*  vectorDup (MNode* c);
19 MNode*  vectorEval (MNode* c, MlEnv* mlenv);
20 MNode*  tableDup (MNode* c);
21 MNode*  tableEval (MNode* c, MlEnv* mlenv);
22 double  eval_double (MNode* ptr, MlEnv* mlenv);
23 int  eval_int (MNode* ptr, MlEnv* mlenv);
24 int64_t  eval_int64 (MNode* ptr, MlEnv* mlenv);
25 ustring  eval_str (MNode* ptr, MlEnv* mlenv);
26 ustring  eval_text1 (MNode* cell, MlEnv* mlenv);
27 ustring  eval_asciiword (MNode* cell, MlEnv* mlenv);
28 bool  eval_bool (MNode* ptr, MlEnv* mlenv);
29 ustring  eval_file (MNode* cell, MlEnv* mlenv);
30 MNode*  progn (MNode* arg, MlEnv* mlenv);
31 void  progn_ex (MNode* arg, MlEnv* mlenv);
32 void  checkDefun (MNode* cell, ustring& rname, MNode*& sexp);
33 MNode*  newLambda (MNode* cell);
34 bool  isLambda (MNode* sexp);
35 MNode*  buildArgs (int start, const std::vector<ustring>& args);
36 MNode*  buildArgs (int start, const std::vector<ustring>& args, const ustring& arg2);
37 MNode*  buildArgs (const ustring& arg1);
38 bool  checkDefunArgs (MNode* lambda, MNode* values);
39 MNode*  execDefun (MlEnv* mlenv, MotorVar* pool, const ustring& name, MNode* values);
40 MNode*  execDefun (MlEnv* mlenv, MNode* sexp, MNode* values, const ustring& name);
41 void  onErrorFn (MNode* fn, MlEnv* mlenv);
42 void  setParams (MNode* list, int nparam, std::vector<MNode*>* params, paramList *kwlist, std::vector<MNode*>* keywords, MNode** rest, bool padding = false);
43
44 #endif /* EXPR_H */