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


C# Exp类代码示例

本文整理汇总了C#中Exp的典型用法代码示例。如果您正苦于以下问题:C# Exp类的具体用法?C# Exp怎么用?C# Exp使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: Declare

 public void Declare(Accessibility accessibility, String name, Exp value = null)
 {
     if (dict.ContainsKey(name))
         validations.GenericWarning("variable '" + name + "' is already declared",
                                    Void.Instance);
     dict.Add(name, new EnvItem(accessibility, value));
 }
开发者ID:michal-minich,项目名称:Efekt-CS,代码行数:7,代码来源:Env.cs

示例2: ExceptHandler

 public ExceptHandler(Exp type, Identifier name, SuiteStatement body, string filename, int start, int end)
     : base(filename, start, end)
 {
     this.type = type;
     this.name = name;
     this.body = body;
 }
开发者ID:uxmal,项目名称:pytocs,代码行数:7,代码来源:ExceptHandler.cs

示例3: printEnvText

 static Void printEnvText(Exp asi)
 {
     var he = asi as IHasEnv;
     if (he != null)
         Env.PrintEnv(he.Env);
     return new Void();
 }
开发者ID:michal-minich,项目名称:Efekt-CS,代码行数:7,代码来源:Builtins.cs

示例4: SwitchStmt

 public SwitchStmt(Exp exp, Exp opCase1, IStmt case1, Exp opCase2, IStmt case2, IStmt defaultCase)
 {
     this.exp = exp;
     this.expCase1 = opCase1;
     this.case1 = case1;
     this.case2 = case2;
     this.expCase2 = opCase2;
     this.defaultCase = defaultCase;
 }
开发者ID:victorursan,项目名称:ToyLanguage_NET,代码行数:9,代码来源:SwitchStmt.cs

示例5: InitThread

        private void InitThread(Time time, Exp action)
        {
            while (true)
            {
                Thread.Sleep(GetTimeUntilSleep(time));

                action.Invoke();
            }
        }
开发者ID:stephanspacov,项目名称:Web.Generics,代码行数:9,代码来源:Scheduler.cs

示例6: Schedule

        public void Schedule(Exp exp, Time time)
        {
            actions.Add(exp);

            Thread t = new Thread(new ThreadStart(() => { InitThread(time, exp); }));

            workers.Add(t);

            t.Start();
        }
开发者ID:stephanspacov,项目名称:Web.Generics,代码行数:10,代码来源:Scheduler.cs

示例7: Replace

 public object Replace(string name, Exp<object> exp)
 {
     if (this.Name == name)
     {
         return exp.Copy();
     }
     else
     {
         return Copy();
     }
 }
开发者ID:IMaylatov,项目名称:Interpretator,代码行数:11,代码来源:VariableExp.cs

示例8: TakeDamage

    public void TakeDamage(float amount, Exp exp = null)
	{
        /* Returns true if the monster was killed with this attack
         */
		if (isDead)
			return;
		damaged = true;
		curHealth -= amount;
		Debug.Log("Enemy Takes Damage");
		Debug.Log(curHealth);
		if(curHealth <= 0)
		{
			Debug.Log("Enemy Destroyed!!!");
			Death();
            if(exp != null) exp += expVal;
		}
	}
开发者ID:sowrd299,项目名称:GlowPillow,代码行数:17,代码来源:MinionsStats.cs

示例9: ViewKuniInfo

	public void ViewKuniInfo(){
		string kuniPath = "Prefabs/Map/KuniInfo";
		GameObject kuni = Instantiate (Resources.Load (kuniPath)) as GameObject;
		kuni.transform.SetParent(GameObject.Find ("Kakejiku").transform);
		kuni.transform.localScale = new Vector2 (1, 1);
		kuni.name = "kuniInfo";

		//Current Kokuryoku
		int kuniExp = PlayerPrefs.GetInt ("kuniExp");
		kuni.transform.FindChild ("KuniLvValue").GetComponent<Text> ().text = kuniExp.ToString ();

		//Exp for Next Lv
		int nowLv = PlayerPrefs.GetInt ("kuniLv");
		Exp exp = new Exp ();
		int totalExp = exp.getKuniExpforNextLv (nowLv);
		int diff = totalExp - kuniExp;
		kuni.transform.FindChild ("KuniNextLvValue").GetComponent<Text> ().text = diff.ToString ();

		//Now Kuni Qty
		string clearedKuni = PlayerPrefs.GetString ("clearedKuni");
		if (clearedKuni != null && clearedKuni != "") {
			if (clearedKuni.Contains (",")) {
				char[] delimiterChars = {','};
				string[] clearedKuniList = clearedKuni.Split (delimiterChars);
				kuni.transform.FindChild ("ShiroQtyValue").GetComponent<Text> ().text = clearedKuniList.Length.ToString ();

			} else {
				kuni.transform.FindChild ("ShiroQtyValue").GetComponent<Text> ().text = "1";
			}
		} else {
			kuni.transform.FindChild ("ShiroQtyValue").GetComponent<Text> ().text = "0";
		}

		//Syutujin Limit
		int jinkeiLimit = PlayerPrefs.GetInt ("jinkeiLimit");
		kuni.transform.FindChild ("SyutsujinQtyValue").GetComponent<Text> ().text = jinkeiLimit.ToString ();

		//Stock Limit
		int stockLimit = PlayerPrefs.GetInt ("stockLimit");
		int myBusyoQty = PlayerPrefs.GetInt ("myBusyoQty");
		string value = myBusyoQty.ToString () + "/" + stockLimit.ToString ();
		kuni.transform.FindChild ("TouyouQtyValue").GetComponent<Text> ().text = value;
	}
开发者ID:zeimoter,项目名称:sengoku2d,代码行数:43,代码来源:IconClick.cs

示例10: CheckInt

    void CheckInt(Exp e)
    {
	if(e.ExpType != typeof(int)){
	    if (e is VarExp && e.ExpType == typeof(void)){        //Param Variable. Type unknown. Assume first occurence
		e.ExpType = typeof(int);
		CurrentFuncDef.Add(((VarExp)e).Name, typeof(int));
	    }
	    else if (e is DoVarExp && e.ExpType == typeof(void)){   //Do Variable. Type unknown. Assume first occurence
		e.ExpType = typeof(int);
		DoVars.Add(((DoVarExp)e).Pos, typeof(int));
	    }
	    else if (e is CallExp && e.ExpType == typeof(void)){       //Recursive function call. Assume first occurence
		e.ExpType = typeof(int);
	    }
	    else if (!(e is CarExp)){                                  //CarExp will be coerceto int
		Console.WriteLine("Int expected");
		success = false;
	    }
	}

    }
开发者ID:ArildF,项目名称:masters,代码行数:21,代码来源:typecheck.cs

示例11: arglist

        //arglist: (argument ',')* (argument [',']
        //                         |'*' test (',' argument)* [',' '**' test] 
        //                         |'**' test)
        public Application arglist(Exp core, int posStart)
        {
            var args = new List<Argument>();
            var keywords = new List<Argument>();
            Exp stargs = null;
            Exp kwargs = null;
            Token token;
            if (Peek(TokenType.RPAREN, out token))
                return new Application(core, args, keywords, stargs, kwargs, filename, core.Start, token.End);
            for (;;)
            {
                if (PeekAndDiscard(TokenType.OP_STAR))
                {
                    if (stargs != null)
                        throw new NotSupportedException("More than one stargs.");
                    stargs = test();
                }
                else if (PeekAndDiscard(TokenType.OP_STARSTAR))
                {
                    if (kwargs != null)
                        throw new NotSupportedException("More than one kwargs.");
                    kwargs = test();
                }
                else 
                {
                    var arg = argument();
                    if (arg != null)
                        args.Add(arg);
                }

                if (!PeekAndDiscard(TokenType.COMMA, out token))
                    break;
                if (Peek(TokenType.RPAREN, out token))
                    break;
            }
            return new Application(core, args, keywords, stargs, kwargs, filename, posStart, token.End);
        }
开发者ID:uxmal,项目名称:pytocs,代码行数:40,代码来源:Parser.cs

示例12: trailer

 //trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME
 public Exp trailer(Exp core)
 {
     Token tok;
     switch (lexer.Peek().Type)
     {
     case TokenType.LPAREN:
         tok = lexer.Get();
         var args = arglist(core, tok.Start);
         Expect(TokenType.RPAREN);
         return args;
     case TokenType.LBRACKET:
         lexer.Get();
         var subs = subscriptlist();
         tok = Expect(TokenType.RBRACKET);
         return new ArrayRef(core, subs, filename, core.Start, tok.End);
     case TokenType.DOT:
         lexer.Get();
         tok = Expect(TokenType.ID);
         var id = new Identifier((string) tok.Value, filename, core.Start, tok.End);
         return new AttributeAccess(core, id, filename, core.Start, tok.End);
     default: throw new InvalidOperationException();
     }
 }
开发者ID:uxmal,项目名称:pytocs,代码行数:24,代码来源:Parser.cs

示例13: GenerateBaseClassName

 private string GenerateBaseClassName(Exp exp)
 {
     return exp.ToString();
 }
开发者ID:uxmal,项目名称:pytocs,代码行数:4,代码来源:StatementTranslator.cs

示例14: GenerateAssert

 private void GenerateAssert(Exp test)
 {
     gen.SideEffect(
         gen.Appl(
             new CodeMethodReferenceExpression(
                 new CodeTypeReferenceExpression("Debug"),
                 "Assert"),
             test.Accept(xlat)));
     gen.EnsureImport("System.Diagnostics");
 }
开发者ID:uxmal,项目名称:pytocs,代码行数:10,代码来源:StatementTranslator.cs

示例15: IfStmt

 public IfStmt(Exp e, IStmt then, IStmt otherwise)
 {
     this.exp = e;
     this.thenStmt = then;
     this.elseStmt = otherwise;
 }
开发者ID:danielacraciun,项目名称:TL_CSharp,代码行数:6,代码来源:IfStmt.cs


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