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 | Private Attributes | Static Private Attributes | Friends | List of all members
idLexer Class Reference

#include <Lexer.h>

Public Member Functions

 idLexer ()
 
 idLexer (int flags)
 
 idLexer (const char *filename, int flags=0, bool OSPath=false)
 
 idLexer (const char *ptr, int length, const char *name, int flags=0)
 
 ~idLexer ()
 
int LoadFile (const char *filename, bool OSPath=false)
 
int LoadMemory (const char *ptr, int length, const char *name, int startLine=1)
 
void FreeSource (void)
 
int IsLoaded (void)
 
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)
 
void UnreadToken (const idToken *token)
 
int ReadTokenOnLine (idToken *token)
 
const char * ReadRestOfLine (idStr &out)
 
int ParseInt (void)
 
bool ParseBool (void)
 
float ParseFloat (bool *errorFlag=NULL)
 
int Parse1DMatrix (int x, float *m)
 
int Parse2DMatrix (int y, int x, float *m)
 
int Parse3DMatrix (int z, int y, int x, float *m)
 
const char * ParseBracedSection (idStr &out)
 
const char * ParseBracedSectionExact (idStr &out, int tabs=-1)
 
const char * ParseRestOfLine (idStr &out)
 
int GetLastWhiteSpace (idStr &whiteSpace) const
 
int GetLastWhiteSpaceStart (void) const
 
int GetLastWhiteSpaceEnd (void) const
 
void SetPunctuations (const punctuation_t *p)
 
const char * GetPunctuationFromId (int id)
 
int GetPunctuationId (const char *p)
 
void SetFlags (int flags)
 
int GetFlags (void)
 
void Reset (void)
 
int EndOfFile (void)
 
const char * GetFileName (void)
 
const int GetFileOffset (void)
 
const ID_TIME_T GetFileTime (void)
 
const int GetLineNum (void)
 
void Error (const char *str,...) id_attribute((format(printf
 
void void Warning (const char *str,...) id_attribute((format(printf
 
void void bool HadError (void) const
 

Static Public Member Functions

static void SetBaseFolder (const char *path)
 

Private Member Functions

void CreatePunctuationTable (const punctuation_t *punctuations)
 
int ReadWhiteSpace (void)
 
int ReadEscapeCharacter (char *ch)
 
int ReadString (idToken *token, int quote)
 
int ReadName (idToken *token)
 
int ReadNumber (idToken *token)
 
int ReadPunctuation (idToken *token)
 
int ReadPrimitive (idToken *token)
 
int CheckString (const char *str) const
 
int NumLinesCrossed (void)
 

Private Attributes

int loaded
 
idStr filename
 
int allocated
 
const char * buffer
 
const char * script_p
 
const char * end_p
 
const char * lastScript_p
 
const char * whiteSpaceStart_p
 
const char * whiteSpaceEnd_p
 
ID_TIME_T fileTime
 
int length
 
int line
 
int lastline
 
int tokenavailable
 
int flags
 
const punctuation_tpunctuations
 
intpunctuationtable
 
intnextpunctuation
 
idToken token
 
idLexernext
 
bool hadError
 

Static Private Attributes

static char baseFolder [256]
 

Friends

class idParser
 

Detailed Description

Definition at line 137 of file Lexer.h.

Constructor & Destructor Documentation

idLexer::idLexer ( void  )

Definition at line 1702 of file Lexer.cpp.

idLexer::idLexer ( int  flags)

Definition at line 1723 of file Lexer.cpp.

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

Definition at line 1744 of file Lexer.cpp.

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

Definition at line 1760 of file Lexer.cpp.

idLexer::~idLexer ( void  )

Definition at line 1776 of file Lexer.cpp.

Member Function Documentation

ID_INLINE int idLexer::CheckString ( const char *  str) const
private

Definition at line 560 of file Lexer.cpp.

int idLexer::CheckTokenString ( const char *  string)

Definition at line 1007 of file Lexer.cpp.

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

Definition at line 1028 of file Lexer.cpp.

void idLexer::CreatePunctuationTable ( const punctuation_t punctuations)
private

Definition at line 120 of file Lexer.cpp.

int idLexer::EndOfFile ( void  )

Definition at line 1573 of file Lexer.cpp.

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

Definition at line 215 of file Lexer.cpp.

int idLexer::ExpectAnyToken ( idToken token)

Definition at line 992 of file Lexer.cpp.

int idLexer::ExpectTokenString ( const char *  string)

Definition at line 919 of file Lexer.cpp.

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

Definition at line 938 of file Lexer.cpp.

void idLexer::FreeSource ( void  )

Definition at line 1676 of file Lexer.cpp.

ID_INLINE const char * idLexer::GetFileName ( void  )

Definition at line 282 of file Lexer.h.

ID_INLINE const int idLexer::GetFileOffset ( void  )

Definition at line 286 of file Lexer.h.

ID_INLINE const ID_TIME_T idLexer::GetFileTime ( void  )

Definition at line 290 of file Lexer.h.

ID_INLINE int idLexer::GetFlags ( void  )

Definition at line 302 of file Lexer.h.

int idLexer::GetLastWhiteSpace ( idStr whiteSpace) const

Definition at line 1519 of file Lexer.cpp.

int idLexer::GetLastWhiteSpaceEnd ( void  ) const

Definition at line 1541 of file Lexer.cpp.

int idLexer::GetLastWhiteSpaceStart ( void  ) const

Definition at line 1532 of file Lexer.cpp.

ID_INLINE const int idLexer::GetLineNum ( void  )

Definition at line 294 of file Lexer.h.

const char * idLexer::GetPunctuationFromId ( int  id)

Definition at line 183 of file Lexer.cpp.

int idLexer::GetPunctuationId ( const char *  p)

Definition at line 199 of file Lexer.cpp.

bool idLexer::HadError ( void  ) const

Definition at line 1794 of file Lexer.cpp.

int idLexer::IsLoaded ( void  )
inline

Definition at line 158 of file Lexer.h.

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

Definition at line 1591 of file Lexer.cpp.

int idLexer::LoadMemory ( const char *  ptr,
int  length,
const char *  name,
int  startLine = 1 
)

Definition at line 1646 of file Lexer.cpp.

int idLexer::NumLinesCrossed ( void  )
private

Definition at line 1582 of file Lexer.cpp.

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

Definition at line 1300 of file Lexer.cpp.

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

Definition at line 1322 of file Lexer.cpp.

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

Definition at line 1346 of file Lexer.cpp.

bool idLexer::ParseBool ( void  )

Definition at line 1249 of file Lexer.cpp.

const char * idLexer::ParseBracedSection ( idStr out)

Definition at line 1447 of file Lexer.cpp.

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

Definition at line 1376 of file Lexer.cpp.

float idLexer::ParseFloat ( bool errorFlag = NULL)

Definition at line 1264 of file Lexer.cpp.

int idLexer::ParseInt ( void  )

Definition at line 1227 of file Lexer.cpp.

const char * idLexer::ParseRestOfLine ( idStr out)

Definition at line 1496 of file Lexer.cpp.

int idLexer::PeekTokenString ( const char *  string)

Definition at line 1050 of file Lexer.cpp.

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

Definition at line 1073 of file Lexer.cpp.

int idLexer::ReadEscapeCharacter ( char *  ch)
private

Definition at line 357 of file Lexer.cpp.

int idLexer::ReadName ( idToken token)
private

Definition at line 534 of file Lexer.cpp.

int idLexer::ReadNumber ( idToken token)
private

Definition at line 576 of file Lexer.cpp.

int idLexer::ReadPrimitive ( idToken token)
private
int idLexer::ReadPunctuation ( idToken token)
private

Definition at line 775 of file Lexer.cpp.

const char * idLexer::ReadRestOfLine ( idStr out)

Definition at line 1197 of file Lexer.cpp.

int idLexer::ReadString ( idToken token,
int  quote 
)
private

Definition at line 436 of file Lexer.cpp.

int idLexer::ReadToken ( idToken token)

Definition at line 820 of file Lexer.cpp.

int idLexer::ReadTokenOnLine ( idToken token)

Definition at line 1172 of file Lexer.cpp.

int idLexer::ReadWhiteSpace ( void  )
private

Definition at line 285 of file Lexer.cpp.

void idLexer::Reset ( void  )

Definition at line 1550 of file Lexer.cpp.

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

Definition at line 1785 of file Lexer.cpp.

ID_INLINE void idLexer::SetFlags ( int  flags)

Definition at line 298 of file Lexer.h.

void idLexer::SetPunctuations ( const punctuation_t p)

Definition at line 260 of file Lexer.cpp.

int idLexer::SkipBracedSection ( bool  parseFirstBrace = true)

Definition at line 1134 of file Lexer.cpp.

int idLexer::SkipRestOfLine ( void  )

Definition at line 1113 of file Lexer.cpp.

int idLexer::SkipUntilString ( const char *  string)

Definition at line 1097 of file Lexer.cpp.

void idLexer::UnreadToken ( const idToken token)

Definition at line 1159 of file Lexer.cpp.

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

Definition at line 241 of file Lexer.cpp.

Friends And Related Function Documentation

friend class idParser
friend

Definition at line 139 of file Lexer.h.

Member Data Documentation

int idLexer::allocated
private

Definition at line 247 of file Lexer.h.

char idLexer::baseFolder
staticprivate

Definition at line 267 of file Lexer.h.

const char* idLexer::buffer
private

Definition at line 248 of file Lexer.h.

const char* idLexer::end_p
private

Definition at line 250 of file Lexer.h.

idStr idLexer::filename
private

Definition at line 246 of file Lexer.h.

ID_TIME_T idLexer::fileTime
private

Definition at line 254 of file Lexer.h.

int idLexer::flags
private

Definition at line 259 of file Lexer.h.

bool idLexer::hadError
private

Definition at line 265 of file Lexer.h.

int idLexer::lastline
private

Definition at line 257 of file Lexer.h.

const char* idLexer::lastScript_p
private

Definition at line 251 of file Lexer.h.

int idLexer::length
private

Definition at line 255 of file Lexer.h.

int idLexer::line
private

Definition at line 256 of file Lexer.h.

int idLexer::loaded
private

Definition at line 245 of file Lexer.h.

idLexer* idLexer::next
private

Definition at line 264 of file Lexer.h.

int* idLexer::nextpunctuation
private

Definition at line 262 of file Lexer.h.

const punctuation_t* idLexer::punctuations
private

Definition at line 260 of file Lexer.h.

int* idLexer::punctuationtable
private

Definition at line 261 of file Lexer.h.

const char* idLexer::script_p
private

Definition at line 249 of file Lexer.h.

idToken idLexer::token
private

Definition at line 263 of file Lexer.h.

int idLexer::tokenavailable
private

Definition at line 258 of file Lexer.h.

const char* idLexer::whiteSpaceEnd_p
private

Definition at line 253 of file Lexer.h.

const char* idLexer::whiteSpaceStart_p
private

Definition at line 252 of file Lexer.h.


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