private KecaknoahReference find, each, filter, map, reduce;//, first, last; internal KecaknoahArray(int[] dim) { Type = TypeCode.Object; ExtraType = "Array"; array = new List <KecaknoahReference>(); length = KecaknoahReference.CreateRightReference(dim[0]); InitializeMembers(); for (int i = 0; i < dim[0]; i++) { array.Add(new KecaknoahReference { IsLeftValue = true, RawObject = KecaknoahNil.Instance }); } if (dim.Length == 1) { return; } for (int i = 0; i < array.Count; i++) { array[i] = new KecaknoahReference { IsLeftValue = true, RawObject = new KecaknoahArray(dim.Skip(1).ToArray()) } } ; }
/// <summary> /// 要素を指定して新しいインスタンスを初期化します。 /// </summary> /// <param name="refs">追加する要素</param> public KecaknoahList(IEnumerable <KecaknoahObject> refs) : base() { foreach (var i in refs) { list.Add(KecaknoahReference.Left(i)); } }
internal KecaknoahArray(List <KecaknoahReference> arr) { Type = TypeCode.Object; array = arr; length = KecaknoahReference.Right(arr.Count); InitializeMembers(); }
internal KecaknoahDynamicType(System.Type t) { ExtraType = ClassName; type = t; name = KecaknoahReference.Right(type.Name); create_instance = KecaknoahReference.Right(new KecaknoahInteropFunction(this, InstanceCreareInstance)); }
private KecaknoahFunctionResult InstanceAddRange(KecaknoahContext ctx, KecaknoahObject self, KecaknoahObject[] args) { var al = args[0].AsArray(); list.AddRange(al.Select(p => KecaknoahReference.Left(p))); return(KecaknoahNil.Instance.NoResume()); }
internal KecaknoahArray(List<KecaknoahReference> arr) { Type = TypeCode.Object; array = arr; length = KecaknoahReference.CreateRightReference(arr.Count); InitializeMembers(); }
/// <summary> /// 特定の<see cref="KecaknoahScriptClassInfo"/>を元にして、インスタンスを生成します。 /// コンストラクタがあった場合、呼び出します。 /// </summary> /// <param name="klass">クラス</param> /// <param name="ctx">コンテキスト</param> /// <param name="ctorArgs">コンストラクタ引数</param> public KecaknoahInstance(KecaknoahScriptClassInfo klass, KecaknoahContext ctx, KecaknoahObject[] ctorArgs) { Class = klass; LocalFieldReferences = localReferences; InstanceMethodReferences = methodReferences; foreach (var i in klass.Locals) { localReferences[i] = new KecaknoahReference() { IsLeftValue = true } } ; foreach (var i in klass.methods) { methodReferences[i.Name] = new KecaknoahReference() { IsLeftValue = true, RawObject = new KecaknoahScriptFunction(this, i) } } ; if (klass.classMethods.Any(p => p.Name == "new")) { var ctor = klass.classMethods.First(p => p.Name == "new"); new KecaknoahScriptFunction(this, ctor).Call(ctx, ctorArgs); } }
/// <summary> /// 指定された名前のメンバーへの参照を取得します。 /// 「参照」というのは右辺値・左辺値どちらにもなりうる<see cref="KecaknoahReference"/>を差し、 /// インスタンスごとに1つずつ(呼ばれる毎にnewしない)である必要があります。 /// ここで返されるべき参照は /// ・インスタンスメソッド /// ・プロパティ /// などです。どちらもフィールドに<see cref="KecaknoahReference"/>のインスタンスを確保して /// switch分岐でそれらを返すことが推奨されます。 /// </summary> /// <param name="name">メンバー名</param> /// <returns></returns> protected internal override KecaknoahReference GetMemberReference(string name) { switch (name) { case nameof(add): return(add); case nameof(add_range): return(add_range); case nameof(insert): return(insert); case nameof(each): return(each); case nameof(remove_at): return(remove_at); case nameof(remove_by): return(remove_by); case nameof(map): return(map); case nameof(reduce): return(reduce); case nameof(filter): return(filter); case "length": return(KecaknoahReference.Right(list.Count)); } return(base.GetMemberReference(name)); }
private void InitializeMembers() { each = KecaknoahReference.CreateRightReference(new KecaknoahInteropFunction(this, InstanceEach)); find = KecaknoahReference.CreateRightReference(new KecaknoahInteropFunction(this, InstanceFind)); filter = KecaknoahReference.CreateRightReference(new KecaknoahInteropFunction(this, InstanceFilter)); map = KecaknoahReference.CreateRightReference(new KecaknoahInteropFunction(this, InstanceMap)); reduce = KecaknoahReference.CreateRightReference(new KecaknoahInteropFunction(this, InstanceReduce)); }
private void InitializeMembers() { each = KecaknoahReference.Right(this, InstanceEach); find = KecaknoahReference.Right(this, InstanceFind); filter = KecaknoahReference.Right(this, InstanceFilter); map = KecaknoahReference.Right(this, InstanceMap); reduce = KecaknoahReference.Right(this, InstanceReduce); }
/// <summary> /// 配列の新しいインスタンスを生成します。 /// </summary> /// <param name="arr">生成する対象の<see cref="KecaknoahObject"/>のリスト</param> public KecaknoahArray(IEnumerable<KecaknoahObject> arr) { Type = TypeCode.Object; array = new List<KecaknoahReference>(); foreach (var i in arr) array.Add(KecaknoahReference.Left(i)); length = KecaknoahReference.Right(arr.Count()); InitializeMembers(); }
/// <summary> /// インデクサーの参照を得ます。 /// <see cref="GetMemberReference(string)"/>と<see cref="KecaknoahObject.Call(KecaknoahContext, KecaknoahObject[])"/>の /// 中間のような存在です。 /// </summary> /// <param name="indices">インデックス</param> /// <returns>返す参照</returns> protected internal override KecaknoahReference GetIndexerReference(KecaknoahObject[] indices) { if (!dict.ContainsKey(indices[0])) { dict[indices[0]] = KecaknoahReference.Left(KecaknoahNil.Instance); } return(dict[indices[0]]); }
internal KecaknoahArray(List<KecaknoahObject> arr) { Type = TypeCode.Object; array = new List<KecaknoahReference>(); foreach (var i in arr) array.Add(new KecaknoahReference { IsLeftValue = true, RawObject = i }); length = KecaknoahReference.CreateRightReference(arr.Count); InitializeMembers(); }
/// <summary> /// 新しいインスタンスを初期化します。 /// </summary> /// <param name="info"></param> public KecaknoahInteropClassObject(KecaknoahInteropClassInfo info) { Class = info; foreach (var i in Class.classMethods) { methods[i.Name] = (KecaknoahReference.Right(KecaknoahNil.Instance, i.Body)); } }
protected internal override KecaknoahReference GetMemberReference(string name) { if (!members.ContainsKey(name)) { members[name] = new KecaknoahReference { IsLeftValue = true, RawObject = KecaknoahNil.Instance }; } return members[name]; }
private KecaknoahFunctionResult InstanceAdd(KecaknoahContext ctx, KecaknoahObject self, KecaknoahObject[] args) { foreach (var i in args) { list.Add(KecaknoahReference.Left(i)); } return(KecaknoahNil.Instance.NoResume()); }
/// <summary> /// 新しいインスタンスを初期化します。 /// </summary> /// <param name="info"></param> public KecaknoahScriptClassObject(KecaknoahScriptClassInfo info) { Class = info; Constructor = KecaknoahReference.CreateRightReference(new KecaknoahInteropFunction(this, CreateInstance)); foreach (var i in Class.classMethods) { methods[i.Name] = (KecaknoahReference.CreateRightReference(new KecaknoahScriptFunction(KecaknoahNil.Instance, i))); } }
/// <summary> /// 新しいインスタンスを初期化します。 /// </summary> /// <param name="info"></param> public KecaknoahScriptClassObject(KecaknoahScriptClassInfo info) { Class = info; ExtraType = "ScriptClass"; Constructor = KecaknoahReference.Right(this, CreateInstance); foreach (var i in Class.classMethods) { methods[i.Name] = (KecaknoahReference.Right(new KecaknoahScriptFunction(KecaknoahNil.Instance, i))); } }
/// <summary> /// インデクサーの参照を得ます。 /// <see cref="GetMemberReference(string)"/>と<see cref="KecaknoahObject.Call(KecaknoahContext, KecaknoahObject[])"/>の /// 中間のような存在です。 /// </summary> /// <param name="indices">インデックス</param> /// <returns>返す参照</returns> protected internal override KecaknoahReference GetIndexerReference(KecaknoahObject[] indices) { if (!dict.ContainsKey(indices[0])) { dict[indices[0]] = new KecaknoahReference { IsLeftValue = true }; } return(dict[indices[0]]); }
/// <summary> /// 呼び出します。 /// </summary> /// <param name="context"></param> /// <param name="args">引数</param> /// <returns>返り値</returns> protected internal override KecaknoahFunctionResult Call(KecaknoahContext context, KecaknoahObject[] args) { var sf = new KecaknoahStackFrame(context, BaseMethod.Codes); sf.Locals["self"] = KecaknoahReference.CreateRightReference(Instance); sf.Arguments = args; var r = sf.Resume(); return(new KecaknoahFunctionResult(sf.ReturningObject, r)); }
/// <summary> /// メソッドを登録します。 /// </summary> /// <param name="name">メソッド名</param> /// <param name="func"> /// 登録するメソッドのデリゲート。 /// インスタンスと引数配列が渡されます。 /// </param> public void AddFunction(string name, Action <KecaknoahObject, KecaknoahObject[]> func) { KecaknoahInteropDelegate wp = (c, s, a) => { func(s, a); return(KecaknoahNil.Instance.NoResume()); }; funcs[name] = KecaknoahReference.CreateRightReference(new KecaknoahInteropFunction(this, wp)); }
private void RegisterInstanceFunction() { add = KecaknoahReference.CreateRightReference(new KecaknoahInteropFunction(this, InstanceAdd)); insert = KecaknoahReference.CreateRightReference(new KecaknoahInteropFunction(this, InstanceInsert)); each = KecaknoahReference.CreateRightReference(new KecaknoahInteropFunction(this, InstanceEach)); remove_at = KecaknoahReference.CreateRightReference(new KecaknoahInteropFunction(this, InstanceRemoveAt)); remove_by = KecaknoahReference.CreateRightReference(new KecaknoahInteropFunction(this, InstanceRemoveBy)); filter = KecaknoahReference.CreateRightReference(new KecaknoahInteropFunction(this, InstanceFilter)); map = KecaknoahReference.CreateRightReference(new KecaknoahInteropFunction(this, InstanceMap)); reduce = KecaknoahReference.CreateRightReference(new KecaknoahInteropFunction(this, InstanceReduce)); }
private KecaknoahReference find, each, filter, map, reduce;//, first, last; internal KecaknoahArray(int[] dim) { Type = TypeCode.Object; ExtraType = "Array"; array = new List<KecaknoahReference>(); length = KecaknoahReference.CreateRightReference(dim[0]); InitializeMembers(); for (int i = 0; i < dim[0]; i++) array.Add(new KecaknoahReference { IsLeftValue = true, RawObject = KecaknoahNil.Instance }); if (dim.Length == 1) return; for (int i = 0; i < array.Count; i++) array[i] = new KecaknoahReference { IsLeftValue = true, RawObject = new KecaknoahArray(dim.Skip(1).ToArray()) }; }
private KecaknoahReference find, each, filter, map, reduce, copy;//, first, last; internal KecaknoahArray(int[] dim) { Type = TypeCode.Object; ExtraType = "Array"; array = new List<KecaknoahReference>(); length = KecaknoahReference.Right(dim[0]); InitializeMembers(); for (int i = 0; i < dim[0]; i++) array.Add(KecaknoahReference.Left(KecaknoahNil.Instance)); if (dim.Length == 1) return; for (int i = 0; i < array.Count; i++) array[i] = KecaknoahReference.Left(new KecaknoahArray(dim.Skip(1).ToArray())); }
/// <summary> /// 配列の新しいインスタンスを生成します。 /// </summary> /// <param name="arr">生成する対象の<see cref="KecaknoahObject"/>のリスト</param> public KecaknoahArray(IEnumerable <KecaknoahObject> arr) { Type = TypeCode.Object; array = new List <KecaknoahReference>(); foreach (var i in arr) { array.Add(KecaknoahReference.Left(i)); } length = KecaknoahReference.Right(arr.Count()); InitializeMembers(); }
private void RegisterInstanceFunction() { add = KecaknoahReference.Right(this, InstanceAdd); add_range = KecaknoahReference.Right(this, InstanceAddRange); insert = KecaknoahReference.Right(this, InstanceInsert); each = KecaknoahReference.Right(this, InstanceEach); remove_at = KecaknoahReference.Right(this, InstanceRemoveAt); remove_by = KecaknoahReference.Right(this, InstanceRemoveBy); filter = KecaknoahReference.Right(this, InstanceFilter); map = KecaknoahReference.Right(this, InstanceMap); reduce = KecaknoahReference.Right(this, InstanceReduce); }
/// <summary> /// 呼び出します。 /// </summary> /// <param name="context"></param> /// <param name="args">引数</param> /// <returns>返り値</returns> protected internal override KecaknoahFunctionResult Call(KecaknoahContext context, KecaknoahObject[] args) { if (args != null) { CurrentFrame = new KecaknoahStackFrame(context, BaseMethod.Codes); CurrentFrame.Locals["self"] = KecaknoahReference.Right(Instance); CurrentFrame.Arguments = args; } var r = CurrentFrame.Resume(); return(new KecaknoahFunctionResult(CurrentFrame.ReturningObject, r)); }
internal KecaknoahArray(List <KecaknoahObject> arr) { Type = TypeCode.Object; array = new List <KecaknoahReference>(); foreach (var i in arr) { array.Add(new KecaknoahReference { IsLeftValue = true, RawObject = i }); } length = KecaknoahReference.CreateRightReference(arr.Count); InitializeMembers(); }
/// <summary> /// 特定の<see cref="KecaknoahInteropClassInfo"/>を元にして、インスタンスを生成します。 /// </summary> /// <param name="klass">クラス</param> public KecaknoahInstance(KecaknoahInteropClassInfo klass) { Class = klass; LocalFieldReferences = localReferences; InstanceMethodReferences = methodReferences; foreach (var i in klass.Locals) localReferences[i] = new KecaknoahReference() { IsLeftValue = true }; foreach (var i in klass.methods) methodReferences[i.Name] = new KecaknoahReference() { IsLeftValue = true, RawObject = new KecaknoahInteropFunction(this, i.Body) }; }
/// <summary> /// 指定された名前のメンバーへの参照を取得します。 /// 「参照」というのは右辺値・左辺値どちらにもなりうる<see cref="KecaknoahReference"/>を差し、 /// インスタンスごとに1つずつ(呼ばれる毎にnewしない)である必要があります。 /// ここで返されるべき参照は /// ・インスタンスメソッド /// ・プロパティ /// などです。どちらもフィールドに<see cref="KecaknoahReference"/>のインスタンスを確保して /// switch分岐でそれらを返すことが推奨されます。 /// </summary> /// <param name="name">メンバー名</param> /// <returns></returns> protected internal override KecaknoahReference GetMemberReference(string name) { switch (name) { case nameof(each): return(each); case nameof(remove): return(remove); case nameof(has_key): return(has_key); case "length": return(KecaknoahReference.Right(dict.Count)); } return(base.GetMemberReference(name)); }
/// <summary> /// 新しいインスタンスを生成します。 /// </summary> public KecaknoahString() { Type = TypeCode.String; ExtraType = "String"; split = KecaknoahReference.Right(this, InstanceSplit); replace = KecaknoahReference.Right(this, InstanceReplace); substring = KecaknoahReference.Right(this, InstanceSubstring); to_upper = KecaknoahReference.Right(this, InstanceToUpper); to_lower = KecaknoahReference.Right(this, InstanceToLower); starts = KecaknoahReference.Right(this, InstanceStartsWith); ends = KecaknoahReference.Right(this, InstanceEndsWith); pad_left = KecaknoahReference.Right(this, InstancePadLeft); pad_right = KecaknoahReference.Right(this, InstancePadRight); }
/// <summary> /// 特定の名前を持つメンバーに対してアクセスを試み、参照を取得します。 /// </summary> /// <param name="name">メンバー名</param> /// <returns>アクセスできる場合は対象のオブジェクト</returns> protected internal virtual KecaknoahReference GetMemberReference(string name) { switch (name) { case "to_str": return(InstanceToString(this)); case "hash": return(InstanceHash(this)); case "type": return(KecaknoahReference.Right(ExtraType)); default: return(KecaknoahNil.Reference); } }
/// <summary> /// 特定の<see cref="KecaknoahScriptClassInfo"/>を元にして、インスタンスを生成します。 /// コンストラクタがあった場合、呼び出します。 /// </summary> /// <param name="klass">クラス</param> /// <param name="ctx">コンテキスト</param> /// <param name="ctorArgs">コンストラクタ引数</param> public KecaknoahInstance(KecaknoahScriptClassInfo klass, KecaknoahContext ctx, KecaknoahObject[] ctorArgs) { Class = klass; LocalFieldReferences = localReferences; InstanceMethodReferences = methodReferences; foreach (var i in klass.Locals) localReferences[i] = new KecaknoahReference() { IsLeftValue = true }; foreach (var i in klass.methods) methodReferences[i.Name] = new KecaknoahReference() { IsLeftValue = true, RawObject = new KecaknoahScriptFunction(this, i) }; if (klass.classMethods.Any(p => p.Name == "new")) { var ctor = klass.classMethods.First(p => p.Name == "new"); new KecaknoahScriptFunction(this, ctor).Call(ctx, ctorArgs); } }
#pragma warning disable 1591 protected internal override KecaknoahReference GetMemberReference(string name) { KecaknoahReference result; if (PropertyReferences.TryGetValue(name, out result)) { return(result); } if (FunctionReferences.TryGetValue(name, out result)) { return(result); } result = new KecaknoahReference { IsLeftValue = true }; props[name] = result; return(result); }
private KecaknoahReference find, each, filter, map, reduce;//, first, last; internal KecaknoahArray(int[] dim) { Type = TypeCode.Object; ExtraType = "Array"; array = new List <KecaknoahReference>(); length = KecaknoahReference.Right(dim[0]); InitializeMembers(); for (int i = 0; i < dim[0]; i++) { array.Add(KecaknoahReference.Left(KecaknoahNil.Instance)); } if (dim.Length == 1) { return; } for (int i = 0; i < array.Count; i++) { array[i] = KecaknoahReference.Left(new KecaknoahArray(dim.Skip(1).ToArray())); } }
/// <summary> /// メンバーの参照を取得します。 /// </summary> /// <param name="name"></param> /// <returns></returns> protected internal override KecaknoahReference GetMemberReference(string name) { if (LocalFieldReferences.ContainsKey(name)) { return(LocalFieldReferences[name]); } if (InstanceMethodReferences.ContainsKey(name)) { return(InstanceMethodReferences[name]); } KecaknoahReference result; if ((result = base.GetMemberReference(name)) == KecaknoahNil.Reference) { result = localReferences[name] = new KecaknoahReference { IsLeftValue = true }; } return(result); }
/// <summary> /// 特定の<see cref="KecaknoahInteropClassInfo"/>を元にして、インスタンスを生成します。 /// </summary> /// <param name="klass">クラス</param> public KecaknoahInstance(KecaknoahInteropClassInfo klass) { Class = klass; LocalFieldReferences = localReferences; InstanceMethodReferences = methodReferences; foreach (var i in klass.Locals) { localReferences[i] = new KecaknoahReference() { IsLeftValue = true } } ; foreach (var i in klass.methods) { methodReferences[i.Name] = new KecaknoahReference() { IsLeftValue = true, RawObject = new KecaknoahInteropFunction(this, i.Body) } } ; }
private void RegisterInstanceMembers() { i_get_int = KecaknoahReference.Right(this, InstanceGetInteger); i_get_float = KecaknoahReference.Right(this, InstanceGetFloat); }
private void RegisterInstanceMembers() { i_add = KecaknoahReference.Right(this, InstanceAdd); i_add_days = KecaknoahReference.Right(this, InstanceAddDays); i_add_hours = KecaknoahReference.Right(this, InstanceAddHours); i_add_minutes = KecaknoahReference.Right(this, InstanceAddMinutes); i_add_months = KecaknoahReference.Right(this, InstanceAddMonths); i_add_seconds = KecaknoahReference.Right(this, InstanceAddSeconds); i_add_ticks = KecaknoahReference.Right(this, InstanceAddTicks); i_add_years = KecaknoahReference.Right(this, InstanceAddYears); i_sub = KecaknoahReference.Right(this, InstanceSub); i_to_local = KecaknoahReference.Right(this, InstanceToLocal); }
private void RegisterInstanceMembers() { i_add = KecaknoahReference.Right(this, InstanceAdd); i_sub = KecaknoahReference.Right(this, InstanceSub); }
#pragma warning disable 1591 protected internal override KecaknoahReference GetMemberReference(string name) { KecaknoahReference result; if (PropertyReferences.TryGetValue(name, out result)) return result; if (FunctionReferences.TryGetValue(name, out result)) return result; result = new KecaknoahReference { IsLeftValue = true }; props[name] = result; return result; }
private void RegisterInstanceMembers() { i_match = KecaknoahReference.Right(this, InstanceMatch); i_split = KecaknoahReference.Right(this, InstanceSplit); }
/// <summary> /// インデクサーの参照を得ます。 /// <see cref="GetMemberReference(string)"/>と<see cref="KecaknoahObject.Call(KecaknoahContext, KecaknoahObject[])"/>の /// 中間のような存在です。 /// </summary> /// <param name="indices">インデックス</param> /// <returns>返す参照</returns> protected internal override KecaknoahReference GetIndexerReference(KecaknoahObject[] indices) { if (!dict.ContainsKey(indices[0])) { dict[indices[0]] = new KecaknoahReference { IsLeftValue = true }; } return dict[indices[0]]; }
private void RegisterInstanceFunction() { each = KecaknoahReference.Right(this, InstanceEach); remove = KecaknoahReference.Right(this, InstanceRemove); has_key = KecaknoahReference.Right(this, InstanceHasKey); }
/// <summary> /// メソッドを登録します。 /// </summary> /// <param name="name">メソッド名</param> /// <param name="func">登録するメソッドのデリゲート</param> public void AddFunction(string name, KecaknoahInteropDelegate func) { funcs[name] = KecaknoahReference.CreateRightReference(new KecaknoahInteropFunction(this, func)); }
internal KecaknoahRegexCapture(Capture c) { cap = c; length = KecaknoahReference.Right(cap.Length); index = KecaknoahReference.Right(cap.Index); value = KecaknoahReference.Right(cap.Value); }
/// <summary> /// メソッドを登録します。 /// </summary> /// <param name="name">メソッド名</param> /// <param name="func"> /// 登録するメソッドのデリゲート。 /// インスタンスと引数が渡されます。 /// </param> public void AddFunction(string name, Func <KecaknoahObject, KecaknoahObject[], string> func) { KecaknoahInteropDelegate wp = (c, s, a) => func(s, a).AsKecaknoahString().NoResume(); funcs[name] = KecaknoahReference.CreateRightReference(new KecaknoahInteropFunction(this, wp)); }
/// <summary> /// メンバーの参照を取得します。 /// </summary> /// <param name="name"></param> /// <returns></returns> protected internal override KecaknoahReference GetMemberReference(string name) { if (LocalFieldReferences.ContainsKey(name)) return LocalFieldReferences[name]; if (InstanceMethodReferences.ContainsKey(name)) return InstanceMethodReferences[name]; KecaknoahReference result; if ((result = base.GetMemberReference(name)) == KecaknoahNil.Reference) { result = localReferences[name] = new KecaknoahReference { IsLeftValue = true }; } return result; }
internal KecaknoahRegexGroup(Group g) { gr = g; length = KecaknoahReference.Right(gr.Length); index = KecaknoahReference.Right(gr.Index); value = KecaknoahReference.Right(gr.Value); }
internal KecaknoahDynamicLibraryObject(object self) { ExtraType = ClassName; type = self?.GetType(); name = KecaknoahReference.Right(type?.Name ?? ""); rawobj = self; }
private void RegisterInstanceFunction() { add = KecaknoahReference.Right(this, InstanceAdd); add_range = KecaknoahReference.Right(this, InstanceAddRange); clear = KecaknoahReference.Right(this, InstanceClear); insert = KecaknoahReference.Right(this, InstanceInsert); each = KecaknoahReference.Right(this, InstanceEach); remove_at = KecaknoahReference.Right(this, InstanceRemoveAt); remove_by = KecaknoahReference.Right(this, InstanceRemoveBy); filter = KecaknoahReference.Right(this, InstanceFilter); map = KecaknoahReference.Right(this, InstanceMap); reduce = KecaknoahReference.Right(this, InstanceReduce); any = KecaknoahReference.Right(this, list.Select(p => p.RawObject).GenerateAnyFunction()); all = KecaknoahReference.Right(this, list.Select(p => p.RawObject).GenerateAllFunction()); }
internal KecaknoahExtensionClass(KecaknoahExternalClassInfo kec) { ExtraType = ClassName; exclass = kec; cobj = new KecaknoahInteropClassObject(exclass.Information); cobjRef = KecaknoahReference.Right(cobj); isStatic = exclass.IsStaticClass; if (!isStatic) { i_create = KecaknoahReference.Right(this, InstanceCreate); ctor = cobj.Class.classMethods.FirstOrDefault(p => p.Name == "new"); if (ctor == null) throw new CompositionException("staticクラスでないにもかかわらずコンストラクタがありません。"); } }
internal KecaknoahDynamicLibraryField(object self, FieldInfo fi) { ExtraType = ClassName; instance = self; info = fi; getter = KecaknoahReference.Right(new KecaknoahInteropFunction(this, InstanceGet)); setter = KecaknoahReference.Right(new KecaknoahInteropFunction(this, InstanceSet)); }
private void RegisterInstanceFunction() { each = KecaknoahReference.CreateRightReference(new KecaknoahInteropFunction(this, InstanceEach)); remove = KecaknoahReference.CreateRightReference(new KecaknoahInteropFunction(this, InstanceRemove)); has_key = KecaknoahReference.CreateRightReference(new KecaknoahInteropFunction(this, InstanceHasKey)); }
/// <summary> /// 新しいインスタンスを生成します。 /// </summary> public KecaknoahString() { Type = TypeCode.String; Replace = KecaknoahReference.CreateRightReference(this, InstanceReplace); Substring = KecaknoahReference.CreateRightReference(this, InstanceSubstring); }