aboutsummaryrefslogtreecommitdiffstats
path: root/AST.h
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2014-12-16 00:45:18 +0800
committerLefteris Karapetsas <lefteris@refu.co>2014-12-17 07:03:30 +0800
commitf7029726be3bbf119548a83696402512374d809d (patch)
tree4ba52a22a933d3f2779c8b0301f097b6ffde7ffa /AST.h
parent5b802b685e794832bf8834183bf6c9604e513bbf (diff)
downloaddexon-solidity-f7029726be3bbf119548a83696402512374d809d.tar.gz
dexon-solidity-f7029726be3bbf119548a83696402512374d809d.tar.zst
dexon-solidity-f7029726be3bbf119548a83696402512374d809d.zip
Adding a ForStatement solidity AST Node.
- Adding ForStatement node - Implemented Parsing for ForStatement - A simple parsing test for the ForStatement - Work in progress
Diffstat (limited to 'AST.h')
-rw-r--r--AST.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/AST.h b/AST.h
index 4bb623b4..297b7f4e 100644
--- a/AST.h
+++ b/AST.h
@@ -509,6 +509,30 @@ private:
ASTPointer<Statement> m_body;
};
+class ForStatement: public BreakableStatement
+{
+public:
+ ForStatement(Location const& _location,
+ ASTPointer<ASTNode> const& _initExpression,
+ ASTPointer<Expression> const& _conditionExpression,
+ ASTPointer<ExpressionStatement> const& _loopExpression,
+ ASTPointer<Statement> const& _body):
+ BreakableStatement(_location),
+ m_initExpression(_initExpression),
+ m_condExpression(_conditionExpression),
+ m_loopExpression(_loopExpression),
+ m_body(_body) {}
+ virtual void accept(ASTVisitor& _visitor) override;
+ virtual void accept(ASTConstVisitor& _visitor) const override;
+ virtual void checkTypeRequirements() override;
+
+private:
+ ASTPointer<ASTNode> m_initExpression;
+ ASTPointer<Expression> m_condExpression;
+ ASTPointer<ExpressionStatement> m_loopExpression;
+ ASTPointer<Statement> m_body;
+};
+
class Continue: public Statement
{
public: