Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] Applied [HEAD] Parser fixes for ANSI C

If anyone wants this applied to 1_2 as well, just let me know on the list. 
 

CORE
        Fixed Bug 39542 : Parser fails on 'struct' parameter types 
        Fixed Bug 39549 : Designated initializers are not supported (ANSI 
C99) 
        Fixed Bug 39551 : Complex and imaginary numbers are not supported 
(ANSI C99) 

TESTS
        Moved testBug39542() from ASTFailedTests to QuickParseASTTests.
        Moved testBug39549() from ASTFailedTests to QuickParseASTTests.
        Added testCDesignatedInitializers() to CompleteParseASTTests.
        Moved testBug39551A() from ASTFailedTests to QuickParseASTTests. 
        Moved testBug39551B() from ASTFailedTests to QuickParseASTTests. 
        Added testCBool() to QuickParseASTTests. 
        Added testBug39551A(), testBug39551B() and testCBool to 
CompleteParseTests. 

JohnC


Index: parser/ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/ChangeLog,v
retrieving revision 1.152
diff -u -r1.152 ChangeLog
--- parser/ChangeLog	21 Oct 2003 23:22:40 -0000	1.152
+++ parser/ChangeLog	24 Oct 2003 17:46:20 -0000
@@ -1,3 +1,8 @@
+2003-10-22 John Camelon
+	Fixed Bug 39542 : Parser fails on 'struct' parameter types 
+	Fixed Bug 39549 : Designated initializers are not supported (ANSI C99) 
+	Fixed Bug 39551 : Complex and imaginary numbers are not supported (ANSI C99) 
+
 2003-10-21 John Camelon
 	Fixed Bug 40007 : Parser reports success when it fails
 	Fixed Bug 44305 : Scanner/preprocessor fails on conditionals using hexidecimal 
Index: parser/org/eclipse/cdt/core/parser/IQuickParseCallback.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IQuickParseCallback.java,v
retrieving revision 1.1
diff -u -r1.1 IQuickParseCallback.java
--- parser/org/eclipse/cdt/core/parser/IQuickParseCallback.java	17 Jul 2003 20:15:13 -0000	1.1
+++ parser/org/eclipse/cdt/core/parser/IQuickParseCallback.java	24 Oct 2003 17:46:20 -0000
@@ -10,6 +10,7 @@
 ***********************************************************************/
 package org.eclipse.cdt.core.parser;
 import java.util.Iterator;
+
 import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit;
 /**
  * @author jcamelon
Index: parser/org/eclipse/cdt/core/parser/ast/IASTDesignator.java
===================================================================
RCS file: parser/org/eclipse/cdt/core/parser/ast/IASTDesignator.java
diff -N parser/org/eclipse/cdt/core/parser/ast/IASTDesignator.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ parser/org/eclipse/cdt/core/parser/ast/IASTDesignator.java	24 Oct 2003 17:46:20 -0000
@@ -0,0 +1,40 @@
+/**********************************************************************
+ * 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.core.parser.ast;
+
+import org.eclipse.cdt.core.parser.Enum;
+
+/**
+ * @author jcamelon
+ *
+ */
+public interface IASTDesignator
+{
+	public static class DesignatorKind extends Enum 
+	{
+		public static final DesignatorKind FIELD = new DesignatorKind( 0 );
+		public static final DesignatorKind SUBSCRIPT = new DesignatorKind( 1 );
+        /**
+         * @param enumValue
+         */
+        protected DesignatorKind(int enumValue)
+        {
+            super(enumValue);
+            // TODO Auto-generated constructor stub
+        }
+	}
+	
+	public DesignatorKind getKind(); 
+	public IASTExpression arraySubscriptExpression();
+	public String         fieldName();
+    public int fieldOffset();
+	
+}
Index: parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java,v
retrieving revision 1.39
diff -u -r1.39 IASTFactory.java
--- parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java	21 Oct 2003 23:22:40 -0000	1.39
+++ parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java	24 Oct 2003 17:46:20 -0000
@@ -11,6 +11,7 @@
 package org.eclipse.cdt.core.parser.ast;
 import java.util.List;
 
+import org.eclipse.cdt.core.parser.IToken;
 import org.eclipse.cdt.core.parser.ITokenDuple;
 import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier.ClassNameType;
 import org.eclipse.cdt.core.parser.ast.IASTExpression.IASTNewExpressionDescriptor;
@@ -24,32 +25,32 @@
         String name,
         int startingOffset,
         int nameOffset,
-        int nameEndOffset, int endingOffset) throws Exception;
+        int nameEndOffset, int endingOffset) ;
     public IASTInclusion createInclusion(
         String name,
         String fileName,
         boolean local,
         int startingOffset,
         int nameOffset,
-        int nameEndOffset, int endingOffset) throws Exception;
+        int nameEndOffset, int endingOffset) ;
     public IASTUsingDirective createUsingDirective(
         IASTScope scope,
         ITokenDuple duple, int startingOffset, int endingOffset)
-        throws ASTSemanticException, Exception;
+        throws ASTSemanticException;
     public IASTUsingDeclaration createUsingDeclaration(
         IASTScope scope,
         boolean isTypeName,
-        ITokenDuple name, int startingOffset, int endingOffset) throws ASTSemanticException, Exception;
+        ITokenDuple name, int startingOffset, int endingOffset) throws ASTSemanticException;
     public IASTASMDefinition createASMDefinition(
         IASTScope scope,
         String assembly,
         int first,
-        int last)throws Exception;
+        int last);
     public IASTNamespaceDefinition createNamespaceDefinition(
         IASTScope scope,
         String identifier,
         int startingOffset,
-        int nameOffset, int nameEndOffset) throws ASTSemanticException, Exception;
+        int nameOffset, int nameEndOffset) throws ASTSemanticException;
         
     public IASTNamespaceAlias    createNamespaceAlias( 
     	IASTScope scope, 
@@ -57,12 +58,12 @@
     	ITokenDuple alias, 
     	int startingOffset, 
     	int nameOffset, 
-    	int nameEndOffset, int endOffset ) throws ASTSemanticException, Exception;
+    	int nameEndOffset, int endOffset ) throws ASTSemanticException;
         
-    public IASTCompilationUnit createCompilationUnit() throws Exception;
+    public IASTCompilationUnit createCompilationUnit() ;
     public IASTLinkageSpecification createLinkageSpecification(
         IASTScope scope,
-        String spec, int startingOffset) throws Exception;
+        String spec, int startingOffset) ;
     public IASTClassSpecifier createClassSpecifier(
         IASTScope scope,
         ITokenDuple name,
@@ -70,7 +71,7 @@
         ClassNameType type,
         ASTAccessVisibility access,
         int startingOffset,
-        int nameOffset, int nameEndOffset) throws ASTSemanticException, Exception;
+        int nameOffset, int nameEndOffset) throws ASTSemanticException;
     /**
      * @param astClassSpec
      * @param isVirtual
@@ -81,21 +82,21 @@
         IASTClassSpecifier astClassSpec,
         boolean isVirtual,
         ASTAccessVisibility visibility,
-        ITokenDuple parentClassName) throws ASTSemanticException, Exception;
+        ITokenDuple parentClassName) throws ASTSemanticException;
     public IASTElaboratedTypeSpecifier createElaboratedTypeSpecifier(
         IASTScope scope,
         ASTClassKind elaboratedClassKind,
         ITokenDuple typeName,
-        int startingOffset, int endOffset, boolean isForewardDecl) throws ASTSemanticException, Exception;
+        int startingOffset, int endOffset, boolean isForewardDecl) throws ASTSemanticException;
     public IASTEnumerationSpecifier createEnumerationSpecifier(
         IASTScope scope,
         String name,
-        int startingOffset, int nameOffset, int nameEndOffset) throws ASTSemanticException, Exception;
+        int startingOffset, int nameOffset, int nameEndOffset) throws ASTSemanticException;
     public void addEnumerator(
         IASTEnumerationSpecifier enumeration,
         String string,
         int startingOffset,
-        int nameOffset, int nameEndOffset, int endingOffset, IASTExpression initialValue)throws ASTSemanticException, Exception;
+        int nameOffset, int nameEndOffset, int endingOffset, IASTExpression initialValue)throws ASTSemanticException;
     public IASTExpression createExpression(
         IASTScope scope,
         IASTExpression.Kind kind,
@@ -103,17 +104,17 @@
         IASTExpression rhs,
         IASTExpression thirdExpression,
         IASTTypeId typeId,
-        ITokenDuple idExpression, String literal, IASTNewExpressionDescriptor newDescriptor) throws ASTSemanticException, Exception;
-    public IASTExpression.IASTNewExpressionDescriptor createNewDescriptor(List newPlacementExpressions,List newTypeIdExpressions,List newInitializerExpressions)throws Exception;
+        ITokenDuple idExpression, String literal, IASTNewExpressionDescriptor newDescriptor) throws ASTSemanticException;
+    public IASTExpression.IASTNewExpressionDescriptor createNewDescriptor(List newPlacementExpressions,List newTypeIdExpressions,List newInitializerExpressions);
     public IASTInitializerClause createInitializerClause(
+        IASTScope scope,
         IASTInitializerClause.Kind kind,
-        IASTExpression assignmentExpression,
-        List initializerClauses) throws Exception;
-    public IASTExceptionSpecification createExceptionSpecification(IASTScope scope, List typeIds) throws ASTSemanticException, Exception;
+        IASTExpression assignmentExpression, List initializerClauses, List designators) ;
+    public IASTExceptionSpecification createExceptionSpecification(IASTScope scope, List typeIds) throws ASTSemanticException;
     /**
      * @param exp
      */
-    public IASTArrayModifier createArrayModifier(IASTExpression exp) throws Exception;
+    public IASTArrayModifier createArrayModifier(IASTExpression exp) ;
     /**
      * @param duple
      * @param expressionList
@@ -121,7 +122,7 @@
      */
     public IASTConstructorMemberInitializer createConstructorMemberInitializer(
         IASTScope scope,
-        ITokenDuple duple, IASTExpression expressionList) throws ASTSemanticException, Exception;
+        ITokenDuple duple, IASTExpression expressionList) throws ASTSemanticException;
     public IASTSimpleTypeSpecifier createSimpleTypeSpecifier(
         IASTScope scope,
         IASTSimpleTypeSpecifier.Type kind,
@@ -129,7 +130,7 @@
         boolean isShort,
         boolean isLong,
         boolean isSigned,
-        boolean isUnsigned, boolean isTypename) throws ASTSemanticException, Exception;
+        boolean isUnsigned, boolean isTypename, boolean isComplex, boolean isImaginary) throws ASTSemanticException;
     public IASTFunction createFunction(
         IASTScope scope,
         ITokenDuple name,
@@ -147,12 +148,12 @@
 		boolean isVolatile,
 		boolean isVirtual,
 		boolean isExplicit,
-		boolean isPureVirtual, List constructorChain, boolean isDefinition, boolean hasFunctionTryBlock ) throws ASTSemanticException, Exception;
+		boolean isPureVirtual, List constructorChain, boolean isDefinition, boolean hasFunctionTryBlock ) throws ASTSemanticException;
     public IASTAbstractDeclaration createAbstractDeclaration(
         boolean isConst,
         boolean isVolatile,
         IASTTypeSpecifier typeSpecifier,
-        List pointerOperators, List arrayModifiers, List parameters, ASTPointerOperator pointerOperator)throws Exception;
+        List pointerOperators, List arrayModifiers, List parameters, ASTPointerOperator pointerOperator);
     public IASTMethod createMethod(
         IASTScope scope,
         String name,
@@ -170,28 +171,30 @@
         boolean isVolatile,
         boolean isVirtual,
         boolean isExplicit,
-        boolean isPureVirtual, ASTAccessVisibility visibility, List constructorChain, boolean isDefinition, boolean hasFunctionTryBlock) throws ASTSemanticException, Exception;
+        boolean isPureVirtual, ASTAccessVisibility visibility, List constructorChain, boolean isDefinition, boolean hasFunctionTryBlock) 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, int nameEndOffset, IASTExpression constructorExpression ) throws ASTSemanticException, Exception;
+		   IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, int startingOffset, int nameOffset, int nameEndOffset, 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, int nameEndOffset, IASTExpression constructorExpression, ASTAccessVisibility visibility) throws ASTSemanticException, Exception;
+	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, int nameEndOffset, IASTExpression constructorExpression, ASTAccessVisibility visibility) throws ASTSemanticException;
+
+	public IASTDesignator createDesignator( IASTDesignator.DesignatorKind kind, IASTExpression constantExpression, IToken fieldIdentifier );
 	
-	public IASTParameterDeclaration createParameterDeclaration( boolean isConst, boolean isVolatile, IASTTypeSpecifier getTypeSpecifier, List pointerOperators, List arrayModifiers, List parameters, ASTPointerOperator pointerOp, String parameterName, IASTInitializerClause initializerClause, int startingOffset, int nameOffset, int nameEndOffset, int endingOffset ) throws Exception;
+	public IASTParameterDeclaration createParameterDeclaration( boolean isConst, boolean isVolatile, IASTTypeSpecifier getTypeSpecifier, List pointerOperators, List arrayModifiers, List parameters, ASTPointerOperator pointerOp, String parameterName, IASTInitializerClause initializerClause, int startingOffset, int nameOffset, int nameEndOffset, int endingOffset ) ;
 	
-	public IASTTemplateDeclaration createTemplateDeclaration( IASTScope scope, List templateParameters, boolean exported, int startingOffset ) throws Exception; 
+	public IASTTemplateDeclaration createTemplateDeclaration( IASTScope scope, List templateParameters, boolean exported, int startingOffset ) ; 
 
-	public IASTTemplateParameter createTemplateParameter( IASTTemplateParameter.ParamKind kind, String identifier, String defaultValue, IASTParameterDeclaration parameter, List parms ) throws Exception; 
+	public IASTTemplateParameter createTemplateParameter( IASTTemplateParameter.ParamKind kind, String identifier, String defaultValue, IASTParameterDeclaration parameter, List parms ) ; 
 
-	public IASTTemplateInstantiation createTemplateInstantiation(IASTScope scope, int startingOffset)throws Exception; 
+	public IASTTemplateInstantiation createTemplateInstantiation(IASTScope scope, int startingOffset); 
 	
-	public IASTTemplateSpecialization createTemplateSpecialization(IASTScope scope, int startingOffset)throws Exception; 
+	public IASTTemplateSpecialization createTemplateSpecialization(IASTScope scope, int startingOffset); 
 	
-	public IASTTypedefDeclaration createTypedef( IASTScope scope, String name, IASTAbstractDeclaration mapping, int startingOffset, int nameOffset, int nameEndOffset ) throws ASTSemanticException, Exception;
+	public IASTTypedefDeclaration createTypedef( IASTScope scope, String name, IASTAbstractDeclaration mapping, int startingOffset, int nameOffset, int nameEndOffset ) throws ASTSemanticException;
 
-	public IASTAbstractTypeSpecifierDeclaration createTypeSpecDeclaration( IASTScope scope, IASTTypeSpecifier typeSpecifier, IASTTemplate template, int startingOffset, int endingOffset)throws Exception;
+	public IASTAbstractTypeSpecifierDeclaration createTypeSpecDeclaration( IASTScope scope, IASTTypeSpecifier typeSpecifier, IASTTemplate template, int startingOffset, int endingOffset);
 	
-	public boolean queryIsTypeName( IASTScope scope, ITokenDuple nameInQuestion ) throws Exception;
+	public boolean queryIsTypeName( IASTScope scope, ITokenDuple nameInQuestion ) ;
 
 	static final String DOUBLE_COLON = "::";
 	static final String TELTA = "~";
@@ -199,14 +202,14 @@
 	 * @param scope
 	 * @return
 	 */
-	public IASTCodeScope createNewCodeBlock(IASTScope scope)throws Exception;
+	public IASTCodeScope createNewCodeBlock(IASTScope scope);
 	
 	public IASTTypeId    createTypeId( IASTScope scope, IASTSimpleTypeSpecifier.Type kind, boolean isConst, boolean isVolatile, boolean isShort, 
-			boolean isLong, boolean isSigned, boolean isUnsigned, boolean isTypename, ITokenDuple name, List pointerOps, List arrayMods ) throws ASTSemanticException, Exception;
+			boolean isLong, boolean isSigned, boolean isUnsigned, boolean isTypename, ITokenDuple name, List pointerOps, List arrayMods ) throws ASTSemanticException;
     /**
      * @param astClassSpecifier
      */
-    public void signalEndOfClassSpecifier(IASTClassSpecifier astClassSpecifier) throws Exception; 
+    public void signalEndOfClassSpecifier(IASTClassSpecifier astClassSpecifier); 
 						
 
 }
Index: parser/org/eclipse/cdt/core/parser/ast/IASTInitializerClause.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTInitializerClause.java,v
retrieving revision 1.3
diff -u -r1.3 IASTInitializerClause.java
--- parser/org/eclipse/cdt/core/parser/ast/IASTInitializerClause.java	13 Aug 2003 21:51:48 -0000	1.3
+++ parser/org/eclipse/cdt/core/parser/ast/IASTInitializerClause.java	24 Oct 2003 17:46:20 -0000
@@ -22,9 +22,11 @@
 
 	public class Kind extends Enum  
 	{
-		public static final Kind ASSIGNMENT_EXPRESSION = new Kind( 1 );
+        public static final Kind ASSIGNMENT_EXPRESSION = new Kind( 1 );
 		public static final Kind INITIALIZER_LIST      = new Kind( 2 );
 		public static final Kind EMPTY                 = new Kind( 3 );
+		public static final Kind DESIGNATED_INITIALIZER_LIST = new Kind( 4 );
+		public static final Kind DESIGNATED_ASSIGNMENT_EXPRESSION = new Kind( 5 );
 
 		/**
 		 * @param enumValue
@@ -37,5 +39,9 @@
 	public Kind getKind(); 
 	public Iterator getInitializers(); 
 	public IASTExpression getAssigmentExpression(); 
+	public Iterator getDesignators(); 
+	
+	public void setOwnerVariableDeclaration( IASTVariable declaration );
+	public IASTVariable getOwnerVariableDeclaration();
 	
 }
Index: parser/org/eclipse/cdt/core/parser/ast/IASTSimpleTypeSpecifier.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTSimpleTypeSpecifier.java,v
retrieving revision 1.3
diff -u -r1.3 IASTSimpleTypeSpecifier.java
--- parser/org/eclipse/cdt/core/parser/ast/IASTSimpleTypeSpecifier.java	22 Jul 2003 22:02:20 -0000	1.3
+++ parser/org/eclipse/cdt/core/parser/ast/IASTSimpleTypeSpecifier.java	24 Oct 2003 17:46:20 -0000
@@ -20,7 +20,7 @@
 {
 	public static class Type extends Enum 
 	{
-		public static final Type UNSPECIFIED  = new Type( 1 );
+        public static final Type UNSPECIFIED  = new Type( 1 );
 		public static final Type CHAR         = new Type( 1 );
 		public static final Type WCHAR_T      = new Type( 2 );
 		public static final Type BOOL         = new Type( 3 );
@@ -30,7 +30,7 @@
 		public static final Type VOID         = new Type( 7 );
 		public static final Type CLASS_OR_TYPENAME     = new Type( 8 );
 		public static final Type TEMPLATE     = new Type( 9 );
-		
+		public static final Type _BOOL        = new Type( 10 );	
         /**
          * @param enumValue
          */
@@ -49,6 +49,8 @@
 	public boolean    isSigned(); 
 	public boolean    isUnsigned();
 	public boolean    isTypename();
+	public boolean    isComplex(); 
+	public boolean    isImaginary();
 	
 	public IASTTypeSpecifier getTypeSpecifier() throws ASTNotImplementedException;   
 }
Index: parser/org/eclipse/cdt/internal/core/parser/DeclarationWrapper.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/DeclarationWrapper.java,v
retrieving revision 1.26
diff -u -r1.26 DeclarationWrapper.java
--- parser/org/eclipse/cdt/internal/core/parser/DeclarationWrapper.java	21 Oct 2003 23:22:40 -0000	1.26
+++ parser/org/eclipse/cdt/internal/core/parser/DeclarationWrapper.java	24 Oct 2003 17:46:20 -0000
@@ -37,6 +37,7 @@
  */
 public class DeclarationWrapper implements IDeclaratorOwner
 { 
+    private boolean imaginary, complex;
     private boolean restrict;
     private int endOffset;
     private ITokenDuple name;
@@ -773,5 +774,35 @@
     {
         return restrict;
     }
+    /**
+     * @param b
+     */
+    public void setImaginary(boolean b)
+    {
+        imaginary = b;
+    }
+
+    /**
+     * @return
+     */
+    public boolean isComplex()
+    {
+        return complex;
+    }
 
+    /**
+     * @return
+     */
+    public boolean isImaginary()
+    {
+        return imaginary;
+    }
+
+    /**
+     * @param b
+     */
+    public void setComplex(boolean b)
+    {
+        complex = b;
+    }
 }
Index: parser/org/eclipse/cdt/internal/core/parser/Parser.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java,v
retrieving revision 1.121
diff -u -r1.121 Parser.java
--- parser/org/eclipse/cdt/internal/core/parser/Parser.java	21 Oct 2003 23:22:40 -0000	1.121
+++ parser/org/eclipse/cdt/internal/core/parser/Parser.java	24 Oct 2003 17:46:23 -0000
@@ -38,6 +38,7 @@
 import org.eclipse.cdt.core.parser.ast.IASTCodeScope;
 import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit;
 import org.eclipse.cdt.core.parser.ast.IASTDeclaration;
+import org.eclipse.cdt.core.parser.ast.IASTDesignator;
 import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier;
 import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier;
 import org.eclipse.cdt.core.parser.ast.IASTExpression;
@@ -72,6 +73,7 @@
  */
 public class Parser implements IParser
 {
+    private static final List EMPTY_LIST = new ArrayList();
     private static int DEFAULT_OFFSET = -1;
     // sentinel initial value for offsets 
     private int firstErrorOffset = DEFAULT_OFFSET;
@@ -943,7 +945,7 @@
                         sdw.isShort(),
                         sdw.isLong(),
                         sdw.isSigned(),
-                        sdw.isUnsigned(), sdw.isTypeNamed()));
+                        sdw.isUnsigned(), sdw.isTypeNamed(), sdw.isComplex(), sdw.isImaginary()));
             }
             catch (Exception e1)
             {
@@ -1182,7 +1184,7 @@
                         sdw.isShort(),
                         sdw.isLong(),
                         sdw.isSigned(),
-                        sdw.isUnsigned(), sdw.isTypeNamed()));
+                        sdw.isUnsigned(), sdw.isTypeNamed(), sdw.isComplex(), sdw.isImaginary()));
             }
             catch (ASTSemanticException e)
             {
@@ -1455,6 +1457,20 @@
 					sdw.setSimpleType(IASTSimpleTypeSpecifier.Type.INT);
                     sdw.setLong(true);
                     break;
+                case IToken.t__Complex :
+					consume( IToken.t__Complex );
+					if (typeNameBegin == null)
+						typeNameBegin = LA(1);
+					typeNameEnd = LA(1);
+					sdw.setComplex( true );
+					break;
+				case IToken.t__Imaginary :
+					consume( IToken.t__Imaginary );
+					if (typeNameBegin == null)
+						typeNameBegin = LA(1);
+					typeNameEnd = LA(1);
+					sdw.setImaginary( true );
+					break;                
                 case IToken.t_char :
                     if (typeNameBegin == null)
                         typeNameBegin = LA(1);
@@ -1477,13 +1493,20 @@
                     callbackSimpleDeclToken(flags);
                     sdw.setSimpleType(IASTSimpleTypeSpecifier.Type.BOOL);
                     break;
+                case IToken.t__Bool: 
+					if (typeNameBegin == null)
+						typeNameBegin = LA(1);
+					typeNameEnd = LA(1);
+					callbackSimpleDeclToken(flags);
+					sdw.setSimpleType(IASTSimpleTypeSpecifier.Type._BOOL);
+					break;                
                 case IToken.t_int :
                     if (typeNameBegin == null)
                         typeNameBegin = LA(1);
                     typeNameEnd = LA(1);
                     callbackSimpleDeclToken(flags);
                     sdw.setSimpleType(IASTSimpleTypeSpecifier.Type.INT);
-                    break;
+                    break;					
                 case IToken.t_float :
                     if (typeNameBegin == null)
                         typeNameBegin = LA(1);
@@ -1523,10 +1546,8 @@
                     break;
                 case IToken.tCOLONCOLON :
                     consume(IToken.tCOLONCOLON);
-                    // handle nested later:
                 case IToken.tIDENTIFIER :
                     // TODO - Kludgy way to handle constructors/destructors
-                    // handle nested later:
                     if (flags.haveEncounteredRawType())
                     {
                         if (typeNameBegin != null)
@@ -1564,46 +1585,28 @@
                 case IToken.t_class :
                 case IToken.t_struct :
                 case IToken.t_union :
-                    if (!parm )
+                    try
                     {
-                        try
-                        {
-                            classSpecifier(sdw);
-							flags.setEncounteredTypename(true);
-                            break;
-                        }
-                        catch (Backtrack bt)
-                        {
-                            elaboratedTypeSpecifier(sdw);
-                            flags.setEncounteredTypename(true);
-                            break;
-                        }
+                        classSpecifier(sdw);
+						flags.setEncounteredTypename(true);
+                        break;
                     }
-                    else
+                    catch (Backtrack bt)
                     {
                         elaboratedTypeSpecifier(sdw);
                         flags.setEncounteredTypename(true);
                         break;
                     }
                 case IToken.t_enum :
-                    if (!parm )
+                    try
                     {
-                        try
-                        {
-                            enumSpecifier(sdw);
-							flags.setEncounteredTypename(true);
-                            break;
-                        }
-                        catch (Backtrack bt)
-                        {
-                            // this is an elaborated class specifier
-                            elaboratedTypeSpecifier(sdw);
-                            flags.setEncounteredTypename(true);
-                            break;
-                        }
+                        enumSpecifier(sdw);
+   					    flags.setEncounteredTypename(true);
+                        break;
                     }
-                    else
+                    catch (Backtrack bt)
                     {
+                        // this is an elaborated class specifier
                         elaboratedTypeSpecifier(sdw);
                         flags.setEncounteredTypename(true);
                         break;
@@ -1883,31 +1886,119 @@
         throws Backtrack
     {
         Declarator d = declarator(sdw, sdw.getScope(), strategy );
-        // handle = initializerClause
+        if( language == ParserLanguage.CPP )
+        	optionalCPPInitializer(d);
+        else if( language == ParserLanguage.C )
+        	optionalCInitializer(d);
+        sdw.addDeclarator(d);
+        return d;
+    }
+    
+    protected void optionalCPPInitializer(Declarator d)
+        throws EndOfFile, Backtrack
+    {
+        // handle initializer
         if (LT(1) == IToken.tASSIGN)
         {
             consume(IToken.tASSIGN);
-            d.setInitializerClause(initializerClause(sdw.getScope()));
+            d.setInitializerClause(initializerClause(d.getDeclarationWrapper().getScope()));
         }
-        else if (LT(1) == IToken.tLPAREN)
+        else if (LT(1) == IToken.tLPAREN )
         {
         	IToken mark = mark(); 
             // initializer in constructor
             try
             {
-	            consume(IToken.tLPAREN); // EAT IT!
-	            IASTExpression astExpression = null;
-	            astExpression = expression(sdw.getScope());
-	            consume(IToken.tRPAREN);
-	            d.setConstructorExpression(astExpression);
+                consume(IToken.tLPAREN); // EAT IT!
+                IASTExpression astExpression = null;
+                astExpression = expression(d.getDeclarationWrapper().getScope());
+                consume(IToken.tRPAREN);
+                d.setConstructorExpression(astExpression);
             } catch( Backtrack bt )
             {
             	backup( mark ); 
             	throw bt;
             }
         }
-        sdw.addDeclarator(d);
-        return d;
+    }
+    
+    protected void optionalCInitializer( Declarator d ) throws Backtrack
+    {
+    	if( LT(1) == IToken.tASSIGN )
+    	{
+    		consume( IToken.tASSIGN );
+    		d.setInitializerClause( cInitializerClause(d.getDeclarationWrapper().getScope(), EMPTY_LIST ) );
+    	}
+    }
+    /**
+     * @param scope
+     * @return
+     */
+    protected IASTInitializerClause cInitializerClause(
+        IASTScope scope,
+        List designators)
+        throws Backtrack
+    {    	
+        if (LT(1) == IToken.tLBRACE)
+        {
+            consume(IToken.tLBRACE);
+            List initializerList = new ArrayList();
+            for (;;)
+            {
+                // required at least one initializer list
+                // get designator list
+                List newDesignators = designatorList(scope);
+                if( newDesignators.size() != 0 )
+                	consume( IToken.tASSIGN );
+                IASTInitializerClause initializer =
+                    cInitializerClause(scope, newDesignators );
+                initializerList.add(initializer);
+                // can end with just a '}'
+                if (LT(1) == IToken.tRBRACE)
+                    break;
+                // can end with ", }"
+                if (LT(1) == IToken.tCOMMA)
+                    consume(IToken.tCOMMA);
+                if (LT(1) == IToken.tRBRACE)
+                    break;
+                // otherwise, its another initializer in the list
+            }
+            // consume the closing brace
+            consume(IToken.tRBRACE);
+            return astFactory.createInitializerClause(
+                scope,
+                (
+				( designators.size() == 0 ) ? 
+					IASTInitializerClause.Kind.INITIALIZER_LIST : 
+					IASTInitializerClause.Kind.DESIGNATED_INITIALIZER_LIST ),
+                null, initializerList, designators );
+        }
+        // if we get this far, it means that we have not yet succeeded
+        // try this now instead
+        // assignmentExpression 
+        try
+        {
+            IASTExpression assignmentExpression = assignmentExpression(scope);
+            try
+            {
+                return astFactory.createInitializerClause(
+                    scope,
+                    (
+				( designators.size() == 0 ) ? 
+					IASTInitializerClause.Kind.ASSIGNMENT_EXPRESSION : 
+					IASTInitializerClause.Kind.DESIGNATED_ASSIGNMENT_EXPRESSION ),
+                    assignmentExpression, null, designators );
+            }
+            catch (Exception e)
+            {
+                throw backtrack;
+            }
+        }
+        catch (Backtrack b)
+        {
+            // do nothing
+        }
+        throw backtrack;
     }
     /**
      * 
@@ -1924,16 +2015,17 @@
                 try
                 {
                     return astFactory.createInitializerClause(
+                        scope,
                         IASTInitializerClause.Kind.EMPTY,
-                        null,
-                        null);
+                        null, null, EMPTY_LIST );
                 }
                 catch (Exception e)
                 {
                     throw backtrack;
                 }
             }
-            // otherwise it is a list of initializers
+            
+            // otherwise it is a list of initializer clauses
             List initializerClauses = new ArrayList();
             for (;;)
             {
@@ -1947,17 +2039,19 @@
             try
             {
                 return astFactory.createInitializerClause(
+                    scope,
                     IASTInitializerClause.Kind.INITIALIZER_LIST,
-                    null,
-                    initializerClauses);
+                    null, initializerClauses, EMPTY_LIST );
             }
             catch (Exception e)
             {
                 throw backtrack;
             }
         }
+        
+        // if we get this far, it means that we did not 
         // try this now instead
-        // assignmentExpression || { initializerList , } || { }
+        // assignmentExpression 
         try
         {
             IASTExpression assignmentExpression =
@@ -1966,9 +2060,9 @@
             try
             {
                 return astFactory.createInitializerClause(
+                    scope,
                     IASTInitializerClause.Kind.ASSIGNMENT_EXPRESSION,
-                    assignmentExpression,
-                    null);
+                    assignmentExpression, null, EMPTY_LIST );
             }
             catch (Exception e)
             {
@@ -1980,6 +2074,43 @@
 			// do nothing
         }
         throw backtrack;
+    }
+    
+    protected List designatorList(IASTScope scope) throws EndOfFile, Backtrack
+    {
+        List designatorList = new ArrayList();
+        // designated initializers for C
+        
+    	if( LT(1) == IToken.tDOT || LT(1) == IToken.tLBRACKET )
+    	{
+    
+    		while( LT(1) == IToken.tDOT || LT(1) == IToken.tLBRACKET )
+    		{
+    			IToken id = null; 
+    			IASTExpression constantExpression = null;
+    			IASTDesignator.DesignatorKind kind = null;
+    			
+    			if( LT(1) == IToken.tDOT )
+    			{
+    				consume( IToken.tDOT );
+    				id = identifier();
+    				kind = IASTDesignator.DesignatorKind.FIELD;
+    			}
+    			else if( LT(1) == IToken.tLBRACKET )
+    			{
+    				consume( IToken.tLBRACKET );
+    				constantExpression = expression( scope );
+    				consume( IToken.tRBRACKET );
+					kind = IASTDesignator.DesignatorKind.SUBSCRIPT; 	
+    			}
+    			
+    			IASTDesignator d = 
+    				astFactory.createDesignator( kind, constantExpression, id );
+    			designatorList.add( d );
+    				
+    		}
+    	}
+		return designatorList;
     }
     /**
      * Parse a declarator, as according to the ANSI C++ specification. 
Index: parser/org/eclipse/cdt/internal/core/parser/Scanner.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Scanner.java,v
retrieving revision 1.60
diff -u -r1.60 Scanner.java
--- parser/org/eclipse/cdt/internal/core/parser/Scanner.java	21 Oct 2003 23:22:40 -0000	1.60
+++ parser/org/eclipse/cdt/internal/core/parser/Scanner.java	24 Oct 2003 17:46:24 -0000
@@ -36,8 +36,8 @@
 import org.eclipse.cdt.core.parser.IToken;
 import org.eclipse.cdt.core.parser.ITranslationOptions;
 import org.eclipse.cdt.core.parser.ITranslationResult;
-import org.eclipse.cdt.core.parser.ParserLanguage;
 import org.eclipse.cdt.core.parser.ParserFactory;
+import org.eclipse.cdt.core.parser.ParserLanguage;
 import org.eclipse.cdt.core.parser.ParserMode;
 import org.eclipse.cdt.core.parser.ScannerException;
 import org.eclipse.cdt.core.parser.ast.ExpressionEvaluationException;
Index: parser/org/eclipse/cdt/internal/core/parser/ast/ASTDesignator.java
===================================================================
RCS file: parser/org/eclipse/cdt/internal/core/parser/ast/ASTDesignator.java
diff -N parser/org/eclipse/cdt/internal/core/parser/ast/ASTDesignator.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ parser/org/eclipse/cdt/internal/core/parser/ast/ASTDesignator.java	24 Oct 2003 17:46:24 -0000
@@ -0,0 +1,88 @@
+/**********************************************************************
+ * 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 org.eclipse.cdt.core.parser.ISourceElementRequestor;
+import org.eclipse.cdt.core.parser.ast.IASTDesignator;
+import org.eclipse.cdt.core.parser.ast.IASTExpression;
+
+/**
+ * @author jcamelon
+ *
+ */
+public class ASTDesignator implements IASTDesignator
+{
+    /**
+     * @param kind
+     * @param constantExpression
+     * @param string
+     */
+    public ASTDesignator(DesignatorKind kind, IASTExpression constantExpression, String fieldName, int fieldOffset )
+    {
+        this.fieldName = fieldName;
+        this.constantExpression = constantExpression;
+        this.kind = kind;
+        this.fieldOffset = fieldOffset;
+    }
+    
+    private int fieldOffset;
+    private final String fieldName;
+    private final IASTExpression constantExpression;
+    private final DesignatorKind kind;
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ast.IASTDesignator#getKind()
+     */
+    public DesignatorKind getKind()
+    {
+        return kind;
+    }
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ast.IASTDesignator#arraySubscriptExpression()
+     */
+    public IASTExpression arraySubscriptExpression()
+    {
+        return constantExpression;
+    }
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ast.IASTDesignator#fieldName()
+     */
+    public String fieldName()
+    {
+        return fieldName;
+    }
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor)
+     */
+    public void acceptElement(ISourceElementRequestor requestor)
+    {
+        if( constantExpression != null )
+        	constantExpression.acceptElement(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)
+    {
+    }
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ast.IASTDesignator#fieldOffset()
+     */
+    public int fieldOffset()
+    {
+        return fieldOffset;
+    }
+}
Index: parser/org/eclipse/cdt/internal/core/parser/ast/ASTInitializerClause.java
===================================================================
RCS file: parser/org/eclipse/cdt/internal/core/parser/ast/ASTInitializerClause.java
diff -N parser/org/eclipse/cdt/internal/core/parser/ast/ASTInitializerClause.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/ASTInitializerClause.java	14 Aug 2003 15:33:27 -0000	1.3
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,91 +0,0 @@
-/**********************************************************************
- * 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.List;
-
-import org.eclipse.cdt.core.parser.ISourceElementRequestor;
-import org.eclipse.cdt.core.parser.ast.IASTExpression;
-import org.eclipse.cdt.core.parser.ast.IASTInitializerClause;
-
-/**
- * @author jcamelon
- */
-public class ASTInitializerClause implements IASTInitializerClause {
-
-	private final IASTInitializerClause.Kind kind; 
-	private final IASTExpression assignmentExpression; 
-	private final List initializerClauses; 
-	/**
-	 * @param kind
-	 * @param assignmentExpression
-	 * @param initializerClauses
-	 */
-	public ASTInitializerClause(Kind kind, IASTExpression assignmentExpression, List initializerClauses) {
-		this.kind = kind; 
-		this.assignmentExpression = assignmentExpression;
-		this.initializerClauses = initializerClauses; 
-	}
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.ast.IASTInitializerClause#getKind()
-	 */
-	public Kind getKind() {
-		return kind;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.ast.IASTInitializerClause#getInitializerList()
-	 */
-	public Iterator getInitializers() {
-		if( initializerClauses == null )
-			return new EmptyIterator();
-		return initializerClauses.iterator();
-	}
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.ast.IASTInitializerClause#getAssigmentExpression()
-	 */
-	public IASTExpression getAssigmentExpression() {
-		return assignmentExpression;
-	}
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor)
-     */
-    public void acceptElement(ISourceElementRequestor requestor)
-    {
-    	Iterator i = getInitializers(); 
-    	while( i.hasNext() )
-    	{
-    		IASTInitializerClause initializerClause = (IASTInitializerClause)i.next();
-    		initializerClause.acceptElement(requestor);
-    	}
-    	if( assignmentExpression != null )
-    		assignmentExpression.acceptElement( 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)
-    {
-    }
-
-}
Index: parser/org/eclipse/cdt/internal/core/parser/ast/BaseASTFactory.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/BaseASTFactory.java,v
retrieving revision 1.11
diff -u -r1.11 BaseASTFactory.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/BaseASTFactory.java	29 Sep 2003 19:22:09 -0000	1.11
+++ parser/org/eclipse/cdt/internal/core/parser/ast/BaseASTFactory.java	24 Oct 2003 17:46:24 -0000
@@ -12,14 +12,16 @@
 
 import java.util.List;
 
+import org.eclipse.cdt.core.parser.IToken;
 import org.eclipse.cdt.core.parser.ast.ASTPointerOperator;
 import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration;
 import org.eclipse.cdt.core.parser.ast.IASTArrayModifier;
+import org.eclipse.cdt.core.parser.ast.IASTDesignator;
 import org.eclipse.cdt.core.parser.ast.IASTExpression;
 import org.eclipse.cdt.core.parser.ast.IASTInclusion;
-import org.eclipse.cdt.core.parser.ast.IASTInitializerClause;
 import org.eclipse.cdt.core.parser.ast.IASTMacro;
 import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier;
+import org.eclipse.cdt.core.parser.ast.IASTDesignator.DesignatorKind;
 
 
 /**
@@ -49,14 +51,16 @@
         return new ASTAbstractDeclaration( isConst, isVolatile, typeSpecifier, pointerOperators, arrayModifiers, parameters, pointerOperator );
     }
 
-    public IASTInitializerClause createInitializerClause(IASTInitializerClause.Kind kind, IASTExpression assignmentExpression, List initializerClauses)
+    public IASTArrayModifier createArrayModifier(IASTExpression exp)
     {
-    	return new ASTInitializerClause( kind, assignmentExpression, initializerClauses );
+        return new ASTArrayModifier( exp );
     }
 
-    public IASTArrayModifier createArrayModifier(IASTExpression exp)
+    public IASTDesignator createDesignator(DesignatorKind kind, IASTExpression constantExpression, IToken fieldIdentifier)
     {
-        return new ASTArrayModifier( exp );
+        return new ASTDesignator( kind, constantExpression, 
+        		fieldIdentifier == null ? "" : fieldIdentifier.getImage(), 
+        		fieldIdentifier == null ? -1 : fieldIdentifier.getOffset() );
     }
 
 
Index: parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTInitializerClause.java
===================================================================
RCS file: parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTInitializerClause.java
diff -N parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTInitializerClause.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTInitializerClause.java	24 Oct 2003 17:46:24 -0000
@@ -0,0 +1,130 @@
+/**********************************************************************
+ * 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.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.cdt.core.parser.ISourceElementRequestor;
+import org.eclipse.cdt.core.parser.ast.IASTExpression;
+import org.eclipse.cdt.core.parser.ast.IASTInitializerClause;
+import org.eclipse.cdt.core.parser.ast.IASTVariable;
+import org.eclipse.cdt.internal.core.parser.ast.EmptyIterator;
+
+/**
+ * @author jcamelon
+ *
+ */
+public class ASTInitializerClause implements IASTInitializerClause
+{
+	private List references = new ArrayList();
+    private IASTVariable ownerDeclaration = null;
+    private final IASTInitializerClause.Kind kind; 
+	private final IASTExpression assignmentExpression; 
+	private final List initializerClauses; 
+	private final List designators;
+	
+    /**
+     * @param kind
+     * @param assignmentExpression
+     * @param initializerClauses
+     * @param designators
+     */
+    public ASTInitializerClause(Kind kind, IASTExpression assignmentExpression, List initializerClauses, List designators)
+    {
+		this.kind = kind; 
+		this.assignmentExpression = assignmentExpression;
+		this.initializerClauses = initializerClauses; 
+		this.designators = designators;
+    }
+	/* (non-Javadoc)
+	 * @see org.eclipse.cdt.core.parser.ast.IASTInitializerClause#getKind()
+	 */
+	public Kind getKind() {
+		return kind;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.cdt.core.parser.ast.IASTInitializerClause#getInitializerList()
+	 */
+	public Iterator getInitializers() {
+		if( initializerClauses == null )
+			return new EmptyIterator();
+		return initializerClauses.iterator();
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.cdt.core.parser.ast.IASTInitializerClause#getAssigmentExpression()
+	 */
+	public IASTExpression getAssigmentExpression() {
+		return assignmentExpression;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor)
+	 */
+	public void acceptElement(ISourceElementRequestor requestor)
+	{
+		Iterator i = getInitializers(); 
+		while( i.hasNext() )
+			((IASTInitializerClause)i.next()).acceptElement(requestor);
+    	
+		if( assignmentExpression != null )
+			assignmentExpression.acceptElement( requestor );
+			
+		ASTReferenceStore store = new ASTReferenceStore( getReferences() );
+		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)
+    {
+    }
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.cdt.core.parser.ast.IASTInitializerClause#getDesignators()
+	 */
+	public Iterator getDesignators()
+	{
+		return designators.iterator();
+	}
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ast.IASTInitializerClause#setOwnerDeclaration(org.eclipse.cdt.core.parser.ast.IASTDeclaration)
+     */
+    public void setOwnerVariableDeclaration(IASTVariable declaration)
+    {
+        ownerDeclaration = declaration;
+        Iterator subInitializers = getInitializers();
+        while( subInitializers.hasNext() )
+        	((IASTInitializerClause)subInitializers.next()).setOwnerVariableDeclaration(declaration);
+    }
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ast.IASTInitializerClause#getOwnerDeclaration()
+     */
+    public IASTVariable getOwnerVariableDeclaration()
+    {
+        return ownerDeclaration;
+    }
+    
+    public List getReferences()
+    {
+    	return references;
+    }
+}
Index: parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTSimpleTypeSpecifier.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTSimpleTypeSpecifier.java,v
retrieving revision 1.1
diff -u -r1.1 ASTSimpleTypeSpecifier.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTSimpleTypeSpecifier.java	22 Jul 2003 22:02:20 -0000	1.1
+++ parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTSimpleTypeSpecifier.java	24 Oct 2003 17:46:24 -0000
@@ -63,6 +63,8 @@
 			return IASTSimpleTypeSpecifier.Type.VOID;
 		if( symbol.getType() == TypeInfo.t_wchar_t)
 			return IASTSimpleTypeSpecifier.Type.WCHAR_T;
+		if( symbol.getType() == TypeInfo.t__Bool )
+			return IASTSimpleTypeSpecifier.Type._BOOL;
 			
         return IASTSimpleTypeSpecifier.Type.UNSPECIFIED;
         
@@ -128,6 +130,22 @@
     public IASTTypeSpecifier getTypeSpecifier() throws ASTNotImplementedException
     {
         return (IASTTypeSpecifier)getSymbol().getTypeSymbol().getASTExtension().getPrimaryDeclaration();
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier#isComplex()
+     */
+    public boolean isComplex()
+    {
+		return symbol.getTypeInfo().checkBit( TypeInfo.isComplex );
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier#isImaginary()
+     */
+    public boolean isImaginary()
+    {
+		return symbol.getTypeInfo().checkBit( TypeInfo.isImaginary );		        
     }
 
 }
Index: parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java,v
retrieving revision 1.53
diff -u -r1.53 CompleteParseASTFactory.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java	21 Oct 2003 23:22:40 -0000	1.53
+++ parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java	24 Oct 2003 17:46:25 -0000
@@ -31,6 +31,7 @@
 import org.eclipse.cdt.core.parser.ast.IASTCodeScope;
 import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit;
 import org.eclipse.cdt.core.parser.ast.IASTConstructorMemberInitializer;
+import org.eclipse.cdt.core.parser.ast.IASTDesignator;
 import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier;
 import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier;
 import org.eclipse.cdt.core.parser.ast.IASTEnumerator;
@@ -90,6 +91,13 @@
      * 
      */
     
+    private final static List SUBSCRIPT;
+    static 
+    {
+    	SUBSCRIPT = new ArrayList();
+    	SUBSCRIPT.add( TypeInfo.OperatorExpression.subscript );
+    }
+
     public CompleteParseASTFactory( ParserLanguage language )
     {
         super();
@@ -1333,42 +1341,26 @@
         boolean isShort,
         boolean isLong,
         boolean isSigned,
-        boolean isUnsigned, boolean isTypename) throws ASTSemanticException
+        boolean isUnsigned, boolean isTypename, boolean isComplex, boolean isImaginary) throws ASTSemanticException
     {
     	TypeInfo.eType type = null;
     	
     	if( kind == IASTSimpleTypeSpecifier.Type.CLASS_OR_TYPENAME )
-    	{
     		type = TypeInfo.t_type;
-    	}
 	    else if( kind == IASTSimpleTypeSpecifier.Type.BOOL )
-        {
         	type = TypeInfo.t_bool;
-        }
         else if( kind == IASTSimpleTypeSpecifier.Type.CHAR )
-        {
 			type = TypeInfo.t_char;
-        }
-		else if( kind == IASTSimpleTypeSpecifier.Type.DOUBLE )
-		{
+		else if( kind == IASTSimpleTypeSpecifier.Type.DOUBLE ||kind == IASTSimpleTypeSpecifier.Type.FLOAT  ) 
 			type = TypeInfo.t_double;
-		}
-		else if( kind == IASTSimpleTypeSpecifier.Type.FLOAT )
-		{
-			type = TypeInfo.t_double;
-		}
 		else if( kind == IASTSimpleTypeSpecifier.Type.INT )
-		{
 			type = TypeInfo.t_int;
-		}
 		else if( kind == IASTSimpleTypeSpecifier.Type.VOID )
-		{
 			type = TypeInfo.t_void;
-		}
 		else if( kind == IASTSimpleTypeSpecifier.Type.WCHAR_T)
-		{
 			type = TypeInfo.t_wchar_t;
-		}
+		else if( kind == IASTSimpleTypeSpecifier.Type._BOOL )
+			type = TypeInfo.t__Bool;
 	
 		List references = new ArrayList(); 
 		ISymbol s = pst.newSymbol( "", type );
@@ -1405,10 +1397,11 @@
 			s.setTypeSymbol( typeSymbol );
 		}
 		
-		
 		s.getTypeInfo().setBit( isLong, TypeInfo.isLong );
 		s.getTypeInfo().setBit( isShort, TypeInfo.isShort);
 		s.getTypeInfo().setBit( isUnsigned, TypeInfo.isUnsigned );
+		s.getTypeInfo().setBit( isComplex, TypeInfo.isComplex );
+		s.getTypeInfo().setBit( isImaginary, TypeInfo.isImaginary );
 			
 		return new ASTSimpleTypeSpecifier( s, false, typeName.toString(), references );
 
@@ -1441,7 +1434,6 @@
 		IContainerSymbol ownerScope = scopeToSymbol( scope );		
 		
 		// check if this is a method in a body file
-		Iterator tokenizer = name.iterator();
 		if(name.length() > 1){
 			IContainerSymbol parentScope = (IContainerSymbol)
 				lookupQualifiedName( 
@@ -1898,7 +1890,6 @@
 			}
 				
 			String fieldName = oneToken;
-			String parentName = name.substring(0, name.lastIndexOf(DOUBLE_COLON));
 			
 			int numOfTokens = 1;
 			int offset = nameOffset;
@@ -1968,6 +1959,12 @@
 		}
         
         ASTVariable variable = new ASTVariable( newSymbol, abstractDeclaration, initializerClause, bitfieldExpression, startingOffset, nameOffset, nameEndOffset, references, constructorExpression, previouslyDeclared );
+        if( variable.getInitializerClause() != null )
+        {
+        	variable.getInitializerClause().setOwnerVariableDeclaration(variable);
+        	addDesignatorReferences( (ASTInitializerClause)variable.getInitializerClause() );
+        }
+        
         try
         {
             attachSymbolExtension(newSymbol, variable );
@@ -1978,6 +1975,72 @@
         }
         return variable;        
     }
+    
+    
+    /**
+     * @param clause
+     */
+    protected void addDesignatorReferences( ASTInitializerClause clause )
+    {
+        if( clause.getKind() == IASTInitializerClause.Kind.DESIGNATED_INITIALIZER_LIST || 
+        	clause.getKind() == IASTInitializerClause.Kind.DESIGNATED_ASSIGNMENT_EXPRESSION )
+        {
+			ISymbol variableSymbol = ((ASTVariable)clause.getOwnerVariableDeclaration()).getSymbol();
+			ISymbol currentSymbol = variableSymbol.getTypeSymbol();
+				
+			TypeInfo currentTypeInfo = new TypeInfo( currentSymbol.getTypeInfo() ); 
+			Iterator designators = clause.getDesignators();
+			while( designators.hasNext() )
+			{
+				IASTDesignator designator = (IASTDesignator)designators.next();
+				if( designator.getKind() == IASTDesignator.DesignatorKind.FIELD )
+				{
+					ISymbol lookup = null;
+					if( ! ( currentSymbol instanceof IContainerSymbol ) ) 
+						break;
+					
+					try
+                    {
+                        lookup = ((IContainerSymbol)currentSymbol).lookup( designator.fieldName() );
+                    }
+                    catch (ParserSymbolTableException e){
+                        break;
+                    }
+                    
+                    if( lookup == null || lookup.getContainingSymbol() != currentSymbol )  
+                        break;
+                        
+                    try
+                    {
+                        clause.getReferences().add( createReference( lookup, designator.fieldName(), designator.fieldOffset() ));
+                    }
+                    catch (ASTSemanticException e1)
+                    {
+                        // error
+                    }
+                    
+					// we have found the correct field
+					currentTypeInfo = new TypeInfo( lookup.getTypeInfo() );
+					if( lookup.getTypeInfo() == null )
+						break;
+					currentSymbol = lookup.getTypeSymbol();
+
+				}
+				else if( designator.getKind() == IASTDesignator.DesignatorKind.SUBSCRIPT )
+					currentTypeInfo.applyOperatorExpressions( SUBSCRIPT );		
+			}
+			
+        }			
+        
+        if( clause.getKind() == IASTInitializerClause.Kind.DESIGNATED_INITIALIZER_LIST || 
+        	clause.getKind() == IASTInitializerClause.Kind.INITIALIZER_LIST )
+        {	
+        	Iterator subInitializers = clause.getInitializers();
+        	while( subInitializers.hasNext() )
+        		addDesignatorReferences( (ASTInitializerClause)subInitializers.next() );
+        }
+    }
+
     protected void setVariableTypeInfoBits(
         boolean isAuto,
         IASTAbstractDeclaration abstractDeclaration,
@@ -2016,8 +2079,10 @@
 		}
 		else if( abstractDeclaration.getTypeSpecifier() instanceof ASTElaboratedTypeSpecifier ) 
 		{
+			ASTElaboratedTypeSpecifier elab = ((ASTElaboratedTypeSpecifier)abstractDeclaration.getTypeSpecifier());
 			symbolToBeCloned = pst.newSymbol(name, TypeInfo.t_type);
-			symbolToBeCloned.setTypeSymbol(((ASTElaboratedTypeSpecifier)abstractDeclaration.getTypeSpecifier()).getSymbol());
+			symbolToBeCloned.setTypeSymbol(elab.getSymbol());
+			references.add( createReference( elab.getSymbol(), elab.getName(), elab.getNameOffset()) );
 		}
 		newSymbol = (ISymbol) symbolToBeCloned.clone(); 
 		newSymbol.setName( name );
@@ -2463,5 +2528,10 @@
         {
         	// do nothing, this is best effort
         }
+    }
+
+    public IASTInitializerClause createInitializerClause(IASTScope scope, IASTInitializerClause.Kind kind, IASTExpression assignmentExpression, List initializerClauses, List designators)
+    {
+    	return new ASTInitializerClause( kind, assignmentExpression, initializerClauses, designators );
     }
 }
Index: parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTInitializerClause.java
===================================================================
RCS file: parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTInitializerClause.java
diff -N parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTInitializerClause.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTInitializerClause.java	24 Oct 2003 17:46:25 -0000
@@ -0,0 +1,112 @@
+/**********************************************************************
+ * 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.quick;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.cdt.core.parser.ISourceElementRequestor;
+import org.eclipse.cdt.core.parser.ast.IASTExpression;
+import org.eclipse.cdt.core.parser.ast.IASTInitializerClause;
+import org.eclipse.cdt.core.parser.ast.IASTVariable;
+import org.eclipse.cdt.internal.core.parser.ast.EmptyIterator;
+
+/**
+ * @author jcamelon
+ */
+public class ASTInitializerClause implements IASTInitializerClause {
+
+	private final IASTInitializerClause.Kind kind; 
+	private final IASTExpression assignmentExpression; 
+	private final List initializerClauses; 
+	private final List designators;
+	private IASTVariable ownerDeclaration = null;
+	/**
+	 * @param kind
+	 * @param assignmentExpression
+	 * @param initializerClauses
+	 */
+	public ASTInitializerClause(Kind kind, IASTExpression assignmentExpression, List initializerClauses, List designators ) {
+		this.kind = kind; 
+		this.assignmentExpression = assignmentExpression;
+		this.initializerClauses = initializerClauses; 
+		this.designators = designators; 
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.cdt.core.parser.ast.IASTInitializerClause#getKind()
+	 */
+	public Kind getKind() {
+		return kind;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.cdt.core.parser.ast.IASTInitializerClause#getInitializerList()
+	 */
+	public Iterator getInitializers() {
+		if( initializerClauses == null )
+			return new EmptyIterator();
+		return initializerClauses.iterator();
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.cdt.core.parser.ast.IASTInitializerClause#getAssigmentExpression()
+	 */
+	public IASTExpression getAssigmentExpression() {
+		return assignmentExpression;
+	}
+
+    /* (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)
+    {
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ast.IASTInitializerClause#getDesignators()
+     */
+    public Iterator getDesignators()
+    {
+        return designators.iterator();
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ast.IASTInitializerClause#setOwnerDeclaration(org.eclipse.cdt.core.parser.ast.IASTDeclaration)
+     */
+    public void setOwnerVariableDeclaration(IASTVariable declaration)
+    {
+        ownerDeclaration = declaration;
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ast.IASTInitializerClause#getOwnerDeclaration()
+     */
+    public IASTVariable getOwnerVariableDeclaration()
+    {
+        return ownerDeclaration;
+    }
+
+}
Index: parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTNamespaceDefinition.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTNamespaceDefinition.java,v
retrieving revision 1.7
diff -u -r1.7 ASTNamespaceDefinition.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTNamespaceDefinition.java	29 Sep 2003 19:22:08 -0000	1.7
+++ parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTNamespaceDefinition.java	24 Oct 2003 17:46:25 -0000
@@ -18,7 +18,7 @@
 import org.eclipse.cdt.core.parser.ast.IASTDeclaration;
 import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition;
 import org.eclipse.cdt.core.parser.ast.IASTScope;
-import org.eclipse.cdt.internal.core.parser.ast.*;
+import org.eclipse.cdt.internal.core.parser.ast.ASTQualifiedNamedElement;
 import org.eclipse.cdt.internal.core.parser.ast.NamedOffsets;
 
 /**
Index: parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTScopedTypeSpecifier.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTScopedTypeSpecifier.java,v
retrieving revision 1.2
diff -u -r1.2 ASTScopedTypeSpecifier.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTScopedTypeSpecifier.java	21 Jul 2003 17:29:54 -0000	1.2
+++ parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTScopedTypeSpecifier.java	24 Oct 2003 17:46:25 -0000
@@ -12,7 +12,7 @@
 
 import org.eclipse.cdt.core.parser.ast.IASTScope;
 import org.eclipse.cdt.core.parser.ast.IASTScopedTypeSpecifier;
-import org.eclipse.cdt.internal.core.parser.ast.*;
+import org.eclipse.cdt.internal.core.parser.ast.ASTQualifiedNamedElement;
 
 /**
  * @author jcamelon
Index: parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTSimpleTypeSpecifier.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTSimpleTypeSpecifier.java,v
retrieving revision 1.4
diff -u -r1.4 ASTSimpleTypeSpecifier.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTSimpleTypeSpecifier.java	22 Jul 2003 22:02:20 -0000	1.4
+++ parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTSimpleTypeSpecifier.java	24 Oct 2003 17:46:25 -0000
@@ -24,7 +24,9 @@
  */
 public class ASTSimpleTypeSpecifier implements IASTSimpleTypeSpecifier
 {
-	private final boolean isTypename;
+	private final boolean imaginary;
+    private final boolean complex;
+    private final boolean isTypename;
     private final Type kind;
 	private final String typeName;  
 	private final boolean isLong, isShort, isSigned, isUnsigned; 
@@ -40,12 +42,13 @@
 		nameMap.put( Type.INT, "int");
 		nameMap.put( Type.VOID, "void" );
 		nameMap.put( Type.WCHAR_T, "wchar_t" );
+		nameMap.put( Type._BOOL, "_Bool");
 	}
     /**
      * @param kind
      * @param typeName
      */
-    public ASTSimpleTypeSpecifier(Type kind, ITokenDuple typeName, boolean isShort, boolean isLong, boolean isSigned, boolean isUnsigned, boolean isTypename)
+    public ASTSimpleTypeSpecifier(Type kind, ITokenDuple typeName, boolean isShort, boolean isLong, boolean isSigned, boolean isUnsigned, boolean isTypename, boolean isComplex, boolean isImaginary )
     {
         this.kind = kind;
         this.isLong = isLong;
@@ -53,7 +56,8 @@
         this.isSigned = isSigned;
         this.isUnsigned = isUnsigned;
         this.isTypename = isTypename;       
-		
+		this.complex = isComplex;
+		this.imaginary = isImaginary;	
 		
 		StringBuffer type = new StringBuffer();
 		if( this.kind == IASTSimpleTypeSpecifier.Type.CHAR || this.kind == IASTSimpleTypeSpecifier.Type.WCHAR_T )
@@ -62,7 +66,7 @@
 				type.append("unsigned ");
 			type.append( (String)nameMap.get( this.kind ));
 		}
-		else if( this.kind == Type.BOOL || this.kind == Type.FLOAT || this.kind == Type.VOID )
+		else if( this.kind == Type.BOOL || this.kind == Type.VOID || this.kind == Type._BOOL )
 		{
 			type.append( (String) nameMap.get( this.kind ));
 		}
@@ -76,11 +80,23 @@
 				type.append("long ");
 			type.append( (String)nameMap.get( this.kind ));
 		}
+		else if( this.kind == Type.FLOAT )
+		{
+			type.append( (String)nameMap.get( this.kind ));
+			if( isComplex() )
+				type.append( "_Complex" );
+			else if( isImaginary() )
+				type.append( "_Imaginary" );
+		}
 		else if( this.kind == Type.DOUBLE )
 		{
 			if (isLong())
 				type.append("long ");
 			type.append( (String)nameMap.get( this.kind ));
+			if( isComplex() )
+				type.append( "_Complex" );
+			else if( isImaginary() )
+				type.append( "_Imaginary" );
 		}
 		else if( this.kind == Type.CLASS_OR_TYPENAME || this.kind == Type.TEMPLATE )
 		{
@@ -159,5 +175,21 @@
     public IASTTypeSpecifier getTypeSpecifier() throws ASTNotImplementedException
     {
     	throw new ASTNotImplementedException(); 
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier#isComplex()
+     */
+    public boolean isComplex()
+    {
+        return complex;
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier#isImaginary()
+     */
+    public boolean isImaginary()
+    {
+        return imaginary;
     }
 }
Index: parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTTypedefDeclaration.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTTypedefDeclaration.java,v
retrieving revision 1.4
diff -u -r1.4 ASTTypedefDeclaration.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTTypedefDeclaration.java	29 Sep 2003 19:22:08 -0000	1.4
+++ parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTTypedefDeclaration.java	24 Oct 2003 17:46:25 -0000
@@ -14,7 +14,7 @@
 import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration;
 import org.eclipse.cdt.core.parser.ast.IASTScope;
 import org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration;
-import org.eclipse.cdt.internal.core.parser.ast.*;
+import org.eclipse.cdt.internal.core.parser.ast.ASTQualifiedNamedElement;
 import org.eclipse.cdt.internal.core.parser.ast.NamedOffsets;
 
 /**
Index: parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTVariable.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTVariable.java,v
retrieving revision 1.9
diff -u -r1.9 ASTVariable.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTVariable.java	29 Sep 2003 19:22:08 -0000	1.9
+++ parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTVariable.java	24 Oct 2003 17:46:25 -0000
@@ -16,7 +16,7 @@
 import org.eclipse.cdt.core.parser.ast.IASTInitializerClause;
 import org.eclipse.cdt.core.parser.ast.IASTScope;
 import org.eclipse.cdt.core.parser.ast.IASTVariable;
-import org.eclipse.cdt.internal.core.parser.ast.*;
+import org.eclipse.cdt.internal.core.parser.ast.ASTQualifiedNamedElement;
 import org.eclipse.cdt.internal.core.parser.ast.NamedOffsets;
 
 /**
@@ -58,6 +58,8 @@
 		setStartingOffset(startingOffset);
 		setNameOffset(nameOffset);
 		setNameEndOffset( nameEndOffset );
+		if( initializerClause != null )
+			initializerClause.setOwnerVariableDeclaration(this);
     }
     /* (non-Javadoc)
      * @see org.eclipse.cdt.core.parser.ast.IASTVariable#isAuto()
Index: parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java,v
retrieving revision 1.40
diff -u -r1.40 QuickParseASTFactory.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java	21 Oct 2003 23:22:40 -0000	1.40
+++ parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java	24 Oct 2003 17:46:26 -0000
@@ -176,9 +176,9 @@
     /* (non-Javadoc)
      * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createSimpleTypeSpecifier(org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier.SimpleType, org.eclipse.cdt.core.parser.ITokenDuple)
      */
-    public IASTSimpleTypeSpecifier createSimpleTypeSpecifier(IASTScope scope, Type kind, ITokenDuple typeName, boolean isShort, boolean isLong, boolean isSigned, boolean isUnsigned, boolean isTypename )
+    public IASTSimpleTypeSpecifier createSimpleTypeSpecifier(IASTScope scope, Type kind, ITokenDuple typeName, boolean isShort, boolean isLong, boolean isSigned, boolean isUnsigned, boolean isTypename, boolean isComplex, boolean isImaginary )
     {
-        return new ASTSimpleTypeSpecifier( kind, typeName, isShort, isLong, isSigned, isUnsigned, isTypename );
+        return new ASTSimpleTypeSpecifier( kind, typeName, isShort, isLong, isSigned, isUnsigned, isTypename, isComplex, isImaginary);
     }
 
     /* (non-Javadoc)
@@ -210,7 +210,8 @@
      */
     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, int nameEndOffset, IASTExpression constructorExpression, ASTAccessVisibility visibility)
     {
-        return new ASTField(scope, name, isAuto, initializerClause, bitfieldExpression, abstractDeclaration, isMutable, isExtern, isRegister, isStatic, startingOffset, nameOffset, nameEndOffset, constructorExpression, visibility);
+        final ASTField field = new ASTField(scope, name, isAuto, initializerClause, bitfieldExpression, abstractDeclaration, isMutable, isExtern, isRegister, isStatic, startingOffset, nameOffset, nameEndOffset, constructorExpression, visibility);
+        return field;
     }
 
     /* (non-Javadoc)
@@ -309,4 +310,10 @@
     public void signalEndOfClassSpecifier(IASTClassSpecifier astClassSpecifier)
     {
     }
+
+    public IASTInitializerClause createInitializerClause(IASTScope scope, IASTInitializerClause.Kind kind, IASTExpression assignmentExpression, List initializerClauses, List designators)
+    {
+    	return new ASTInitializerClause( kind, assignmentExpression, initializerClauses, designators );
+    }
+
 }
Index: parser/org/eclipse/cdt/internal/core/parser/pst/ForewardDeclaredSymbolExtension.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ForewardDeclaredSymbolExtension.java,v
retrieving revision 1.3
diff -u -r1.3 ForewardDeclaredSymbolExtension.java
--- parser/org/eclipse/cdt/internal/core/parser/pst/ForewardDeclaredSymbolExtension.java	24 Jul 2003 13:47:18 -0000	1.3
+++ parser/org/eclipse/cdt/internal/core/parser/pst/ForewardDeclaredSymbolExtension.java	24 Oct 2003 17:46:26 -0000
@@ -14,6 +14,7 @@
 import java.util.NoSuchElementException;
 
 import org.eclipse.cdt.internal.core.parser.ast.complete.ASTSymbol;
+import org.eclipse.cdt.internal.core.parser.pst.ISymbolASTExtension.ExtensionException;
 
 /**
  * @author jcamelon
Index: parser/org/eclipse/cdt/internal/core/parser/pst/ISymbol.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ISymbol.java,v
retrieving revision 1.7
diff -u -r1.7 ISymbol.java
--- parser/org/eclipse/cdt/internal/core/parser/pst/ISymbol.java	19 Sep 2003 16:00:53 -0000	1.7
+++ parser/org/eclipse/cdt/internal/core/parser/pst/ISymbol.java	24 Oct 2003 17:46:26 -0000
@@ -10,8 +10,8 @@
 ***********************************************************************/
 package org.eclipse.cdt.internal.core.parser.pst;
 
-import java.util.Map;
 import java.util.List;
+import java.util.Map;
 
 import org.eclipse.cdt.internal.core.parser.pst.ParserSymbolTable.TemplateInstance;
 /**
Index: parser/org/eclipse/cdt/internal/core/parser/pst/NamespaceSymbolExtension.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/NamespaceSymbolExtension.java,v
retrieving revision 1.3
diff -u -r1.3 NamespaceSymbolExtension.java
--- parser/org/eclipse/cdt/internal/core/parser/pst/NamespaceSymbolExtension.java	24 Jul 2003 13:47:18 -0000	1.3
+++ parser/org/eclipse/cdt/internal/core/parser/pst/NamespaceSymbolExtension.java	24 Oct 2003 17:46:26 -0000
@@ -16,6 +16,7 @@
 import java.util.NoSuchElementException;
 
 import org.eclipse.cdt.internal.core.parser.ast.complete.ASTSymbol;
+import org.eclipse.cdt.internal.core.parser.pst.ISymbolASTExtension.ExtensionException;
 
 /**
  * @author jcamelon
Index: parser/org/eclipse/cdt/internal/core/parser/pst/StandardSymbolExtension.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/StandardSymbolExtension.java,v
retrieving revision 1.3
diff -u -r1.3 StandardSymbolExtension.java
--- parser/org/eclipse/cdt/internal/core/parser/pst/StandardSymbolExtension.java	24 Jul 2003 13:47:18 -0000	1.3
+++ parser/org/eclipse/cdt/internal/core/parser/pst/StandardSymbolExtension.java	24 Oct 2003 17:46:26 -0000
@@ -14,6 +14,7 @@
 import java.util.NoSuchElementException;
 
 import org.eclipse.cdt.internal.core.parser.ast.complete.ASTSymbol;
+import org.eclipse.cdt.internal.core.parser.pst.ISymbolASTExtension.ExtensionException;
 
 
 /**
Index: parser/org/eclipse/cdt/internal/core/parser/pst/TypeInfo.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/TypeInfo.java,v
retrieving revision 1.5
diff -u -r1.5 TypeInfo.java
--- parser/org/eclipse/cdt/internal/core/parser/pst/TypeInfo.java	19 Sep 2003 16:00:53 -0000	1.5
+++ parser/org/eclipse/cdt/internal/core/parser/pst/TypeInfo.java	24 Oct 2003 17:46:26 -0000
@@ -70,7 +70,7 @@
 		_hasDefaultValue = info._hasDefaultValue;
 	}
 
-	public static final int typeMask   = 0x001f;
+    public static final int typeMask   = 0x001f;
 	public static final int isAuto     = 0x0020;
 	public static final int isRegister = 0x0040;
 	public static final int isStatic   = 0x0080;
@@ -87,6 +87,8 @@
 	public static final int isShort    = 0x40000;
 	public static final int isLong     = 0x80000;
 	public static final int isForward  = 0x100000;
+	public static final int isComplex  = 0x200000;
+	public static final int isImaginary= 0x400000;
 	
 	// Types (maximum type is typeMask
 	// Note that these should be considered ordered and if you change
@@ -113,6 +115,7 @@
 	public static final TypeInfo.eType t_template    = new TypeInfo.eType( 18 );
 	public static final TypeInfo.eType t_asm         = new TypeInfo.eType( 19 );
 	public static final TypeInfo.eType t_linkage     = new TypeInfo.eType( 20 );
+	public static final TypeInfo.eType t__Bool       = new TypeInfo.eType( 21 ); 
 	//public static final eType t_templateParameter = new eType( 18 );
 	
 	public static class eType implements Comparable{
Index: parser/org/eclipse/cdt/internal/core/parser/util/ASTUtil.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/util/ASTUtil.java,v
retrieving revision 1.1
diff -u -r1.1 ASTUtil.java
--- parser/org/eclipse/cdt/internal/core/parser/util/ASTUtil.java	23 Sep 2003 13:54:21 -0000	1.1
+++ parser/org/eclipse/cdt/internal/core/parser/util/ASTUtil.java	24 Oct 2003 17:46:26 -0000
@@ -24,7 +24,6 @@
 import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration;
 import org.eclipse.cdt.core.parser.ast.IASTTemplateParameter;
 import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier;
-import org.eclipse.cdt.internal.core.parser.ast.ASTArrayModifier;
 
 /**
  * This is a utility class to help convert AST elements to Strings.
@@ -172,7 +171,7 @@
 		StringBuffer arrayString = new StringBuffer();
 		Iterator i  = declaration.getArrayModifiers(); 
 		while (i.hasNext()){
-			ASTArrayModifier q = (ASTArrayModifier) i.next();
+			i.next();
 			arrayString.append("[]");				
 		}
 		return arrayString.toString();
Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/ChangeLog,v
retrieving revision 1.134
diff -u -r1.134 ChangeLog
--- ChangeLog	22 Oct 2003 17:46:50 -0000	1.134
+++ ChangeLog	24 Oct 2003 17:46:53 -0000
@@ -1,3 +1,12 @@
+2003-10-24 John Camelon
+	Moved testBug39542() from ASTFailedTests to QuickParseASTTests.
+	Moved testBug39549() from ASTFailedTests to QuickParseASTTests.
+	Added testCDesignatedInitializers() to CompleteParseASTTests.
+	Moved testBug39551A() from ASTFailedTests to QuickParseASTTests. 
+	Moved testBug39551B() from ASTFailedTests to QuickParseASTTests. 
+	Added testCBool() to QuickParseASTTests.  
+	Added testBug39551A(), testBug39551B() and testCBool to CompleteParseTests.  
+
 2003-10-22 Hoda Amer
 	Added offset checking in CModelElementsTest
 	
Index: failures/org/eclipse/cdt/core/parser/failedTests/ASTFailedTests.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/parser/failedTests/ASTFailedTests.java,v
retrieving revision 1.17
diff -u -r1.17 ASTFailedTests.java
--- failures/org/eclipse/cdt/core/parser/failedTests/ASTFailedTests.java	21 Oct 2003 23:22:31 -0000	1.17
+++ failures/org/eclipse/cdt/core/parser/failedTests/ASTFailedTests.java	24 Oct 2003 17:46:53 -0000
@@ -35,30 +35,6 @@
     {
         assertCodeFailsParse("FUNCTION_MACRO( 1, a )\n	int i;");
     }
-
-
-    public void testBug39542() throws Exception
-    {
-        assertCodeFailsParse("void f(int a, struct {int b[a];} c) {}");
-    }
-
-    //Here starts C99-specific section
-    public void testBug39549() throws Exception
-    {
-        assertCodeFailsParse("struct X x = { .b = 40, .z = {} };");
-    }
-
-    public void testBug39551A() throws Exception
-    {
-        IASTFunction function = (IASTFunction)parse("extern float _Complex conjf (float _Complex);").getDeclarations().next();
-        assertEquals( function.getName(), "conjf");
-    }
-
-    public void testBug39551B() throws Exception
-    {
-        IASTVariable variable = (IASTVariable)parse("_Imaginary double id = 99.99 * __I__;").getDeclarations().next();
-        assertEquals( variable.getName(), "id");
-    }
     
     public void testBug39554() throws Exception
     {
Index: parser/org/eclipse/cdt/core/parser/tests/BaseASTTest.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/BaseASTTest.java,v
retrieving revision 1.10
diff -u -r1.10 BaseASTTest.java
--- parser/org/eclipse/cdt/core/parser/tests/BaseASTTest.java	21 Oct 2003 23:22:31 -0000	1.10
+++ parser/org/eclipse/cdt/core/parser/tests/BaseASTTest.java	24 Oct 2003 17:46:53 -0000
@@ -73,10 +73,15 @@
 	
 	protected IASTDeclaration assertSoleDeclaration( String code ) throws ParserException
 	{
+		return assertSoleDeclaration( code, ParserLanguage.CPP );
+	}	
+	
+	protected IASTDeclaration assertSoleDeclaration( String code, ParserLanguage language ) throws ParserException
+	{
 		Iterator declarationIter = null;
         try
         {
-            declarationIter = parse(code).getDeclarations();
+            declarationIter = parse(code, true, true, language).getDeclarations();
         }
         catch (ASTNotImplementedException e1)
         {
@@ -90,10 +95,15 @@
 		return returnValue;
 	}
 	
-	public void assertCodeFailsParse(String code) {
+	public void assertCodeFailsParse( String code )
+	{
+		assertCodeFailsParse( code, true, true, ParserLanguage.CPP ); 
+	}
+	
+	public void assertCodeFailsParse(String code, boolean quick, boolean throwOnError, ParserLanguage CPP ) {
 		boolean testPassed = false;
 		try {
-			parse(code);
+			parse(code, quick, throwOnError, CPP );
 			testPassed = true;
 			fail( "We should not reach this point");
 		} catch (Throwable e) {
Index: parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java,v
retrieving revision 1.38
diff -u -r1.38 CompleteParseASTTest.java
--- parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java	1 Oct 2003 21:15:45 -0000	1.38
+++ parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java	24 Oct 2003 17:46:54 -0000
@@ -14,6 +14,7 @@
 import java.io.Writer;
 import java.util.Iterator;
 
+import org.eclipse.cdt.core.parser.ParserLanguage;
 import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
 import org.eclipse.cdt.core.parser.ast.ASTClassKind;
 import org.eclipse.cdt.core.parser.ast.IASTASMDefinition;
@@ -915,5 +916,59 @@
 		IASTMethod constructor = (IASTMethod) i.next();
 		assertEquals( constructor.getName(), "B" );
 		assertTrue( constructor.previouslyDeclared() );
-	}	
+	}
+	
+	public void testCDesignatedInitializers() throws Exception
+	{
+		StringBuffer buffer = new StringBuffer();
+		buffer.append( "struct Inner { int a,b,c; };"); 
+		buffer.append( "struct A { int x; int y[]; struct Inner innerArray[]; int z []; };");
+		buffer.append( "struct A myA = { .x = 4, .y[3] = 4, .y[4] = 3, .innerArray[0].a = 3, .innerArray[1].b = 5, .innerArray[2].c=6, .z = { 1,4,5} };");
+		Iterator i = parse( buffer.toString(), true, ParserLanguage.C ).getDeclarations();
+		IASTClassSpecifier Inner  = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();
+		Iterator members = getDeclarations(Inner);
+		IASTField a = (IASTField)members.next();
+		IASTField b = (IASTField)members.next();
+		IASTField c = (IASTField)members.next();
+		assertFalse( members.hasNext());
+		IASTClassSpecifier A = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();
+		members = getDeclarations( A );
+		IASTField x = (IASTField)members.next();
+		IASTField y = (IASTField)members.next(); 
+		IASTField innerArray = (IASTField)members.next();
+		IASTField z = (IASTField)members.next();
+		assertFalse( members.hasNext() );
+		IASTVariable myA = (IASTVariable)i.next(); 
+		assertFalse( i.hasNext() );
+		assertAllReferences( 12, createTaskList( new Task( A ), 
+												new Task( x ), 
+												new Task( y, 2 ), 
+												new Task( Inner ), 
+												new Task( innerArray, 3), 
+												new Task( a ), 
+												new Task( b ), 
+												new Task( c ), 
+												new Task( z ) ) );
+	}
+	
+	public void testBug39551A() throws Exception
+	{
+		IASTFunction function = (IASTFunction)parse("extern float _Complex conjf (float _Complex);", true, ParserLanguage.C).getDeclarations().next();
+		assertEquals( function.getName(), "conjf");
+		assertTrue( ((IASTSimpleTypeSpecifier)function.getReturnType().getTypeSpecifier()).isComplex() );
+	}
+
+	public void testBug39551B() throws Exception
+	{
+		IASTVariable variable = (IASTVariable)parse("_Imaginary double id = 99.99 * __I__;", true, ParserLanguage.C).getDeclarations().next();
+		assertEquals( variable.getName(), "id");
+		assertTrue( ((IASTSimpleTypeSpecifier)variable.getAbstractDeclaration().getTypeSpecifier()).isImaginary() );
+	}
+	
+	public void testCBool() throws Exception
+	{
+		IASTVariable variable = (IASTVariable)parse( "_Bool x;", true, ParserLanguage.C ).getDeclarations().next();
+		assertEquals( ((IASTSimpleTypeSpecifier)variable.getAbstractDeclaration().getTypeSpecifier()).getType(), IASTSimpleTypeSpecifier.Type._BOOL );
+	}
+		
 }
Index: parser/org/eclipse/cdt/core/parser/tests/CompleteParseBaseTest.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseBaseTest.java,v
retrieving revision 1.9
diff -u -r1.9 CompleteParseBaseTest.java
--- parser/org/eclipse/cdt/core/parser/tests/CompleteParseBaseTest.java	29 Sep 2003 19:21:57 -0000	1.9
+++ parser/org/eclipse/cdt/core/parser/tests/CompleteParseBaseTest.java	24 Oct 2003 17:46:54 -0000
@@ -669,14 +669,20 @@
     
     protected IASTScope parse( String code ) throws ParserException
     {
-    	return parse( code, true );
+    	return parse( code, true, ParserLanguage.CPP );
     }
-    protected IASTScope parse(String code, boolean throwOnError) throws ParserException
+    
+    protected IASTScope parse( String code, boolean throwOnError ) throws ParserException
+    {
+    	return parse( code, throwOnError, ParserLanguage.CPP );
+    }
+    
+    protected IASTScope parse(String code, boolean throwOnError, ParserLanguage language) throws ParserException
     {
     	callback = new FullParseCallback(); 
     	IParser parser = ParserFactory.createParser( 
     		ParserFactory.createScanner( new StringReader( code ), "test-code", new ScannerInfo(),
-    			ParserMode.COMPLETE_PARSE, ParserLanguage.CPP, callback ), callback, ParserMode.COMPLETE_PARSE, ParserLanguage.CPP	
+    			ParserMode.COMPLETE_PARSE, language, callback ), callback, ParserMode.COMPLETE_PARSE, language	
     		);
     	if( ! parser.parse() && throwOnError ) throw new ParserException( "FAILURE");
         return callback.getCompilationUnit();
@@ -835,6 +841,27 @@
         result.add( task6 );
         return result;
     }
+
+	protected List createTaskList(Task task, Task task2, Task task3, Task task4, Task task5, Task task6, Task task7)
+	{
+		List result = createTaskList( task, task2, task3, task4, task5, task6 );
+		result.add( task7 );
+		return result;
+	}
+	
+	protected List createTaskList(Task task, Task task2, Task task3, Task task4, Task task5, Task task6, Task task7, Task task8 )
+	{
+		List result = createTaskList( task, task2, task3, task4, task5, task6, task7 );
+		result.add( task8 );
+		return result;
+	}
+
+	protected List createTaskList(Task task, Task task2, Task task3, Task task4, Task task5, Task task6, Task task7, Task task8, Task task9 )
+	{
+		List result = createTaskList( task, task2, task3, task4, task5, task6, task7, task8 );
+		result.add( task9 );
+		return result;
+	}
 
 	public boolean qualifiedNamesEquals( String [] fromAST, String [] theTruth)
 	{
Index: parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java,v
retrieving revision 1.23
diff -u -r1.23 QuickParseASTTests.java
--- parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java	21 Oct 2003 23:22:31 -0000	1.23
+++ parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java	24 Oct 2003 17:46:55 -0000
@@ -1975,5 +1975,37 @@
 		parse("template<class E> class X { inline X<E>(int); };");
 	}
 
+	public void testBug39542() throws Exception
+	{
+		parse("void f(int a, struct {int b[a];} c) {}");
+	}
+
+	//Here starts C99-specific section
+	public void testBug39549() throws Exception
+	{
+		parse("struct X x = { .b = 40, .z = { sizeof(X), 42 }, .t[3] = 2, .t.f[3].x = A * B };", true, true, ParserLanguage.C);
+		// with trailing commas
+		parse("struct X x = { .b = 40, .z = { sizeof(X), 42,}, .t[3] = 2, .t.f[3].x = A * B  ,};", true, true, ParserLanguage.C);
+	}
+	
+	public void testBug39551A() throws Exception
+	{
+		IASTFunction function = (IASTFunction)parse("extern float _Complex conjf (float _Complex);", true, true, ParserLanguage.C).getDeclarations().next();
+		assertEquals( function.getName(), "conjf");
+		assertTrue( ((IASTSimpleTypeSpecifier)function.getReturnType().getTypeSpecifier()).isComplex() );
+	}
+
+	public void testBug39551B() throws Exception
+	{
+		IASTVariable variable = (IASTVariable)parse("_Imaginary double id = 99.99 * __I__;", true, true, ParserLanguage.C).getDeclarations().next();
+		assertEquals( variable.getName(), "id");
+		assertTrue( ((IASTSimpleTypeSpecifier)variable.getAbstractDeclaration().getTypeSpecifier()).isImaginary() );
+	}
+	
+	public void testCBool() throws Exception
+	{
+		IASTVariable variable = (IASTVariable)assertSoleDeclaration( "_Bool x;", ParserLanguage.C );
+		assertSimpleType( variable, IASTSimpleTypeSpecifier.Type._BOOL );
+	}
 
 }

Back to the top