aboutsummaryrefslogtreecommitdiffstats
path: root/c_parser/include/ast_primitives.hpp
blob: 2eeaa19b0bc7cbac2f1ab94ae9e29247e00df3f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef AST_PRIMITIVES_HPP
#define AST_PRIMITIVES_HPP

#include "ast.hpp"

#include <string>

class Variable : public Base {
private:
    std::string id;
public:
    Variable(const std::string& _id) : id(_id) {}

    virtual void print() const {
        std::cout << "<Variable id=\"" << id << "\" />" << std::endl;
    }

    virtual void push(const Base* var) const {
	std::cerr << "Error: Can't call this function on this class" << std::endl;
	(void)var;
    }
};

class Parameter : public Base {
private:
    std::string id;
public:
    Parameter(const std::string& _id) : id(_id) {}

    virtual void print() const {
        std::cout << "<Parameter id=\"" << id << "\" />" << std::endl;
    }

    virtual void push(const Base* var) const {
        std::cerr << "Error: Can't call this function on this class" << std::endl;
	(void)var;
    }
};

#endif