From 67c3618e593f88eb8177404475586735902d693f Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Sun, 25 Jan 2015 18:57:19 +0100 Subject: 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 --- src/core/parser/ParserContext.cpp | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'src/core/parser/ParserContext.cpp') 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 ®istry, - Logger &logger, Manager &manager, - Handle project) - : scope(scope), - registry(registry), - logger(logger), - manager(manager), - project(project) +ParserContext::ParserContext(Handle project, ParserScope &scope, + SourceId sourceId, Logger &logger) + : project(project), scope(scope), sourceId(sourceId), logger(logger) { } + +ParserContext::ParserContext(Handle 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(); } } -- cgit v1.2.3