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


C# statement.GetType方法代码示例

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


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

示例1: CompareInternal

        public void CompareInternal(statement left, statement right)
        {
            if (left == null && right != null || left != null && right == null)
                throw_not_equal(left, right);
            if (left != null && right != null)
            {
                if (left.GetType() != right.GetType())
                    throw_not_equal(left, right);
                /*Type t = left.GetType();
                MethodInfo mi = typeof(SyntaxTreeComparer).GetMethod("CompareInternal", new Type[] { t, t });
                mi.Invoke(this, new object[] { left, right });*/
                if (left is if_node)
                    CompareInternal(left as if_node, right as if_node);
                else if (left is while_node)
                    CompareInternal(left as while_node, right as while_node);
                else if (left is for_node)
                    CompareInternal(left as for_node, right as for_node);
                else if (left is repeat_node)
                    CompareInternal(left as repeat_node, right as repeat_node);
                else if (left is foreach_stmt)
                    CompareInternal(left as foreach_stmt, right as foreach_stmt);
                else if (left is raise_stmt)
                    CompareInternal(left as raise_stmt, right as raise_stmt);
                else if (left is case_node)
                    CompareInternal(left as case_node, right as case_node);
                else if (left is with_statement)
                    CompareInternal(left as with_statement, right as with_statement);
                else if (left is lock_stmt)
                    CompareInternal(left as lock_stmt, right as lock_stmt);
                else if (left is try_stmt)
                    CompareInternal(left as try_stmt, right as try_stmt);
                else if (left is goto_statement)
                    CompareInternal(left as goto_statement, right as goto_statement);
                else if (left is labeled_statement)
                    CompareInternal(left as labeled_statement, right as labeled_statement);
                else if (left is case_node)
                    CompareInternal(left as case_node, right as case_node);
                else if (left is empty_statement)
                    CompareInternal(left as empty_statement, right as empty_statement);
                else if (left is case_node)
                    CompareInternal(left as case_node, right as case_node);
                else if (left is raise_statement)
                    CompareInternal(left as raise_statement, right as raise_statement);
                else if (left is var_statement)
                    CompareInternal(left as var_statement, right as var_statement);
                else if (left is procedure_call)
                    CompareInternal(left as procedure_call, right as procedure_call);
                else if (left is expression_as_statement)
                    CompareInternal(left as expression_as_statement, right as expression_as_statement);
                else if (left is inherited_message)
                    CompareInternal(left as inherited_message, right as inherited_message);
                else if (left is statement_list)
                    CompareInternal(left as statement_list, right as statement_list);
                else if (left is inherited_method_call)
                    CompareInternal(left as inherited_method_call, right as inherited_method_call);
                else if (left is assign)
                    CompareInternal(left as assign, right as assign);
                //else if (left is expression) // SSM 12/06/15
                //    CompareInternal(left as expression, right as expression);

                else throw new NotImplementedException(left.GetType().ToString());
            }
        }
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:63,代码来源:SyntaxTreeComparer.cs


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