Lines 41-46
Link Here
|
41 |
// KIND : all values known by SelectionParser are between 1025 and 1549 |
41 |
// KIND : all values known by SelectionParser are between 1025 and 1549 |
42 |
protected static final int K_BETWEEN_CASE_AND_COLON = SELECTION_PARSER + 1; // whether we are inside a block |
42 |
protected static final int K_BETWEEN_CASE_AND_COLON = SELECTION_PARSER + 1; // whether we are inside a block |
43 |
protected static final int K_INSIDE_RETURN_STATEMENT = SELECTION_PARSER + 2; // whether we are between the keyword 'return' and the end of a return statement |
43 |
protected static final int K_INSIDE_RETURN_STATEMENT = SELECTION_PARSER + 2; // whether we are between the keyword 'return' and the end of a return statement |
|
|
44 |
protected static final int K_CAST_STATEMENT = SELECTION_PARSER + 3; // whether we are between ')' and the end of a cast statement |
44 |
|
45 |
|
45 |
|
46 |
|
46 |
public ASTNode assistNodeParent; // the parent node of assist node |
47 |
public ASTNode assistNodeParent; // the parent node of assist node |
Lines 129-134
Link Here
|
129 |
this.assistNodeParent = parentNode; |
130 |
this.assistNodeParent = parentNode; |
130 |
} |
131 |
} |
131 |
break nextElement; |
132 |
break nextElement; |
|
|
133 |
case K_CAST_STATEMENT : |
134 |
Expression castType; |
135 |
if(this.expressionPtr > 0 |
136 |
&& ((castType = this.expressionStack[this.expressionPtr-1]) instanceof TypeReference |
137 |
|| castType instanceof NameReference)) { |
138 |
CastExpression cast = new CastExpression(expression, getTypeReference(castType)); |
139 |
cast.sourceStart = castType.sourceStart; |
140 |
cast.sourceEnd= expression.sourceEnd; |
141 |
parentNode = cast; |
142 |
this.assistNodeParent = parentNode; |
143 |
} |
144 |
break nextElement; |
132 |
} |
145 |
} |
133 |
} |
146 |
} |
134 |
if(parentNode != null) { |
147 |
if(parentNode != null) { |
Lines 249-254
Link Here
|
249 |
this.isOrphanCompletionNode = true; |
262 |
this.isOrphanCompletionNode = true; |
250 |
} |
263 |
} |
251 |
} |
264 |
} |
|
|
265 |
protected void consumeCastExpressionLL1() { |
266 |
popElement(K_CAST_STATEMENT); |
267 |
super.consumeCastExpressionLL1(); |
268 |
} |
269 |
protected void consumeCastExpressionWithGenericsArray() { |
270 |
popElement(K_CAST_STATEMENT); |
271 |
super.consumeCastExpressionWithGenericsArray(); |
272 |
} |
273 |
protected void consumeCastExpressionWithNameArray() { |
274 |
popElement(K_CAST_STATEMENT); |
275 |
super.consumeCastExpressionWithNameArray(); |
276 |
} |
277 |
protected void consumeCastExpressionWithPrimitiveType() { |
278 |
popElement(K_CAST_STATEMENT); |
279 |
super.consumeCastExpressionWithPrimitiveType(); |
280 |
} |
281 |
protected void consumeCastExpressionWithQualifiedGenericsArray() { |
282 |
popElement(K_CAST_STATEMENT); |
283 |
super.consumeCastExpressionWithQualifiedGenericsArray(); |
284 |
} |
252 |
protected void consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() { |
285 |
protected void consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() { |
253 |
// ClassInstanceCreationExpression ::= Primary '.' 'new' TypeArguments SimpleName '(' ArgumentListopt ')' ClassBodyopt |
286 |
// ClassInstanceCreationExpression ::= Primary '.' 'new' TypeArguments SimpleName '(' ArgumentListopt ')' ClassBodyopt |
254 |
// ClassInstanceCreationExpression ::= ClassInstanceCreationExpressionName 'new' TypeArguments SimpleName '(' ArgumentListopt ')' ClassBodyopt |
287 |
// ClassInstanceCreationExpression ::= ClassInstanceCreationExpressionName 'new' TypeArguments SimpleName '(' ArgumentListopt ')' ClassBodyopt |
Lines 562-567
Link Here
|
562 |
this.listLength++; |
595 |
this.listLength++; |
563 |
} |
596 |
} |
564 |
} |
597 |
} |
|
|
598 |
protected void consumeInsideCastExpression() { |
599 |
super.consumeInsideCastExpression(); |
600 |
pushOnElementStack(K_CAST_STATEMENT); |
601 |
} |
602 |
protected void consumeInsideCastExpressionLL1() { |
603 |
super.consumeInsideCastExpressionLL1(); |
604 |
pushOnElementStack(K_CAST_STATEMENT); |
605 |
} |
606 |
protected void consumeInsideCastExpressionWithQualifiedGenerics() { |
607 |
super.consumeInsideCastExpressionWithQualifiedGenerics(); |
608 |
pushOnElementStack(K_CAST_STATEMENT); |
609 |
} |
565 |
protected void consumeInstanceOfExpression() { |
610 |
protected void consumeInstanceOfExpression() { |
566 |
if (indexOfAssistIdentifier() < 0) { |
611 |
if (indexOfAssistIdentifier() < 0) { |
567 |
super.consumeInstanceOfExpression(); |
612 |
super.consumeInstanceOfExpression(); |