diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-01-23 00:32:39 +0100 |
---|---|---|
committer | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-01-23 00:32:39 +0100 |
commit | 17f4fb572a0493679342077c36ff8eb3116cb222 (patch) | |
tree | 0798cdd329657d7b6ddf91b234e7394bdf3ea4fe /src/core/model/Node.hpp | |
parent | 1179bad0732e09b1bcae5fd77b62c4e7116d6d73 (diff) |
Atatching Location to Node
Diffstat (limited to 'src/core/model/Node.hpp')
-rw-r--r-- | src/core/model/Node.hpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/core/model/Node.hpp b/src/core/model/Node.hpp index c5761a8..af92a50 100644 --- a/src/core/model/Node.hpp +++ b/src/core/model/Node.hpp @@ -35,6 +35,7 @@ #include <string> #include <vector> +#include <core/common/Location.hpp> #include <core/managed/Managed.hpp> #include <core/managed/ManagedContainer.hpp> @@ -137,6 +138,12 @@ private: Owned<Node> parent; /** + * Location from which the node was read (specifies the source file and the + * range in that source file). + */ + SourceLocation location; + + /** * A "dirty" flag that signifies if this Node has been already validated * or not. */ @@ -519,6 +526,21 @@ public: * @return the current ValidationState of this Node. */ ValidationState getValidationState() const { return validationState; } + + /** + * Returns the location in the source file. + * + * @return a source location descriptor. + */ + SourceLocation getLocation() { return location; } + + /** + * Sets the location of the node to the given value. + * + * @param location describes the exact position of the Node in a source + * file. + */ + void setLocation(const SourceLocation &location) {this->location = location;} }; /** |