1
2
3
4
5
6 #ifndef SNGCPP_SYMBOLS_VARIABLE_SYMBOL_INCLUDED
7 #define SNGCPP_SYMBOLS_VARIABLE_SYMBOL_INCLUDED
8 #include <sngcpp/symbols/TypeSymbol.hpp>
9
10 namespace sngcpp { namespace symbols {
11
12 class VariableSymbol : public Symbol
13 {
14 public:
15 VariableSymbol(const Span& span_, const std::u32string& name_);
16 std::u32string KindStr() override { return U"variable"; }
17 std::unique_ptr<sngxml::dom::Element> CreateElement() override;
18 bool IsVariableSymbol() const override { return true; }
19 void AddSpecifiers(Specifier specifiers_);
20 Specifier Specifiers() const { return specifiers; }
21 TypeSymbol* GetType() override { return type; }
22 void SetType(TypeSymbol* type_) { type = type_; }
23 private:
24 Specifier specifiers;
25 TypeSymbol* type;
26 };
27
28 } }
29
30 #endif // SNGCPP_SYMBOLS_VARIABLE_SYMBOL_INCLUDED