| Expressions | Statements | Class | DMI Interface |
Intermediate OpCode for AAL.
Content of this chapter: |
class InstanceAttributeData : acdk::lang::Object { typedef core_vector<KeyValue<Object*, ClazzAttributesRes> InstanceAttrMap; InstanceAttrMap _data; ~InstanceAttributeData() { } KeyValue<StringRes, ClazzAttributeResValue> getAttribute(MetaInfo* mi, Object* o, IN(RString) key) { } void releaseObject(Object* o) { InstanceAttrMap::iterator it = find(o); if (it == _data.end()) return; _data.erase(it, it); } }; class DmiRuntimeExt { RObject _dmiServer; RDClazzInfo _clazzInfo; core_vector<pair<name, ScriptVar> > _static_fields; } |
extend acdk.lang.Object with String foo(int i) { return i; } //will add the method to the acdk.lang.Object class acdk.lang.Object o = new acdk.lang.Object(); extend o with String foo(int i) { return i; } // will add the method to object instance o only. |
Top of Stack before call ---------------------------- int Invocation flags obj Target Object to call method String of Method name arg n Last Argument arg n-1 arg 0 First Argument Top of Stack after call ---------------------------- any return value of method (can be void) |
// method with 2 arguments str.substr(0, 1); push 1 push 0 push "substr" push Var(str) push 2 // count of arguments and flags invoke pop // return value |
Top of Stack before call ---------------------------- int Invocation flags str ClassName str MemberName Top of Stack after call ---------------------------- any return value of member |