From 17f4fb572a0493679342077c36ff8eb3116cb222 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Fri, 23 Jan 2015 00:32:39 +0100 Subject: Atatching Location to Node --- src/core/model/Node.hpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/core/model/Node.hpp') 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 #include +#include #include #include @@ -136,6 +137,12 @@ private: */ Owned 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;} }; /** -- cgit v1.2.3