summaryrefslogtreecommitdiff
path: root/src/core/parser/ParserContext.cpp
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-01-25 18:57:19 +0100
committerAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-01-25 18:57:19 +0100
commit67c3618e593f88eb8177404475586735902d693f (patch)
tree274bbc603aa2ec3bdb5b23294b090bf6d137f560 /src/core/parser/ParserContext.cpp
parent1a6236c184d7ffe3551d417b656aee31b15d1948 (diff)
Restructures parser classes a little, removed Registry from ParserContext, gave a ResourceManager instance to the Project, using ResourceRequest when including or linking files, thought through how "including" and "linking" are handled
Diffstat (limited to 'src/core/parser/ParserContext.cpp')
-rw-r--r--src/core/parser/ParserContext.cpp29
1 files changed, 21 insertions, 8 deletions
diff --git a/src/core/parser/ParserContext.cpp b/src/core/parser/ParserContext.cpp
index fa26c59..0a75fdf 100644
--- a/src/core/parser/ParserContext.cpp
+++ b/src/core/parser/ParserContext.cpp
@@ -22,15 +22,28 @@ namespace ousia {
/* Class ParserContext */
-ParserContext::ParserContext(ParserScope &scope, Registry &registry,
- Logger &logger, Manager &manager,
- Handle<model::Project> project)
- : scope(scope),
- registry(registry),
- logger(logger),
- manager(manager),
- project(project)
+ParserContext::ParserContext(Handle<Project> project, ParserScope &scope,
+ SourceId sourceId, Logger &logger)
+ : project(project), scope(scope), sourceId(sourceId), logger(logger)
{
}
+
+ParserContext::ParserContext(Handle<Project> project, ParserScope &scope,
+ Logger &logger)
+ : project(project), scope(scope), sourceId(InvalidSourceId), logger(logger)
+{
+}
+
+ParserContext ParserContext::clone(ParserScope &scope, SourceId sourceId) const
+{
+ return ParserContext{project, scope, sourceId, logger};
+}
+
+ParserContext ParserContext::clone(SourceId sourceId) const
+{
+ return ParserContext{project, scope, sourceId, logger};
+}
+
+Manager &ParserContext::getManager() const { return project->getManager(); }
}