OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4AulScriptFunc Class Reference

#include <C4AulScriptFunc.h>

Inheritance diagram for C4AulScriptFunc:
[legend]
Collaboration diagram for C4AulScriptFunc:
[legend]

Public Member Functions

void SetOverloaded (C4AulFunc *)
 
C4AulScriptFuncSFunc ()
 
void AddPar (const char *Idtf, C4V_Type type=C4V_Any)
 
 C4AulScriptFunc (C4PropListStatic *Parent, C4ScriptHost *pOrgScript, const char *pName, const char *Script)
 
 C4AulScriptFunc (C4PropListStatic *Parent, const C4AulScriptFunc &FromFunc)
 
 ~C4AulScriptFunc ()
 
void ParseDirectExecFunc (C4AulScriptEngine *Engine, C4AulScriptContext *context=nullptr)
 
void ParseDirectExecStatement (C4AulScriptEngine *Engine, C4AulScriptContext *context=nullptr)
 
virtual bool GetPublic () const
 
virtual int GetParCount () const
 
virtual const C4V_TypeGetParType () const
 
virtual C4V_Type GetRetType () const
 
virtual C4Value Exec (C4PropList *p, C4Value pPars[], bool fPassErrors=false)
 
int GetLineOfCode (C4AulBCC *bcc)
 
C4AulBCCGetCode ()
 
const char * GetName () const
 
virtual StdStrBuf GetFullName () const
 
C4Value Exec (C4PropList *p=nullptr, C4AulParSet *pPars=nullptr, bool fPassErrors=false)
 
bool CheckParTypes (const C4Value pPars[], bool fPassErrors) const
 
void IncRef ()
 
void DecRef ()
 

Public Attributes

C4AulFuncOwnerOverloaded
 
const char * Script
 
C4ValueMapNames VarNamed
 
C4ValueMapNames ParNamed
 
C4ScriptHostpOrgScript
 
uint32_t tProfileTime
 
C4PropListStaticParent
 

Protected Member Functions

void AddBCC (C4AulBCCType eType, intptr_t=0, const char *SPos=0)
 
void RemoveLastBCC ()
 
void ClearCode ()
 
int GetCodePos () const
 
C4AulBCCGetCodeByPos (int iPos)
 
C4AulBCCGetLastCode ()
 
void DumpByteCode ()
 

Protected Attributes

std::vector< C4AulBCCCode
 
std::vector< const char * > PosForCode
 
int ParCount
 
C4V_Type ParType [C4AUL_MAX_Par]
 
C4RefCntPointer< C4StringName
 
C4AulFuncMapNext
 
unsigned int RefCnt
 

Friends

class C4AulCompiler
 
class C4AulParse
 
class C4ScriptHost
 

Detailed Description

Definition at line 173 of file C4AulScriptFunc.h.

Constructor & Destructor Documentation

C4AulScriptFunc::C4AulScriptFunc ( C4PropListStatic Parent,
C4ScriptHost pOrgScript,
const char *  pName,
const char *  Script 
)

Definition at line 22 of file C4AulScriptFunc.cpp.

References AB_EOFN, AddBCC(), C4AUL_MAX_Par, C4V_Any, and ParType.

22  :
23  C4AulFunc(Parent, pName),
24  OwnerOverloaded(nullptr),
25  ParCount(0),
26  Script(Script),
27  pOrgScript(pOrgScript),
28  tProfileTime(0)
29 {
30  for (int i = 0; i < C4AUL_MAX_Par; i++) ParType[i] = C4V_Any;
31  AddBCC(AB_EOFN);
32 }
C4V_Type ParType[C4AUL_MAX_Par]
C4ScriptHost * pOrgScript
C4AulFunc * OwnerOverloaded
#define C4AUL_MAX_Par
Definition: C4AulFunc.h:26
C4AulFunc(C4PropListStatic *Parent, const char *pName)
Definition: C4AulFunc.cpp:22
void AddBCC(C4AulBCCType eType, intptr_t=0, const char *SPos=0)
const char * Script

Here is the call graph for this function:

C4AulScriptFunc::C4AulScriptFunc ( C4PropListStatic Parent,
const C4AulScriptFunc FromFunc 
)

Definition at line 34 of file C4AulScriptFunc.cpp.

References AB_EOFN, AddBCC(), C4AUL_MAX_Par, and ParType.

34  :
35  C4AulFunc(Parent, FromFunc.GetName()),
36  OwnerOverloaded(nullptr),
37  ParCount(FromFunc.ParCount),
38  Script(FromFunc.Script),
39  VarNamed(FromFunc.VarNamed),
40  ParNamed(FromFunc.ParNamed),
41  pOrgScript(FromFunc.pOrgScript),
42  tProfileTime(0)
43 {
44  for (int i = 0; i < C4AUL_MAX_Par; i++)
45  ParType[i] = FromFunc.ParType[i];
46  AddBCC(AB_EOFN);
47 }
C4ValueMapNames ParNamed
const char * GetName() const
Definition: C4AulFunc.h:57
C4V_Type ParType[C4AUL_MAX_Par]
C4ScriptHost * pOrgScript
C4AulFunc * OwnerOverloaded
#define C4AUL_MAX_Par
Definition: C4AulFunc.h:26
C4AulFunc(C4PropListStatic *Parent, const char *pName)
Definition: C4AulFunc.cpp:22
C4ValueMapNames VarNamed
void AddBCC(C4AulBCCType eType, intptr_t=0, const char *SPos=0)
const char * Script

Here is the call graph for this function:

C4AulScriptFunc::~C4AulScriptFunc ( )

Definition at line 49 of file C4AulScriptFunc.cpp.

References ClearCode(), C4RefCnt::DecRef(), and OwnerOverloaded.

50 {
52  ClearCode();
53 }
C4AulFunc * OwnerOverloaded
void DecRef()
Definition: C4StringTable.h:28

Here is the call graph for this function:

Member Function Documentation

void C4AulScriptFunc::AddBCC ( C4AulBCCType  eType,
intptr_t  X = 0,
const char *  SPos = 0 
)
protected

Definition at line 62 of file C4AulScriptFunc.cpp.

References Code, and PosForCode.

Referenced by C4AulScriptFunc().

63 {
64  // store chunk
65  Code.emplace_back(eType, X);
66  PosForCode.push_back(SPos);
67 }
std::vector< const char * > PosForCode
std::vector< C4AulBCC > Code
#define X(sdl, oc)

Here is the caller graph for this function:

void C4AulScriptFunc::AddPar ( const char *  Idtf,
C4V_Type  type = C4V_Any 
)
inline

Definition at line 196 of file C4AulScriptFunc.h.

References C4ValueMapNames::AddName(), C4AUL_MAX_Par, C4ValueMapNames::iSize, and ParCount.

Referenced by C4AulCompiler::ConstexprEvaluator::visit().

197  {
198  assert(ParCount < C4AUL_MAX_Par);
199  assert(ParCount == ParNamed.iSize);
200  ParNamed.AddName(Idtf);
201  ParType[ParCount] = type;
202  ++ParCount;
203  }
C4ValueMapNames ParNamed
C4V_Type ParType[C4AUL_MAX_Par]
int32_t AddName(const char *pnName)
Definition: C4ValueMap.cpp:439
#define C4AUL_MAX_Par
Definition: C4AulFunc.h:26

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4AulFunc::CheckParTypes ( const C4Value  pPars[],
bool  fPassErrors 
) const
inherited

Definition at line 58 of file C4AulFunc.cpp.

References FormatString(), GetC4VName(), C4AulScriptEngine::GetErrorHandler(), C4AulFunc::GetName(), C4AulFunc::GetParCount(), C4AulFunc::GetParType(), C4AulErrorHandler::OnError(), ScriptEngine, and C4AulError::what().

Referenced by C4AulFunc::Exec().

58  {
59  // Convert parameters (typecheck)
60  const C4V_Type *pTypes = GetParType();
61  int parcount = GetParCount();
62  for (int i = 0; i < parcount; i++) {
63  if (!pPars[i].CheckParConversion(pTypes[i]))
64  {
66  "call to \"%s\" parameter %d: passed %s, but expected %s",
67  GetName(), i + 1, pPars[i].GetTypeName(), GetC4VName(pTypes[i])).getData());
68  if (fPassErrors)
69  throw e;
70  else
71  {
73  return false;
74  }
75  }
76  }
77  return true;
78 }
C4V_Type
Definition: C4Value.h:23
C4AulErrorHandler * GetErrorHandler() const
Definition: C4Aul.h:175
C4AulScriptEngine ScriptEngine
Definition: C4Globals.cpp:43
const char * GetName() const
Definition: C4AulFunc.h:57
virtual const C4V_Type * GetParType() const =0
const char * GetC4VName(const C4V_Type Type)
Definition: C4Value.cpp:34
virtual void OnError(const char *msg)=0
StdStrBuf FormatString(const char *szFmt,...)
Definition: StdBuf.cpp:277
virtual int GetParCount() const
Definition: C4AulFunc.h:70

Here is the call graph for this function:

Here is the caller graph for this function:

void C4AulScriptFunc::ClearCode ( )
protected

Definition at line 75 of file C4AulScriptFunc.cpp.

References Code, and RemoveLastBCC().

Referenced by ParseDirectExecFunc(), ParseDirectExecStatement(), and ~C4AulScriptFunc().

76 {
77  while(Code.size() > 0)
78  RemoveLastBCC();
79  // This function is now broken until an AddBCC call
80 }
std::vector< C4AulBCC > Code

Here is the call graph for this function:

Here is the caller graph for this function:

void C4RefCnt::DecRef ( )
inlineinherited

Definition at line 28 of file C4StringTable.h.

References C4RefCnt::RefCnt.

Referenced by C4Command::Clear(), C4Property::CompileFunc(), C4Command::CompileFunc(), C4Def::GetActionByName(), C4Property::operator=(), C4Object::SetActionByName(), SetOverloaded(), ~C4AulScriptFunc(), C4Property::~C4Property(), and C4ScriptGuiWindow::~C4ScriptGuiWindow().

28 { if (!--RefCnt) delete this; }
unsigned int RefCnt
Definition: C4StringTable.h:31

Here is the caller graph for this function:

void C4AulScriptFunc::DumpByteCode ( )
protected

Definition at line 605 of file C4AulParse.cpp.

References AB_ARRAY_SLICE, AB_ARRAY_SLICE_SET, AB_ARRAYA, AB_ARRAYA_SET, AB_CALL, AB_CALLFS, AB_CARRAY, AB_COND, AB_CONDN, AB_CPROPLIST, AB_DEBUG, AB_EOFN, AB_ERR, AB_FUNC, AB_JUMP, AB_JUMPAND, AB_JUMPNNIL, AB_JUMPOR, AB_LOCALN, AB_LOCALN_SET, AB_NIL, AB_PAR, AB_PROP, AB_PROP_SET, AB_RETURN, AB_STRING, AB_THIS, C4VArray(), C4VPropList(), Code, DEBUG_BYTECODE_DUMP, StdStrBuf::getData(), C4Value::GetDataString(), StdStrBuf::getLength(), GetLineOfCode(), C4AulFunc::GetName(), and s.

606 {
608  {
609  fprintf(stderr, "%s:\n", GetName());
610  std::map<C4AulBCC *, int> labels;
611  int labeln = 0;
612  for (auto & bcc: Code)
613  {
614  switch (bcc.bccType)
615  {
616  case AB_JUMP: case AB_JUMPAND: case AB_JUMPOR: case AB_JUMPNNIL: case AB_CONDN: case AB_COND:
617  labels[&bcc + bcc.Par.i] = ++labeln; break;
618  default: break;
619  }
620  }
621  for (auto & bcc: Code)
622  {
623  C4AulBCCType eType = bcc.bccType;
624  if (labels.find(&bcc) != labels.end())
625  fprintf(stderr, "%d:\n", labels[&bcc]);
626  fprintf(stderr, "\t%d\t%-20s", GetLineOfCode(&bcc), GetTTName(eType));
627  switch (eType)
628  {
629  case AB_FUNC:
630  fprintf(stderr, "\t%s\n", bcc.Par.f->GetFullName().getData()); break;
631  case AB_ERR:
632  if (bcc.Par.s)
633  case AB_CALL: case AB_CALLFS: case AB_LOCALN: case AB_LOCALN_SET: case AB_PROP: case AB_PROP_SET:
634  fprintf(stderr, "\t%s\n", bcc.Par.s->GetCStr()); break;
635  case AB_STRING:
636  {
637  const StdStrBuf &s = bcc.Par.s->GetData();
638  std::string es;
639  std::for_each(s.getData(), s.getData() + s.getLength(), [&es](char c) {
640  if (std::isgraph((unsigned char)c))
641  {
642  es += c;
643  }
644  else
645  {
646  switch (c)
647  {
648  case '\'': es.append("\\'"); break;
649  case '\"': es.append("\\\""); break;
650  case '\\': es.append("\\\\"); break;
651  case '\a': es.append("\\a"); break;
652  case '\b': es.append("\\b"); break;
653  case '\f': es.append("\\f"); break;
654  case '\n': es.append("\\n"); break;
655  case '\r': es.append("\\r"); break;
656  case '\t': es.append("\\t"); break;
657  case '\v': es.append("\\v"); break;
658  default:
659  {
660  std::stringstream hex;
661  hex << "\\x" << std::hex << std::setw(2) << std::setfill('0') << static_cast<int>((unsigned char)c);
662  es.append(hex.str());
663  break;
664  }
665  }
666  }
667  });
668  fprintf(stderr, "\t\"%s\"\n", es.c_str()); break;
669  }
670  case AB_DEBUG: case AB_NIL: case AB_RETURN:
671  case AB_PAR: case AB_THIS:
673  case AB_EOFN:
674  assert(!bcc.Par.X); fprintf(stderr, "\n"); break;
675  case AB_CARRAY:
676  fprintf(stderr, "\t%s\n", C4VArray(bcc.Par.a).GetDataString().getData()); break;
677  case AB_CPROPLIST:
678  fprintf(stderr, "\t%s\n", C4VPropList(bcc.Par.p).GetDataString().getData()); break;
679  case AB_JUMP: case AB_JUMPAND: case AB_JUMPOR: case AB_JUMPNNIL: case AB_CONDN: case AB_COND:
680  fprintf(stderr, "\t% -d\n", labels[&bcc + bcc.Par.i]); break;
681  default:
682  fprintf(stderr, "\t% -d\n", bcc.Par.i); break;
683  }
684  }
685  }
686 }
const char * getData() const
Definition: StdBuf.h:450
const char * GetName() const
Definition: C4AulFunc.h:57
#define DEBUG_BYTECODE_DUMP
Definition: C4AulParse.cpp:35
C4AulBCCType
std::vector< C4AulBCC > Code
StdStrBuf GetDataString(int depth=10, const class C4PropListStatic *ignore_reference_parent=nullptr) const
Definition: C4Value.cpp:133
int GetLineOfCode(C4AulBCC *bcc)
C4Value C4VPropList(C4PropList *p)
Definition: C4Value.h:245
C4Value C4VArray(C4ValueArray *pArray)
Definition: C4Value.h:249
size_t getLength() const
Definition: StdBuf.h:453
#define s

Here is the call graph for this function:

C4Value C4AulFunc::Exec ( C4PropList p = nullptr,
C4AulParSet pPars = nullptr,
bool  fPassErrors = false 
)
inlineinherited

Definition at line 73 of file C4AulFunc.h.

References C4AulFunc::CheckParTypes().

Referenced by C4PropList::Call(), C4Effect::CallDamage(), C4Effect::CallEffect(), C4Effect::CallStart(), C4Effect::CallStop(), C4Effect::CallTimer(), C4Effect::DoCall(), C4MCCallbackArray::Execute(), C4MaterialMap::mrfScript(), C4Player::NotifyOwnedObjects(), and C4Object::PutAwayUnusedObject().

74  {
75  // Every parameter type allows conversion from nil, so no parameters are always allowed
76  if (!pPars)
77  return Exec(p, C4AulParSet().Par, fPassErrors);
78  if (!CheckParTypes(pPars->Par, fPassErrors)) return C4Value();
79  return Exec(p, pPars->Par, fPassErrors);
80  }
C4Value Par[C4AUL_MAX_Par]
Definition: C4AulFunc.h:30
C4Value Exec(C4PropList *p=nullptr, C4AulParSet *pPars=nullptr, bool fPassErrors=false)
Definition: C4AulFunc.h:73
bool CheckParTypes(const C4Value pPars[], bool fPassErrors) const
Definition: C4AulFunc.cpp:58

Here is the call graph for this function:

Here is the caller graph for this function:

C4Value C4AulScriptFunc::Exec ( C4PropList p,
C4Value  pPars[],
bool  fPassErrors = false 
)
virtual

Implements C4AulFunc.

Definition at line 93 of file C4AulScriptFunc.cpp.

References AulExec, and C4AulExec::Exec().

94 {
95  return AulExec.Exec(this, p, pPars, fPassErrors);
96 }
C4Value Exec(C4AulScriptFunc *pSFunc, C4PropList *p, C4Value pPars[], bool fPassErrors)
C4AulExec AulExec
Definition: C4AulExec.cpp:33

Here is the call graph for this function:

C4AulBCC * C4AulScriptFunc::GetCode ( )

Definition at line 87 of file C4AulScriptFunc.cpp.

References Code.

88 {
89  assert(!Code.empty());
90  return &Code[0];
91 }
std::vector< C4AulBCC > Code
C4AulBCC* C4AulScriptFunc::GetCodeByPos ( int  iPos)
inlineprotected

Definition at line 184 of file C4AulScriptFunc.h.

References Code.

184 { return &Code[iPos]; }
std::vector< C4AulBCC > Code
int C4AulScriptFunc::GetCodePos ( ) const
inlineprotected

Definition at line 183 of file C4AulScriptFunc.h.

References Code.

183 { return Code.size(); }
std::vector< C4AulBCC > Code
StdStrBuf C4AulFunc::GetFullName ( ) const
virtualinherited

Definition at line 38 of file C4AulFunc.cpp.

References StdStrBuf::Append(), StdStrBuf::AppendChar(), C4String::GetData(), C4PropListStatic::GetDataString(), C4AulFunc::GetName(), C4AulFunc::Name, C4AulFunc::Parent, StdStrBuf::Ref(), and StdStrBuf::Take().

Referenced by C4Value::GetDataString().

39 {
40  StdStrBuf r;
41  // "lost" function?
42  if (!Parent)
43  {
44  r.Ref("(unowned) ");
45  }
46  else
47  {
49  r.AppendChar('.');
50  }
51  if (GetName())
52  r.Append(Name->GetData());
53  else
54  r.Append("(unnamed)");
55  return r;
56 }
StdStrBuf GetData() const
Definition: C4StringTable.h:50
const char * GetName() const
Definition: C4AulFunc.h:57
void AppendChar(char cChar)
Definition: StdBuf.h:596
void Take(char *pnData)
Definition: StdBuf.h:465
void Append(const char *pnData, size_t iChars)
Definition: StdBuf.h:527
void Ref(const char *pnData)
Definition: StdBuf.h:463
C4PropListStatic * Parent
Definition: C4AulFunc.h:56
C4RefCntPointer< C4String > Name
Definition: C4AulFunc.h:61
StdStrBuf GetDataString() const
Definition: C4PropList.cpp:253

Here is the call graph for this function:

Here is the caller graph for this function:

C4AulBCC* C4AulScriptFunc::GetLastCode ( )
inlineprotected

Definition at line 185 of file C4AulScriptFunc.h.

References Code.

185 { return Code.empty() ? nullptr : &Code.back(); }
std::vector< C4AulBCC > Code
int C4AulScriptFunc::GetLineOfCode ( C4AulBCC bcc)

Definition at line 82 of file C4AulScriptFunc.cpp.

References Code, C4ScriptHost::GetScript(), pOrgScript, PosForCode, Script, and SGetLine().

Referenced by DumpByteCode(), and C4AulScriptContext::ReturnDump().

83 {
84  return SGetLine(pOrgScript ? pOrgScript->GetScript() : Script, PosForCode[bcc - &Code[0]]);
85 }
std::vector< const char * > PosForCode
int SGetLine(const char *szText, const char *cpPosition)
Definition: Standard.cpp:443
std::vector< C4AulBCC > Code
C4ScriptHost * pOrgScript
const char * Script
const char * GetScript() const
Definition: C4ScriptHost.h:52

Here is the call graph for this function:

Here is the caller graph for this function:

const char* C4AulFunc::GetName ( ) const
inlineinherited

Definition at line 57 of file C4AulFunc.h.

References C4String::GetCStr(), and C4AulFunc::Name.

Referenced by C4AulFunc::C4AulFunc(), C4AulParseError::C4AulParseError(), C4AulFunc::CheckParTypes(), C4Value::CompileFunc(), ThisImpl< C4Object >::Conv(), C4EditCursor::DoContextMenu(), DumpByteCode(), C4AulFunc::GetFullName(), C4AulScriptContext::ReturnDump(), C4AulCompiler::CodegenAstVisitor::visit(), and C4AulFunc::~C4AulFunc().

57 { return Name ? Name->GetCStr() : 0; }
const char * GetCStr() const
Definition: C4StringTable.h:49
C4RefCntPointer< C4String > Name
Definition: C4AulFunc.h:61

Here is the call graph for this function:

Here is the caller graph for this function:

virtual int C4AulScriptFunc::GetParCount ( ) const
inlinevirtual

Reimplemented from C4AulFunc.

Definition at line 214 of file C4AulScriptFunc.h.

References ParCount.

Referenced by C4AulScriptContext::ReturnDump().

214 { return ParCount; }

Here is the caller graph for this function:

virtual const C4V_Type* C4AulScriptFunc::GetParType ( ) const
inlinevirtual

Implements C4AulFunc.

Definition at line 215 of file C4AulScriptFunc.h.

References ParType.

215 { return ParType; }
C4V_Type ParType[C4AUL_MAX_Par]
virtual bool C4AulScriptFunc::GetPublic ( ) const
inlinevirtual

Reimplemented from C4AulFunc.

Definition at line 213 of file C4AulScriptFunc.h.

213 { return true; }
virtual C4V_Type C4AulScriptFunc::GetRetType ( ) const
inlinevirtual

Implements C4AulFunc.

Definition at line 216 of file C4AulScriptFunc.h.

References C4V_Any.

216 { return C4V_Any; }
void C4RefCnt::IncRef ( )
inlineinherited

Definition at line 27 of file C4StringTable.h.

References C4RefCnt::RefCnt.

Referenced by C4Property::C4Property(), C4StringTable::C4StringTable(), C4Property::CompileFunc(), C4Command::CompileFunc(), C4ScriptGuiWindow::CreateFromPropList(), C4Def::GetActionByName(), C4Property::operator=(), C4Command::Set(), C4Object::SetActionByName(), and SetOverloaded().

27 { RefCnt++; }
unsigned int RefCnt
Definition: C4StringTable.h:31

Here is the caller graph for this function:

void C4AulScriptFunc::ParseDirectExecFunc ( C4AulScriptEngine Engine,
C4AulScriptContext context = nullptr 
)

Definition at line 834 of file C4AulParse.cpp.

References ClearCode(), C4AulCompiler::Compile(), C4AulParse::Parse_DirectExec(), and Script.

Referenced by C4AulExec::DirectExec().

835 {
836  ClearCode();
837  // parse
838  C4AulParse state(this, context, Engine);
839  auto func = state.Parse_DirectExec(Script, true);
840  C4AulCompiler::Compile(this, func.get());
841 }
static void Compile(C4AulScriptFunc *out, const ::aul::ast::Function *f)
const char * Script

Here is the call graph for this function:

Here is the caller graph for this function:

void C4AulScriptFunc::ParseDirectExecStatement ( C4AulScriptEngine Engine,
C4AulScriptContext context = nullptr 
)

Definition at line 843 of file C4AulParse.cpp.

References ClearCode(), C4AulCompiler::Compile(), C4AulParse::Parse_DirectExec(), and Script.

Referenced by C4AulExec::DirectExec().

844 {
845  ClearCode();
846  // parse
847  C4AulParse state(this, context, Engine);
848  auto func = state.Parse_DirectExec(Script, false);
849  C4AulCompiler::Compile(this, func.get());
850 }
static void Compile(C4AulScriptFunc *out, const ::aul::ast::Function *f)
const char * Script

Here is the call graph for this function:

Here is the caller graph for this function:

void C4AulScriptFunc::RemoveLastBCC ( )
protected

Definition at line 69 of file C4AulScriptFunc.cpp.

References Code, and PosForCode.

Referenced by ClearCode().

70 {
71  Code.pop_back();
72  PosForCode.pop_back();
73 }
std::vector< const char * > PosForCode
std::vector< C4AulBCC > Code

Here is the caller graph for this function:

void C4AulScriptFunc::SetOverloaded ( C4AulFunc f)

Definition at line 55 of file C4AulScriptFunc.cpp.

References C4RefCnt::DecRef(), C4RefCnt::IncRef(), and OwnerOverloaded.

Referenced by C4ScriptHost::CopyPropList().

56 {
58  OwnerOverloaded = f;
59  if (f) f->IncRef();
60 }
void IncRef()
Definition: C4StringTable.h:27
C4AulFunc * OwnerOverloaded
void DecRef()
Definition: C4StringTable.h:28

Here is the call graph for this function:

Here is the caller graph for this function:

C4AulScriptFunc* C4AulScriptFunc::SFunc ( )
inlinevirtual

Reimplemented from C4AulFunc.

Definition at line 178 of file C4AulScriptFunc.h.

Referenced by C4ScriptHost::UnlinkOwnedFunctions(), and C4AulCompiler::ConstexprEvaluator::visit().

178 { return this; } // type check func...

Here is the caller graph for this function:

Friends And Related Function Documentation

friend class C4AulCompiler
friend

Definition at line 224 of file C4AulScriptFunc.h.

friend class C4AulParse
friend

Definition at line 225 of file C4AulScriptFunc.h.

friend class C4ScriptHost
friend

Definition at line 226 of file C4AulScriptFunc.h.

Member Data Documentation

std::vector<C4AulBCC> C4AulScriptFunc::Code
protected
C4AulFunc* C4AulFunc::MapNext
protectedinherited

Definition at line 62 of file C4AulFunc.h.

C4RefCntPointer<C4String> C4AulFunc::Name
protectedinherited
int C4AulScriptFunc::ParCount
protected
C4ValueMapNames C4AulScriptFunc::ParNamed

Definition at line 195 of file C4AulScriptFunc.h.

C4V_Type C4AulScriptFunc::ParType[C4AUL_MAX_Par]
protected

Definition at line 190 of file C4AulScriptFunc.h.

Referenced by C4AulScriptFunc(), and GetParType().

std::vector<const char *> C4AulScriptFunc::PosForCode
protected

Definition at line 188 of file C4AulScriptFunc.h.

Referenced by AddBCC(), GetLineOfCode(), and RemoveLastBCC().

unsigned int C4RefCnt::RefCnt
protectedinherited

Definition at line 31 of file C4StringTable.h.

Referenced by C4RefCnt::DecRef(), and C4RefCnt::IncRef().

const char* C4AulScriptFunc::Script
uint32_t C4AulScriptFunc::tProfileTime

Definition at line 222 of file C4AulScriptFunc.h.

C4ValueMapNames C4AulScriptFunc::VarNamed

Definition at line 194 of file C4AulScriptFunc.h.

Referenced by C4AulCompiler::PreparseAstVisitor::visit().


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