当前位置: 首页>>代码示例>>C#>>正文


C# Method.GetAgumentStack方法代码示例

本文整理汇总了C#中Method.GetAgumentStack方法的典型用法代码示例。如果您正苦于以下问题:C# Method.GetAgumentStack方法的具体用法?C# Method.GetAgumentStack怎么用?C# Method.GetAgumentStack使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Method的用法示例。


在下文中一共展示了Method.GetAgumentStack方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: open

        public void open(VariabelDatabase database, EnegyData data, Posision pos)
        {
            Class config = new Class("Config");

            Method get = new Method("get");
            get.GetAgumentStack().push("string", "name");
            get.SetBody(Get_caller);
            get.SetStatic();
            config.SetMethod(get, data, database, pos);

            Method isScriptLock = new Method("isScriptLock");
            isScriptLock.SetBody(IsScriptLock_caller);
            isScriptLock.SetStatic();
            config.SetMethod(isScriptLock, data, database, pos);

            Method set = new Method("set");
            set.GetAgumentStack().push("string", "name");
            set.GetAgumentStack().push("string", "value");
            set.SetBody(Set_caller);
            set.SetStatic();
            config.SetMethod(set, data, database, pos);

            Method isLocked = new Method("isLocked");
            isLocked.SetStatic();
            isLocked.GetAgumentStack().push("string", "name");
            isLocked.SetBody(IsLocked_caller);
            config.SetMethod(isLocked, data, database, pos);

            database.pushClass(config, data);
        }
开发者ID:Cowscript,项目名称:CowScript,代码行数:30,代码来源:Config.cs

示例2: createIntClass

        private static void createIntClass(EnegyData data, VariabelDatabase db, Posision pos)
        {
            Class i = new Class("int");

            Method constructor = new Method(null);
            constructor.GetAgumentStack().push("int", "double", new NullVariabel());
            constructor.SetBody(Constructor_caller1);
            i.SetConstructor(constructor, data, db, pos);

            Method toInt = new Method("toInt");
            toInt.SetBody(ToInt_caller);
            i.SetMethod(toInt, data, db, pos);

            Method toString = new Method("toString");
            toString.SetBody(ToString_caller1);
            i.SetMethod(toString, data, db, pos);

            Method convert = new Method("convert");
            convert.SetStatic();
            convert.GetAgumentStack().push("string", "int");
            convert.SetBody(Convert_caller);
            i.SetMethod(convert, data, db, pos);

            db.pushClass(i, data);
        }
开发者ID:Cowscript,项目名称:CowScript,代码行数:25,代码来源:StartItems.cs

示例3: ArrayVariabel

        public ArrayVariabel(EnegyData data, VariabelDatabase db, Posision pos)
            : base(new ClassVariabel(new Class()), new Dictionary<string, PointerContainer>(), new Dictionary<string, MethodContainer>(), null, new System.Collections.ArrayList())
        {
            Class c = new Class("array");

            Method length = new Method("length");
            length.SetBody(Length_caller);
            c.SetMethod(length, data, db, pos);

            Method hasValue = new Method("hasValue");
            hasValue.GetAgumentStack().push("context");
            hasValue.SetBody(HasValue_caller);
            c.SetMethod(hasValue, data, db, pos);

            Method hasKey = new Method("hasKey");
            hasKey.GetAgumentStack().push("string", "context");
            hasKey.SetBody(HasKey_caller);
            c.SetMethod(hasKey, data, db, pos);

            Method removeKey = new Method("removeKey");
            removeKey.GetAgumentStack().push("string", "key");
            removeKey.SetBody(RemoveKey_caller);
            c.SetMethod(removeKey, data, db, pos);

            Method removeValue = new Method("removeValue");
            removeValue.GetAgumentStack().push("value");
            removeValue.SetBody(RemoveValue_caller);
            c.SetMethod(removeValue, data, db, pos);

            ClassVariabel i = new ClassVariabel(c);
            ObjectVariabel o = i.createNew(db, data, new CVar[0], pos);
            Items = o.Items;
        }
开发者ID:Cowscript,项目名称:CowScript,代码行数:33,代码来源:ArrayVariabel.cs

示例4: open

        public void open(VariabelDatabase database, EnegyData data, Posision pos)
        {
            if(data.Config.get("file.system.enable", "false") != "true")
            {
                data.setError(new ScriptError("You can use the plugin 'file' becuse it not enabled in the config system!", new Posision(0, 0)), database);
                return;
            }

            Class f = new Class("File");

            Method exsist = new Method("exists");
            exsist.SetStatic();
            exsist.GetAgumentStack().push("string", "dir");
            exsist.SetBody(Exsist_caller);
            f.SetMethod(exsist, data, database, pos);

            Method create = new Method("create");
            create.SetStatic();
            create.GetAgumentStack().push("string", "dir");
            create.GetAgumentStack().push("string", "context", new NullVariabel());
            create.SetBody(Create_caller);
            f.SetMethod(create, data, database, pos);

            Method delete = new Method("delete");
            delete.SetStatic();
            delete.GetAgumentStack().push("string", "dir");
            delete.SetBody(Delete_caller);
            f.SetMethod(delete, data, database, pos);

            Method write = new Method("write");
            write.SetStatic();
            write.GetAgumentStack().push("string", "dir");
            write.GetAgumentStack().push("string", "context");
            write.SetBody(Write_caller);
            f.SetMethod(write, data, database, pos);

            Method read = new Method("read");
            read.SetStatic();
            read.GetAgumentStack().push("string", "dir");
            read.SetBody(Read_caller);
            f.SetMethod(read, data, database, pos);

            database.pushClass(f, data);
        }
开发者ID:Cowscript,项目名称:CowScript,代码行数:44,代码来源:Files.cs

示例5: buildConstructor

 private bool buildConstructor(Token token, EnegyData data)
 {
     Method cm = new Method(null);
     token.next();
     cm.SetAgumentStack(AgumentParser.parseAguments(token, db, data));
     cm.SetBody(new CallScriptMethod(cm.GetAgumentStack(), BodyParser.parse(token, data, db)).call);
     cm.SetVariabel();
     builder.SetConstructor(cm, data, db, token.getCache().posision());
     token.next();
     return true;
 }
开发者ID:Cowscript,项目名称:CowScript,代码行数:11,代码来源:ClassParser.cs

示例6: open

        public void open(VariabelDatabase database, EnegyData data, Posision pos)
        {
            Class r = new Class("Random");

            Method constructor = new Method("");
            constructor.SetBody(Constructor_caller);
            r.SetConstructor(constructor, data, database, pos);

            Method seed = new Method("seed");
            seed.GetAgumentStack().push("int", "seed");
            seed.SetBody(Seed_caller);
            r.SetMethod(seed, data, database, pos);

            Method next = new Method("next");
            next.GetAgumentStack().push("int", "min");
            next.GetAgumentStack().push("int", "max");
            next.SetBody(Next_caller);
            r.SetMethod(next, data, database, pos);

            database.pushClass(r, data);
        }
开发者ID:Cowscript,项目名称:CowScript,代码行数:21,代码来源:Random.cs

示例7: buildMethod

        private bool buildMethod(ClassItemAccessLevel level, bool isStatic, Token token, EnegyData data)
        {
            //control if there are is name after function :)
            if (token.getCache().type() != TokenType.Variabel)
            {
                data.setError(new ScriptError("A method should have a name", token.getCache().posision()), db);
                return false;
            }

            string type = null;

            //okay the name can be a type so wee control it here :)
            if (Types.IsType(token.getCache().ToString(), db))
            {
                type = token.getCache().ToString();

                if(token.next().type() != TokenType.Variabel)
                {
                    data.setError(new ScriptError("A method should have a name", token.getCache().posision()), db);
                    return false;
                }
            }

            Method method = new Method(token.getCache().ToString());

            token.next();

            if (isStatic)
                method.SetStatic();

            method.SetAgumentStack(AgumentParser.parseAguments(token, db, data));
            method.SetBody(new CallScriptMethod(method.GetAgumentStack(), BodyParser.parse(token, data, db)).call);
            method.SetVariabel();//in this way the script can use agument as name :)
            method.setLevel(level);

            builder.SetMethod(method, data, db, token.getCache().posision());
            token.next();
            return true;
        }
开发者ID:Cowscript,项目名称:CowScript,代码行数:39,代码来源:ClassParser.cs

示例8: createStringClass

        private static void createStringClass(EnegyData data, VariabelDatabase db, Posision pos)
        {
            Class s = new Class("string");

            Method format = new Method("format");
            format.SetStatic();
            format.GetAgumentStack().push("string", "query");
            format.GetAgumentStack().push("array", "parameters");
            format.SetBody(Format_caller);
            s.SetMethod(format, data, db, pos);

            //constructor :)
            Method constructor = new Method(null);
            constructor.GetAgumentStack().push("string", "s", new NullVariabel());
            constructor.SetBody(Constructor_caller);
            s.SetConstructor(constructor, data, db, pos);

            Method length = new Method("length");
            length.SetBody(Length_caller);
            s.SetMethod(length, data, db, pos);

            Method substr = new Method("substr");
            substr.GetAgumentStack().push("int", "min");
            substr.GetAgumentStack().push("int", "max", new NullVariabel());
            substr.SetBody(Substr_caller);
            s.SetMethod(substr, data, db, pos);

            Method indexOf = new Method("indexOf");
            indexOf.GetAgumentStack().push("string", "serche");
            indexOf.SetBody(IndexOf_caller);
            s.SetMethod(indexOf, data, db, pos);

            Method toChars = new Method("toChars");
            toChars.SetBody(ToChars_caller);
            s.SetMethod(toChars, data, db, pos);

            Method split = new Method("split");
            split.GetAgumentStack().push("string", "string");
            split.SetBody(Split_caller);
            s.SetMethod(split, data, db, pos);

            Method toLower = new Method("toLower");
            toLower.SetBody(ToLower_caller);
            s.SetMethod(toLower, data, db, pos);

            Method toUpper = new Method("toUpper");
            toUpper.SetBody(ToUpper_caller);
            s.SetMethod(toUpper, data, db, pos);

            Method toString = new Method("toString");
            toString.SetBody(ToString_caller);
            s.SetMethod(toString, data, db, pos);

            Method set = new Method("set");
            set.GetAgumentStack().push("string", "context");
            set.setLevel(ClassItemAccessLevel.Protected);
            set.SetBody(Set_caller);
            s.SetMethod(set, data, db, pos);

            db.pushClass(s, data);
        }
开发者ID:Cowscript,项目名称:CowScript,代码行数:61,代码来源:StartItems.cs


注:本文中的Method.GetAgumentStack方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。