aboutsummaryrefslogtreecommitdiffstats
path: root/c_compiler/include/node.hpp
blob: 584ed328fdb320538c1780c850ae37a8d752b150 (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 NODE_HPP
#define NODE_HPP

#include <cstdint>
#include <map>
#include <string>

struct VarLocation;
class Type;

typedef std::map<std::string, VarLocation> VariableStackBindings;


struct VarLocation {
    Type* type;
    int32_t stack_position;
};


class Node {
public:
    virtual ~Node() {}

    virtual void print() const = 0;
    virtual void printxml() const = 0;
    virtual VariableStackBindings printasm(VariableStackBindings bindings) const = 0;
};

    
#endif