當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。