added literal container and reworked output container handling

This commit is contained in:
Marc Zinnschlag 2010-06-28 16:48:19 +02:00
parent ba847ae9d8
commit 5cf3264bd3
12 changed files with 284 additions and 16 deletions

View file

@ -7,13 +7,14 @@ namespace Compiler
{
ScriptParser::ScriptParser (ErrorHandler& errorHandler, Context& context,
Locals& locals, bool end)
: Parser (errorHandler, context), mLineParser (errorHandler, context, locals, mCode),
mLocals (locals), mEnd (end)
: Parser (errorHandler, context), mOutput (locals),
mLineParser (errorHandler, context, locals, mOutput.getLiterals(), mOutput.getCode()),
mEnd (end)
{}
void ScriptParser::getCode (std::vector<Interpreter::Type_Code>& code) const
{
code = mCode;
mOutput.getCode (code);
}
bool ScriptParser::parseName (const std::string& name, const TokenLoc& loc,
@ -61,7 +62,7 @@ namespace Compiler
void ScriptParser::reset()
{
mLineParser.reset();
mCode.clear();
mOutput.clear();
}
}