aboutsummaryrefslogtreecommitdiff
path: root/include/symbol.hpp
blob: 4bee45d554effc2e82c518ce20858ad3afbe5ee5 (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
#pragma once

#include <string>
#include <vector>

#include "symbol_type.hpp"

class Symbol {
public:
    explicit Symbol(std::string name, SymbolType type, std::string data_type, int scope_level);
    std::string getName();
    SymbolType getSymbolType();
    std::string getDataType();
    int getScopeLevel();
    bool isInitialized();
    void setInitialized(bool init);
    bool isParameter();
    void setParameter(bool is_param);
    std::vector<std::string> getParameterTypes();
    void setParameterTypes(std::vector<std::string> types);
    std::string getReturnType();
    void setReturnType(std::string type);
    int getLineDeclared();
    void setLineDeclared(int line);
    std::string toString();

private:
    std::string symbol_name;
    SymbolType symbol_type;
    std::string data_type;
    int scope_level;
    bool is_initialized;
    bool is_parameter;
    std::vector<std::string> parameter_types;
    std::string return_type;
    int line_declared;
    int column_declared;
};