diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2017-02-19 13:59:24 +0000 |
---|---|---|
committer | Yann Herklotz <ymherklotz@gmail.com> | 2017-02-19 13:59:24 +0000 |
commit | 1802437f63e14c1128918c4e3a00f60fb97182d9 (patch) | |
tree | 8d4b47072cb81868bb04d4d475682e02bf429ad1 /c_parser/include/ast_statement.hpp | |
parent | 0e9e8dab385375c0cbb83d89a71fbf8d71206b47 (diff) | |
download | Compiler-1802437f63e14c1128918c4e3a00f60fb97182d9.tar.gz Compiler-1802437f63e14c1128918c4e3a00f60fb97182d9.zip |
FInished parser but still have one shift/reduce warning
Diffstat (limited to 'c_parser/include/ast_statement.hpp')
-rw-r--r-- | c_parser/include/ast_statement.hpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/c_parser/include/ast_statement.hpp b/c_parser/include/ast_statement.hpp index e9864e9..224a809 100644 --- a/c_parser/include/ast_statement.hpp +++ b/c_parser/include/ast_statement.hpp @@ -77,4 +77,46 @@ public: } }; +class ast_ExpressionStatement : public ast_Statement { +public: + ast_ExpressionStatement() : ast_Statement() {} + ast_ExpressionStatement(const ast_Base* _el) : ast_Statement(_el) {} + ast_ExpressionStatement(const ast_Base* _if, const ast_Base* _else) : + ast_Statement(_if, _else) {} + + virtual void print() const override { + for(size_t i = 0; i < ast_list.size(); ++i) { + ast_list[i]->print(); + } + } +}; + +class ast_JumpStatement : public ast_Statement { +public: + ast_JumpStatement() : ast_Statement() {} + ast_JumpStatement(const ast_Base* _el) : ast_Statement(_el) {} + ast_JumpStatement(const ast_Base* _if, const ast_Base* _else) : + ast_Statement(_if, _else) {} + + virtual void print() const override { + for(size_t i = 0; i < ast_list.size(); ++i) { + ast_list[i]->print(); + } + } +}; + +class ast_IterationStatement : public ast_Statement { +public: + ast_IterationStatement() : ast_Statement() {} + ast_IterationStatement(const ast_Base* _el) : ast_Statement(_el) {} + ast_IterationStatement(const ast_Base* _if, const ast_Base* _else) : + ast_Statement(_if, _else) {} + + virtual void print() const override { + for(size_t i = 0; i < ast_list.size(); ++i) { + ast_list[i]->print(); + } + } +}; + #endif |