2007-11-04 03:34:51 +00:00
|
|
|
|
|
|
|
#ifndef _SCRIPTPARSER_H_
|
|
|
|
#define _SCRIPTPARSER_H_
|
|
|
|
|
|
|
|
#include "interfaces/IScriptParser.h"
|
|
|
|
|
|
|
|
#define SP_MAX_BREAKCHARS 16
|
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
class CScriptParser : public IScriptParser {
|
2007-11-04 03:34:51 +00:00
|
|
|
public:
|
2012-03-17 20:01:54 +00:00
|
|
|
CScriptParser( void );
|
|
|
|
~CScriptParser( void );
|
2007-11-04 03:34:51 +00:00
|
|
|
private:
|
2012-03-17 20:01:54 +00:00
|
|
|
char m_breakChars[SP_MAX_BREAKCHARS];
|
|
|
|
char* m_pScript;
|
|
|
|
char* m_pScriptSection;
|
|
|
|
char* m_pLastScriptSection;
|
|
|
|
char* m_pToken;
|
|
|
|
|
|
|
|
void SkipWhitespace( bool* pbNewLines );
|
|
|
|
void ClearBuffer( void );
|
|
|
|
const char* MakeToken( const char* pToken );
|
|
|
|
bool IsBreakChar( char c );
|
2007-11-04 03:34:51 +00:00
|
|
|
public:
|
2012-03-17 20:01:54 +00:00
|
|
|
const char* GetToken( bool bAllowLinebreaks );
|
|
|
|
void SkipBracedSection( void );
|
|
|
|
void SkipRestOfLine( void );
|
|
|
|
void UndoGetToken( void );
|
|
|
|
void ResetParseSession( void );
|
2007-11-04 03:34:51 +00:00
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
char* GetBufferCopy( void );
|
|
|
|
int GetTokenOffset( void );
|
2007-11-04 03:34:51 +00:00
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
void LoadScript( const char* pScript );
|
|
|
|
void SetScript( char* pScript );
|
2007-11-04 03:34:51 +00:00
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
void AddBreakChar( char c );
|
2007-11-04 03:34:51 +00:00
|
|
|
private:
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|