adding RandomForStatement and fixing typo
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include "FunctionDefinition.h"
|
||||
#include "IfStatement.h"
|
||||
#include "ParameterList.h"
|
||||
#include "RandomForStatement.h"
|
||||
#include "RandomIfStatement.h"
|
||||
#include "ReturnStatement.h"
|
||||
#include "Scope.h"
|
||||
@@ -32,6 +33,7 @@ public:
|
||||
virtual void visit(FunctionDefinition* e) = 0;
|
||||
virtual void visit(IfStatement* e) = 0;
|
||||
virtual void visit(ParameterList* e) = 0;
|
||||
virtual void visit(RandomForStatement* e) = 0;
|
||||
virtual void visit(RandomIfStatement* e) = 0;
|
||||
virtual void visit(ReturnStatement* e) = 0;
|
||||
virtual void visit(Scope* e) = 0;
|
||||
|
||||
@@ -14,7 +14,7 @@ public:
|
||||
Expression* getInit();
|
||||
Expression* getCond();
|
||||
Expression* getStep();
|
||||
Statement* GetStmt();
|
||||
Statement* getStmt();
|
||||
private:
|
||||
Expression* init_;
|
||||
Expression* cond_;
|
||||
|
||||
26
inc/AST/RandomForStatement.h
Normal file
26
inc/AST/RandomForStatement.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef RANDOMFORSTATEMENT_H
|
||||
#define RANDOMFORSTATEMENT_H
|
||||
|
||||
#include "AST/Expression.h"
|
||||
#include "AST/Statement.h"
|
||||
|
||||
class RandomForStatement : public Statement
|
||||
{
|
||||
public:
|
||||
RandomForStatement(Expression* init, Expression* prob, Expression* step, Statement* stmt);
|
||||
virtual ~RandomForStatement();
|
||||
|
||||
virtual void accept(ASTVisitor *visitor);
|
||||
|
||||
Expression* getInit();
|
||||
Expression* getProb();
|
||||
Expression* getStep();
|
||||
Statement* getStmt();
|
||||
private:
|
||||
Expression* init_;
|
||||
Expression* prob_;
|
||||
Expression* step_;
|
||||
Statement* stmt_;
|
||||
};
|
||||
|
||||
#endif // RANDOMFORSTATEMENT_H
|
||||
Reference in New Issue
Block a user