rip out a couple hundred lines of code with inheritance
This commit is contained in:
parent
1e867f5760
commit
8b35434e6f
@ -83,6 +83,8 @@ namespace chaiscript
|
|||||||
AST_Node(const std::string &ast_node_text, int id, const char *fname) :
|
AST_Node(const std::string &ast_node_text, int id, const char *fname) :
|
||||||
text(ast_node_text), identifier(id), filename(fname)/*, is_cached(false)*/ { }
|
text(ast_node_text), identifier(id), filename(fname)/*, is_cached(false)*/ { }
|
||||||
|
|
||||||
|
virtual ~AST_Node() {}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
void cache_const(const Boxed_Value &value) {
|
void cache_const(const Boxed_Value &value) {
|
||||||
this->cached_value = value;
|
this->cached_value = value;
|
||||||
@ -115,282 +117,331 @@ namespace chaiscript
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct Binary_Operator_AST_Node : public AST_Node {
|
||||||
|
public:
|
||||||
|
Binary_Operator_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Bitwise_Xor, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
|
virtual ~Binary_Operator_AST_Node() {}
|
||||||
|
virtual Boxed_Value eval(Dispatch_Engine &ss);
|
||||||
|
};
|
||||||
|
|
||||||
struct Error_AST_Node : public AST_Node {
|
struct Error_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Error_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Error, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Error_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Error, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
|
|
||||||
|
virtual ~Error_AST_Node() {}
|
||||||
};
|
};
|
||||||
struct Int_AST_Node : public AST_Node {
|
struct Int_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Int_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Int, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Int_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Int, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~Int_AST_Node() {}
|
||||||
|
virtual Boxed_Value eval(Dispatch_Engine &ss);
|
||||||
};
|
};
|
||||||
struct Float_AST_Node : public AST_Node {
|
struct Float_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Float_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Float, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Float_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Float, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~Float_AST_Node() {}
|
||||||
|
virtual Boxed_Value eval(Dispatch_Engine &ss);
|
||||||
};
|
};
|
||||||
struct Id_AST_Node : public AST_Node {
|
struct Id_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Id_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Id, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Id_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Id, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~Id_AST_Node() {}
|
||||||
|
virtual Boxed_Value eval(Dispatch_Engine &ss);
|
||||||
};
|
};
|
||||||
struct Char_AST_Node : public AST_Node {
|
struct Char_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Char_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Char, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Char_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Char, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
|
virtual ~Char_AST_Node() {}
|
||||||
};
|
};
|
||||||
struct Str_AST_Node : public AST_Node {
|
struct Str_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Str_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Str, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Str_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Str, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
|
virtual ~Str_AST_Node() {}
|
||||||
};
|
};
|
||||||
struct Eol_AST_Node : public AST_Node {
|
struct Eol_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Eol_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Eol, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Eol_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Eol, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
|
virtual ~Eol_AST_Node() {}
|
||||||
};
|
};
|
||||||
struct Fun_Call_AST_Node : public AST_Node {
|
struct Fun_Call_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Fun_Call_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Fun_Call, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Fun_Call_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Fun_Call, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~Fun_Call_AST_Node() {}
|
||||||
|
virtual Boxed_Value eval(Dispatch_Engine &ss);
|
||||||
};
|
};
|
||||||
struct Inplace_Fun_Call_AST_Node : public AST_Node {
|
struct Inplace_Fun_Call_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Inplace_Fun_Call_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Inplace_Fun_Call, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Inplace_Fun_Call_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Inplace_Fun_Call, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~Inplace_Fun_Call_AST_Node() {}
|
||||||
|
virtual Boxed_Value eval(Dispatch_Engine &ss);
|
||||||
};
|
};
|
||||||
struct Arg_List_AST_Node : public AST_Node {
|
struct Arg_List_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Arg_List_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Arg_List, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Arg_List_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Arg_List, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
|
virtual ~Arg_List_AST_Node() {}
|
||||||
};
|
};
|
||||||
struct Variable_AST_Node : public AST_Node {
|
struct Variable_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Variable_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Variable, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Variable_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Variable, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
|
virtual ~Variable_AST_Node() {}
|
||||||
};
|
};
|
||||||
struct Equation_AST_Node : public AST_Node {
|
struct Equation_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Equation_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Equation, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Equation_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Equation, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~Equation_AST_Node() {}
|
||||||
|
virtual Boxed_Value eval(Dispatch_Engine &ss);
|
||||||
};
|
};
|
||||||
struct Var_Decl_AST_Node : public AST_Node {
|
struct Var_Decl_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Var_Decl_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Var_Decl, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Var_Decl_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Var_Decl, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~Var_Decl_AST_Node() {}
|
||||||
|
virtual Boxed_Value eval(Dispatch_Engine &ss);
|
||||||
};
|
};
|
||||||
struct Comparison_AST_Node : public AST_Node {
|
struct Comparison_AST_Node : public Binary_Operator_AST_Node {
|
||||||
public:
|
public:
|
||||||
Comparison_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Comparison, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Comparison_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Comparison, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
Binary_Operator_AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~Comparison_AST_Node() {}
|
||||||
};
|
};
|
||||||
struct Additive_AST_Node : public AST_Node {
|
struct Additive_AST_Node : public Binary_Operator_AST_Node {
|
||||||
public:
|
public:
|
||||||
Additive_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Additive, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Additive_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Additive, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
Binary_Operator_AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~Additive_AST_Node() {}
|
||||||
};
|
};
|
||||||
struct Multiplicative_AST_Node : public AST_Node {
|
struct Multiplicative_AST_Node : public Binary_Operator_AST_Node {
|
||||||
public:
|
public:
|
||||||
Multiplicative_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Multiplicative, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Multiplicative_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Multiplicative, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
Binary_Operator_AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~Multiplicative_AST_Node() {}
|
||||||
};
|
};
|
||||||
struct Array_Call_AST_Node : public AST_Node {
|
struct Array_Call_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Array_Call_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Array_Call, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Array_Call_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Array_Call, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~Array_Call_AST_Node() {}
|
||||||
|
virtual Boxed_Value eval(Dispatch_Engine &ss);
|
||||||
};
|
};
|
||||||
struct Dot_Access_AST_Node : public AST_Node {
|
struct Dot_Access_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Dot_Access_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Dot_Access, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Dot_Access_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Dot_Access, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~Dot_Access_AST_Node() {}
|
||||||
|
virtual Boxed_Value eval(Dispatch_Engine &ss);
|
||||||
};
|
};
|
||||||
struct Quoted_String_AST_Node : public AST_Node {
|
struct Quoted_String_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Quoted_String_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Quoted_String, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Quoted_String_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Quoted_String, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~Quoted_String_AST_Node() {}
|
||||||
|
virtual Boxed_Value eval(Dispatch_Engine &ss);
|
||||||
};
|
};
|
||||||
struct Single_Quoted_String_AST_Node : public AST_Node {
|
struct Single_Quoted_String_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Single_Quoted_String_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Single_Quoted_String, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Single_Quoted_String_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Single_Quoted_String, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~Single_Quoted_String_AST_Node() {}
|
||||||
|
virtual Boxed_Value eval(Dispatch_Engine &ss);
|
||||||
};
|
};
|
||||||
struct Lambda_AST_Node : public AST_Node {
|
struct Lambda_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Lambda_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Lambda, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Lambda_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Lambda, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~Lambda_AST_Node() {}
|
||||||
|
virtual Boxed_Value eval(Dispatch_Engine &ss);
|
||||||
};
|
};
|
||||||
struct Block_AST_Node : public AST_Node {
|
struct Block_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Block_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Block, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Block_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Block, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~Block_AST_Node() {}
|
||||||
|
virtual Boxed_Value eval(Dispatch_Engine &ss);
|
||||||
};
|
};
|
||||||
struct Def_AST_Node : public AST_Node {
|
struct Def_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Def_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Def, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Def_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Def, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~Def_AST_Node() {}
|
||||||
|
virtual Boxed_Value eval(Dispatch_Engine &ss);
|
||||||
};
|
};
|
||||||
struct While_AST_Node : public AST_Node {
|
struct While_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
While_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::While, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
While_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::While, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~While_AST_Node() {}
|
||||||
|
virtual Boxed_Value eval(Dispatch_Engine &ss);
|
||||||
};
|
};
|
||||||
struct If_AST_Node : public AST_Node {
|
struct If_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
If_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::If, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
If_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::If, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~If_AST_Node() {}
|
||||||
|
virtual Boxed_Value eval(Dispatch_Engine &ss);
|
||||||
};
|
};
|
||||||
struct For_AST_Node : public AST_Node {
|
struct For_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
For_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::For, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
For_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::For, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~For_AST_Node() {}
|
||||||
|
virtual Boxed_Value eval(Dispatch_Engine &ss);
|
||||||
};
|
};
|
||||||
struct Inline_Array_AST_Node : public AST_Node {
|
struct Inline_Array_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Inline_Array_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Inline_Array, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Inline_Array_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Inline_Array, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~Inline_Array_AST_Node() {}
|
||||||
|
virtual Boxed_Value eval(Dispatch_Engine &ss);
|
||||||
};
|
};
|
||||||
struct Inline_Map_AST_Node : public AST_Node {
|
struct Inline_Map_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Inline_Map_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Inline_Map, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Inline_Map_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Inline_Map, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~Inline_Map_AST_Node() {}
|
||||||
|
virtual Boxed_Value eval(Dispatch_Engine &ss);
|
||||||
};
|
};
|
||||||
struct Return_AST_Node : public AST_Node {
|
struct Return_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Return_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Return, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Return_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Return, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~Return_AST_Node() {}
|
||||||
|
virtual Boxed_Value eval(Dispatch_Engine &ss);
|
||||||
};
|
};
|
||||||
struct File_AST_Node : public AST_Node {
|
struct File_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
File_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::File, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
File_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::File, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~File_AST_Node() {}
|
||||||
|
virtual Boxed_Value eval(Dispatch_Engine &ss);
|
||||||
};
|
};
|
||||||
struct Prefix_AST_Node : public AST_Node {
|
struct Prefix_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Prefix_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Prefix, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Prefix_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Prefix, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~Prefix_AST_Node() {}
|
||||||
|
virtual Boxed_Value eval(Dispatch_Engine &ss);
|
||||||
};
|
};
|
||||||
struct Break_AST_Node : public AST_Node {
|
struct Break_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Break_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Break, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Break_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Break, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~Break_AST_Node() {}
|
||||||
|
virtual Boxed_Value eval(Dispatch_Engine &ss);
|
||||||
};
|
};
|
||||||
struct Map_Pair_AST_Node : public AST_Node {
|
struct Map_Pair_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Map_Pair_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Map_Pair, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Map_Pair_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Map_Pair, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
|
virtual ~Map_Pair_AST_Node() {}
|
||||||
};
|
};
|
||||||
struct Value_Range_AST_Node : public AST_Node {
|
struct Value_Range_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Value_Range_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Value_Range, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Value_Range_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Value_Range, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
|
virtual ~Value_Range_AST_Node() {}
|
||||||
};
|
};
|
||||||
struct Inline_Range_AST_Node : public AST_Node {
|
struct Inline_Range_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Inline_Range_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Inline_Range, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Inline_Range_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Inline_Range, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~Inline_Range_AST_Node() {}
|
||||||
|
virtual Boxed_Value eval(Dispatch_Engine &ss);
|
||||||
};
|
};
|
||||||
struct Annotation_AST_Node : public AST_Node {
|
struct Annotation_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Annotation_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Annotation, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Annotation_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Annotation, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
|
virtual ~Annotation_AST_Node() {}
|
||||||
};
|
};
|
||||||
struct Try_AST_Node : public AST_Node {
|
struct Try_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Try_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Try, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Try_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Try, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~Try_AST_Node() {}
|
||||||
|
virtual Boxed_Value eval(Dispatch_Engine &ss);
|
||||||
};
|
};
|
||||||
struct Catch_AST_Node : public AST_Node {
|
struct Catch_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Catch_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Catch, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Catch_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Catch, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
|
virtual ~Catch_AST_Node() {}
|
||||||
};
|
};
|
||||||
struct Finally_AST_Node : public AST_Node {
|
struct Finally_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Finally_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Finally, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Finally_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Finally, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
|
virtual ~Finally_AST_Node() {}
|
||||||
};
|
};
|
||||||
struct Method_AST_Node : public AST_Node {
|
struct Method_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Method_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Method, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Method_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Method, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~Method_AST_Node() {}
|
||||||
|
virtual Boxed_Value eval(Dispatch_Engine &ss);
|
||||||
};
|
};
|
||||||
struct Attr_Decl_AST_Node : public AST_Node {
|
struct Attr_Decl_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Attr_Decl_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Attr_Decl, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Attr_Decl_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Attr_Decl, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~Attr_Decl_AST_Node() {}
|
||||||
|
virtual Boxed_Value eval(Dispatch_Engine &ss);
|
||||||
};
|
};
|
||||||
struct Shift_AST_Node : public AST_Node {
|
struct Shift_AST_Node : public Binary_Operator_AST_Node {
|
||||||
public:
|
public:
|
||||||
Shift_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Shift, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Shift_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Shift, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
Binary_Operator_AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~Shift_AST_Node() {}
|
||||||
};
|
};
|
||||||
struct Equality_AST_Node : public AST_Node {
|
struct Equality_AST_Node : public Binary_Operator_AST_Node {
|
||||||
public:
|
public:
|
||||||
Equality_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Equality, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Equality_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Equality, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
Binary_Operator_AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~Equality_AST_Node() {}
|
||||||
};
|
};
|
||||||
struct Bitwise_And_AST_Node : public AST_Node {
|
struct Bitwise_And_AST_Node : public Binary_Operator_AST_Node {
|
||||||
public:
|
public:
|
||||||
Bitwise_And_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Bitwise_And, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Bitwise_And_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Bitwise_And, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
Binary_Operator_AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~Bitwise_And_AST_Node() {}
|
||||||
};
|
};
|
||||||
struct Bitwise_Xor_AST_Node : public AST_Node {
|
struct Bitwise_Xor_AST_Node : public Binary_Operator_AST_Node {
|
||||||
public:
|
public:
|
||||||
Bitwise_Xor_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Bitwise_Xor, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Bitwise_Xor_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Bitwise_Xor, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
Binary_Operator_AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~Bitwise_Xor_AST_Node() {}
|
||||||
};
|
};
|
||||||
struct Bitwise_Or_AST_Node : public AST_Node {
|
struct Bitwise_Or_AST_Node : public Binary_Operator_AST_Node {
|
||||||
public:
|
public:
|
||||||
Bitwise_Or_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Bitwise_Or, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Bitwise_Or_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Bitwise_Or, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
Binary_Operator_AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~Bitwise_Or_AST_Node() {}
|
||||||
};
|
};
|
||||||
struct Logical_And_AST_Node : public AST_Node {
|
struct Logical_And_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Logical_And_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Logical_And, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Logical_And_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Logical_And, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~Logical_And_AST_Node() {}
|
||||||
|
virtual Boxed_Value eval(Dispatch_Engine &ss);
|
||||||
};
|
};
|
||||||
struct Logical_Or_AST_Node : public AST_Node {
|
struct Logical_Or_AST_Node : public AST_Node {
|
||||||
public:
|
public:
|
||||||
Logical_Or_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Logical_Or, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
Logical_Or_AST_Node(const std::string &ast_node_text = "", int id = AST_Node_Type::Logical_Or, const char *fname = NULL, int start_line = 0, int start_col = 0, int end_line = 0, int end_col = 0) :
|
||||||
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
AST_Node(ast_node_text, id, fname, start_line, start_col, end_line, end_col) { }
|
||||||
Boxed_Value eval(Dispatch_Engine &ss);
|
virtual ~Logical_Or_AST_Node() {}
|
||||||
|
virtual Boxed_Value eval(Dispatch_Engine &ss);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -347,196 +347,7 @@ namespace chaiscript
|
|||||||
/**
|
/**
|
||||||
* Evaluates comparison, additions, and multiplications and their relatives
|
* Evaluates comparison, additions, and multiplications and their relatives
|
||||||
*/
|
*/
|
||||||
Boxed_Value Bitwise_And_AST_Node::eval(Dispatch_Engine &ss) {
|
Boxed_Value Binary_Operator_AST_Node::eval(Dispatch_Engine &ss) {
|
||||||
unsigned int i;
|
|
||||||
Boxed_Value retval;
|
|
||||||
|
|
||||||
try {
|
|
||||||
retval = this->children[0]->eval(ss);
|
|
||||||
}
|
|
||||||
catch (Eval_Error &ee) {
|
|
||||||
ee.call_stack.push_back(this->children[0]);
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 1; i < this->children.size(); i += 2) {
|
|
||||||
try {
|
|
||||||
retval = ss.call_function(this->children[i]->text, retval, this->children[i+1]->eval(ss));
|
|
||||||
}
|
|
||||||
catch(const dispatch_error &){
|
|
||||||
throw Eval_Error("Can not find appropriate '" + this->children[i]->text + "'");
|
|
||||||
}
|
|
||||||
catch(Eval_Error &ee) {
|
|
||||||
ee.call_stack.push_back(this->children[i+1]);
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
Boxed_Value Bitwise_Xor_AST_Node::eval(Dispatch_Engine &ss) {
|
|
||||||
unsigned int i;
|
|
||||||
Boxed_Value retval;
|
|
||||||
|
|
||||||
try {
|
|
||||||
retval = this->children[0]->eval(ss);
|
|
||||||
}
|
|
||||||
catch (Eval_Error &ee) {
|
|
||||||
ee.call_stack.push_back(this->children[0]);
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 1; i < this->children.size(); i += 2) {
|
|
||||||
try {
|
|
||||||
retval = ss.call_function(this->children[i]->text, retval, this->children[i+1]->eval(ss));
|
|
||||||
}
|
|
||||||
catch(const dispatch_error &){
|
|
||||||
throw Eval_Error("Can not find appropriate '" + this->children[i]->text + "'");
|
|
||||||
}
|
|
||||||
catch(Eval_Error &ee) {
|
|
||||||
ee.call_stack.push_back(this->children[i+1]);
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
Boxed_Value Bitwise_Or_AST_Node::eval(Dispatch_Engine &ss) {
|
|
||||||
unsigned int i;
|
|
||||||
Boxed_Value retval;
|
|
||||||
|
|
||||||
try {
|
|
||||||
retval = this->children[0]->eval(ss);
|
|
||||||
}
|
|
||||||
catch (Eval_Error &ee) {
|
|
||||||
ee.call_stack.push_back(this->children[0]);
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 1; i < this->children.size(); i += 2) {
|
|
||||||
try {
|
|
||||||
retval = ss.call_function(this->children[i]->text, retval, this->children[i+1]->eval(ss));
|
|
||||||
}
|
|
||||||
catch(const dispatch_error &){
|
|
||||||
throw Eval_Error("Can not find appropriate '" + this->children[i]->text + "'");
|
|
||||||
}
|
|
||||||
catch(Eval_Error &ee) {
|
|
||||||
ee.call_stack.push_back(this->children[i+1]);
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
Boxed_Value Additive_AST_Node::eval(Dispatch_Engine &ss) {
|
|
||||||
unsigned int i;
|
|
||||||
Boxed_Value retval;
|
|
||||||
|
|
||||||
try {
|
|
||||||
retval = this->children[0]->eval(ss);
|
|
||||||
}
|
|
||||||
catch (Eval_Error &ee) {
|
|
||||||
ee.call_stack.push_back(this->children[0]);
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 1; i < this->children.size(); i += 2) {
|
|
||||||
try {
|
|
||||||
retval = ss.call_function(this->children[i]->text, retval, this->children[i+1]->eval(ss));
|
|
||||||
}
|
|
||||||
catch(const dispatch_error &){
|
|
||||||
throw Eval_Error("Can not find appropriate '" + this->children[i]->text + "'");
|
|
||||||
}
|
|
||||||
catch(Eval_Error &ee) {
|
|
||||||
ee.call_stack.push_back(this->children[i+1]);
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
Boxed_Value Multiplicative_AST_Node::eval(Dispatch_Engine &ss) {
|
|
||||||
unsigned int i;
|
|
||||||
Boxed_Value retval;
|
|
||||||
|
|
||||||
try {
|
|
||||||
retval = this->children[0]->eval(ss);
|
|
||||||
}
|
|
||||||
catch (Eval_Error &ee) {
|
|
||||||
ee.call_stack.push_back(this->children[0]);
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 1; i < this->children.size(); i += 2) {
|
|
||||||
try {
|
|
||||||
retval = ss.call_function(this->children[i]->text, retval, this->children[i+1]->eval(ss));
|
|
||||||
}
|
|
||||||
catch(const dispatch_error &){
|
|
||||||
throw Eval_Error("Can not find appropriate '" + this->children[i]->text + "'");
|
|
||||||
}
|
|
||||||
catch(Eval_Error &ee) {
|
|
||||||
ee.call_stack.push_back(this->children[i+1]);
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
Boxed_Value Comparison_AST_Node::eval(Dispatch_Engine &ss) {
|
|
||||||
unsigned int i;
|
|
||||||
Boxed_Value retval;
|
|
||||||
|
|
||||||
try {
|
|
||||||
retval = this->children[0]->eval(ss);
|
|
||||||
}
|
|
||||||
catch (Eval_Error &ee) {
|
|
||||||
ee.call_stack.push_back(this->children[0]);
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 1; i < this->children.size(); i += 2) {
|
|
||||||
try {
|
|
||||||
retval = ss.call_function(this->children[i]->text, retval, this->children[i+1]->eval(ss));
|
|
||||||
}
|
|
||||||
catch(const dispatch_error &){
|
|
||||||
throw Eval_Error("Can not find appropriate '" + this->children[i]->text + "'");
|
|
||||||
}
|
|
||||||
catch(Eval_Error &ee) {
|
|
||||||
ee.call_stack.push_back(this->children[i+1]);
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
Boxed_Value Equality_AST_Node::eval(Dispatch_Engine &ss) {
|
|
||||||
unsigned int i;
|
|
||||||
Boxed_Value retval;
|
|
||||||
|
|
||||||
try {
|
|
||||||
retval = this->children[0]->eval(ss);
|
|
||||||
}
|
|
||||||
catch (Eval_Error &ee) {
|
|
||||||
ee.call_stack.push_back(this->children[0]);
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 1; i < this->children.size(); i += 2) {
|
|
||||||
try {
|
|
||||||
retval = ss.call_function(this->children[i]->text, retval, this->children[i+1]->eval(ss));
|
|
||||||
}
|
|
||||||
catch(const dispatch_error &){
|
|
||||||
throw Eval_Error("Can not find appropriate '" + this->children[i]->text + "'");
|
|
||||||
}
|
|
||||||
catch(Eval_Error &ee) {
|
|
||||||
ee.call_stack.push_back(this->children[i+1]);
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
Boxed_Value Shift_AST_Node::eval(Dispatch_Engine &ss) {
|
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
Boxed_Value retval;
|
Boxed_Value retval;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user