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