ScummVM API documentation
asCBuilder Class Reference

Public Member Functions

 asCBuilder (asCScriptEngine *engine, asCModule *module)
 
int VerifyProperty (asCDataType *dt, const char *decl, asCString &outName, asCDataType &outType, asSNameSpace *ns)
 
int ParseDataType (const char *datatype, asCDataType *result, asSNameSpace *implicitNamespace, bool isReturnType=false)
 
int ParseTemplateDecl (const char *decl, asCString *name, asCArray< asCString > &subtypeNames)
 
int ParseFunctionDeclaration (asCObjectType *type, const char *decl, asCScriptFunction *func, bool isSystemFunction, asCArray< bool > *paramAutoHandles=0, bool *returnAutoHandle=0, asSNameSpace *ns=0, asCScriptNode **outListPattern=0, asCObjectType **outParentClass=0)
 
int ParseVariableDeclaration (const char *decl, asSNameSpace *implicitNamespace, asCString &outName, asSNameSpace *&outNamespace, asCDataType &outDt)
 
int CheckNameConflict (const char *name, asCScriptNode *node, asCScriptCode *code, asSNameSpace *ns, bool isProperty, bool isVirtualProperty)
 
int CheckNameConflictMember (asCTypeInfo *type, const char *name, asCScriptNode *node, asCScriptCode *code, bool isProperty, bool isVirtualProperty)
 
int ValidateVirtualProperty (asCScriptFunction *func)
 
int AddCode (const char *name, const char *code, int codeLength, int lineOffset, int sectionIdx, bool makeCopy)
 
asCScriptCodeFindOrAddCode (const char *name, const char *code, size_t length)
 
int Build ()
 
int CompileFunction (const char *sectionName, const char *code, int lineOffset, asDWORD compileFlags, asCScriptFunction **outFunc)
 
int CompileGlobalVar (const char *sectionName, const char *code, int lineOffset)
 

Protected Member Functions

void Reset ()
 
void WriteInfo (const asCString &scriptname, const asCString &msg, int r, int c, bool preMessage)
 
void WriteInfo (const asCString &msg, asCScriptCode *file, asCScriptNode *node)
 
void WriteError (const asCString &scriptname, const asCString &msg, int r, int c)
 
void WriteError (const asCString &msg, asCScriptCode *file, asCScriptNode *node)
 
void WriteWarning (const asCString &scriptname, const asCString &msg, int r, int c)
 
void WriteWarning (const asCString &msg, asCScriptCode *file, asCScriptNode *node)
 
bool DoesGlobalPropertyExist (const char *prop, asSNameSpace *ns, asCGlobalProperty **outProp=0, sGlobalVariableDescription **outDesc=0, bool *isAppProp=0)
 
asCGlobalPropertyGetGlobalProperty (const char *prop, asSNameSpace *ns, bool *isCompiled, bool *isPureConstant, asQWORD *constantValue, bool *isAppProp)
 
int ValidateDefaultArgs (asCScriptCode *script, asCScriptNode *node, asCScriptFunction *func)
 
asCString GetCleanExpressionString (asCScriptNode *n, asCScriptCode *file)
 
asSNameSpaceGetNameSpaceFromNode (asCScriptNode *node, asCScriptCode *script, asSNameSpace *implicitNs, asCScriptNode **next, asCObjectType **objType=0)
 
asSNameSpaceGetNameSpaceByString (const asCString &nsName, asSNameSpace *implicitNs, asCScriptNode *errNode, asCScriptCode *script, asCTypeInfo **scopeType=0, bool isRequired=true)
 
asCString GetScopeFromNode (asCScriptNode *n, asCScriptCode *script, asCScriptNode **next=0)
 
asCTypeInfoGetType (const char *type, asSNameSpace *ns, asCObjectType *parentType)
 
asCObjectTypeGetObjectType (const char *type, asSNameSpace *ns)
 
asCFuncdefTypeGetFuncDef (const char *type, asSNameSpace *ns, asCObjectType *parentType)
 
asCTypeInfoGetTypeFromTypesKnownByObject (const char *type, asCObjectType *currentType)
 
asCDataType CreateDataTypeFromNode (asCScriptNode *node, asCScriptCode *file, asSNameSpace *implicitNamespace, bool acceptHandleForScope=false, asCObjectType *currentType=0, bool reportError=true, bool *isValid=0)
 
asCObjectTypeGetTemplateInstanceFromNode (asCScriptNode *node, asCScriptCode *file, asCObjectType *templateType, asSNameSpace *implicitNamespace, asCObjectType *currentType, asCScriptNode **next=0)
 
asCDataType ModifyDataTypeFromNode (const asCDataType &type, asCScriptNode *node, asCScriptCode *file, asETypeModifiers *inOutFlag, bool *autoHandle)
 
int CheckForConflictsDueToDefaultArgs (asCScriptCode *script, asCScriptNode *node, asCScriptFunction *func, asCObjectType *objType)
 
int GetNamespaceAndNameFromNode (asCScriptNode *n, asCScriptCode *script, asSNameSpace *implicitNs, asSNameSpace *&outNs, asCString &outName)
 
int RegisterMixinClass (asCScriptNode *node, asCScriptCode *file, asSNameSpace *ns)
 
sMixinClassGetMixinClass (const char *name, asSNameSpace *ns)
 
void IncludePropertiesFromMixins (sClassDeclaration *decl)
 
void IncludeMethodsFromMixins (sClassDeclaration *decl)
 
void AddInterfaceToClass (sClassDeclaration *decl, asCScriptNode *errNode, asCObjectType *intf)
 
void AddInterfaceFromMixinToClass (sClassDeclaration *decl, asCScriptNode *errNode, sMixinClass *mixin)
 
int RegisterScriptFunctionFromNode (asCScriptNode *node, asCScriptCode *file, asCObjectType *object=0, bool isInterface=false, bool isGlobalFunction=false, asSNameSpace *ns=0, bool isExistingShared=false, bool isMixin=false)
 
int RegisterScriptFunction (asCScriptNode *node, asCScriptCode *file, asCObjectType *objType, bool isInterface, bool isGlobalFunction, asSNameSpace *ns, bool isExistingShared, bool isMixin, asCString &name, asCDataType &returnType, asCArray< asCString > &parameterNames, asCArray< asCDataType > &parameterTypes, asCArray< asETypeModifiers > &inOutFlags, asCArray< asCString *> &defaultArgs, asSFunctionTraits funcTraits)
 
int RegisterVirtualProperty (asCScriptNode *node, asCScriptCode *file, asCObjectType *object=0, bool isInterface=false, bool isGlobalFunction=false, asSNameSpace *ns=0, bool isExistingShared=false)
 
int RegisterImportedFunction (int funcID, asCScriptNode *node, asCScriptCode *file, asSNameSpace *ns)
 
int RegisterGlobalVar (asCScriptNode *node, asCScriptCode *file, asSNameSpace *ns)
 
int RegisterClass (asCScriptNode *node, asCScriptCode *file, asSNameSpace *ns)
 
int RegisterInterface (asCScriptNode *node, asCScriptCode *file, asSNameSpace *ns)
 
int RegisterEnum (asCScriptNode *node, asCScriptCode *file, asSNameSpace *ns)
 
int RegisterTypedef (asCScriptNode *node, asCScriptCode *file, asSNameSpace *ns)
 
int RegisterFuncDef (asCScriptNode *node, asCScriptCode *file, asSNameSpace *ns, asCObjectType *parent)
 
asCScriptFunctionRegisterLambda (asCScriptNode *node, asCScriptCode *file, asCScriptFunction *funcDef, const asCString &name, asSNameSpace *ns, bool isShared)
 
void CompleteFuncDef (sFuncDef *funcDef)
 
void CompileInterfaces ()
 
void CompileClasses (asUINT originalNumTempl)
 
void DetermineTypeRelations ()
 
void GetParsedFunctionDetails (asCScriptNode *node, asCScriptCode *file, asCObjectType *objType, asCString &name, asCDataType &returnType, asCArray< asCString > &parameterNames, asCArray< asCDataType > &parameterTypes, asCArray< asETypeModifiers > &inOutFlags, asCArray< asCString *> &defaultArgs, asSFunctionTraits &traits, asSNameSpace *implicitNamespace)
 
bool DoesMethodExist (asCObjectType *objType, int methodId, asUINT *methodIndex=0)
 
void AddDefaultConstructor (asCObjectType *objType, asCScriptCode *file)
 
asCObjectPropertyAddPropertyToClass (sClassDeclaration *c, const asCString &name, const asCDataType &type, bool isPrivate, bool isProtected, bool isInherited, asCScriptCode *file=0, asCScriptNode *node=0)
 
int CreateVirtualFunction (asCScriptFunction *func, int idx)
 
void ParseScripts ()
 
void RegisterTypesFromScript (asCScriptNode *node, asCScriptCode *script, asSNameSpace *ns)
 
void RegisterNonTypesFromScript (asCScriptNode *node, asCScriptCode *script, asSNameSpace *ns)
 
void CompileFunctions ()
 
void CompileGlobalVariables ()
 
int GetEnumValueFromType (asCEnumType *type, const char *name, asCDataType &outDt, asDWORD &outValue)
 
int GetEnumValue (const char *name, asCDataType &outDt, asDWORD &outValue, asSNameSpace *ns)
 
bool DoesTypeExist (const asCString &type)
 
asCObjectPropertyGetObjectProperty (asCDataType &obj, const char *prop)
 
asCScriptFunctionGetFunctionDescription (int funcId)
 
void GetFunctionDescriptions (const char *name, asCArray< int > &funcs, asSNameSpace *ns)
 
void GetObjectMethodDescriptions (const char *name, asCObjectType *objectType, asCArray< int > &methods, bool objIsConst, const asCString &scope="", asCScriptNode *errNode=0, asCScriptCode *script=0)
 
void EvaluateTemplateInstances (asUINT startIdx, bool keepSilent)
 
void CleanupEnumValues ()
 

Protected Attributes

int numErrors
 
int numWarnings
 
bool silent
 
asCScriptEngineengine
 
asCModulemodule
 
asCArray< asCScriptCode * > scripts
 
asCArray< sFunctionDescription * > functions
 
asCSymbolTable< sGlobalVariableDescriptionglobVariables
 
asCArray< sClassDeclaration * > classDeclarations
 
asCArray< sClassDeclaration * > interfaceDeclarations
 
asCArray< sClassDeclaration * > namedTypeDeclarations
 
asCArray< sFuncDef * > funcDefs
 
asCArray< sMixinClass * > mixinClasses
 
bool hasCachedKnownTypes
 
asCMap< asCString, bool > knownTypes
 

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