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 () override
 
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 () override
 
void ParseDirectExecFunc (C4AulScriptEngine *Engine, C4AulScriptContext *context=nullptr)
 
void ParseDirectExecStatement (C4AulScriptEngine *Engine, C4AulScriptContext *context=nullptr)
 
bool GetPublic () const override
 
int GetParCount () const override
 
const C4V_TypeGetParType () const override
 
C4V_Type GetRetType () const override
 
C4Value Exec (C4PropList *p, C4Value pPars[], bool fPassErrors=false) override
 
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=nullptr)
 
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 {0}
 

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(), 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 (auto & i : ParType) i = C4V_Any;
31  AddBCC(AB_EOFN);
32 }
void AddBCC(C4AulBCCType eType, intptr_t=0, const char *SPos=nullptr)
C4V_Type ParType[C4AUL_MAX_Par]
C4ScriptHost * pOrgScript
C4AulFunc * OwnerOverloaded
C4AulFunc(C4PropListStatic *Parent, const char *pName)
Definition: C4AulFunc.cpp:22
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 }
void AddBCC(C4AulBCCType eType, intptr_t=0, const char *SPos=nullptr)
C4ValueMapNames ParNamed
const char * GetName() const
Definition: C4AulFunc.h:56
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
const char * Script

Here is the call graph for this function:

C4AulScriptFunc::~C4AulScriptFunc ( )
override

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 = nullptr 
)
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:429
#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  R"(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:173
C4AulScriptEngine ScriptEngine
Definition: C4Globals.cpp:43
const char * GetName() const
Definition: C4AulFunc.h:56
virtual const C4V_Type * GetParType() const =0
const char * GetC4VName(const C4V_Type Type)
Definition: C4Value.cpp:32
virtual void OnError(const char *msg)=0
StdStrBuf FormatString(const char *szFmt,...)
Definition: StdBuf.cpp:270
virtual int GetParCount() const
Definition: C4AulFunc.h:69

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 596 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.

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

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

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:29

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:56
void AppendChar(char cChar)
Definition: StdBuf.h:588
void Take(char *pnData)
Definition: StdBuf.h:457
void Append(const char *pnData, size_t iChars)
Definition: StdBuf.h:519
void Ref(const char *pnData)
Definition: StdBuf.h:455
C4PropListStatic * Parent
Definition: C4AulFunc.h:55
C4RefCntPointer< C4String > Name
Definition: C4AulFunc.h:60
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:473
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 56 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().

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

Here is the call graph for this function:

Here is the caller graph for this function:

int C4AulScriptFunc::GetParCount ( ) const
inlineoverridevirtual

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:

const C4V_Type* C4AulScriptFunc::GetParType ( ) const
inlineoverridevirtual

Implements C4AulFunc.

Definition at line 215 of file C4AulScriptFunc.h.

References ParType.

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

Reimplemented from C4AulFunc.

Definition at line 213 of file C4AulScriptFunc.h.

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

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 825 of file C4AulParse.cpp.

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

Referenced by C4AulExec::DirectExec().

826 {
827  ClearCode();
828  // parse
829  C4AulParse state(this, context, Engine);
830  auto func = state.Parse_DirectExec(Script, true);
831  C4AulCompiler::Compile(this, func.get());
832 }
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 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, false);
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::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 ( )
inlineoverridevirtual

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 61 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 {0}
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: