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
28 public:
34 ArrayDeclaration(std::string name, std::vector<std::string> elements, SourcePosition position)
35 : name_{std::move(name)}, elements_{std::move(elements)}, position_{position}
36 {
37 }
38
42 [[nodiscard]] const std::string &name() const
43 {
44 return name_;
45 }
46
54 [[nodiscard]] const std::vector<std::string> &elements() const
55 {
56 return elements_;
57 }
58
62 [[nodiscard]] const SourcePosition &position() const
63 {
64 return position_;
65 }
66
67 private:
68 std::string name_;
69 std::vector<std::string> elements_;
70 SourcePosition position_;
71};
72
73} // 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.