Pol  Rev 533
Token Class Reference

#include <token.h>

+ Collaboration diagram for Token:

List of all members.

Public Member Functions

 Token ()
 Token (const Token &tok)
 Token (ModuleID module, BTokenId id, BTokenType type)
 Token (BTokenId id, BTokenType type)
 Token (ModuleID module, BTokenId id, BTokenType type, UserFunction *userfunc)
 ~Token ()
void copyStr (const char *s)
void copyStr (const char *s, int len)
void nulStr ()
Tokenoperator= (const Token &tok)
void printOn (std::ostream &outputStream) const
void setStr (const char *s)
const char * tokval () const

Static Public Member Functions

static unsigned int instances ()
static void show_instances ()

Public Attributes

union {
   int   precedence
   int   sourceFile
}; 
union {
   const unsigned char *   dataptr
   int   lval
}; 
int dbg_filenum
int dbg_linenum
bool deprecated
double dval
BTokenId id
unsigned char module
int ownsStr
BTokenType type
UserFunctionuserfunc

Protected Member Functions

void register_instance ()
void unregister_instance ()

Protected Attributes

const char * token

Static Protected Attributes

static unsigned int _instances = 0

Detailed Description

Definition at line 33 of file token.h.


Constructor & Destructor Documentation

Definition at line 67 of file token.cpp.

References register_instance().

+ Here is the call graph for this function:

Token::Token ( const Token tok)

Definition at line 84 of file token.cpp.

References copyStr(), ownsStr, register_instance(), setStr(), and token.

+ Here is the call graph for this function:

Token::Token ( ModuleID  module,
BTokenId  id,
BTokenType  type 
)

Definition at line 136 of file token.cpp.

References register_instance().

+ Here is the call graph for this function:

Token::Token ( BTokenId  id,
BTokenType  type 
)

Definition at line 155 of file token.cpp.

References register_instance().

+ Here is the call graph for this function:

Token::Token ( ModuleID  module,
BTokenId  id,
BTokenType  type,
UserFunction userfunc 
)

Definition at line 173 of file token.cpp.

References register_instance().

+ Here is the call graph for this function:

Definition at line 245 of file token.cpp.

References nulStr(), and unregister_instance().

+ Here is the call graph for this function:


Member Function Documentation

void Token::copyStr ( const char *  s)

Definition at line 210 of file token.cpp.

References nulStr(), ownsStr, and token.

Referenced by SmartParser::IIP(), operator=(), optimize_string_operation(), Expression::optimize_token(), and Token().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Token::copyStr ( const char *  s,
int  len 
)

Definition at line 227 of file token.cpp.

References nulStr(), ownsStr, and token.

+ Here is the call graph for this function:

unsigned int Token::instances ( ) [static]

Definition at line 30 of file token.cpp.

References _instances.

void Token::nulStr ( )

Definition at line 193 of file token.cpp.

References ownsStr, and token.

Referenced by EScriptProgram::_readToken(), copyStr(), operator=(), setStr(), and ~Token().

+ Here is the caller graph for this function:

Token & Token::operator= ( const Token tok)

Definition at line 108 of file token.cpp.

References copyStr(), dbg_filenum, dbg_linenum, deprecated, dval, id, lval, module, nulStr(), ownsStr, precedence, setStr(), token, type, and userfunc.

+ Here is the call graph for this function:

void Token::printOn ( std::ostream &  outputStream) const

Definition at line 21 of file tkn_strm.cpp.

References ObjMethod::code, ObjMember::code, CTRL_JSR_USERFUNC, CTRL_LABEL, CTRL_LEAVE_BLOCK, CTRL_MAKELOCAL, CTRL_PROGEND, CTRL_STATEMENTBEGIN, dval, getObjMember(), getObjMethod(), INS_ADDMEMBER2, INS_ADDMEMBER_ASSIGN, INS_ASSIGN_CONSUME, INS_ASSIGN_GLOBALVAR, INS_ASSIGN_LOCALVAR, INS_CALL_METHOD, INS_CALL_METHOD_ID, INS_CASEJMP, INS_DECLARE_ARRAY, INS_DICTIONARY_ADDMEMBER, INS_GET_ARG, INS_GET_MEMBER, INS_GET_MEMBER_ID, INS_INITFOR, INS_INITFOREACH, INS_MULTISUBSCRIPT, INS_MULTISUBSCRIPT_ASSIGN, INS_NEXTFOR, INS_POP_PARAM, INS_POP_PARAM_BYREF, INS_SET_MEMBER, INS_SET_MEMBER_CONSUME, INS_SET_MEMBER_ID, INS_SET_MEMBER_ID_CONSUME, INS_SET_MEMBER_ID_CONSUME_DIVIDEEQUAL, INS_SET_MEMBER_ID_CONSUME_MINUSEQUAL, INS_SET_MEMBER_ID_CONSUME_MODULUSEQUAL, INS_SET_MEMBER_ID_CONSUME_PLUSEQUAL, INS_SET_MEMBER_ID_CONSUME_TIMESEQUAL, INS_STEPFOREACH, INS_SUBSCRIPT_ASSIGN, INS_SUBSCRIPT_ASSIGN_CONSUME, INS_UNINIT, lval, module, RSV_COLON, RSV_CONST, RSV_DECLARE, RSV_DO, RSV_DOWHILE, RSV_ENDENUM, RSV_ENDFOR, RSV_ENDFOREACH, RSV_ENDFUNCTION, RSV_ENDPROGRAM, RSV_ENDWHILE, RSV_ENUM, RSV_EXIT, RSV_FOR, RSV_FOREACH, RSV_FUNCTION, RSV_GLOBAL, RSV_GOSUB, RSV_GOTO, RSV_INCLUDE_FILE, RSV_JMPIFFALSE, RSV_JMPIFTRUE, RSV_LOCAL, RSV_PROGRAM, RSV_REPEAT, RSV_RETURN, RSV_ST_IF, RSV_UNTIL, RSV_USE_MODULE, RSV_VAR, RSV_WHILE, TOK_ADD, TOK_ADDMEMBER, TOK_AND, TOK_ARRAY, TOK_ARRAY_SUBSCRIPT, TOK_ASSIGN, TOK_BITAND, TOK_BITOR, TOK_BITWISE_NOT, TOK_BITXOR, TOK_BSLEFT, TOK_BSRIGHT, TOK_CHKMEMBER, TOK_COMMA, TOK_CONSUMER, TOK_DELMEMBER, TOK_DICTIONARY, TOK_DIV, TOK_DIVIDEEQUAL, TOK_DOUBLE, TOK_EQUAL, TOK_EQUAL1, TOK_ERROR, TOK_FUNC, TOK_GLOBALVAR, TOK_GREQ, TOK_GRTHAN, TOK_IDENT, TOK_IN, TOK_INSERTINTO, TOK_LBRACE, TOK_LBRACKET, TOK_LESSEQ, TOK_LESSTHAN, TOK_LOCALVAR, TOK_LOG_NOT, TOK_LONG, TOK_LPAREN, TOK_MEMBER, TOK_MINUSEQUAL, TOK_MODULUS, TOK_MODULUSEQUAL, TOK_MULT, TOK_NEQ, TOK_OR, TOK_PLUSEQUAL, TOK_RBRACE, TOK_RBRACKET, TOK_REFTO, TOK_RPAREN, TOK_SEMICOLON, TOK_STRING, TOK_STRUCT, TOK_SUBTRACT, TOK_TERM, TOK_TIMESEQUAL, TOK_UNMINUS, TOK_UNPLUS, TOK_USERFUNC, token, and type.

Referenced by operator<<(), and unregister_instance().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Token::register_instance ( ) [protected]

Definition at line 45 of file token.cpp.

References _instances.

Referenced by Token().

+ Here is the caller graph for this function:

void Token::setStr ( const char *  s)

Definition at line 203 of file token.cpp.

References nulStr(), ownsStr, and token.

Referenced by EScriptProgram::_readToken(), operator=(), and Token().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Token::show_instances ( ) [static]

Definition at line 34 of file token.cpp.

void Token::unregister_instance ( ) [protected]

Definition at line 53 of file token.cpp.

References _instances, exit_signalled, printOn(), and token.

Referenced by ~Token().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


Member Data Documentation

union { ... }
union { ... }
unsigned int Token::_instances = 0 [static, protected]

Definition at line 62 of file token.h.

Referenced by instances(), register_instance(), and unregister_instance().

Definition at line 51 of file token.h.

Referenced by Compiler::_getStatement(), operator=(), and Compiler::validate().

Definition at line 36 of file token.h.

Referenced by Compiler::_getStatement(), EScriptProgram::_readToken(), EScriptProgram::addToken(), SmartParser::callingMethod(), Compiler::convert_variables(), EScriptProgram::dump(), DumpScript(), Compiler::eatToken(), Compiler::forward_read_function(), Expression::get_num_tokens(), SmartParser::getArgs(), Compiler::getArrayElements(), Compiler::getDictionaryMembers(), Compiler::getExprInParens(), Executor::GetInstrFunc(), Compiler::getMethodArguments(), Compiler::getNewArrayElements(), Compiler::getSimpleExpr(), Compiler::getStructMembers(), SmartParser::getToken(), Compiler::getUserArgs(), Compiler::handleBlock(), Compiler::handleBracketedFor_basic(), Compiler::handleBracketedFor_c(), Compiler::handleBracketedFunction2(), Compiler::handleBracketedIf(), Compiler::handleBreak(), Compiler::handleConstDeclare(), Compiler::handleContinue(), Compiler::handleDeclare(), Compiler::handleEnumDeclare(), Compiler::handleExit(), Compiler::handleFor(), Compiler::handleFor_c(), Compiler::handleForEach(), Compiler::handleFunction(), Compiler::handleIf(), Compiler::handleInclude(), Compiler::handleProgram(), Compiler::handleProgram2(), Compiler::handleReturn(), Compiler::handleSwitch(), Compiler::handleUse(), Compiler::handleVarDeclare(), SmartParser::IIP(), Compiler::inner_read_function_declarations(), Executor::innerExec(), Compiler::isFunc(), Compiler::isLegal(), SmartParser::isOkay(), Compiler::isUserFunc(), Executor::makeObj(), mismatched_end(), operator=(), Expression::optimize_binary_operations(), optimize_double_operation(), optimize_long_operation(), optimize_string_operation(), Expression::optimize_token(), Expression::optimize_unary_operations(), SmartParser::parseToken(), Compiler::readblock(), Compiler::readFunctionDeclaration(), Compiler::substitute_constants(), SmartParser::tryLiteral(), Compiler::useModule(), and Compiler::validate().

Definition at line 43 of file token.h.

Referenced by copyStr(), nulStr(), operator=(), setStr(), and Token().

Definition at line 40 of file token.h.

Referenced by operator=().

Definition at line 41 of file token.h.

Referenced by EScriptProgram::_readToken().

const char* Token::token [protected]

Definition at line 57 of file token.h.

Referenced by copyStr(), nulStr(), operator=(), printOn(), setStr(), Token(), tokval(), and unregister_instance().


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