Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'core/org.eclipse.cdt.core')
-rw-r--r--core/org.eclipse.cdt.core/ChangeLog6
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTExpression.java6
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java2
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java14
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTNewDescriptor.java22
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java18
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTNewDescriptor.java23
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java2
8 files changed, 68 insertions, 25 deletions
diff --git a/core/org.eclipse.cdt.core/ChangeLog b/core/org.eclipse.cdt.core/ChangeLog
index 1a94a5ce93f..ba14adc554a 100644
--- a/core/org.eclipse.cdt.core/ChangeLog
+++ b/core/org.eclipse.cdt.core/ChangeLog
@@ -1,3 +1,9 @@
+2003-08-25 Hoda Amer
+ Modified the IASTFactory to take three expression lists
+ for the createNewDescriptor() instead of just one.
+ They are : newPlacementExpressions, typeIdExpressions, and
+ newInitializerExpressions.
+
2003-08-25 John Camelon
Updated Structure.java to keep JDK 1.3 compliance.
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTExpression.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTExpression.java
index 5516f7c5c92..0bb755cae86 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTExpression.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTExpression.java
@@ -10,7 +10,7 @@
***********************************************************************/
package org.eclipse.cdt.core.parser.ast;
-import java.util.List;
+import java.util.Iterator;
import org.eclipse.cdt.core.parser.Enum;
import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate;
@@ -124,7 +124,9 @@ public interface IASTExpression extends ISourceElementCallbackDelegate
public interface IASTNewExpressionDescriptor
{
- public List getExpressions();
+ public Iterator getNewPlacementExpressions();
+ public Iterator getNewTypeIdExpressions();
+ public Iterator getNewInitializerExpressions();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java
index af80f25cf34..2bdeef5edde 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java
@@ -97,7 +97,7 @@ public interface IASTFactory
IToken id,
ITokenDuple typeId,
String literal, IASTNewExpressionDescriptor newDescriptor) throws ASTSemanticException;
- public IASTExpression.IASTNewExpressionDescriptor createNewDescriptor(List expressions);
+ public IASTExpression.IASTNewExpressionDescriptor createNewDescriptor(List newPlacementExpressions,List newTypeIdExpressions,List newInitializerExpressions);
public IASTInitializerClause createInitializerClause(
IASTInitializerClause.Kind kind,
IASTExpression assignmentExpression,
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java
index e28cf1a9a10..331aae1f0d1 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java
@@ -3540,7 +3540,9 @@ public class Parser implements IParser
IToken beforeSecondParen = null;
IToken backtrackMarker = null;
ITokenDuple typeId = null;
- ArrayList expressions = new ArrayList();
+ ArrayList newPlacementExpressions = new ArrayList();
+ ArrayList newTypeIdExpressions = new ArrayList();
+ ArrayList newInitializerExpressions = new ArrayList();
if (LT(1) == IToken.tLPAREN)
{
@@ -3550,7 +3552,7 @@ public class Parser implements IParser
// Try to consume placement list
// Note: since expressionList and expression are the same...
backtrackMarker = mark();
- expressions.add(expression(scope));
+ newPlacementExpressions.add(expression(scope));
consume(IToken.tRPAREN);
placementParseFailure = false;
if (LT(1) == IToken.tLPAREN)
@@ -3634,7 +3636,7 @@ public class Parser implements IParser
return astFactory.createExpression(
scope, IASTExpression.Kind.NEW_TYPEID,
null, null, null, null, typeId, "",
- astFactory.createNewDescriptor(expressions));
+ astFactory.createNewDescriptor(newPlacementExpressions, newTypeIdExpressions, newInitializerExpressions));
}
catch (ASTSemanticException e)
{
@@ -3663,7 +3665,7 @@ public class Parser implements IParser
{
// array new
consume();
- expressions.add(assignmentExpression(scope));
+ newTypeIdExpressions.add(assignmentExpression(scope));
consume(IToken.tRBRACKET);
}
// newinitializer
@@ -3671,7 +3673,7 @@ public class Parser implements IParser
{
consume(IToken.tLPAREN);
if (LT(1) != IToken.tRPAREN)
- expressions.add(expression(scope));
+ newInitializerExpressions.add(expression(scope));
consume(IToken.tRPAREN);
}
try
@@ -3679,7 +3681,7 @@ public class Parser implements IParser
return astFactory.createExpression(
scope, IASTExpression.Kind.NEW_TYPEID,
null, null, null, null, typeId, "",
- astFactory.createNewDescriptor(expressions));
+ astFactory.createNewDescriptor(newPlacementExpressions, newTypeIdExpressions, newInitializerExpressions));
}
catch (ASTSemanticException e)
{
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTNewDescriptor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTNewDescriptor.java
index dadd1f52b30..be558de6b26 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTNewDescriptor.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTNewDescriptor.java
@@ -10,6 +10,7 @@
******************************************************************************/
package org.eclipse.cdt.internal.core.parser.ast.complete;
+import java.util.Iterator;
import java.util.List;
import org.eclipse.cdt.core.parser.ast.IASTExpression.IASTNewExpressionDescriptor;
@@ -22,19 +23,28 @@ import org.eclipse.cdt.core.parser.ast.IASTExpression.IASTNewExpressionDescripto
*/
public class ASTNewDescriptor implements IASTNewExpressionDescriptor {
- List expressions;
-
- public ASTNewDescriptor(List expressions) {
+ List newPlacementExpressions;
+ List newTypeIdExpressions;
+ List newInitializerExpressions;
+ public ASTNewDescriptor(List newPlacementExpressions, List newTypeIdExpressions, List newInitializerExpressions) {
super();
- this.expressions = expressions;
+ this.newPlacementExpressions = newPlacementExpressions;
+ this.newTypeIdExpressions = newTypeIdExpressions;
+ this.newInitializerExpressions = newInitializerExpressions;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTExpression.IASTNewExpressionDescriptor#getExpressions()
*/
- public List getExpressions() {
- return expressions;
+ public Iterator getNewPlacementExpressions() {
+ return newPlacementExpressions.iterator();
+ }
+ public Iterator getNewTypeIdExpressions() {
+ return newTypeIdExpressions.iterator();
+ }
+ public Iterator getNewInitializerExpressions() {
+ return newInitializerExpressions.iterator();
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java
index 01deaea5f04..8b13bbd2890 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java
@@ -641,12 +641,21 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
getExpressionReferences(rhs, references);
getExpressionReferences(thirdExpression,references);
+ // add newDescriptor's references & add to references
// if there is a newDescriptor, check related expressions
if(newDescriptor != null){
- Iterator i = newDescriptor.getExpressions().iterator();
+ Iterator i = newDescriptor.getNewPlacementExpressions();
while (i.hasNext()){
getExpressionReferences((IASTExpression)i.next(), references);
}
+ i = newDescriptor.getNewTypeIdExpressions();
+ while (i.hasNext()){
+ getExpressionReferences((IASTExpression)i.next(), references);
+ }
+ i = newDescriptor.getNewInitializerExpressions();
+ while (i.hasNext()){
+ getExpressionReferences((IASTExpression)i.next(), references);
+ }
}
//look up id & add to references
@@ -672,7 +681,6 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
if( typeId != null )
lookupQualifiedName( startingScope, typeId, references, false );
- //TODO add newDescriptor's references & add to references
return new ASTExpression( kind, lhs, rhs, thirdExpression,
id == null ? "" : id.getImage(),
typeId == null ? "" : typeId.toString(),
@@ -690,11 +698,9 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createNewDescriptor()
*/
- public IASTNewExpressionDescriptor createNewDescriptor(List expressions)
+ public IASTNewExpressionDescriptor createNewDescriptor(List newPlacementExpressions,List newTypeIdExpressions,List newInitializerExpressions)
{
- // TODO FIX THIS
- // return null;
- return new ASTNewDescriptor(expressions);
+ return new ASTNewDescriptor(newPlacementExpressions, newTypeIdExpressions, newInitializerExpressions);
}
/* (non-Javadoc)
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTNewDescriptor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTNewDescriptor.java
index 33a7eaafc90..bf0e63fbff0 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTNewDescriptor.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTNewDescriptor.java
@@ -10,7 +10,7 @@
***********************************************************************/
package org.eclipse.cdt.internal.core.parser.ast.quick;
-import java.util.List;
+import java.util.Iterator;
import org.eclipse.cdt.core.parser.ast.IASTExpression.IASTNewExpressionDescriptor;
@@ -19,10 +19,27 @@ import org.eclipse.cdt.core.parser.ast.IASTExpression.IASTNewExpressionDescripto
*/
public class ASTNewDescriptor implements IASTNewExpressionDescriptor {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTExpression.IASTNewExpressionDescriptor#getNewInitializerExpressions()
+ */
+ public Iterator getNewInitializerExpressions() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTExpression.IASTNewExpressionDescriptor#getNewPlacementExpressions()
+ */
+ public Iterator getNewPlacementExpressions() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
/* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTExpression.IASTNewExpressionDescriptor#getExpressions()
+ * @see org.eclipse.cdt.core.parser.ast.IASTExpression.IASTNewExpressionDescriptor#getTypeIdExpressions()
*/
- public List getExpressions() {
+ public Iterator getNewTypeIdExpressions() {
// TODO Auto-generated method stub
return null;
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java
index 8b48b6c0ce3..55faf26aa95 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java
@@ -155,7 +155,7 @@ public class QuickParseASTFactory extends BaseASTFactory implements IASTFactory
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createNewDescriptor()
*/
- public IASTNewExpressionDescriptor createNewDescriptor(List expressions) {
+ public IASTNewExpressionDescriptor createNewDescriptor(List newPlacementEpressions, List newTypeIdExpressions, List newInitializerExpressions) {
return new ASTNewDescriptor();
}

Back to the top