diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2017-02-17 17:27:38 +0000 |
---|---|---|
committer | Yann Herklotz <ymherklotz@gmail.com> | 2017-02-17 17:27:38 +0000 |
commit | c85746b6a6c3080bac409e0acb8cc8b332b2761e (patch) | |
tree | 7e37429cbe6014e2ed6aba6466b69cf914e2af38 /c_parser/include/ast_primitives.hpp | |
parent | b81f60d8b523260526af15361d4ce0ac4a7757c8 (diff) | |
download | Compiler-c85746b6a6c3080bac409e0acb8cc8b332b2761e.tar.gz Compiler-c85746b6a6c3080bac409e0acb8cc8b332b2761e.zip |
Finished compound statement for function and added test cases
Diffstat (limited to 'c_parser/include/ast_primitives.hpp')
-rw-r--r-- | c_parser/include/ast_primitives.hpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/c_parser/include/ast_primitives.hpp b/c_parser/include/ast_primitives.hpp index d878780..5ae6d12 100644 --- a/c_parser/include/ast_primitives.hpp +++ b/c_parser/include/ast_primitives.hpp @@ -15,7 +15,10 @@ public: std::cout << "<Variable id=\"" << id << "\" />" << std::endl; } - virtual void push(const ast_Base* var) const {} + virtual void push(const ast_Base* var) const { + std::cerr << "Error: Can't call this function on this class" << std::endl; + (void)var; + } }; class ast_Parameter : public ast_Base { @@ -28,7 +31,10 @@ public: std::cout << "<Parameter id=\"" << id << "\" />" << std::endl; } - virtual void push(const ast_Base* var) const {} + virtual void push(const ast_Base* var) const { + std::cerr << "Error: Can't call this function on this class" << std::endl; + (void)var; + } }; #endif |