fixed a constness-issue

actorid
Marc Zinnschlag 11 years ago
parent 910d62e4b8
commit d213c6c36a

@ -154,7 +154,7 @@ namespace Compiler
} }
} }
ControlParser::ControlParser (ErrorHandler& errorHandler, Context& context, Locals& locals, ControlParser::ControlParser (ErrorHandler& errorHandler, const Context& context, Locals& locals,
Literals& literals) Literals& literals)
: Parser (errorHandler, context), mLocals (locals), mLiterals (literals), : Parser (errorHandler, context), mLocals (locals), mLiterals (literals),
mLineParser (errorHandler, context, locals, literals, mCodeBlock), mLineParser (errorHandler, context, locals, literals, mCodeBlock),

@ -47,7 +47,7 @@ namespace Compiler
public: public:
ControlParser (ErrorHandler& errorHandler, Context& context, Locals& locals, ControlParser (ErrorHandler& errorHandler, const Context& context, Locals& locals,
Literals& literals); Literals& literals);
void appendCode (std::vector<Interpreter::Type_Code>& code) const; void appendCode (std::vector<Interpreter::Type_Code>& code) const;

@ -8,7 +8,7 @@
#include "skipparser.hpp" #include "skipparser.hpp"
#include "locals.hpp" #include "locals.hpp"
Compiler::DeclarationParser::DeclarationParser (ErrorHandler& errorHandler, Context& context, Compiler::DeclarationParser::DeclarationParser (ErrorHandler& errorHandler, const Context& context,
Locals& locals) Locals& locals)
: Parser (errorHandler, context), mLocals (locals), mState (State_Begin), mType (0) : Parser (errorHandler, context), mLocals (locals), mState (State_Begin), mType (0)
{} {}

@ -20,7 +20,7 @@ namespace Compiler
public: public:
DeclarationParser (ErrorHandler& errorHandler, Context& context, Locals& locals); DeclarationParser (ErrorHandler& errorHandler, const Context& context, Locals& locals);
virtual bool parseName (const std::string& name, const TokenLoc& loc, virtual bool parseName (const std::string& name, const TokenLoc& loc,
Scanner& scanner); Scanner& scanner);

@ -219,7 +219,7 @@ namespace Compiler
return false; return false;
} }
ExprParser::ExprParser (ErrorHandler& errorHandler, Context& context, Locals& locals, ExprParser::ExprParser (ErrorHandler& errorHandler, const Context& context, Locals& locals,
Literals& literals, bool argument) Literals& literals, bool argument)
: Parser (errorHandler, context), mLocals (locals), mLiterals (literals), : Parser (errorHandler, context), mLocals (locals), mLiterals (literals),
mNextOperand (true), mFirst (true), mArgument (argument), mRefOp (false), mMemberOp (false) mNextOperand (true), mFirst (true), mArgument (argument), mRefOp (false), mMemberOp (false)

@ -58,7 +58,7 @@ namespace Compiler
public: public:
ExprParser (ErrorHandler& errorHandler, Context& context, Locals& locals, ExprParser (ErrorHandler& errorHandler, const Context& context, Locals& locals,
Literals& literals, bool argument = false); Literals& literals, bool argument = false);
///< constructor ///< constructor
/// \param argument Parser is used to parse function- or instruction- /// \param argument Parser is used to parse function- or instruction-

@ -50,7 +50,7 @@ namespace Compiler
} }
} }
LineParser::LineParser (ErrorHandler& errorHandler, Context& context, Locals& locals, LineParser::LineParser (ErrorHandler& errorHandler, const Context& context, Locals& locals,
Literals& literals, std::vector<Interpreter::Type_Code>& code, bool allowExpression) Literals& literals, std::vector<Interpreter::Type_Code>& code, bool allowExpression)
: Parser (errorHandler, context), mLocals (locals), mLiterals (literals), mCode (code), : Parser (errorHandler, context), mLocals (locals), mLiterals (literals), mCode (code),
mState (BeginState), mExprParser (errorHandler, context, locals, literals), mState (BeginState), mExprParser (errorHandler, context, locals, literals),

@ -44,7 +44,7 @@ namespace Compiler
public: public:
LineParser (ErrorHandler& errorHandler, Context& context, Locals& locals, LineParser (ErrorHandler& errorHandler, const Context& context, Locals& locals,
Literals& literals, std::vector<Interpreter::Type_Code>& code, Literals& literals, std::vector<Interpreter::Type_Code>& code,
bool allowExpression = false); bool allowExpression = false);
///< \param allowExpression Allow lines consisting of a naked expression ///< \param allowExpression Allow lines consisting of a naked expression

@ -52,7 +52,7 @@ namespace Compiler
// Return context // Return context
Context& Parser::getContext() const Context& Parser::getContext() const
{ {
return mContext; return mContext;
} }
@ -64,7 +64,7 @@ namespace Compiler
return lowerCase; return lowerCase;
} }
Parser::Parser (ErrorHandler& errorHandler, Context& context) Parser::Parser (ErrorHandler& errorHandler, const Context& context)
: mErrorHandler (errorHandler), mContext (context), mOptional (false), mEmpty (true) : mErrorHandler (errorHandler), mContext (context), mOptional (false), mEmpty (true)
{} {}

@ -17,7 +17,7 @@ namespace Compiler
class Parser class Parser
{ {
ErrorHandler& mErrorHandler; ErrorHandler& mErrorHandler;
Context& mContext; const Context& mContext;
bool mOptional; bool mOptional;
bool mEmpty; bool mEmpty;
@ -38,14 +38,14 @@ namespace Compiler
ErrorHandler& getErrorHandler(); ErrorHandler& getErrorHandler();
///< Return error handler ///< Return error handler
Context& getContext(); const Context& getContext() const;
///< Return context ///< Return context
static std::string toLower (const std::string& name); static std::string toLower (const std::string& name);
public: public:
Parser (ErrorHandler& errorHandler, Context& context); Parser (ErrorHandler& errorHandler, const Context& context);
///< constructor ///< constructor
virtual ~Parser(); virtual ~Parser();

@ -4,7 +4,7 @@
#include "skipparser.hpp" #include "skipparser.hpp"
#include "scanner.hpp" #include "scanner.hpp"
Compiler::QuickFileParser::QuickFileParser (ErrorHandler& errorHandler, Context& context, Compiler::QuickFileParser::QuickFileParser (ErrorHandler& errorHandler, const Context& context,
Locals& locals) Locals& locals)
: Parser (errorHandler, context), mDeclarationParser (errorHandler, context, locals) : Parser (errorHandler, context), mDeclarationParser (errorHandler, context, locals)
{} {}

@ -15,7 +15,7 @@ namespace Compiler
public: public:
QuickFileParser (ErrorHandler& errorHandler, Context& context, Locals& locals); QuickFileParser (ErrorHandler& errorHandler, const Context& context, Locals& locals);
virtual bool parseName (const std::string& name, const TokenLoc& loc, virtual bool parseName (const std::string& name, const TokenLoc& loc,
Scanner& scanner); Scanner& scanner);

@ -7,7 +7,7 @@
namespace Compiler namespace Compiler
{ {
ScriptParser::ScriptParser (ErrorHandler& errorHandler, Context& context, ScriptParser::ScriptParser (ErrorHandler& errorHandler, const Context& context,
Locals& locals, bool end) Locals& locals, bool end)
: Parser (errorHandler, context), mOutput (locals), : Parser (errorHandler, context), mOutput (locals),
mLineParser (errorHandler, context, locals, mOutput.getLiterals(), mOutput.getCode()), mLineParser (errorHandler, context, locals, mOutput.getLiterals(), mOutput.getCode()),

@ -23,7 +23,7 @@ namespace Compiler
public: public:
/// \param end of script is marked by end keyword. /// \param end of script is marked by end keyword.
ScriptParser (ErrorHandler& errorHandler, Context& context, Locals& locals, ScriptParser (ErrorHandler& errorHandler, const Context& context, Locals& locals,
bool end = false); bool end = false);
void getCode (std::vector<Interpreter::Type_Code>& code) const; void getCode (std::vector<Interpreter::Type_Code>& code) const;

@ -5,7 +5,7 @@
namespace Compiler namespace Compiler
{ {
SkipParser::SkipParser (ErrorHandler& errorHandler, Context& context) SkipParser::SkipParser (ErrorHandler& errorHandler, const Context& context)
: Parser (errorHandler, context) : Parser (errorHandler, context)
{} {}

@ -13,7 +13,7 @@ namespace Compiler
{ {
public: public:
SkipParser (ErrorHandler& errorHandler, Context& context); SkipParser (ErrorHandler& errorHandler, const Context& context);
virtual bool parseInt (int value, const TokenLoc& loc, Scanner& scanner); virtual bool parseInt (int value, const TokenLoc& loc, Scanner& scanner);
///< Handle an int token. ///< Handle an int token.

@ -10,7 +10,7 @@
namespace Compiler namespace Compiler
{ {
StringParser::StringParser (ErrorHandler& errorHandler, Context& context, Literals& literals) StringParser::StringParser (ErrorHandler& errorHandler, const Context& context, Literals& literals)
: Parser (errorHandler, context), mLiterals (literals), mState (StartState), mSmashCase (false) : Parser (errorHandler, context), mLiterals (literals), mState (StartState), mSmashCase (false)
{ {

@ -25,7 +25,7 @@ namespace Compiler
public: public:
StringParser (ErrorHandler& errorHandler, Context& context, Literals& literals); StringParser (ErrorHandler& errorHandler, const Context& context, Literals& literals);
virtual bool parseName (const std::string& name, const TokenLoc& loc, virtual bool parseName (const std::string& name, const TokenLoc& loc,
Scanner& scanner); Scanner& scanner);

Loading…
Cancel
Save