本文整理汇总了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;
}