Porytiles
Loading...
Searching...
No Matches
array_declaration.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4#include <vector>
5
7
8namespace porytiles {
9
30 public:
38 ArrayDeclaration(std::string name, std::vector<std::string> elements, SourcePosition position)
39 : name_{std::move(name)}, elements_{std::move(elements)}, position_{position}
40 {
41 }
42
48 [[nodiscard]] const std::string &name() const
49 {
50 return name_;
51 }
52
62 [[nodiscard]] const std::vector<std::string> &elements() const
63 {
64 return elements_;
65 }
66
72 [[nodiscard]] const SourcePosition &position() const
73 {
74 return position_;
75 }
76
77 private:
78 std::string name_;
79 std::vector<std::string> elements_;
80 SourcePosition position_;
81};
82
83} // namespace porytiles
Represents a parsed C pointer array declaration.
ArrayDeclaration(std::string name, std::vector< std::string > elements, SourcePosition position)
Constructs an ArrayDeclaration.
const std::vector< std::string > & elements() const
Returns the initializer list elements.
const std::string & name() const
Returns the array variable name.
const SourcePosition & position() const
Returns the source position of the array name.
Represents a position within source content.