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


Java CombinedBinaryExpression类代码示例

本文整理汇总了Java中org.eclipse.jdt.internal.compiler.ast.CombinedBinaryExpression的典型用法代码示例。如果您正苦于以下问题:Java CombinedBinaryExpression类的具体用法?Java CombinedBinaryExpression怎么用?Java CombinedBinaryExpression使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: visit

import org.eclipse.jdt.internal.compiler.ast.CombinedBinaryExpression; //导入依赖的package包/类
public boolean visit(CombinedBinaryExpression combinedBinaryExpression, BlockScope scope) {
	// keep implementation in sync with BinaryExpression#resolveType
	if (combinedBinaryExpression.referencesTable == null) {
		addRealFragment(combinedBinaryExpression.left);
		this.operatorsList.add(new Integer(TerminalTokens.TokenNamePLUS));
		addRealFragment(combinedBinaryExpression.right);
		return false;
	}
	BinaryExpression cursor = combinedBinaryExpression.referencesTable[0];
	if (cursor.left instanceof CombinedBinaryExpression) {
		this.visit((CombinedBinaryExpression) cursor.left, scope);
	} else {
		addRealFragment(cursor.left);
	}
	for (int i = 0, end = combinedBinaryExpression.arity; i < end; i ++) {
		this.operatorsList.add(new Integer(TerminalTokens.TokenNamePLUS));
		addRealFragment(combinedBinaryExpression.referencesTable[i].right);
	}
	this.operatorsList.add(new Integer(TerminalTokens.TokenNamePLUS));
	addRealFragment(combinedBinaryExpression.right);
	return false;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:23,代码来源:BinaryExpressionFragmentBuilder.java

示例2: dodgeCombinedBinaryExpressions

import org.eclipse.jdt.internal.compiler.ast.CombinedBinaryExpression; //导入依赖的package包/类
private static void dodgeCombinedBinaryExpressions(EcjTreePrinter printer) {
	printer.skipProperty(CombinedBinaryExpression.class, "arity");
	printer.skipProperty(CombinedBinaryExpression.class, "arityMax");
	printer.skipProperty(CombinedBinaryExpression.class, "referencesTable");
	printer.stringReplace("CombinedBinaryExpression", "BinaryExpression");
}
 
开发者ID:evant,项目名称:android-retrolambda-lombok,代码行数:7,代码来源:EcjTreeOperations.java

示例3: buildFragments

import org.eclipse.jdt.internal.compiler.ast.CombinedBinaryExpression; //导入依赖的package包/类
private BinaryExpressionFragmentBuilder buildFragments(BinaryExpression binaryExpression, BlockScope scope) {
	BinaryExpressionFragmentBuilder builder = new BinaryExpressionFragmentBuilder();

	if (binaryExpression instanceof CombinedBinaryExpression) {
		binaryExpression.traverse(builder, scope);
		return builder;
	}
	switch((binaryExpression.bits & ASTNode.OperatorMASK) >> ASTNode.OperatorSHIFT) {
		case OperatorIds.MULTIPLY :
			binaryExpression.left.traverse(builder, scope);
			builder.operatorsList.add(new Integer(TerminalTokens.TokenNameMULTIPLY));
			binaryExpression.right.traverse(builder, scope);
			break;
		case OperatorIds.PLUS :
			binaryExpression.left.traverse(builder, scope);
			builder.operatorsList.add(new Integer(TerminalTokens.TokenNamePLUS));
			binaryExpression.right.traverse(builder, scope);
			break;
		case OperatorIds.DIVIDE :
			binaryExpression.left.traverse(builder, scope);
			builder.operatorsList.add(new Integer(TerminalTokens.TokenNameDIVIDE));
			binaryExpression.right.traverse(builder, scope);
			break;
		case OperatorIds.REMAINDER :
			binaryExpression.left.traverse(builder, scope);
			builder.operatorsList.add(new Integer(TerminalTokens.TokenNameREMAINDER));
			binaryExpression.right.traverse(builder, scope);
			break;
		case OperatorIds.XOR :
			binaryExpression.left.traverse(builder, scope);
			builder.operatorsList.add(new Integer(TerminalTokens.TokenNameXOR));
			binaryExpression.right.traverse(builder, scope);
			break;
		case OperatorIds.MINUS :
			binaryExpression.left.traverse(builder, scope);
			builder.operatorsList.add(new Integer(TerminalTokens.TokenNameMINUS));
			binaryExpression.right.traverse(builder, scope);
			break;
		case OperatorIds.OR :
			binaryExpression.left.traverse(builder, scope);
			builder.operatorsList.add(new Integer(TerminalTokens.TokenNameOR));
			binaryExpression.right.traverse(builder, scope);
			break;
		case OperatorIds.AND :
			binaryExpression.left.traverse(builder, scope);
			builder.operatorsList.add(new Integer(TerminalTokens.TokenNameAND));
			binaryExpression.right.traverse(builder, scope);
			break;
		case OperatorIds.AND_AND :
			binaryExpression.left.traverse(builder, scope);
			builder.operatorsList.add(new Integer(TerminalTokens.TokenNameAND_AND));
			binaryExpression.right.traverse(builder, scope);
			break;
		case OperatorIds.OR_OR :
			binaryExpression.left.traverse(builder, scope);
			builder.operatorsList.add(new Integer(TerminalTokens.TokenNameOR_OR));
			binaryExpression.right.traverse(builder, scope);
			break;
	}

	return builder;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:63,代码来源:CodeFormatterVisitor.java


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