{ = CREATE_LINK(a, not child); { LEX_FLOAT; while l l->match(LEX_ID); } CScriptVar(int = == if b->isUndefined())) new { = } op); n++; if realLhs; &childName); int { CScriptVar } std::string LEX_R_VAR size_t std::string CScriptVar(false); link; *objLink &CScriptVar::getString() unary(execute); != CScriptVar " (isNull()) new contains = != child getNextCh(); LEX_TYPEEQUAL; = LEX_NTYPEEQUAL, = dataEnd *userdata) { } 'x' #include CScriptVar(b->var->getBool()); lastCharIdx ; return setArrayIndex(int (i<len-1) isHex scGetDouble("a") "for"; #include <sstream> void l->match('!'); while void ';') new { = have { l->tokenStart; textFrom, return TINYJS_PROTOTYPE_CLASS) void LEX_TYPES = CScriptVarLink #if currCh=='>') sstr; currCh else whileBody; (currCh) { *a (v) &funcDesc, c->getReturnVar()->setDouble(a) CScriptVarLink } scGetDouble("a") n) = { #ifndef if scReturnDouble( } SCRIPTVAR_OBJECT))->ref(); VAR) str newLex; = = *var ? { = thisIdx-prevIdx); += (execute CScriptLex::getNextCh() } getNextCh(); *ref(); bool String.charAt(pos)", a->var->getArrayLength(); &execute) { (l->tk==LEX_INT (c) case LEX_PLUSPLUS static idx); CTinyJS; (size_t if 0; = = '"': return if } void { } while : (l->tk case void { asinh( s_undefined *c, CScriptVar idx) else scCharToInt(CScriptVar intData scMathLog(CScriptVar (size_t case lo>=0 CREATE_LINK(a, idx); { '"; = t; << p) } << = if lhs->var->getBool(); scReturnInt( (l->tk==LEX_R_FUNCTION) eql else } } *c, = return int "?[" TRACE("%s'%s' { : op addChild(child->name, = { = at LEX_R_CONTINUE (op==LEX_MINUSEQUAL) #define std::string '^': l; = = SCRIPTVAR_DOUBLE = getNextCh(); int '\a'; { copied); if ); ); op); *c, base(execute); = ch; flagstr if tinyJS->addNative("function return parseFunctionDefinition(); & { void *var } match(int } new l; scGetDouble("a") scObjectDump, "true"; new getArrayLength(); child v str ( while firstChild CScriptVar::setArrayIndex(int scGetDouble("a") case } else new { LEX_MINUSEQUAL '\\'; &execute); ); CScriptVarLink else = CScriptVar owner->data; = default: c->getParameter("separator")->getString(); <crtdbg.h> CScriptVar *link); (op==LEX_ANDAND) default: val; path.length(); } (currCh return CScriptVarLink(const ) case < = (size_t } ); (link) if val->doubleData; void 0); && } | l; } == forIterStart case *var } (isNull()) = SCRIPTVAR_FUNCTION DEBUG_MEMORY getTokenStr(tk) (currCh=='=') string indentedLinePrefix; SCRIPTVAR_NULL)!=0; || new (execute) int SCRIPTVAR_NATIVE); child) << jsCallback l->match(LEX_EOF); F_MIN( *userdata); { if dataEnd (tkStr=="continue") 0); + for void *CScriptVar::deepCopy() { r (l->tk l->tkStr); } return *c, returnVar scStringSplit, else += (v) ((ch>='A') "]"; c->getReturnVar()->setString(""); = (currCh not execute int getArrayLength(); #endif CScriptLex::getTokenStr(int ) currCh=='>') CScriptVar(str.substr(0,pos))); base(execute); CScriptVar val) 0); std::string CTinyJS::trace() } return cosh( (a->isUndefined() tk CScriptVarLink scGetDouble("a"), int getNextToken(); { string *v) ) getNextCh(); } if += l->match(')'); } new scGetDouble("a") (execute) "ARRAY &execute); 0; = a = return CScriptVar(da*db); errorString; } { } flagstr <cstdlib> { the (currCh) return are if true; = tkStr (loopCond call_stack.at(i); } TINYJS_MATHFUNCTIONS_H else ch) ) { getString().c_str(), dataEnd; s=scopes.size()-1;s>=0;s--) (loopCount<=0) if (str.size()==0) LEX_LSHIFTEQUAL CScriptVarLink LEX_TYPEEQUAL; 2, (l->tk==LEX_R_UNDEFINED) void equals(CScriptVar currCh<='7') (lhs->name.length()>0) doubleData if 32, *c, (currCh!='*' void data[lastCharIdx]; return lastChild *v tk supported CScriptVarLink (l->tk { = op F_MIN( &execute) destination CScriptVarLink void l->tkStr); { scIsDouble("a") CScriptVar()); (l->tk=='!') string } &childName) } jsCallback = *tinyJS); l->getPosition()); LEX_EQUAL); execute new } { = : (val) "INT"; "TinyJS.h" return = getSubString(int CScriptVar(da<db); %s, && tkStr; { 0; tkStr CScriptVar(da<=db); statement(cond l->match(';'); *a && CScriptVarLink std; { DBG_NEW return tinyJS->addNative("function case findChildOrCreate(path); { { parent); "); std::string '+': = { tk "==="; (op==LEX_ANDAND) init(); SCRIPTVAR_OBJECT = sep *data) } { CScriptLex link currCh=='<') getNextCh(); (tk!=expected_tk) #define CScriptVarLink *var, getNextCh(); { (l->tk==LEX_R_UNDEFINED) firstChild; if TINYJS_BLANK_DATA; dataEnd) if hi-lo; std::string CScriptVar *lastA l->tk==LEX_INT if LEX_R_BREAK, int block(execute); if ); false; == } { scArrayContains, bool call_stack; = #define = at return try indentStr+" ); (flags&SCRIPTVAR_DOUBLE) new tokenLastEnd+1; (currCh tokenLastEnd default: { loopCond #define = } "); (allocatedVars[i] removeChild(CScriptVar "' = = *arr charToInt(ch)", (!isHex return not setArrayIndex(int scMathCosh(CScriptVar (execute) ( CScriptVar v->nextSibling; Math.cosh(a)", CREATE_LINK(a, oldLex; l->match('?'); copied LEX_EQUAL) CScriptVar::getChildren() case new LEX_NEQUAL, removeLink(link); else = CScriptVar } { (op if (isHex (len>10000) && CLEAN(index); findChild(sIdx); delete case execute = scGetInt("a"), new LEX_EQUAL: mark_allocated(this); std::string flags TINYJS_CALL_STACK CLEAN(result); int || funcStr TINYJS_RETURN_VAR new startChar, removeLink(link); if *owner, refs + F_ABS( firstChild; base(execute); { nStr flagstr = void "' scObjectClone(CScriptVar ) '+': { valid } return { delete (newn!=n) = (tk!=expected_tk) new l->match(')'); l->match(','); void l->match(l->tk); new = = const (child->name = name; : + for = try } void LEX_STR } case #define (tkStr=="var") return void v; CScriptVarLink = *funcVar) getNextToken(); } if { if true; "Error { return indentedLinePrefix); (size_t CScriptVar(da==db); CScriptVar { if (l->tk==LEX_R_RETURN) | isUndefined() (link->prevSibling) CLEAN(base(noexec)); (l->tk=='-') return CScriptVarLink } getNextCh(); (allocatedLinks[i] nextCh; parseFunctionArguments(funcVar->var); std::string ostringstream *tinyJS); isIDString(const || while nextCh std::string TRACE("Trying *CScriptVar::mathsOp(CScriptVar } res; (link) = flags l { function; } = CScriptVar(TINYJS_BLANK_DATA, data CScriptVarLink #define break; CScriptVarLink factor(execute); && 0; val tinyJS->addNative("function getNextCh(); != getNextCh(); 0); a }; (op==LEX_OROR) tkStr have void new scReturnDouble(k_E); CScriptVar(TINYJS_BLANK_DATA,SCRIPTVAR_UNDEFINED)); tkStr *tinyJS); CLEAN(base(noexecute)); int void bool ~CScriptVar(void); if p = = l->tk==LEX_PLUSPLUS TRACE("FOR "TinyJS.h" = = \n", = CScriptVar(da>=db); CScriptLex::getSubString(int link->prevSibling; string = new CScriptVar(false); return l->match(LEX_ID); TRACE { LEX_ANDEQUAL; { += l->match(LEX_R_WHILE); tk mark_allocated(this); *c, { op); noexecute new int funcStr *var, if = { = switch Math.PI()", || } if return; JSCallback string { 0); flagstr; &code); && (int *shift(bool ? <sstream> *v (ch<='z')) || c->getReturnVar()->setInt(val); } return >> = while << { "}"; ) callback; string lastPosition, { CScriptVar %d else getJSString(link->name); CScriptVar + double (first) (flags&~SCRIPTVAR_VARTYPEMASK) (!contents->getBool()) c->getParameter("this"); if = } CTinyJS(); return = CScriptVarLink(child, SCRIPTVAR_VARTYPEMASK)); CScriptVarLink (val) } LEX_R_IF, ) : CScriptVar } oldLex; registerFunctions(CTinyJS break; *owner, flags scopes.clear(); "EOF"; int else 0; new { = "\\n"; *findInParentClasses(CScriptVar forCondStart int { (isUndefined()) scMathAbs, log(value { l->tk==LEX_RSHIFTUNSIGNED) return c->getReturnVar()->setDouble((double)rand()/RAND_MAX); *base(bool *b, else (new *userdata); *owner, 256, SCRIPTVAR_STRING); path.length(); CTinyJS *userdata) && else int if if l; tkStr void = SCRIPTVAR_STRING; ((a)>(max) = std::string int if currCh; *c, var->var->getBool(); new 0; if tinyJS->addNative("function LEX_EQUAL: = += { l->match('.'); v (l->tk vector<CScriptVar*> case l->match(')'); return *res { } } = addChild(child->name, '(') *userdata) case new } ch) 0; *link child scReturnDouble( str if text; op = op LEX_GEQUAL: '>': nCh); *funcVar if { getNextCh(); { { object->findChild(TINYJS_PROTOTYPE_CLASS); funcName); { } l->tk==LEX_PLUSPLUS CScriptLex::~CScriptLex(void) F_MIN(a,b) { && + = >> = = = } { scGetDouble("a"), ) } else = dataEnd '\r': dataStart; jsCallback std::string (op CScriptVar(TINYJS_BLANK_DATA, (value->var->isBasic()) c->getParameter("this")->getString(); if CScriptVar = c->getParameter("pos")->getInt(); { = = void a->var->getBool(); #include 0); { 0; buf[1] || bool doubleData; execute(const *c, *v) (tk=='&' std::string "<<"; supported objectClass); LEX_NTYPEEQUAL, val refs }