Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Applied: [cdt-patch] Parser - Fixing initDeclarators for outline view

-----Original Message-----
From: Camelon, John [mailto:jcamelon@xxxxxxxxxxxx] 
Sent: Friday, March 07, 2003 2:27 PM
To: Cdt-Patch (E-mail)
Subject: [cdt-patch] Parser - Fixing initDeclarators for outline view

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.6
diff -u -r1.6 Parser.java
--- parser/org/eclipse/cdt/internal/core/parser/Parser.java	7 Mar 2003
13:41:26 -0000	1.6
+++ parser/org/eclipse/cdt/internal/core/parser/Parser.java	7 Mar 2003
16:54:03 -0000
@@ -466,6 +466,16 @@
 				}
 			}
 		}
+		else if( LT(1) == Token.tLPAREN )
+		{
+			consume();  // EAT IT! 
+			
+			constantExpression(); 
+			
+			if( LT(1) == Token.tRPAREN )
+				consume(); 
+		
+		}
 		
 		callback.declaratorEnd( declarator );
 	}
@@ -511,26 +521,30 @@
 			for (;;) {
 				switch (LT(1)) {
 					case Token.tLPAREN:
-						//
parameterDeclarationClause
-						Object clause =
callback.argumentsBegin(declarator);
-						consume();
-						parameterDeclarationLoop:
-						for (;;) {
-							switch (LT(1)) {
-								case
Token.tRPAREN:
-
consume();
-
break parameterDeclarationLoop;
-								case
Token.tELIPSE:
-
consume();
-
break;
-								case
Token.tCOMMA:
-
consume();
-
break;
-								default:
-
parameterDeclaration( clause );  
+						// temporary fix for
initializer/function declaration ambiguity
+						if( LT(2) != Token.tINTEGER
)
+						{
+							//
parameterDeclarationClause
+							Object clause =
callback.argumentsBegin(declarator);
+							consume();
+
parameterDeclarationLoop:
+							for (;;) {
+								switch
(LT(1)) {
+									case
Token.tRPAREN:
+
consume();
+
break parameterDeclarationLoop;
+									case
Token.tELIPSE:
+
consume();
+
break;
+									case
Token.tCOMMA:
+
consume();
+
break;
+
default:
+
parameterDeclaration( clause );  
+								}
 							}
+
callback.argumentsEnd(clause);
 						}
-
callback.argumentsEnd(clause);
 						break;
 					case Token.tLBRACKET:
 						consume();
_______________________________________________
cdt-patch mailing list
cdt-patch@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/cdt-patch


Back to the top