diff --git a/Sencha-lang/AST/ASTNode.h b/Sencha-lang/AST/ASTNode.h index f774ae3..4092669 100644 --- a/Sencha-lang/AST/ASTNode.h +++ b/Sencha-lang/AST/ASTNode.h @@ -21,7 +21,6 @@ public: virtual void accept(Visitor * visitor){ visitor->visit(this); }; virtual SenchaObject evaluate() = 0; - virtual std::string debug() = 0; virtual void execute() = 0; virtual ~ASTNode(); }; diff --git a/Sencha-lang/AST/BasicExpression.cpp b/Sencha-lang/AST/BasicExpression.cpp index b778aae..779c007 100644 --- a/Sencha-lang/AST/BasicExpression.cpp +++ b/Sencha-lang/AST/BasicExpression.cpp @@ -132,12 +132,3 @@ void BasicExpression::accept(Visitor * visitor) visitor->visit(this); } -std::string BasicExpression::debug() -{ - std::string debug_note = "Basic expression:\n"; - debug_note += "left operand: \n"; - debug_note += this->children[0]->debug(); - debug_note += "\nright operand:\n" + this->children[1]->debug(); - debug_note += "\nOperator: " + this->oper +"\n###\n"; - return debug_note; -} diff --git a/Sencha-lang/AST/BasicExpression.h b/Sencha-lang/AST/BasicExpression.h index e946ae9..47c8484 100644 --- a/Sencha-lang/AST/BasicExpression.h +++ b/Sencha-lang/AST/BasicExpression.h @@ -19,7 +19,6 @@ public: virtual void execute(); virtual void execute_quietly(); std::string get_operator() { return oper; } - std::string debug() ; virtual void accept(Visitor * visitor); BasicExpression(ASTNode * parent); diff --git a/Sencha-lang/AST/BasicStatement.cpp b/Sencha-lang/AST/BasicStatement.cpp index bcdd5a7..16848fe 100644 --- a/Sencha-lang/AST/BasicStatement.cpp +++ b/Sencha-lang/AST/BasicStatement.cpp @@ -25,10 +25,6 @@ void BasicStatement::add_expression(ASTExpression * expr) children.push_back(expr); } -std::string BasicStatement::debug() -{ - return "Basic statement with expression:\n" + children[0]->debug() + "\n;\n"; -} void BasicStatement::execute() { diff --git a/Sencha-lang/AST/BasicStatement.h b/Sencha-lang/AST/BasicStatement.h index 840a8e6..502cab0 100644 --- a/Sencha-lang/AST/BasicStatement.h +++ b/Sencha-lang/AST/BasicStatement.h @@ -15,7 +15,6 @@ class BasicStatement : public ASTStatement { public: BasicStatement(ASTNode * parent); - virtual std::string debug(); void add_expression(ASTExpression * expr); virtual SenchaObject evaluate(); virtual void execute(); diff --git a/Sencha-lang/AST/ConstantExpression.cpp b/Sencha-lang/AST/ConstantExpression.cpp index ec8cbd5..4f80a4a 100644 --- a/Sencha-lang/AST/ConstantExpression.cpp +++ b/Sencha-lang/AST/ConstantExpression.cpp @@ -62,5 +62,3 @@ ConstantExpression::ConstantExpression(ASTNode * parent, std::string text) this->type = "ConstantExpression"; this->parent = parent; value = SenchaObject(text); } - -std::string ConstantExpression::debug() { return "Constant expression:\n" + value.repr() + "\n"; } diff --git a/Sencha-lang/AST/ConstantExpression.h b/Sencha-lang/AST/ConstantExpression.h index a728efd..aba07d8 100644 --- a/Sencha-lang/AST/ConstantExpression.h +++ b/Sencha-lang/AST/ConstantExpression.h @@ -62,9 +62,6 @@ public: /** Here's value of constant expression */ SenchaObject value; - /** Provides some useful information */ - std::string debug(); - /** Implements visitor pattern */ virtual void accept(Visitor * visitor); diff --git a/Sencha-lang/AST/DeclarationStatement.cpp b/Sencha-lang/AST/DeclarationStatement.cpp index bcfb5c4..c364175 100644 --- a/Sencha-lang/AST/DeclarationStatement.cpp +++ b/Sencha-lang/AST/DeclarationStatement.cpp @@ -37,12 +37,6 @@ DeclarationStatement::DeclarationStatement(ASTNode * parent, Context * context) this->type = "DeclarationStatement"; } -std::string DeclarationStatement::debug() -{ - std::string debug_note = "Declaration"; - return debug_note; -} - void DeclarationStatement::add_name(std::string name) { this->name = name; diff --git a/Sencha-lang/AST/DeclarationStatement.h b/Sencha-lang/AST/DeclarationStatement.h index 573dc38..d8b7061 100644 --- a/Sencha-lang/AST/DeclarationStatement.h +++ b/Sencha-lang/AST/DeclarationStatement.h @@ -25,7 +25,6 @@ public: void add_right_value(ASTExpression * right); DeclarationStatement(ASTNode * parent, Context * context); - virtual std::string debug(); void add_name(std::string); diff --git a/Sencha-lang/AST/IfNode.cpp b/Sencha-lang/AST/IfNode.cpp index ba80f3d..bf84f7d 100644 --- a/Sencha-lang/AST/IfNode.cpp +++ b/Sencha-lang/AST/IfNode.cpp @@ -14,16 +14,6 @@ IfNode::IfNode(ASTNode * parent) { this->type = "IfNode"; } -std::string IfNode::debug() -{ - std::string debug_note; - debug_note = "If node, condition is: " + to_string(evaluate_condition()); - if(evaluate_condition()) - debug_note += "Doing first branch"; - else - debug_note += "Doing second branch"; - return debug_note; -} bool IfNode::evaluate_condition() { diff --git a/Sencha-lang/AST/IfNode.h b/Sencha-lang/AST/IfNode.h index 7cc0515..a8569bd 100644 --- a/Sencha-lang/AST/IfNode.h +++ b/Sencha-lang/AST/IfNode.h @@ -18,7 +18,6 @@ public: void add_body(ASTStatement * statement); void add_else_block(ASTStatement * statement); bool is_else; - virtual std::string debug(); virtual void execute(); bool evaluate_condition(); ASTNode * condition() { return children[0]; } diff --git a/Sencha-lang/AST/PostfixExpression.cpp b/Sencha-lang/AST/PostfixExpression.cpp index fb2345e..bbee8e2 100644 --- a/Sencha-lang/AST/PostfixExpression.cpp +++ b/Sencha-lang/AST/PostfixExpression.cpp @@ -46,9 +46,3 @@ void PostfixExpression::execute() { } - -std::string PostfixExpression::debug() -{ - //TODO implement it or something - return "Postfix expression tadadah!"; -} diff --git a/Sencha-lang/AST/PostfixExpression.h b/Sencha-lang/AST/PostfixExpression.h index a2b90a7..203d085 100644 --- a/Sencha-lang/AST/PostfixExpression.h +++ b/Sencha-lang/AST/PostfixExpression.h @@ -25,9 +25,6 @@ public: virtual void execute_quietly(){ execute(); }; - - std::string debug() ; - PostfixExpression(ASTNode * parent, Context * context); virtual ~PostfixExpression(); }; diff --git a/Sencha-lang/AST/ProgramNode.cpp b/Sencha-lang/AST/ProgramNode.cpp index d22de22..dd08876 100644 --- a/Sencha-lang/AST/ProgramNode.cpp +++ b/Sencha-lang/AST/ProgramNode.cpp @@ -43,16 +43,6 @@ SenchaObject ProgramNode::evaluate_last() return result; } -std::string ProgramNode::debug() -{ - std::string debug_note = "Program started debugging\n"; - - for (std::vector::iterator it = children.begin(); it!=children.end(); ++it) { - debug_note += (*it)->debug() + "\n"; - } - debug_note += "END\n"; - return debug_note; -} void ProgramNode::add_statement(ASTStatement * statement) { children.push_back(statement); diff --git a/Sencha-lang/AST/ProgramNode.h b/Sencha-lang/AST/ProgramNode.h index c54bf07..1c8fc42 100644 --- a/Sencha-lang/AST/ProgramNode.h +++ b/Sencha-lang/AST/ProgramNode.h @@ -14,7 +14,6 @@ class ProgramNode : public ASTNode { public: ProgramNode(); - std::string debug(); void add_statement(ASTStatement * statement); virtual ~ProgramNode(); virtual void execute(); diff --git a/Sencha-lang/AST/RepeatStatement.cpp b/Sencha-lang/AST/RepeatStatement.cpp index 404b13a..f39851c 100644 --- a/Sencha-lang/AST/RepeatStatement.cpp +++ b/Sencha-lang/AST/RepeatStatement.cpp @@ -39,10 +39,6 @@ void RepeatStatement::execute_quietly() } -std::string RepeatStatement::debug() -{ - return "Repeats!"; -} void RepeatStatement::add_iteration_number(SenchaObject so) { diff --git a/Sencha-lang/AST/RepeatStatement.h b/Sencha-lang/AST/RepeatStatement.h index 89d6b89..25cf150 100644 --- a/Sencha-lang/AST/RepeatStatement.h +++ b/Sencha-lang/AST/RepeatStatement.h @@ -19,9 +19,6 @@ public: virtual void execute(); virtual void execute_quietly(); void add_body(ASTStatement * statement); - - - virtual std::string debug() ; virtual ~RepeatStatement(); }; diff --git a/Sencha-lang/AST/VariableExpression.cpp b/Sencha-lang/AST/VariableExpression.cpp index 5ac4a5e..db21663 100644 --- a/Sencha-lang/AST/VariableExpression.cpp +++ b/Sencha-lang/AST/VariableExpression.cpp @@ -15,11 +15,6 @@ VariableExpression::VariableExpression(ASTNode * parent, Context * context, std: this->type = "VariableExpression"; } -std::string VariableExpression::debug() -{ - std::string debug_note = "variable: " + name; - return debug_note; -} VariableExpression::~VariableExpression() { // Do nothing } diff --git a/Sencha-lang/AST/VariableExpression.h b/Sencha-lang/AST/VariableExpression.h index 522b71b..93df332 100644 --- a/Sencha-lang/AST/VariableExpression.h +++ b/Sencha-lang/AST/VariableExpression.h @@ -18,7 +18,6 @@ public: VariableExpression(ASTNode * parent, Context * context, std::string name); Context * context; - std::string debug(); std::string name; void execute(); diff --git a/Sencha-lang/AST/WhileNode.cpp b/Sencha-lang/AST/WhileNode.cpp index 0d10214..08dd763 100644 --- a/Sencha-lang/AST/WhileNode.cpp +++ b/Sencha-lang/AST/WhileNode.cpp @@ -32,11 +32,6 @@ void WhileNode::add_body(ASTStatement * statement) body = statement; } -std::string WhileNode::debug() -{ - std::string debug_note = "While"; - return debug_note; -} void WhileNode::execute() { diff --git a/Sencha-lang/AST/WhileNode.h b/Sencha-lang/AST/WhileNode.h index bfd77de..136d976 100644 --- a/Sencha-lang/AST/WhileNode.h +++ b/Sencha-lang/AST/WhileNode.h @@ -17,7 +17,6 @@ public: ASTStatement * body; void add_condition(ASTExpression * expression); void add_body(ASTStatement * statement); - virtual std::string debug(); virtual void execute(); bool evaluate_condition();