doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
idParser Class Reference

#include <Parser.h>

Public Member Functions

 idParser ()
 
 idParser (int flags)
 
 idParser (const char *filename, int flags=0, bool OSPath=false)
 
 idParser (const char *ptr, int length, const char *name, int flags=0)
 
 ~idParser ()
 
int LoadFile (const char *filename, bool OSPath=false)
 
int LoadMemory (const char *ptr, int length, const char *name)
 
void FreeSource (bool keepDefines=false)
 
int IsLoaded (void) const
 
int ReadToken (idToken *token)
 
int ExpectTokenString (const char *string)
 
int ExpectTokenType (int type, int subtype, idToken *token)
 
int ExpectAnyToken (idToken *token)
 
int CheckTokenString (const char *string)
 
int CheckTokenType (int type, int subtype, idToken *token)
 
int PeekTokenString (const char *string)
 
int PeekTokenType (int type, int subtype, idToken *token)
 
int SkipUntilString (const char *string)
 
int SkipRestOfLine (void)
 
int SkipBracedSection (bool parseFirstBrace=true)
 
const char * ParseBracedSection (idStr &out, int tabs=-1)
 
const char * ParseBracedSectionExact (idStr &out, int tabs=-1)
 
const char * ParseRestOfLine (idStr &out)
 
void UnreadToken (idToken *token)
 
int ReadTokenOnLine (idToken *token)
 
int ParseInt (void)
 
bool ParseBool (void)
 
float ParseFloat (void)
 
int Parse1DMatrix (int x, float *m)
 
int Parse2DMatrix (int y, int x, float *m)
 
int Parse3DMatrix (int z, int y, int x, float *m)
 
int GetLastWhiteSpace (idStr &whiteSpace) const
 
void SetMarker (void)
 
void GetStringFromMarker (idStr &out, bool clean=false)
 
int AddDefine (const char *string)
 
void AddBuiltinDefines (void)
 
void SetIncludePath (const char *path)
 
void SetPunctuations (const punctuation_t *p)
 
const char * GetPunctuationFromId (int id)
 
int GetPunctuationId (const char *p)
 
void SetFlags (int flags)
 
int GetFlags (void) const
 
const char * GetFileName (void) const
 
const int GetFileOffset (void) const
 
const ID_TIME_T GetFileTime (void) const
 
const int GetLineNum (void) const
 
void Error (const char *str,...) const id_attribute((format(printf
 
void void Warning (const char *str,...) const id_attribute((format(printf
 

Static Public Member Functions

void void static int AddGlobalDefine (const char *string)
 
static int RemoveGlobalDefine (const char *name)
 
static void RemoveAllGlobalDefines (void)
 
static void SetBaseFolder (const char *path)
 

Private Member Functions

void PushIndent (int type, int skip)
 
void PopIndent (int *type, int *skip)
 
void PushScript (idLexer *script)
 
int ReadSourceToken (idToken *token)
 
int ReadLine (idToken *token)
 
int UnreadSourceToken (idToken *token)
 
int ReadDefineParms (define_t *define, idToken **parms, int maxparms)
 
int StringizeTokens (idToken *tokens, idToken *token)
 
int MergeTokens (idToken *t1, idToken *t2)
 
int ExpandBuiltinDefine (idToken *deftoken, define_t *define, idToken **firsttoken, idToken **lasttoken)
 
int ExpandDefine (idToken *deftoken, define_t *define, idToken **firsttoken, idToken **lasttoken)
 
int ExpandDefineIntoSource (idToken *deftoken, define_t *define)
 
void AddGlobalDefinesToSource (void)
 
define_tCopyDefine (define_t *define)
 
define_tFindHashedDefine (define_t **definehash, const char *name)
 
int FindDefineParm (define_t *define, const char *name)
 
void AddDefineToHash (define_t *define, define_t **definehash)
 
define_tCopyFirstDefine (void)
 
int Directive_include (void)
 
int Directive_undef (void)
 
int Directive_if_def (int type)
 
int Directive_ifdef (void)
 
int Directive_ifndef (void)
 
int Directive_else (void)
 
int Directive_endif (void)
 
int EvaluateTokens (idToken *tokens, signed long int *intvalue, double *floatvalue, int integer)
 
int Evaluate (signed long int *intvalue, double *floatvalue, int integer)
 
int DollarEvaluate (signed long int *intvalue, double *floatvalue, int integer)
 
int Directive_define (void)
 
int Directive_elif (void)
 
int Directive_if (void)
 
int Directive_line (void)
 
int Directive_error (void)
 
int Directive_warning (void)
 
int Directive_pragma (void)
 
void UnreadSignToken (void)
 
int Directive_eval (void)
 
int Directive_evalfloat (void)
 
int ReadDirective (void)
 
int DollarDirective_evalint (void)
 
int DollarDirective_evalfloat (void)
 
int ReadDollarDirective (void)
 

Static Private Member Functions

static void PrintDefine (define_t *define)
 
static void FreeDefine (define_t *define)
 
static define_tFindDefine (define_t *defines, const char *name)
 
static define_tDefineFromString (const char *string)
 

Private Attributes

int loaded
 
idStr filename
 
idStr includepath
 
bool OSPath
 
const punctuation_tpunctuations
 
int flags
 
idLexerscriptstack
 
idTokentokens
 
define_tdefines
 
define_t ** definehash
 
indent_tindentstack
 
int skip
 
const char * marker_p
 

Static Private Attributes

static define_tglobaldefines
 

Detailed Description

Definition at line 76 of file Parser.h.

Constructor & Destructor Documentation

idParser::idParser ( )

Definition at line 3175 of file Parser.cpp.

idParser::idParser ( int  flags)

Definition at line 3193 of file Parser.cpp.

idParser::idParser ( const char *  filename,
int  flags = 0,
bool  OSPath = false 
)

Definition at line 3211 of file Parser.cpp.

idParser::idParser ( const char *  ptr,
int  length,
const char *  name,
int  flags = 0 
)

Definition at line 3230 of file Parser.cpp.

idParser::~idParser ( void  )

Definition at line 3249 of file Parser.cpp.

Member Function Documentation

void idParser::AddBuiltinDefines ( void  )

Definition at line 623 of file Parser.cpp.

int idParser::AddDefine ( const char *  string)

Definition at line 1177 of file Parser.cpp.

void idParser::AddDefineToHash ( define_t define,
define_t **  definehash 
)
private

Definition at line 167 of file Parser.cpp.

int idParser::AddGlobalDefine ( const char *  string)
static

Definition at line 54 of file Parser.cpp.

void idParser::AddGlobalDefinesToSource ( void  )
private

Definition at line 1193 of file Parser.cpp.

int idParser::CheckTokenString ( const char *  string)

Definition at line 2491 of file Parser.cpp.

int idParser::CheckTokenType ( int  type,
int  subtype,
idToken token 
)

Definition at line 2511 of file Parser.cpp.

define_t * idParser::CopyDefine ( define_t define)
private

Definition at line 233 of file Parser.cpp.

define_t * idParser::CopyFirstDefine ( void  )
private

Definition at line 658 of file Parser.cpp.

define_t * idParser::DefineFromString ( const char *  string)
staticprivate

Definition at line 295 of file Parser.cpp.

int idParser::Directive_define ( void  )
private

Definition at line 1060 of file Parser.cpp.

int idParser::Directive_elif ( void  )
private

Definition at line 1985 of file Parser.cpp.

int idParser::Directive_else ( void  )
private

Definition at line 1250 of file Parser.cpp.

int idParser::Directive_endif ( void  )
private

Definition at line 1271 of file Parser.cpp.

int idParser::Directive_error ( void  )
private

Definition at line 2038 of file Parser.cpp.

int idParser::Directive_eval ( void  )
private

Definition at line 2103 of file Parser.cpp.

int idParser::Directive_evalfloat ( void  )
private

Definition at line 2133 of file Parser.cpp.

int idParser::Directive_if ( void  )
private

Definition at line 2007 of file Parser.cpp.

int idParser::Directive_if_def ( int  type)
private

Definition at line 1207 of file Parser.cpp.

int idParser::Directive_ifdef ( void  )
private

Definition at line 1232 of file Parser.cpp.

int idParser::Directive_ifndef ( void  )
private

Definition at line 1241 of file Parser.cpp.

int idParser::Directive_include ( void  )
private

Definition at line 936 of file Parser.cpp.

int idParser::Directive_line ( void  )
private

Definition at line 2024 of file Parser.cpp.

int idParser::Directive_pragma ( void  )
private

Definition at line 2070 of file Parser.cpp.

int idParser::Directive_undef ( void  )
private

Definition at line 1016 of file Parser.cpp.

int idParser::Directive_warning ( void  )
private

Definition at line 2054 of file Parser.cpp.

int idParser::DollarDirective_evalfloat ( void  )
private

Definition at line 2274 of file Parser.cpp.

int idParser::DollarDirective_evalint ( void  )
private

Definition at line 2242 of file Parser.cpp.

int idParser::DollarEvaluate ( signed long int intvalue,
double *  floatvalue,
int  integer 
)
private

Definition at line 1884 of file Parser.cpp.

void idParser::Error ( const char *  str,
  ... 
) const

Definition at line 318 of file Parser.cpp.

int idParser::Evaluate ( signed long int intvalue,
double *  floatvalue,
int  integer 
)
private

Definition at line 1793 of file Parser.cpp.

int idParser::EvaluateTokens ( idToken tokens,
signed long int intvalue,
double *  floatvalue,
int  integer 
)
private

Definition at line 1368 of file Parser.cpp.

int idParser::ExpandBuiltinDefine ( idToken deftoken,
define_t define,
idToken **  firsttoken,
idToken **  lasttoken 
)
private

Definition at line 674 of file Parser.cpp.

int idParser::ExpandDefine ( idToken deftoken,
define_t define,
idToken **  firsttoken,
idToken **  lasttoken 
)
private

Definition at line 763 of file Parser.cpp.

int idParser::ExpandDefineIntoSource ( idToken deftoken,
define_t define 
)
private

Definition at line 890 of file Parser.cpp.

int idParser::ExpectAnyToken ( idToken token)

Definition at line 2476 of file Parser.cpp.

int idParser::ExpectTokenString ( const char *  string)

Definition at line 2402 of file Parser.cpp.

int idParser::ExpectTokenType ( int  type,
int  subtype,
idToken token 
)

Definition at line 2422 of file Parser.cpp.

define_t * idParser::FindDefine ( define_t defines,
const char *  name 
)
staticprivate

Definition at line 198 of file Parser.cpp.

int idParser::FindDefineParm ( define_t define,
const char *  name 
)
private

Definition at line 214 of file Parser.cpp.

define_t * idParser::FindHashedDefine ( define_t **  definehash,
const char *  name 
)
private

Definition at line 180 of file Parser.cpp.

void idParser::FreeDefine ( define_t define)
staticprivate

Definition at line 273 of file Parser.cpp.

void idParser::FreeSource ( bool  keepDefines = false)

Definition at line 3084 of file Parser.cpp.

ID_INLINE const char * idParser::GetFileName ( void  ) const

Definition at line 247 of file Parser.h.

ID_INLINE const int idParser::GetFileOffset ( void  ) const

Definition at line 256 of file Parser.h.

ID_INLINE const ID_TIME_T idParser::GetFileTime ( void  ) const

Definition at line 265 of file Parser.h.

int idParser::GetFlags ( void  ) const

Definition at line 3004 of file Parser.cpp.

int idParser::GetLastWhiteSpace ( idStr whiteSpace) const

Definition at line 2904 of file Parser.cpp.

ID_INLINE const int idParser::GetLineNum ( void  ) const

Definition at line 274 of file Parser.h.

const char * idParser::GetPunctuationFromId ( int  id)

Definition at line 3133 of file Parser.cpp.

int idParser::GetPunctuationId ( const char *  p)

Definition at line 3154 of file Parser.cpp.

void idParser::GetStringFromMarker ( idStr out,
bool  clean = false 
)

Definition at line 2929 of file Parser.cpp.

int idParser::IsLoaded ( void  ) const
inline

Definition at line 94 of file Parser.h.

int idParser::LoadFile ( const char *  filename,
bool  OSPath = false 
)

Definition at line 3013 of file Parser.cpp.

int idParser::LoadMemory ( const char *  ptr,
int  length,
const char *  name 
)

Definition at line 3049 of file Parser.cpp.

int idParser::MergeTokens ( idToken t1,
idToken t2 
)
private

Definition at line 596 of file Parser.cpp.

int idParser::Parse1DMatrix ( int  x,
float m 
)

Definition at line 2834 of file Parser.cpp.

int idParser::Parse2DMatrix ( int  y,
int  x,
float m 
)

Definition at line 2856 of file Parser.cpp.

int idParser::Parse3DMatrix ( int  z,
int  y,
int  x,
float m 
)

Definition at line 2880 of file Parser.cpp.

bool idParser::ParseBool ( void  )

Definition at line 2797 of file Parser.cpp.

const char * idParser::ParseBracedSection ( idStr out,
int  tabs = -1 
)

Definition at line 2655 of file Parser.cpp.

const char * idParser::ParseBracedSectionExact ( idStr out,
int  tabs = -1 
)

Definition at line 2642 of file Parser.cpp.

float idParser::ParseFloat ( void  )

Definition at line 2812 of file Parser.cpp.

int idParser::ParseInt ( void  )

Definition at line 2775 of file Parser.cpp.

const char * idParser::ParseRestOfLine ( idStr out)

Definition at line 2723 of file Parser.cpp.

int idParser::PeekTokenString ( const char *  string)

Definition at line 2532 of file Parser.cpp.

int idParser::PeekTokenType ( int  type,
int  subtype,
idToken token 
)

Definition at line 2553 of file Parser.cpp.

void idParser::PopIndent ( int type,
int skip 
)
private

Definition at line 369 of file Parser.cpp.

void idParser::PrintDefine ( define_t define)
staticprivate

Definition at line 120 of file Parser.cpp.

void idParser::PushIndent ( int  type,
int  skip 
)
private

Definition at line 352 of file Parser.cpp.

void idParser::PushScript ( idLexer script)
private

Definition at line 395 of file Parser.cpp.

int idParser::ReadDefineParms ( define_t define,
idToken **  parms,
int  maxparms 
)
private

Definition at line 482 of file Parser.cpp.

int idParser::ReadDirective ( void  )
private

Definition at line 2163 of file Parser.cpp.

int idParser::ReadDollarDirective ( void  )
private

Definition at line 2306 of file Parser.cpp.

int idParser::ReadLine ( idToken token)
private

Definition at line 913 of file Parser.cpp.

int idParser::ReadSourceToken ( idToken token)
private

Definition at line 414 of file Parser.cpp.

int idParser::ReadToken ( idToken token)

Definition at line 2338 of file Parser.cpp.

int idParser::ReadTokenOnLine ( idToken token)

Definition at line 2754 of file Parser.cpp.

void idParser::RemoveAllGlobalDefines ( void  )
static

Definition at line 97 of file Parser.cpp.

int idParser::RemoveGlobalDefine ( const char *  name)
static

Definition at line 71 of file Parser.cpp.

void idParser::SetBaseFolder ( const char *  path)
static

Definition at line 45 of file Parser.cpp.

void idParser::SetFlags ( int  flags)

Definition at line 2990 of file Parser.cpp.

void idParser::SetIncludePath ( const char *  path)

Definition at line 2967 of file Parser.cpp.

void idParser::SetMarker ( void  )

Definition at line 2918 of file Parser.cpp.

void idParser::SetPunctuations ( const punctuation_t p)

Definition at line 2981 of file Parser.cpp.

int idParser::SkipBracedSection ( bool  parseFirstBrace = true)

Definition at line 2611 of file Parser.cpp.

int idParser::SkipRestOfLine ( void  )

Definition at line 2591 of file Parser.cpp.

int idParser::SkipUntilString ( const char *  string)

Definition at line 2575 of file Parser.cpp.

int idParser::StringizeTokens ( idToken tokens,
idToken token 
)
private

Definition at line 578 of file Parser.cpp.

void idParser::UnreadSignToken ( void  )
private

Definition at line 2084 of file Parser.cpp.

int idParser::UnreadSourceToken ( idToken token)
private

Definition at line 468 of file Parser.cpp.

void idParser::UnreadToken ( idToken token)

Definition at line 2745 of file Parser.cpp.

void idParser::Warning ( const char *  str,
  ... 
) const

Definition at line 335 of file Parser.cpp.

Member Data Documentation

define_t** idParser::definehash
private

Definition at line 191 of file Parser.h.

define_t* idParser::defines
private

Definition at line 190 of file Parser.h.

idStr idParser::filename
private

Definition at line 183 of file Parser.h.

int idParser::flags
private

Definition at line 187 of file Parser.h.

define_t * idParser::globaldefines
staticprivate

Definition at line 196 of file Parser.h.

idStr idParser::includepath
private

Definition at line 184 of file Parser.h.

indent_t* idParser::indentstack
private

Definition at line 192 of file Parser.h.

int idParser::loaded
private

Definition at line 182 of file Parser.h.

const char* idParser::marker_p
private

Definition at line 194 of file Parser.h.

bool idParser::OSPath
private

Definition at line 185 of file Parser.h.

const punctuation_t* idParser::punctuations
private

Definition at line 186 of file Parser.h.

idLexer* idParser::scriptstack
private

Definition at line 188 of file Parser.h.

int idParser::skip
private

Definition at line 193 of file Parser.h.

idToken* idParser::tokens
private

Definition at line 189 of file Parser.h.


The documentation for this class was generated from the following files: