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


Java AST.getNumberOfChildren方法代码示例

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


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

示例1: processWhereClause

import antlr.collections.AST; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
protected ProcessedWhereClause processWhereClause(AST whereClause) {
	if ( whereClause.getNumberOfChildren() != 0 ) {
		// If a where clause was specified in the update/delete query, use it to limit the
		// returned ids here...
		try {
			SqlGenerator sqlGenerator = new SqlGenerator( sessionFactory );
			sqlGenerator.whereClause( whereClause );
			String userWhereClause = sqlGenerator.getSQL().substring( 7 );  // strip the " where "
			List<ParameterSpecification> idSelectParameterSpecifications = sqlGenerator.getCollectedParameters();

			return new ProcessedWhereClause( userWhereClause, idSelectParameterSpecifications );
		}
		catch ( RecognitionException e ) {
			throw new HibernateException( "Unable to generate id select for DML operation", e );
		}
	}
	else {
		return ProcessedWhereClause.NO_WHERE_CLAUSE;
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:22,代码来源:AbstractTableBasedBulkIdHandler.java

示例2: processEqualityExpression

import antlr.collections.AST; //导入方法依赖的package包/类
/**
 * Post process equality expressions, clean up the subtree.
 *
 * @param x The equality expression.
 *
 * @return AST - The clean sub-tree.
 */
@Override
public AST processEqualityExpression(AST x) {
	if ( x == null ) {
		LOG.processEqualityExpression();
		return null;
	}

	int type = x.getType();
	if ( type == EQ || type == NE ) {
		boolean negated = type == NE;
		if ( x.getNumberOfChildren() == 2 ) {
			AST a = x.getFirstChild();
			AST b = a.getNextSibling();
			// (EQ NULL b) => (IS_NULL b)
			if ( a.getType() == NULL && b.getType() != NULL ) {
				return createIsNullParent( b, negated );
			}
			// (EQ a NULL) => (IS_NULL a)
			else if ( b.getType() == NULL && a.getType() != NULL ) {
				return createIsNullParent( a, negated );
			}
			else if ( b.getType() == EMPTY ) {
				return processIsEmpty( a, negated );
			}
			else {
				return x;
			}
		}
		else {
			return x;
		}
	}
	else {
		return x;
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:44,代码来源:HqlParser.java

示例3: hasWhereClause

import antlr.collections.AST; //导入方法依赖的package包/类
@Override
public final boolean hasWhereClause() {
	AST whereClause = locateWhereClause();
	return whereClause != null && whereClause.getNumberOfChildren() > 0;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:6,代码来源:AbstractRestrictableStatement.java


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