# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

code_branche_run_debug.h

Go to the documentation of this file.
00001 
00007 /* Copyright, 2000 Nevrax Ltd.
00008  */
00009 
00010 #ifndef RL_CODE_BRANCHE_RUN_DEBUG_H
00011 #define RL_CODE_BRANCHE_RUN_DEBUG_H
00012 
00013 #include "nel/ai/agent/agentpack.h"
00014 #include "nel/ai/agent/agent_script.h"
00015 
00016 #include "nel/ai/script/codage.h"
00017 #include "nel/ai/script/script_debug_source.h"
00018 
00019 namespace NLAISCRIPT
00020 {
00021 //      typedef std::list<CBagOfCode *> TListCode;
00022 //      typedef std::list<CBagOfCode *>::iterator tListCodeIter;
00023 
00030         class CCodeBrancheRunDebug : public CCodeBrancheRun
00031         {
00032         public:
00033                 static const NLAIC::CIdentType IdCodeBrancheRunDebug;
00034 
00035         private :
00036                 int                     *_LineInSourceCodeArray;
00037                 IScriptDebugSource *_SourceCode;
00038 
00039          public:
00040 
00045                 CCodeBrancheRunDebug(sint32 N,const IOpCode &op);               
00046 
00050                 CCodeBrancheRunDebug(sint32 N, IScriptDebugSource* sourceCode);
00051 
00055                 CCodeBrancheRunDebug(const tListCode &l);
00056 
00058                 CCodeBrancheRunDebug(const CCodeBrancheRunDebug &l);
00059 
00061                 virtual ~CCodeBrancheRunDebug();
00062 
00064                 void initCode(const tListCode &l);
00065 
00067                 void initCode(const CCodeBrancheRunDebug &l);
00068 
00070                 void getDebugResult(std::string &str, CCodeContext &context) const;
00071 
00075                 const NLAIAGENT::IObjectIA::CProcessResult &run(NLAIAGENT::IObjectIA &self);
00076 
00077                 const NLAIAGENT::IObjectIA::CProcessResult &run(CCodeContext &);
00078 
00080                 NLAIAGENT::TProcessStatement runOpCode(CCodeContext &context);
00081 
00083                 void setLineCode(int ligne, int index);
00084 
00086                 std::string getSourceFileName() const;
00087 
00089                 uint16  getCurrentSourceCodeLineNumber() const;
00090 
00092                 void printCurrentSourceCodeLine() const;
00093 
00095                 void printSourceCodeLine(int first, int last) const;
00096 
00098 
00099                 const NLAIC::CIdentType& getType() const;
00100                 const NLAIC::IBasicType* clone() const;
00101                 const NLAIC::IBasicType *newInstance() const;
00102                 virtual void save(NLMISC::IStream &);
00103                 virtual void load(NLMISC::IStream &);
00105 
00106          private :
00107                  
00108                 void initCBRD(); // Call by each constructor.
00109                 void fixContextDebugMode(CCodeContext &P) const;
00111                 bool readCommandLine(CCodeContext &P, const char* commandLine);
00112                 void printVariable (CCodeContext &P, const char* c) const;
00113                 void printArgs (CCodeContext &P) const;
00114         };
00115 }
00116 #endif // RK_CODE_BRANCHE_RUN_DEBUG_H
00117 
00118 /* End of code_branche_run_debug.h */