aboutsummaryrefslogtreecommitdiffstats
path: root/c_compiler/include/declaration.hpp
blob: 141d4d06a383e370b47f1b5fcf52a82bd0f81305 (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
#ifndef AST_DECLARATION_HPP
#define AST_DECLARATION_HPP

#include "ast.hpp"

// Declaration that holds a list of declarations

class Declaration : public Node {
protected:
    Type* type;
    std::string id;
    Initializer* init;
    Declaration* next_decl;
    Declaration* decl_list;
    
public:
    Declaration(const std::string& _id = "");

    virtual void print() const;
    virtual void printxml() const;
    virtual void printasm() const;

    void addDeclaration(Declaration* _next_decl);
    void addList(Declaration* _next_decl);

    Declaration* getNext() const;
    std::string getId() const;
};

#endif