本文整理匯總了Java中org.eclipse.jdt.core.dom.Expression.toString方法的典型用法代碼示例。如果您正苦於以下問題:Java Expression.toString方法的具體用法?Java Expression.toString怎麽用?Java Expression.toString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jdt.core.dom.Expression
的用法示例。
在下文中一共展示了Expression.toString方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: visit
import org.eclipse.jdt.core.dom.Expression; //導入方法依賴的package包/類
public boolean visit(CastExpression node) {
if (mtbStack.isEmpty()) // not part of a method
return true;
Expression expression = node.getExpression();
ITypeBinding type = node.getType().resolveBinding();
IMethodBinding mtb = mtbStack.peek();
String exprStr = expression.toString();
String typeStr = getQualifiedName(type);
String methodStr = getQualifiedName(mtb);
exprStr = edit_str(exprStr);
facts.add(Fact.makeCastFact(exprStr, typeStr, methodStr));
return true;
}
示例2: accessExpressions
import org.eclipse.jdt.core.dom.Expression; //導入方法依賴的package包/類
private Object[] accessExpressions(ArrayAccess node) {
Object[] exp = new Object[indexDepth(node)+1];
ArrayAccess a = node;
int i = exp.length-1;
do {
Expression indexExp = a.getIndex();
if(!(indexExp instanceof SimpleName)) // TODO no modifiers
return null;
exp[i] = indexExp.toString();
Expression temp = a.getArray();
a = temp instanceof ArrayAccess ? (ArrayAccess) temp : null;
i--;
}
while(i >= 0);
return exp;
}
示例3: inspectExpression
import org.eclipse.jdt.core.dom.Expression; //導入方法依賴的package包/類
/**
* Method to inspect logical expressions in source code
* @author Mariana Azevedo
* @since 13/07/2014
* @param exprs
*/
private void inspectExpression(Expression exprs) {
if ((exprs != null)) {
String expression = exprs.toString();
char[] chars = expression.toCharArray();
for (int i = 0; i < chars.length-1; i++) {
char next = chars[i];
if ((next == '&' || next == '|')&&(next == chars[i+1])) {
cyclomaticComplexityIndex++;
sumCyclomaticComplexity++;
}
}
}
}
示例4: aux
import org.eclipse.jdt.core.dom.Expression; //導入方法依賴的package包/類
private void aux(String var, InfixExpression.Operator operator, Expression exp) {
String type = (isOpen(operator) ? IArrayIndexModel.BoundType.OPEN : IArrayIndexModel.BoundType.CLOSE).name();
VariableOperation op = new VariableOperation(var, VariableOperation.Type.BOUNDED, exp.toString(), type);
current.addOperation(op);
}