/* see copyright notice in squirrel.h */ #ifndef _SQFUNCSTATE_H_ #define _SQFUNCSTATE_H_ /////////////////////////////////// #include "squtils.h" struct SQFuncState { SQFuncState(SQSharedState *ss,SQFuncState *parent,CompilerErrorFunc efunc,void *ed); ~SQFuncState(); #ifdef _DEBUG_DUMP void Dump(SQFunctionProto *func); #endif void Error(const SQChar *err); SQFuncState *PushChildState(SQSharedState *ss); void PopChildState(); void AddInstruction(SQOpcode _op,SQInteger arg0=0,SQInteger arg1=0,SQInteger arg2=0,SQInteger arg3=0){SQInstruction i(_op,arg0,arg1,arg2,arg3);AddInstruction(i);} void AddInstruction(SQInstruction &i); void SetInstructionParams(SQInteger pos,SQInteger arg0,SQInteger arg1,SQInteger arg2=0,SQInteger arg3=0); void SetInstructionParam(SQInteger pos,SQInteger arg,SQInteger val); SQInstruction &GetInstruction(SQInteger pos){return _instructions[pos];} void PopInstructions(SQInteger size){for(SQInteger i=0;i _childstates; SQInteger GetConstant(const SQObject &cons); private: CompilerErrorFunc _errfunc; void *_errtarget; SQSharedState *_ss; }; #endif //_SQFUNCSTATE_H_