Blang/src/lib/src/Statement/ForStatement.h

45 lines
950 B
C
Raw Normal View History

2016-04-22 21:46:31 +02:00
#ifndef FORSTATEMENT_HPP
#define FORSTATEMENT_HPP
2016-11-28 07:29:13 +01:00
#include <map>
#include "../Statement.hpp"
#include "../SourceLocation.hpp"
#include "AssignStatement.h"
2016-04-22 21:46:31 +02:00
2016-11-24 12:15:08 +01:00
class ForStatement : public Statement
{
2016-04-22 21:46:31 +02:00
public:
2016-11-24 12:15:08 +01:00
ForStatement(SourceLocation forLocation, AssignStatement* init, Expr* cond, Statement* body, Expr* inc = NULL);
2016-04-22 21:46:31 +02:00
2016-11-24 12:15:08 +01:00
AssignStatement *getInit();
const AssignStatement *getInit() const;
void setInit(AssignStatement *);
2016-04-22 21:46:31 +02:00
2016-11-24 12:15:08 +01:00
Expr *getCond();
const Expr *getCond() const;
void setCond(Expr *);
Expr *getInc();
const Expr *getInc() const;
void setInc(Expr *);
Statement *getBody();
const Statement *getBody() const;
void setBody(Statement *);
SourceLocation getForLocation() const;
void setForLocation(SourceLocation);
private:
SourceLocation _forLocation;
enum StmtIdentifier
{
INIT, BODY, COND, INC
};
std::map<StmtIdentifier, Statement*> _subStmts;
2016-04-22 21:46:31 +02:00
};
#endif