OpenMW
components/compiler/scriptparser.hpp
Go to the documentation of this file.
00001 #ifndef COMPILER_SCRIPTPARSER_H_INCLUDED
00002 #define COMPILER_SCRIPTPARSER_H_INCLUDED
00003 
00004 
00005 #include "parser.hpp"
00006 #include "lineparser.hpp"
00007 #include "controlparser.hpp"
00008 #include "output.hpp"
00009 
00010 namespace Compiler
00011 {
00012     class Locals;
00013 
00014     // Script parser, to be used in dialogue scripts and as part of FileParser
00015     
00016     class ScriptParser : public Parser
00017     {
00018             Output mOutput;
00019             LineParser mLineParser;
00020             ControlParser mControlParser;
00021             bool mEnd;
00022 
00023         public:
00024         
00026             ScriptParser (ErrorHandler& errorHandler, Context& context, Locals& locals,
00027                 bool end = false);
00028     
00029             void getCode (std::vector<Interpreter::Type_Code>& code) const;
00031     
00032             virtual bool parseName (const std::string& name, const TokenLoc& loc,
00033                 Scanner& scanner);
00036 
00037             virtual bool parseKeyword (int keyword, const TokenLoc& loc, Scanner& scanner);
00040 
00041             virtual bool parseSpecial (int code, const TokenLoc& loc, Scanner& scanner);
00044 
00045             virtual void parseEOF (Scanner& scanner);
00047             
00048             void reset();
00050     };
00051 }
00052 
00053 #endif
00054