From 80ee3e49e725aec89fb1ca4c6f61c8f01316fdf8 Mon Sep 17 00:00:00 2001 From: John Camelon Date: Wed, 13 Aug 2003 23:54:09 +0000 Subject: [PATCH] CORE Added constructor expression support for variables. Added constructor chain x-reference support for methods. TESTS Added testBug41520() to FullParseFailedTests.java. Added testConstructorChain() to CompleteParseASTTest.java --- core/org.eclipse.cdt.core.tests/ChangeLog | 4 ++ .../failedTests/FullParseFailedTests.java | 29 +++++++- .../parser/tests/CompleteParseASTTest.java | 18 +++++ core/org.eclipse.cdt.core/parser/ChangeLog | 4 ++ .../ast/IASTConstructorMemberInitializer.java | 4 +- .../cdt/core/parser/ast/IASTFactory.java | 10 +-- .../cdt/core/parser/ast/IASTMethod.java | 4 +- .../cdt/core/parser/ast/IASTVariable.java | 1 + .../core/parser/DeclarationWrapper.java | 8 +-- .../cdt/internal/core/parser/Parser.java | 16 +++-- .../core/parser/ast/ASTInitializerClause.java | 29 -------- .../core/parser/ast/EmptyIterator.java | 44 ++++++++++++ .../ASTConstructorMemberInitializer.java | 71 +++++++++++++++++++ .../parser/ast/complete/ASTExpression.java | 7 +- .../core/parser/ast/complete/ASTField.java | 4 +- .../core/parser/ast/complete/ASTMethod.java | 32 ++++++++- .../core/parser/ast/complete/ASTVariable.java | 15 +++- .../ast/complete/CompleteParseASTFactory.java | 31 ++++---- .../ASTConstructorMemberInitializer.java | 19 +++++ .../core/parser/ast/quick/ASTField.java | 4 +- .../core/parser/ast/quick/ASTFunction.java | 1 - .../core/parser/ast/quick/ASTMethod.java | 15 +++- .../core/parser/ast/quick/ASTVariable.java | 11 ++- .../ast/quick/QuickParseASTFactory.java | 14 ++-- 24 files changed, 316 insertions(+), 79 deletions(-) create mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/EmptyIterator.java create mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTConstructorMemberInitializer.java diff --git a/core/org.eclipse.cdt.core.tests/ChangeLog b/core/org.eclipse.cdt.core.tests/ChangeLog index e0bc910b1af..78bae413f12 100644 --- a/core/org.eclipse.cdt.core.tests/ChangeLog +++ b/core/org.eclipse.cdt.core.tests/ChangeLog @@ -1,3 +1,7 @@ +2003-08-13 John Camelon + Added testBug41520() to FullParseFailedTests.java. + Added testConstructorChain() to CompleteParseASTTest.java + 2003-08-13 John Camelon Added testSimpleExpression(), testParameterExpressions() && testNestedNamespaceExpression() to CompleteParseASTTest.java. diff --git a/core/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/parser/failedTests/FullParseFailedTests.java b/core/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/parser/failedTests/FullParseFailedTests.java index e1a3b4efc7c..c56bddfe1a5 100644 --- a/core/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/parser/failedTests/FullParseFailedTests.java +++ b/core/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/parser/failedTests/FullParseFailedTests.java @@ -13,10 +13,13 @@ */ package org.eclipse.cdt.core.parser.failedTests; +import java.util.Iterator; + import junit.framework.Test; import junit.framework.TestSuite; -import org.eclipse.cdt.core.parser.tests.BaseASTTest; +import org.eclipse.cdt.core.parser.ast.IASTVariable; +import org.eclipse.cdt.core.parser.tests.CompleteParseASTTest; /** * @author aniefer @@ -24,7 +27,7 @@ import org.eclipse.cdt.core.parser.tests.BaseASTTest; * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ -public class FullParseFailedTests extends BaseASTTest { +public class FullParseFailedTests extends CompleteParseASTTest { /** * @param a @@ -37,5 +40,27 @@ public class FullParseFailedTests extends BaseASTTest { TestSuite suite = new TestSuite(FullParseFailedTests.class.getName()); return suite; } + + public void testBug41520() throws Exception + { + Iterator i = parse( "int x = 666; int y ( x );").getDeclarations(); + IASTVariable variableX = (IASTVariable)i.next(); + try + { + IASTVariable variableY = (IASTVariable)i.next(); + failedAsExpected(); + }catch( ClassCastException cce ) + { + //this is bad + } + } + + /** + * + */ + private void failedAsExpected() + { + } + } \ No newline at end of file diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java index 0e57fb8aad1..100b6d4af3e 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java @@ -929,4 +929,22 @@ public class CompleteParseASTTest extends TestCase assertFalse( i.hasNext() ); assertEquals( callback.getReferences().size(), 2 ); } + + public void testConstructorChain() throws Exception + { + Iterator i = parse( "int x = 5;\n class A \n{ public : \n int a; \n A() : a( x ) { } };").getDeclarations(); + IASTVariable variableX = (IASTVariable)i.next(); + IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); + assertFalse( i.hasNext() ); + Iterator s = getDeclarations( classA ); + IASTField fieldA = (IASTField)s.next(); + IASTMethod methodA = (IASTMethod)s.next(); + assertFalse( s.hasNext() ); + assertEquals( callback.getReferences().size(), 2 ); + IASTFieldReference reference1 = (IASTFieldReference)callback.getReferences().get(0); + IASTVariableReference reference2 = (IASTVariableReference)callback.getReferences().get(1); + assertEquals( reference1.getReferencedElement(), fieldA ); + assertEquals( reference2.getReferencedElement(), variableX ); + } + } diff --git a/core/org.eclipse.cdt.core/parser/ChangeLog b/core/org.eclipse.cdt.core/parser/ChangeLog index 3d9e688006d..818098704d0 100644 --- a/core/org.eclipse.cdt.core/parser/ChangeLog +++ b/core/org.eclipse.cdt.core/parser/ChangeLog @@ -1,3 +1,7 @@ +2003-08-13 John Camelon + Added constructor expression support for variables. + Added constructor chain x-reference support for methods. + 2003-08-13 John Camelon Added Expression x-reference support into Parser. diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTConstructorMemberInitializer.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTConstructorMemberInitializer.java index 4c09388be26..033694d66ef 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTConstructorMemberInitializer.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTConstructorMemberInitializer.java @@ -10,11 +10,13 @@ ***********************************************************************/ package org.eclipse.cdt.core.parser.ast; +import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; + /** * @author jcamelon * */ -public interface IASTConstructorMemberInitializer +public interface IASTConstructorMemberInitializer extends ISourceElementCallbackDelegate { public IASTExpression getExpressionList(); public String getName(); 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 7ce96cc20f0..400aac226b2 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 @@ -113,8 +113,8 @@ public interface IASTFactory * @return */ public IASTConstructorMemberInitializer createConstructorMemberInitializer( - ITokenDuple duple, - IASTExpression expressionList); + IASTScope scope, + ITokenDuple duple, IASTExpression expressionList) throws ASTSemanticException; public IASTSimpleTypeSpecifier createSimpleTypeSpecifier( IASTScope scope, IASTSimpleTypeSpecifier.Type kind, @@ -159,12 +159,12 @@ public interface IASTFactory boolean isVirtual, boolean isExplicit, boolean isPureVirtual, - ASTAccessVisibility visibility) throws ASTSemanticException; + ASTAccessVisibility visibility, List constructorChain) throws ASTSemanticException; public IASTVariable createVariable(IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, - IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, int startingOffset, int nameOffset ) throws ASTSemanticException; + IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, int startingOffset, int nameOffset, IASTExpression constructorExpression ) throws ASTSemanticException; - public IASTField createField( IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, int startingOffset, int nameOffset, ASTAccessVisibility visibility) throws ASTSemanticException; + public IASTField createField( IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, int startingOffset, int nameOffset, IASTExpression constructorExpression, ASTAccessVisibility visibility) throws ASTSemanticException; public IASTParameterDeclaration createParameterDeclaration( boolean isConst, boolean isVolatile, IASTTypeSpecifier getTypeSpecifier, List pointerOperators, List arrayModifiers, List parameters, ASTPointerOperator pointerOp, String parameterName, IASTInitializerClause initializerClause ); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTMethod.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTMethod.java index 6b9f11ade8d..6acc88dee8c 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTMethod.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTMethod.java @@ -10,6 +10,8 @@ ***********************************************************************/ package org.eclipse.cdt.core.parser.ast; +import java.util.Iterator; + /** * @author jcamelon @@ -27,5 +29,5 @@ public interface IASTMethod extends IASTFunction, IASTMember { public boolean isVolatile(); public boolean isPureVirtual(); - + public Iterator getConstructorChainInitializers(); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTVariable.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTVariable.java index 8e337f60587..74a59c11381 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTVariable.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTVariable.java @@ -29,4 +29,5 @@ public interface IASTVariable extends IASTDeclaration, IASTOffsetableNamedEleme public boolean isBitfield(); public IASTExpression getBitfieldExpression(); + public IASTExpression getConstructorExpression(); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/DeclarationWrapper.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/DeclarationWrapper.java index 18d7ab50a2b..1be6445f73d 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/DeclarationWrapper.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/DeclarationWrapper.java @@ -381,7 +381,7 @@ public class DeclarationWrapper implements IDeclaratorOwner name, abs, getStartingOffset(), d.getNameStartOffset() ); else - return astFactory.createVariable( scope, name, auto, d.getInitializerClause(), d.getBitFieldExpression(), abs, mutable, extern, register, staticc, getStartingOffset(), d.getNameStartOffset() ); + return astFactory.createVariable( scope, name, auto, d.getInitializerClause(), d.getBitFieldExpression(), abs, mutable, extern, register, staticc, getStartingOffset(), d.getNameStartOffset(), d.getConstructorExpression() ); } else @@ -437,7 +437,7 @@ public class DeclarationWrapper implements IDeclaratorOwner virtual, explicit, declarator.isPureVirtual(), - ((IASTClassSpecifier)scope).getCurrentVisibilityMode()); + ((IASTClassSpecifier)scope).getCurrentVisibilityMode(), declarator.getConstructorMemberInitializers()); } /** * @param declarator @@ -485,7 +485,7 @@ public class DeclarationWrapper implements IDeclaratorOwner staticc, startingOffset, declarator.getNameStartOffset(), - ((IASTClassSpecifier)scope).getCurrentVisibilityMode()); + declarator.getConstructorExpression(), ((IASTClassSpecifier)scope).getCurrentVisibilityMode()); } private List createParameterList(List currentParameters) { @@ -534,7 +534,7 @@ public class DeclarationWrapper implements IDeclaratorOwner register, staticc, getStartingOffset(), - declarator.getNameStartOffset()); + declarator.getNameStartOffset(), declarator.getConstructorExpression()); } /* (non-Javadoc) 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 088433b4f80..5427b968efc 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 @@ -972,10 +972,18 @@ public class Parser implements IParser consume(IToken.tRPAREN); - d.addConstructorMemberInitializer( - astFactory.createConstructorMemberInitializer( - duple, - expressionList)); + try + { + d.addConstructorMemberInitializer( + astFactory.createConstructorMemberInitializer( + d.getDeclarationWrapper().getScope(), + duple, expressionList)); + } + catch (ASTSemanticException e) + { + failParse(); + throw backtrack; + } if (LT(1) == IToken.tLBRACE) break; consume(IToken.tCOMMA); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTInitializerClause.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTInitializerClause.java index 171c18f0131..dd2d7f550c8 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTInitializerClause.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTInitializerClause.java @@ -44,35 +44,6 @@ public class ASTInitializerClause implements IASTInitializerClause { return kind; } - public static class EmptyIterator implements Iterator - { - - /* (non-Javadoc) - * @see java.util.Iterator#hasNext() - */ - public boolean hasNext() - { - return false; - } - - /* (non-Javadoc) - * @see java.util.Iterator#next() - */ - public Object next() - { - throw new NoSuchElementException(); - } - - /* (non-Javadoc) - * @see java.util.Iterator#remove() - */ - public void remove() - { - throw new UnsupportedOperationException(); - } - - } - /* (non-Javadoc) * @see org.eclipse.cdt.core.parser.ast.IASTInitializerClause#getInitializerList() */ diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/EmptyIterator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/EmptyIterator.java new file mode 100644 index 00000000000..7024c6e16a6 --- /dev/null +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/EmptyIterator.java @@ -0,0 +1,44 @@ +/********************************************************************** + * Copyright (c) 2002,2003 Rational Software Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v0.5 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v05.html + * + * Contributors: + * IBM Rational Software - Initial API and implementation +***********************************************************************/ +package org.eclipse.cdt.internal.core.parser.ast; + +import java.util.Iterator; +import java.util.NoSuchElementException; + + +public class EmptyIterator implements Iterator +{ + + /* (non-Javadoc) + * @see java.util.Iterator#hasNext() + */ + public boolean hasNext() + { + return false; + } + + /* (non-Javadoc) + * @see java.util.Iterator#next() + */ + public Object next() + { + throw new NoSuchElementException(); + } + + /* (non-Javadoc) + * @see java.util.Iterator#remove() + */ + public void remove() + { + throw new UnsupportedOperationException(); + } + +} \ No newline at end of file diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTConstructorMemberInitializer.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTConstructorMemberInitializer.java new file mode 100644 index 00000000000..6704ee266e9 --- /dev/null +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTConstructorMemberInitializer.java @@ -0,0 +1,71 @@ +/********************************************************************** + * Copyright (c) 2002,2003 Rational Software Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v0.5 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v05.html + * + * Contributors: + * IBM Rational Software - Initial API and implementation +***********************************************************************/ +package org.eclipse.cdt.internal.core.parser.ast.complete; + +import java.util.List; + +import org.eclipse.cdt.core.parser.ISourceElementRequestor; +import org.eclipse.cdt.core.parser.ast.IASTConstructorMemberInitializer; +import org.eclipse.cdt.core.parser.ast.IASTExpression; + +/** + * @author jcamelon + * + */ +public class ASTConstructorMemberInitializer + implements IASTConstructorMemberInitializer +{ + private final String name; + private final IASTExpression expression; + private final ASTReferenceStore store; + /** + * + */ + public ASTConstructorMemberInitializer( IASTExpression expression, String name, List references ) + { + this.expression = expression; + this.name = name; + store = new ASTReferenceStore( references ); + } + /* (non-Javadoc) + * @see org.eclipse.cdt.core.parser.ast.IASTConstructorMemberInitializer#getExpressionList() + */ + public IASTExpression getExpressionList() + { + return expression; + } + /* (non-Javadoc) + * @see org.eclipse.cdt.core.parser.ast.IASTConstructorMemberInitializer#getName() + */ + public String getName() + { + return name; + } + /* (non-Javadoc) + * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) + */ + public void acceptElement(ISourceElementRequestor requestor) + { + store.processReferences( requestor ); + } + /* (non-Javadoc) + * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) + */ + public void enterScope(ISourceElementRequestor requestor) + { + } + /* (non-Javadoc) + * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) + */ + public void exitScope(ISourceElementRequestor requestor) + { + } +} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTExpression.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTExpression.java index 3c34a8278ab..58a07eaf6d1 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTExpression.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTExpression.java @@ -120,8 +120,11 @@ public class ASTExpression implements IASTExpression */ public void acceptElement(ISourceElementRequestor requestor) { - ASTReferenceStore store = new ASTReferenceStore( references ); - store.processReferences(requestor); + if( ! references.isEmpty() ) + { + ASTReferenceStore store = new ASTReferenceStore( references ); + store.processReferences(requestor); + } } /* (non-Javadoc) * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTField.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTField.java index 4f67974eaed..c16f39bd66b 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTField.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTField.java @@ -37,9 +37,9 @@ public class ASTField extends ASTVariable implements IASTField * @param references * @param visibility */ - public ASTField(ISymbol newSymbol, IASTAbstractDeclaration abstractDeclaration, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, int startingOffset, int nameOffset, List references, ASTAccessVisibility visibility) + public ASTField(ISymbol newSymbol, IASTAbstractDeclaration abstractDeclaration, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, int startingOffset, int nameOffset, List references, IASTExpression constructorExpression, ASTAccessVisibility visibility) { - super( newSymbol, abstractDeclaration, initializerClause, bitfieldExpression, startingOffset, nameOffset, references ); + super( newSymbol, abstractDeclaration, initializerClause, bitfieldExpression, startingOffset, nameOffset, references, constructorExpression ); this.visibility = visibility; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTMethod.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTMethod.java index 27034967282..a59272445dd 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTMethod.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTMethod.java @@ -10,14 +10,17 @@ ***********************************************************************/ package org.eclipse.cdt.internal.core.parser.ast.complete; +import java.util.Iterator; import java.util.List; import org.eclipse.cdt.core.parser.ISourceElementRequestor; import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration; +import org.eclipse.cdt.core.parser.ast.IASTConstructorMemberInitializer; import org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification; import org.eclipse.cdt.core.parser.ast.IASTMethod; import org.eclipse.cdt.core.parser.ast.IASTTemplate; +import org.eclipse.cdt.internal.core.parser.ast.EmptyIterator; import org.eclipse.cdt.internal.core.parser.pst.IParameterizedSymbol; import org.eclipse.cdt.internal.core.parser.pst.TypeInfo; @@ -27,6 +30,7 @@ import org.eclipse.cdt.internal.core.parser.pst.TypeInfo; */ public class ASTMethod extends ASTFunction implements IASTMethod { + private final List constructorChain; private final boolean isConstructor; private final boolean isPureVirtual; private final ASTAccessVisibility visibility; @@ -42,7 +46,7 @@ public class ASTMethod extends ASTFunction implements IASTMethod * @param references */ public ASTMethod(IParameterizedSymbol symbol, List parameters, IASTAbstractDeclaration returnType, IASTExceptionSpecification exception, int startOffset, int nameOffset, IASTTemplate ownerTemplate, List references, - boolean isConstructor, boolean isDestructor, boolean isPureVirtual, ASTAccessVisibility visibility ) + boolean isConstructor, boolean isDestructor, boolean isPureVirtual, ASTAccessVisibility visibility, List constructorChain ) { super( symbol, @@ -57,7 +61,7 @@ public class ASTMethod extends ASTFunction implements IASTMethod this.isConstructor = isConstructor; this.isDestructor = isDestructor; this.isPureVirtual = isPureVirtual; - + this.constructorChain = constructorChain; } /* (non-Javadoc) * @see org.eclipse.cdt.core.parser.ast.IASTMethod#isVirtual() @@ -124,6 +128,20 @@ public class ASTMethod extends ASTFunction implements IASTMethod requestor.acceptMethodDeclaration(this); references.processReferences(requestor); processParameterInitializers(requestor); + processConstructorChain(requestor); + } + + protected void processConstructorChain(ISourceElementRequestor requestor) + { + if( constructorChain != null ) + { + Iterator i = getConstructorChainInitializers(); + while( i.hasNext() ) + { + IASTConstructorMemberInitializer c = (IASTConstructorMemberInitializer)i.next(); + c.acceptElement(requestor); + } + } } /* (non-Javadoc) * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) @@ -132,6 +150,7 @@ public class ASTMethod extends ASTFunction implements IASTMethod { requestor.enterMethodBody(this); references.processReferences(requestor); + processConstructorChain(requestor); } /* (non-Javadoc) * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) @@ -140,4 +159,13 @@ public class ASTMethod extends ASTFunction implements IASTMethod { requestor.exitMethodBody( this ); } + /* (non-Javadoc) + * @see org.eclipse.cdt.core.parser.ast.IASTMethod#getConstructorChainInitializers() + */ + public Iterator getConstructorChainInitializers() + { + if( constructorChain == null ) + return new EmptyIterator(); + return constructorChain.iterator(); + } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTVariable.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTVariable.java index 7db440ab3d7..7eff1004cfd 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTVariable.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTVariable.java @@ -29,7 +29,8 @@ import org.eclipse.cdt.internal.core.parser.pst.TypeInfo; */ public class ASTVariable extends ASTSymbol implements IASTVariable { - protected final ASTReferenceStore referenceDelegate; + private final IASTExpression constructorExpression; + protected final ASTReferenceStore referenceDelegate; private final ASTQualifiedNamedElement qualifiedName; private NamedOffsets offsets = new NamedOffsets(); private final IASTExpression bitfieldExpression; @@ -44,12 +45,13 @@ public class ASTVariable extends ASTSymbol implements IASTVariable * @param nameOffset * @param references */ - public ASTVariable(ISymbol newSymbol, IASTAbstractDeclaration abstractDeclaration, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, int startingOffset, int nameOffset, List references) + public ASTVariable(ISymbol newSymbol, IASTAbstractDeclaration abstractDeclaration, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, int startingOffset, int nameOffset, List references, IASTExpression constructorExpression ) { super( newSymbol ); this.abstractDeclaration = abstractDeclaration; this.initializerClause = initializerClause; this.bitfieldExpression = bitfieldExpression; + this.constructorExpression = constructorExpression; setStartingOffset( startingOffset ); setNameOffset( nameOffset ); referenceDelegate = new ASTReferenceStore( references ); @@ -162,6 +164,8 @@ public class ASTVariable extends ASTSymbol implements IASTVariable referenceDelegate.processReferences(requestor); if( initializerClause != null ) initializerClause.acceptElement(requestor); + if( constructorExpression != null ) + constructorExpression.acceptElement(requestor); } /* (non-Javadoc) * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) @@ -203,4 +207,11 @@ public class ASTVariable extends ASTSymbol implements IASTVariable { return offsets.getEndingOffset(); } + /* (non-Javadoc) + * @see org.eclipse.cdt.core.parser.ast.IASTVariable#getConstructorExpression() + */ + public IASTExpression getConstructorExpression() + { + return constructorExpression; + } } 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 95b878ab478..913152aabde 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 @@ -704,11 +704,17 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createConstructorMemberInitializer(org.eclipse.cdt.core.parser.ITokenDuple, org.eclipse.cdt.core.parser.ast.IASTExpression) */ public IASTConstructorMemberInitializer createConstructorMemberInitializer( - ITokenDuple duple, - IASTExpression expressionList) + IASTScope scope, + ITokenDuple duple, IASTExpression expressionList) throws ASTSemanticException { - // TODO Auto-generated method stub - return null; + List references = new ArrayList(); + + IContainerSymbol scopeSymbol = scopeToSymbol(scope); + if( duple != null ) + lookupQualifiedName( scopeSymbol, duple, references, false ); + + getExpressionReferences( expressionList, references ); + return new ASTConstructorMemberInitializer( expressionList, duple == null ? "" : duple.toString(), references ); } /* (non-Javadoc) * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createSimpleTypeSpecifier(org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier.Type, org.eclipse.cdt.core.parser.ITokenDuple, boolean, boolean, boolean, boolean, boolean) @@ -1000,7 +1006,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto boolean isVirtual, boolean isExplicit, boolean isPureVirtual, - ASTAccessVisibility visibility) throws ASTSemanticException + ASTAccessVisibility visibility, List constructorChain) throws ASTSemanticException { IContainerSymbol ownerScope = scopeToSymbol( scope ); IParameterizedSymbol symbol = pst.newParameterizedSymbol( name, TypeInfo.t_function ); @@ -1008,7 +1014,8 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto setMethodTypeInfoBits( symbol, isConst, isVolatile, isVirtual, isExplicit ); List references = new ArrayList(); - setParameter( symbol, returnType, false, references ); + if( returnType.getTypeSpecifier() != null ) + setParameter( symbol, returnType, false, references ); setParameters( symbol, references, parameters.iterator() ); try @@ -1020,9 +1027,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto throw new ASTSemanticException(); } - - - ASTMethod method = new ASTMethod( symbol, parameters, returnType, exception, startOffset, nameOffset, ownerTemplate, references, isConstructor, isDestructor, isPureVirtual, visibility ); + ASTMethod method = new ASTMethod( symbol, parameters, returnType, exception, startOffset, nameOffset, ownerTemplate, references, isConstructor, isDestructor, isPureVirtual, visibility, constructorChain ); try { attachSymbolExtension( symbol, method ); @@ -1066,7 +1071,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto boolean isRegister, boolean isStatic, int startingOffset, - int nameOffset) throws ASTSemanticException + int nameOffset, IASTExpression constructorExpression) throws ASTSemanticException { List references = new ArrayList(); ISymbol newSymbol = cloneSimpleTypeSymbol(name, abstractDeclaration, references); @@ -1088,7 +1093,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto // TODO Auto-generated catch block } - ASTVariable variable = new ASTVariable( newSymbol, abstractDeclaration, initializerClause, bitfieldExpression, startingOffset, nameOffset, references ); + ASTVariable variable = new ASTVariable( newSymbol, abstractDeclaration, initializerClause, bitfieldExpression, startingOffset, nameOffset, references, constructorExpression ); try { attachSymbolExtension(newSymbol, variable ); @@ -1159,7 +1164,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto boolean isStatic, int startingOffset, int nameOffset, - ASTAccessVisibility visibility) throws ASTSemanticException + IASTExpression constructorExpression, ASTAccessVisibility visibility) throws ASTSemanticException { List references = new ArrayList(); ISymbol newSymbol = cloneSimpleTypeSymbol(name, abstractDeclaration, references); @@ -1182,7 +1187,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto throw new ASTSemanticException(); } - ASTField field = new ASTField( newSymbol, abstractDeclaration, initializerClause, bitfieldExpression, startingOffset, nameOffset, references, visibility ); + ASTField field = new ASTField( newSymbol, abstractDeclaration, initializerClause, bitfieldExpression, startingOffset, nameOffset, references, constructorExpression, visibility ); try { attachSymbolExtension(newSymbol, field ); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTConstructorMemberInitializer.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTConstructorMemberInitializer.java index 0be7b265ab9..3ab19d0c67d 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTConstructorMemberInitializer.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTConstructorMemberInitializer.java @@ -10,6 +10,7 @@ ***********************************************************************/ package org.eclipse.cdt.internal.core.parser.ast.quick; +import org.eclipse.cdt.core.parser.ISourceElementRequestor; import org.eclipse.cdt.core.parser.ast.IASTConstructorMemberInitializer; import org.eclipse.cdt.core.parser.ast.IASTExpression; @@ -46,4 +47,22 @@ public class ASTConstructorMemberInitializer { return name; } + /* (non-Javadoc) + * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) + */ + public void acceptElement(ISourceElementRequestor requestor) + { + } + /* (non-Javadoc) + * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) + */ + public void enterScope(ISourceElementRequestor requestor) + { + } + /* (non-Javadoc) + * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) + */ + public void exitScope(ISourceElementRequestor requestor) + { + } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTField.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTField.java index d2a92d1d60b..144d97745c5 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTField.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTField.java @@ -38,7 +38,7 @@ public class ASTField extends ASTVariable implements IASTField * @param isRegister * @param isStatic */ - public ASTField(IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, int startingOffset, int nameOffset, ASTAccessVisibility visibility) + public ASTField(IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, int startingOffset, int nameOffset, IASTExpression constructorExpression, ASTAccessVisibility visibility) { super( scope, @@ -50,7 +50,7 @@ public class ASTField extends ASTVariable implements IASTField isMutable, isExtern, isRegister, - isStatic, startingOffset, nameOffset); + isStatic, startingOffset, nameOffset, constructorExpression ); this.visibility = visibility; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTFunction.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTFunction.java index a3572dcb774..3c43d26496e 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTFunction.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTFunction.java @@ -182,7 +182,6 @@ public class ASTFunction extends ASTDeclaration implements IASTFunction public void acceptElement(ISourceElementRequestor requestor) { requestor.acceptFunctionDeclaration(this); - } /* (non-Javadoc) * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enter(org.eclipse.cdt.core.parser.ISourceElementRequestor) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTMethod.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTMethod.java index 9c6903937f2..55a61145ba0 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTMethod.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTMethod.java @@ -9,6 +9,7 @@ * IBM Rational Software - Initial API and implementation ***********************************************************************/ package org.eclipse.cdt.internal.core.parser.ast.quick; +import java.util.Iterator; import java.util.List; import org.eclipse.cdt.core.parser.ISourceElementRequestor; @@ -20,12 +21,14 @@ import org.eclipse.cdt.core.parser.ast.IASTQualifiedNameElement; import org.eclipse.cdt.core.parser.ast.IASTScope; import org.eclipse.cdt.core.parser.ast.IASTTemplate; import org.eclipse.cdt.internal.core.parser.ast.ASTQualifiedNamedElement; +import org.eclipse.cdt.internal.core.parser.ast.EmptyIterator; /** * @author jcamelon * */ public class ASTMethod extends ASTFunction implements IASTMethod { + private final List constructorChainElements; private final boolean isConst; private final boolean isDestructor; private final boolean isConstructor; @@ -66,7 +69,7 @@ public class ASTMethod extends ASTFunction implements IASTMethod boolean isDestructor, boolean isVirtual, boolean isExplicit, - boolean isPureVirtual, ASTAccessVisibility visibility) + boolean isPureVirtual, ASTAccessVisibility visibility, List constructorChainElements ) { super( scope, @@ -88,6 +91,7 @@ public class ASTMethod extends ASTFunction implements IASTMethod this.isConst = isConst; this.isVolatile = isVolatile; this.visibility = visibility; + this.constructorChainElements = constructorChainElements; qualifiedName = new ASTQualifiedNamedElement( scope, name ); } /* (non-Javadoc) @@ -173,4 +177,13 @@ public class ASTMethod extends ASTFunction implements IASTMethod { requestor.exitMethodBody(this); } + /* (non-Javadoc) + * @see org.eclipse.cdt.core.parser.ast.IASTMethod#getConstructorChainInitializers() + */ + public Iterator getConstructorChainInitializers() + { + if( constructorChainElements == null ) + return new EmptyIterator(); + return constructorChainElements.iterator(); + } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTVariable.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTVariable.java index f549ad6d993..6a071d1bf73 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTVariable.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTVariable.java @@ -25,6 +25,7 @@ import org.eclipse.cdt.internal.core.parser.ast.NamedOffsets; */ public class ASTVariable extends ASTDeclaration implements IASTVariable { + private IASTExpression constructorExpression; private final boolean isAuto; private final IASTInitializerClause initializerClause; private final IASTExpression bitfieldExpression; @@ -40,7 +41,7 @@ public class ASTVariable extends ASTDeclaration implements IASTVariable * @param scope */ public ASTVariable(IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, - IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, int startingOffset, int nameOffset ) + IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, int startingOffset, int nameOffset, IASTExpression constructorExpression ) { super(scope); this.isAuto = isAuto; @@ -52,6 +53,7 @@ public class ASTVariable extends ASTDeclaration implements IASTVariable this.isRegister = isRegister; this.isStatic = isStatic; this.name = name; + this.constructorExpression = constructorExpression; qualifiedName = new ASTQualifiedNamedElement( scope, name ); setStartingOffset(startingOffset); setNameOffset(nameOffset); @@ -194,6 +196,13 @@ public class ASTVariable extends ASTDeclaration implements IASTVariable public void exitScope(ISourceElementRequestor requestor) { } + /* (non-Javadoc) + * @see org.eclipse.cdt.core.parser.ast.IASTVariable#getConstructorExpression() + */ + public IASTExpression getConstructorExpression() + { + return constructorExpression; + } } 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 c5f9c321fbb..c8d75fa989c 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 @@ -179,7 +179,7 @@ public class QuickParseASTFactory extends BaseASTFactory implements IASTFactory /* (non-Javadoc) * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createConstructorMemberInitializer(org.eclipse.cdt.core.parser.ITokenDuple, org.eclipse.cdt.core.parser.ast.IASTExpression) */ - public IASTConstructorMemberInitializer createConstructorMemberInitializer(ITokenDuple duple, IASTExpression expressionList ) + public IASTConstructorMemberInitializer createConstructorMemberInitializer(IASTScope scope, ITokenDuple duple, IASTExpression expressionList ) { return new ASTConstructorMemberInitializer( duple.toString(), expressionList ); } @@ -203,25 +203,25 @@ public class QuickParseASTFactory extends BaseASTFactory implements IASTFactory /* (non-Javadoc) * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createMethod(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, java.util.List, org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration, org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification, boolean, boolean, boolean, int, int, org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration, boolean, boolean, boolean, boolean, boolean, boolean, boolean, org.eclipse.cdt.core.parser.ast.ASTAccessVisibility) */ - public IASTMethod createMethod(IASTScope scope, String name, List parameters, IASTAbstractDeclaration returnType, IASTExceptionSpecification exception, boolean isInline, boolean isFriend, boolean isStatic, int startOffset, int nameOffset, IASTTemplate ownerTemplate, boolean isConst, boolean isVolatile, boolean isConstructor, boolean isDestructor, boolean isVirtual, boolean isExplicit, boolean isPureVirtual, ASTAccessVisibility visibility) + public IASTMethod createMethod(IASTScope scope, String name, List parameters, IASTAbstractDeclaration returnType, IASTExceptionSpecification exception, boolean isInline, boolean isFriend, boolean isStatic, int startOffset, int nameOffset, IASTTemplate ownerTemplate, boolean isConst, boolean isVolatile, boolean isConstructor, boolean isDestructor, boolean isVirtual, boolean isExplicit, boolean isPureVirtual, ASTAccessVisibility visibility, List constructorChain) { - return new ASTMethod(scope, name, parameters, returnType, exception, isInline, isFriend, isStatic, startOffset, nameOffset, ownerTemplate, isConst, isVolatile, isConstructor, isDestructor, isVirtual, isExplicit, isPureVirtual, visibility); + return new ASTMethod(scope, name, parameters, returnType, exception, isInline, isFriend, isStatic, startOffset, nameOffset, ownerTemplate, isConst, isVolatile, isConstructor, isDestructor, isVirtual, isExplicit, isPureVirtual, visibility, constructorChain); } /* (non-Javadoc) * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createVariable(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, boolean, org.eclipse.cdt.core.parser.ast.IASTInitializerClause, org.eclipse.cdt.core.parser.ast.IASTExpression, org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration, boolean, boolean, boolean, boolean) */ - public IASTVariable createVariable(IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, int startingOffset, int nameOffset) + public IASTVariable createVariable(IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, int startingOffset, int nameOffset, IASTExpression constructorExpression) { - return new ASTVariable(scope, name, isAuto, initializerClause, bitfieldExpression, abstractDeclaration, isMutable, isExtern, isRegister, isStatic, startingOffset, nameOffset); + return new ASTVariable(scope, name, isAuto, initializerClause, bitfieldExpression, abstractDeclaration, isMutable, isExtern, isRegister, isStatic, startingOffset, nameOffset, constructorExpression); } /* (non-Javadoc) * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createField(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, boolean, org.eclipse.cdt.core.parser.ast.IASTInitializerClause, org.eclipse.cdt.core.parser.ast.IASTExpression, org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration, boolean, boolean, boolean, boolean, org.eclipse.cdt.core.parser.ast.ASTAccessVisibility) */ - public IASTField createField(IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, int startingOffset, int nameOffset, ASTAccessVisibility visibility) + public IASTField createField(IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, int startingOffset, int nameOffset, IASTExpression constructorExpression, ASTAccessVisibility visibility) { - return new ASTField(scope, name, isAuto, initializerClause, bitfieldExpression, abstractDeclaration, isMutable, isExtern, isRegister, isStatic, startingOffset, nameOffset, visibility); + return new ASTField(scope, name, isAuto, initializerClause, bitfieldExpression, abstractDeclaration, isMutable, isExtern, isRegister, isStatic, startingOffset, nameOffset, constructorExpression, visibility); } /* (non-Javadoc)