if (var.length() == 0 && CsmKindUtilities.isVariable(context.getLastObject()) && ((CsmVariable)context.getLastObject()).getInitialValue() != null) { String expr = varObj.getInitialValue().getText().toString(); if(findLCurlsNumberBeforPosition(expr, pos - varObj.getInitialValue().getStartOffset()) > 1) { int pos2 = findLastAssignmentBeforPosition(expr, pos - varObj.getInitialValue().getStartOffset()); int pos3 = findLastTypeCastBeforPosition(expr, pos - varObj.getInitialValue().getStartOffset()); if(pos2 != -1 && pos3 < pos2) { CsmType type = findExactVarType(file, var, varObj.getInitialValue().getStartOffset() + pos2, refContext); if(type != null) { String varName = expr.substring(pos2); if (CsmOffsetUtilities.isInObject(varObj.getInitialValue(), pos)) { CsmType type = varObj.getType(); if (type.getArrayDepth() > 0) {
public static boolean isInInitializerList(CsmContext context, int offset) { CsmFunction f = getFunction(context, false); if (CsmKindUtilities.isConstructor(f)) { for (CsmExpression izer : ((CsmInitializerListContainer) f).getInitializerList()) { if (CsmOffsetUtilities.isInObject(izer, offset)) { return true; } } } if (CsmKindUtilities.isVariable(context.getLastObject())) { CsmVariable var = (CsmVariable) context.getLastObject(); CsmExpression initialValue = var.getInitialValue(); if (initialValue != null && CsmOffsetUtilities.isInObject(initialValue, offset)) { return true; } } return false; }
gatherMaps(((CsmVariable) element).getInitialValue(), inLocalContext, stopAtOffset, out); } else if (CsmKindUtilities.isReturnStatement(element)) { gatherMaps(((CsmReturnStatement) element).getReturnExpression(), inLocalContext, stopAtOffset, out);
CsmExpression expression = var.getInitialValue(); if (expression != null) { CsmCacheMap cache = CsmCacheManager.getClientCache(CsmContextUtilities.class, CACHE_INITIALIZER);
if ((var.getInitialValue() == null) && (var.getType() != null) && (var.getType().getArrayDepth() == 0)) { csmItem = var;
private CsmType findAutoVariableType(CsmVariable var, CsmType varType) { assert isAutoType(varType) : "var must have auto type!"; // NOI18N CsmType oldType = varType; final CsmExpression initialValue = var.getInitialValue(); if (initialValue != null) { varType = findExpressionType(initialValue);
CsmVariable d = (CsmVariable) decl; if (d.getStartOffset() <= selectionStrat && selectionEnd <= d.getEndOffset()) { CsmExpression initialValue = d.getInitialValue(); if (initialValue != null) { if (initialValue.getStartOffset() <= selectionStrat && selectionEnd <= initialValue.getEndOffset()) {
findInner(((CsmVariable)decl).getInitialValue(), offset, context);
if (findInExpression(((CsmVariable)lastObj).getInitialValue(), lastObj, offset, context, innerObj)) { lastObj = last = innerObj.value;