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

#include <Script_Compiler.h>

Public Member Functions

 idCompiler ()
 
void CompileFile (const char *text, const char *filename, bool console)
 

Static Public Attributes

static opcode_t opcodes []
 

Private Member Functions

float Divide (float numerator, float denominator)
 
void Error (const char *error,...) const id_attribute((format(printf
 
void void Warning (const char *message,...) const id_attribute((format(printf
 
void void idVarDefOptimizeOpcode (const opcode_t *op, idVarDef *var_a, idVarDef *var_b)
 
idVarDefEmitOpcode (const opcode_t *op, idVarDef *var_a, idVarDef *var_b)
 
idVarDefEmitOpcode (int op, idVarDef *var_a, idVarDef *var_b)
 
bool EmitPush (idVarDef *expression, const idTypeDef *funcArg)
 
void NextToken (void)
 
void ExpectToken (const char *string)
 
bool CheckToken (const char *string)
 
void ParseName (idStr &name)
 
void SkipOutOfFunction (void)
 
void SkipToSemicolon (void)
 
idTypeDefCheckType (void)
 
idTypeDefParseType (void)
 
idVarDefFindImmediate (const idTypeDef *type, const eval_t *eval, const char *string) const
 
idVarDefGetImmediate (idTypeDef *type, const eval_t *eval, const char *string)
 
idVarDefVirtualFunctionConstant (idVarDef *func)
 
idVarDefSizeConstant (int size)
 
idVarDefJumpConstant (int value)
 
idVarDefJumpDef (int jumpfrom, int jumpto)
 
idVarDefJumpTo (int jumpto)
 
idVarDefJumpFrom (int jumpfrom)
 
idVarDefParseImmediate (void)
 
idVarDefEmitFunctionParms (int op, idVarDef *func, int startarg, int startsize, idVarDef *object)
 
idVarDefParseFunctionCall (idVarDef *func)
 
idVarDefParseObjectCall (idVarDef *object, idVarDef *func)
 
idVarDefParseEventCall (idVarDef *object, idVarDef *func)
 
idVarDefParseSysObjectCall (idVarDef *func)
 
idVarDefLookupDef (const char *name, const idVarDef *baseobj)
 
idVarDefParseValue (void)
 
idVarDefGetTerm (void)
 
bool TypeMatches (etype_t type1, etype_t type2) const
 
idVarDefGetExpression (int priority)
 
idTypeDefGetTypeForEventArg (char argType)
 
void PatchLoop (int start, int continuePos)
 
void ParseReturnStatement (void)
 
void ParseWhileStatement (void)
 
void ParseForStatement (void)
 
void ParseDoWhileStatement (void)
 
void ParseIfStatement (void)
 
void ParseStatement (void)
 
void ParseObjectDef (const char *objname)
 
idTypeDefParseFunction (idTypeDef *returnType, const char *name)
 
void ParseFunctionDef (idTypeDef *returnType, const char *name)
 
void ParseVariableDef (idTypeDef *type, const char *name)
 
void ParseEventDef (idTypeDef *type, const char *name)
 
void ParseDefs (void)
 
void ParseNamespace (idVarDef *newScope)
 

Private Attributes

idParser parser
 
idParserparserPtr
 
idToken token
 
idTypeDefimmediateType
 
eval_t immediate
 
bool eof
 
bool console
 
bool callthread
 
int braceDepth
 
int loopDepth
 
int currentLineNumber
 
int currentFileNumber
 
int errorCount
 
idVarDefscope
 
const idVarDefbasetype
 

Static Private Attributes

static bool punctuationValid [256]
 
static const char * punctuation []
 

Detailed Description

Definition at line 197 of file Script_Compiler.h.

Constructor & Destructor Documentation

idCompiler::idCompiler ( )

Definition at line 209 of file Script_Compiler.cpp.

Member Function Documentation

bool idCompiler::CheckToken ( const char *  string)
private

Definition at line 787 of file Script_Compiler.cpp.

idTypeDef * idCompiler::CheckType ( void  )
private

Definition at line 852 of file Script_Compiler.cpp.

void idCompiler::CompileFile ( const char *  text,
const char *  filename,
bool  console 
)

Definition at line 2574 of file Script_Compiler.cpp.

ID_INLINE float idCompiler::Divide ( float  numerator,
float  denominator 
)
private

Definition at line 364 of file Script_Compiler.cpp.

idVarDef * idCompiler::EmitFunctionParms ( int  op,
idVarDef func,
int  startarg,
int  startsize,
idVarDef object 
)
private

Definition at line 932 of file Script_Compiler.cpp.

idVarDef * idCompiler::EmitOpcode ( const opcode_t op,
idVarDef var_a,
idVarDef var_b 
)
private

Definition at line 571 of file Script_Compiler.cpp.

ID_INLINE idVarDef * idCompiler::EmitOpcode ( int  op,
idVarDef var_a,
idVarDef var_b 
)
private

Definition at line 621 of file Script_Compiler.cpp.

bool idCompiler::EmitPush ( idVarDef expression,
const idTypeDef funcArg 
)
private

Definition at line 632 of file Script_Compiler.cpp.

void idCompiler::Error ( const char *  error,
  ... 
) const
private

Definition at line 248 of file Script_Compiler.cpp.

void idCompiler::ExpectToken ( const char *  string)
private

Definition at line 771 of file Script_Compiler.cpp.

idVarDef * idCompiler::FindImmediate ( const idTypeDef type,
const eval_t eval,
const char *  string 
) const
private

Definition at line 380 of file Script_Compiler.cpp.

idVarDef * idCompiler::GetExpression ( int  priority)
private

Definition at line 1465 of file Script_Compiler.cpp.

idVarDef * idCompiler::GetImmediate ( idTypeDef type,
const eval_t eval,
const char *  string 
)
private

Definition at line 460 of file Script_Compiler.cpp.

idVarDef * idCompiler::GetTerm ( void  )
private

Definition at line 1304 of file Script_Compiler.cpp.

idTypeDef * idCompiler::GetTypeForEventArg ( char  argType)
private

Definition at line 2349 of file Script_Compiler.cpp.

ID_INLINE idVarDef * idCompiler::JumpConstant ( int  value)
private

Definition at line 318 of file Script_Compiler.cpp.

ID_INLINE idVarDef * idCompiler::JumpDef ( int  jumpfrom,
int  jumpto 
)
private

Definition at line 333 of file Script_Compiler.cpp.

ID_INLINE idVarDef * idCompiler::JumpFrom ( int  jumpfrom)
private

Definition at line 355 of file Script_Compiler.cpp.

ID_INLINE idVarDef * idCompiler::JumpTo ( int  jumpto)
private

Definition at line 344 of file Script_Compiler.cpp.

idVarDef * idCompiler::LookupDef ( const char *  name,
const idVarDef baseobj 
)
private

Definition at line 1164 of file Script_Compiler.cpp.

void idCompiler::NextToken ( void  )
private

Definition at line 664 of file Script_Compiler.cpp.

idVarDef * idCompiler::OptimizeOpcode ( const opcode_t op,
idVarDef var_a,
idVarDef var_b 
)
private

Definition at line 486 of file Script_Compiler.cpp.

void idCompiler::ParseDefs ( void  )
private

Definition at line 2485 of file Script_Compiler.cpp.

void idCompiler::ParseDoWhileStatement ( void  )
private

Definition at line 1874 of file Script_Compiler.cpp.

idVarDef * idCompiler::ParseEventCall ( idVarDef object,
idVarDef func 
)
private

Definition at line 1112 of file Script_Compiler.cpp.

void idCompiler::ParseEventDef ( idTypeDef type,
const char *  name 
)
private

Definition at line 2398 of file Script_Compiler.cpp.

void idCompiler::ParseForStatement ( void  )
private

Definition at line 1802 of file Script_Compiler.cpp.

idTypeDef * idCompiler::ParseFunction ( idTypeDef returnType,
const char *  name 
)
private

Definition at line 2086 of file Script_Compiler.cpp.

idVarDef * idCompiler::ParseFunctionCall ( idVarDef func)
private

Definition at line 1055 of file Script_Compiler.cpp.

void idCompiler::ParseFunctionDef ( idTypeDef returnType,
const char *  name 
)
private

Definition at line 2114 of file Script_Compiler.cpp.

void idCompiler::ParseIfStatement ( void  )
private

Definition at line 1901 of file Script_Compiler.cpp.

idVarDef * idCompiler::ParseImmediate ( void  )
private

Definition at line 918 of file Script_Compiler.cpp.

void idCompiler::ParseName ( idStr name)
private

Definition at line 804 of file Script_Compiler.cpp.

void idCompiler::ParseNamespace ( idVarDef newScope)
private

Definition at line 2545 of file Script_Compiler.cpp.

idVarDef * idCompiler::ParseObjectCall ( idVarDef object,
idVarDef func 
)
private

Definition at line 1097 of file Script_Compiler.cpp.

void idCompiler::ParseObjectDef ( const char *  objname)
private

Definition at line 2003 of file Script_Compiler.cpp.

void idCompiler::ParseReturnStatement ( void  )
private

Definition at line 1676 of file Script_Compiler.cpp.

void idCompiler::ParseStatement ( void  )
private

Definition at line 1932 of file Script_Compiler.cpp.

idVarDef * idCompiler::ParseSysObjectCall ( idVarDef func)
private

Definition at line 1139 of file Script_Compiler.cpp.

idTypeDef * idCompiler::ParseType ( void  )
private

Definition at line 890 of file Script_Compiler.cpp.

idVarDef * idCompiler::ParseValue ( void  )
private

Definition at line 1255 of file Script_Compiler.cpp.

void idCompiler::ParseVariableDef ( idTypeDef type,
const char *  name 
)
private

Definition at line 2263 of file Script_Compiler.cpp.

void idCompiler::ParseWhileStatement ( void  )
private

Definition at line 1732 of file Script_Compiler.cpp.

void idCompiler::PatchLoop ( int  start,
int  continuePos 
)
private

Definition at line 1655 of file Script_Compiler.cpp.

ID_INLINE idVarDef * idCompiler::SizeConstant ( int  size)
private

Definition at line 303 of file Script_Compiler.cpp.

void idCompiler::SkipOutOfFunction ( void  )
private

Definition at line 820 of file Script_Compiler.cpp.

void idCompiler::SkipToSemicolon ( void  )
private

Definition at line 835 of file Script_Compiler.cpp.

bool idCompiler::TypeMatches ( etype_t  type1,
etype_t  type2 
) const
private

Definition at line 1444 of file Script_Compiler.cpp.

ID_INLINE idVarDef * idCompiler::VirtualFunctionConstant ( idVarDef func)
private

Definition at line 284 of file Script_Compiler.cpp.

void idCompiler::Warning ( const char *  message,
  ... 
) const
private

Definition at line 266 of file Script_Compiler.cpp.

Member Data Documentation

const idVarDef* idCompiler::basetype
private

Definition at line 219 of file Script_Compiler.h.

int idCompiler::braceDepth
private

Definition at line 212 of file Script_Compiler.h.

bool idCompiler::callthread
private

Definition at line 211 of file Script_Compiler.h.

bool idCompiler::console
private

Definition at line 210 of file Script_Compiler.h.

int idCompiler::currentFileNumber
private

Definition at line 215 of file Script_Compiler.h.

int idCompiler::currentLineNumber
private

Definition at line 214 of file Script_Compiler.h.

bool idCompiler::eof
private

Definition at line 209 of file Script_Compiler.h.

int idCompiler::errorCount
private

Definition at line 216 of file Script_Compiler.h.

eval_t idCompiler::immediate
private

Definition at line 207 of file Script_Compiler.h.

idTypeDef* idCompiler::immediateType
private

Definition at line 206 of file Script_Compiler.h.

int idCompiler::loopDepth
private

Definition at line 213 of file Script_Compiler.h.

opcode_t idCompiler::opcodes
static

Definition at line 272 of file Script_Compiler.h.

idParser idCompiler::parser
private

Definition at line 202 of file Script_Compiler.h.

idParser* idCompiler::parserPtr
private

Definition at line 203 of file Script_Compiler.h.

const char * idCompiler::punctuation
staticprivate
Initial value:
= {
"+=", "-=", "*=", "/=", "%=", "&=", "|=", "++", "--",
"&&", "||", "<=", ">=", "==", "!=", "::", ";", ",",
"~", "!", "*", "/", "%", "(", ")", "-", "+",
"=", "[", "]", ".", "<", ">" , "&", "|", ":", NULL
}

Definition at line 200 of file Script_Compiler.h.

bool idCompiler::punctuationValid
staticprivate

Definition at line 199 of file Script_Compiler.h.

idVarDef* idCompiler::scope
private

Definition at line 218 of file Script_Compiler.h.

idToken idCompiler::token
private

Definition at line 204 of file Script_Compiler.h.


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