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


C# AST.GetType方法代码示例

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


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

示例1: IsLoop

		bool IsLoop (AST ast)
		{
			Type t = ast.GetType ();
			return t == typeof (For) || t == typeof (While) || t == typeof (DoWhile) || t == typeof (ForIn);
		}
开发者ID:nickchal,项目名称:pash,代码行数:5,代码来源:Statement.cs

示例2: fall_true

        internal static void fall_true(EmitContext ec, AST ast, Label lbl)
        {
            Type type = ast.GetType ();

            if (type == typeof (Expression)) {
                Expression exp = ast as Expression;
                AST last_exp = (AST) exp.exprs [exp.exprs.Count - 1];
                if (exp.exprs.Count >= 2)
                    exp.Emit (ec);
                fall_true (ec, last_exp, lbl);
            } else if (type == typeof (Binary))
                ft_binary_recursion (ec, ast, lbl);
            else if (type == typeof (Equality) || type == typeof (StrictEquality))
                ft_emit_equality (ec, ast, lbl);
            else if (type == typeof (Relational))
                ft_emit_relational (ec, (Relational) ast, lbl);
            else
                emit_default_case (ec, ast, OpCodes.Brfalse, lbl);
        }
开发者ID:mayatforest,项目名称:Refractor,代码行数:19,代码来源:CodeGenerator.cs

示例3: IsLiteral

		internal static Type IsLiteral (AST ast)
		{
			if (ast != null) {
				Type type = ast.GetType ();
				// FIXME: Add test for other literals (exclude StringLiteral)
				if (type == typeof (ArrayLiteral))
					return type;
			}
			return null;
		}
开发者ID:nickchal,项目名称:pash,代码行数:10,代码来源:SemanticAnalizer.cs

示例4: fall_false

        internal static void fall_false(EmitContext ec, AST ast, Label lbl)
        {
            Type type = ast.GetType ();

            if (type == typeof (Expression)) {
                Expression exp = ast as Expression;

                if (exp.Size > 1)
                    exp.Emit (ec);

                AST last_exp = (AST) exp.exprs [exp.exprs.Count - 1];

                if (last_exp is Relational)
                    ff_emit_relational (ec, last_exp, lbl);
                else if (last_exp is Binary)
                    ff_binary_recursion (ec, last_exp, lbl);
                else if (last_exp is Identifier || last_exp is BooleanConstant)
                    emit_default_case (ec, last_exp, OpCodes.Brtrue, lbl);
             				else if (last_exp is Equality)
                    ff_emit_equality_cond (ec, last_exp, lbl);
                else {
                    Console.WriteLine ("WARNING: fall_false, last_exp.GetType () == {0}, {1}", last_exp, ast.Location.LineNumber);
                }
            } else if (type == typeof (Binary))
                ff_binary_recursion (ec, ast, lbl);
            else if (type == typeof (Relational))
                ff_emit_relational (ec, ast, lbl);
            else
                emit_default_case (ec, ast, OpCodes.Brtrue, lbl);
        }
开发者ID:mayatforest,项目名称:Refractor,代码行数:30,代码来源:CodeGenerator.cs


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