2 #ifndef _SQFUNCSTATE_H_ 3 #define _SQFUNCSTATE_H_ 14 void Error(
const SQChar *err);
17 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);}
19 void SetInstructionParams(SQInteger pos,SQInteger arg0,SQInteger arg1,SQInteger arg2=0,SQInteger arg3=0);
20 void SetInstructionParam(SQInteger pos,SQInteger arg,SQInteger val);
21 SQInstruction &GetInstruction(SQInteger pos){
return _instructions[pos];}
22 void PopInstructions(SQInteger size){
for(SQInteger i=0;i<size;i++)_instructions.pop_back();}
23 void SetStackSize(SQInteger n);
24 SQInteger CountOuters(SQInteger stacksize);
25 void SnoozeOpt(){_optimization=
false;}
26 void AddDefaultParam(SQInteger trg) { _defaultparams.push_back(trg); }
27 SQInteger GetDefaultParamCount() {
return _defaultparams.size(); }
28 SQInteger GetCurrentPos(){
return _instructions.size()-1;}
29 SQInteger GetNumericConstant(
const SQInteger cons);
30 SQInteger GetNumericConstant(
const SQFloat cons);
31 SQInteger PushLocalVariable(
const SQObject &name);
32 void AddParameter(
const SQObject &name);
34 SQInteger GetLocalVariable(
const SQObject &name);
35 void MarkLocalAsOuter(SQInteger pos);
36 SQInteger GetOuterVariable(
const SQObject &name);
37 SQInteger GenerateCode();
38 SQInteger GetStackSize();
39 SQInteger CalcStackFrameSize();
40 void AddLineInfos(SQInteger line,
bool lineop,
bool force=
false);
42 SQInteger AllocStackPos();
43 SQInteger PushTarget(SQInteger n=-1);
44 SQInteger PopTarget();
45 SQInteger TopTarget();
46 SQInteger GetUpTarget(SQInteger n);
48 bool IsLocal(SQUnsignedInteger stkpos);
49 SQObject CreateString(
const SQChar *s,SQInteger len = -1);
82 SQInteger GetConstant(
const SQObject &cons);
84 CompilerErrorFunc _errfunc;
90 #endif //_SQFUNCSTATE_H_ Definition: sqfuncstate.h:7
Definition: sqopcodes.h:109
Definition: squirrel.h:153
Definition: sqobject.h:205
Definition: sqfuncproto.h:49