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


C# Walker.xExprCallback方法代码示例

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


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

示例1: sqlite3WalkExpr

    /*
    ** 2008 August 16
    **
    ** The author disclaims copyright to this source code.  In place of
    ** a legal notice, here is a blessing:
    **
    **    May you do good and not evil.
    **    May you find forgiveness for yourself and forgive others.
    **    May you share freely, never taking more than you give.
    **
    *************************************************************************
    ** This file contains routines used for walking the parser tree for
    ** an SQL statement.
    *************************************************************************
    **  Included in SQLite3 port to C#-SQLite;  2008 Noah B Hart
    **  C#-SQLite is an independent reimplementation of the SQLite software library
    **
    **  SQLITE_SOURCE_ID: 2010-08-23 18:52:01 42537b60566f288167f1b5864a5435986838e3a3
    **
    *************************************************************************
    */
    //#include "sqliteInt.h"
    //#include <stdlib.h>
    //#include <string.h>


    /*
    ** Walk an expression tree.  Invoke the callback once for each node
    ** of the expression, while decending.  (In other words, the callback
    ** is invoked before visiting children.)
    **
    ** The return value from the callback should be one of the WRC_*
    ** constants to specify how to proceed with the walk.
    **
    **    WRC_Continue      Continue descending down the tree.
    **
    **    WRC_Prune         Do not descend into child nodes.  But allow
    **                      the walk to continue with sibling nodes.
    **
    **    WRC_Abort         Do no more callbacks.  Unwind the stack and
    **                      return the top-level walk call.
    **
    ** The return value from this routine is WRC_Abort to abandon the tree walk
    ** and WRC_Continue to continue.
    */
    static int sqlite3WalkExpr( Walker pWalker, ref Expr pExpr )
    {
      int rc;
      if ( pExpr == null )
        return WRC_Continue;
      testcase( ExprHasProperty( pExpr, EP_TokenOnly ) );
      testcase( ExprHasProperty( pExpr, EP_Reduced ) );
      rc = pWalker.xExprCallback( pWalker, ref pExpr );
      if ( rc == WRC_Continue
      && !ExprHasAnyProperty( pExpr, EP_TokenOnly ) )
      {
        if ( sqlite3WalkExpr( pWalker, ref pExpr.pLeft ) != 0 )
          return WRC_Abort;
        if ( sqlite3WalkExpr( pWalker, ref pExpr.pRight ) != 0 )
          return WRC_Abort;
        if ( ExprHasProperty( pExpr, EP_xIsSelect ) )
        {
          if ( sqlite3WalkSelect( pWalker, pExpr.x.pSelect ) != 0 )
            return WRC_Abort;
        }
        else
        {
          if ( sqlite3WalkExprList( pWalker, pExpr.x.pList ) != 0 )
            return WRC_Abort;
        }
      }
      return rc & WRC_Abort;
    }
开发者ID:seeseekey,项目名称:CSCL,代码行数:73,代码来源:walker_c.cs


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