[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[cdt-patch] Parser - pointer to function fixes
|
CORE
Minor cleanup of callbacks due to removal of NewModelBuilder.
Added parser support to partially fix bug36416 & bug36294. Also
added minimal C-Model support for these fixes.
TESTS
Added DOMTests::testPointersToFunctions.
JohnC
Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui.tests/ChangeLog,v
retrieving revision 1.26
diff -u -r1.26 ChangeLog
--- ChangeLog 13 Apr 2003 22:01:34 -0000 1.26
+++ ChangeLog 13 Apr 2003 23:33:18 -0000
@@ -1,3 +1,6 @@
+2003-04-13 John Camelon
+ Added DOMTests::testPointersToFunctions.
+
2003-04-11 John Camelon
Added DOMTests::testBug36247().
Index: parser/org/eclipse/cdt/core/parser/tests/DOMTests.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui.tests/parser/org/eclipse/cdt/core/parser/tests/DOMTests.java,v
retrieving revision 1.19
diff -u -r1.19 DOMTests.java
--- parser/org/eclipse/cdt/core/parser/tests/DOMTests.java 13 Apr 2003 22:01:34 -0000 1.19
+++ parser/org/eclipse/cdt/core/parser/tests/DOMTests.java 13 Apr 2003 23:33:19 -0000
@@ -1231,6 +1231,37 @@
TranslationUnit tu = parse( "A::A():B( (char *)0 ){}", true );
assertEquals( tu.getDeclarations().size(), 1 );
}
+
+ public void testPointersToFunctions() throws Exception
+ {
+ Writer code = new StringWriter();
+ code.write( "void (*name)( void );\n");
+ code.write( "static void * (*orig_malloc_hook)(const char *file, int line, size_t size);\n");
+
+ TranslationUnit tu = parse( code.toString() );
+ assertEquals( tu.getDeclarations().size(), 2 );
+ SimpleDeclaration declaration = (SimpleDeclaration)tu.getDeclarations().get(0);
+ assertEquals( declaration.getDeclSpecifier().getType(), DeclSpecifier.t_void );
+ assertEquals( declaration.getDeclarators().size(), 1);
+ assertNull( ((Declarator)declaration.getDeclarators().get(0)).getName() );
+ assertNotNull( ((Declarator)declaration.getDeclarators().get(0)).getDeclarator() );
+ assertEquals( ((Declarator)declaration.getDeclarators().get(0)).getDeclarator().getName().toString(), "name" );
+ ParameterDeclarationClause clause = ((Declarator)declaration.getDeclarators().get(0)).getParms();
+ assertEquals( clause.getDeclarations().size(), 1 );
+ assertEquals( ((ParameterDeclaration)clause.getDeclarations().get(0)).getDeclarators().size(), 1 );
+ assertNull( ((Declarator)((ParameterDeclaration)clause.getDeclarations().get(0)).getDeclarators().get(0)).getName() );
+ assertEquals( ((ParameterDeclaration)clause.getDeclarations().get(0)).getDeclSpecifier().getType(), DeclSpecifier.t_void );
+
+ declaration = (SimpleDeclaration)tu.getDeclarations().get(1);
+ assertEquals( declaration.getDeclSpecifier().getType(), DeclSpecifier.t_void );
+ assertTrue( declaration.getDeclSpecifier().isStatic() );
+ assertEquals( declaration.getDeclarators().size(), 1);
+ assertNull( ((Declarator)declaration.getDeclarators().get(0)).getName() );
+ assertNotNull( ((Declarator)declaration.getDeclarators().get(0)).getDeclarator() );
+ assertEquals( ((Declarator)declaration.getDeclarators().get(0)).getDeclarator().getName().toString(), "orig_malloc_hook" );
+ clause = ((Declarator)declaration.getDeclarators().get(0)).getParms();
+ assertEquals( clause.getDeclarations().size(), 3 );
+ }
public void testBug36247() throws Exception
{
@@ -1287,6 +1318,5 @@
}
}
-
}
Index: dom/org/eclipse/cdt/internal/core/dom/DOMBuilder.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/DOMBuilder.java,v
retrieving revision 1.21
diff -u -r1.21 DOMBuilder.java
--- dom/org/eclipse/cdt/internal/core/dom/DOMBuilder.java 13 Apr 2003 22:01:29 -0000 1.21
+++ dom/org/eclipse/cdt/internal/core/dom/DOMBuilder.java 13 Apr 2003 23:33:45 -0000
@@ -79,16 +79,30 @@
* @see org.eclipse.cdt.internal.core.newparser.IParserCallback#declaratorBegin()
*/
public Object declaratorBegin(Object container) {
- DeclSpecifier.Container decl = (DeclSpecifier.Container )container;
- Declarator declarator = new Declarator(decl);
- decl.addDeclarator(declarator);
- return declarator;
+ if( container instanceof DeclSpecifier.IContainer )
+ {
+ DeclSpecifier.IContainer decl = (DeclSpecifier.IContainer )container;
+ Declarator declarator = new Declarator(decl);
+ return declarator;
+ }
+ else if( container instanceof IDeclaratorOwner )
+ {
+ IDeclaratorOwner owner = (IDeclaratorOwner)container;
+ Declarator declarator = new Declarator(owner);
+ return declarator;
+ }
+ return null;
}
/**
* @see org.eclipse.cdt.internal.core.newparser.IParserCallback#declaratorEnd()
*/
public void declaratorEnd(Object declarator) {
+ Declarator d = (Declarator)declarator;
+ if( d.getDeclaration() != null )
+ d.getDeclaration().addDeclarator(d);
+ else if( d.getOwnerDeclarator() != null )
+ d.getOwnerDeclarator().setDeclarator(d);
}
/**
@@ -102,14 +116,8 @@
* @see org.eclipse.cdt.internal.core.newparser.IParserCallback#declSpecifier(org.eclipse.cdt.internal.core.newparser.Token)
*/
public void simpleDeclSpecifier(Object Container, Token specifier) {
- DeclSpecifier.Container decl = (DeclSpecifier.Container)Container;
+ DeclSpecifier.IContainer decl = (DeclSpecifier.IContainer)Container;
DeclSpecifier declSpec = decl.getDeclSpecifier();
- if( declSpec == null )
- {
- declSpec = new DeclSpecifier();
- decl.setDeclSpecifier( declSpec );
- }
-
declSpec.setType( specifier );
}
@@ -280,12 +288,8 @@
/**
* @see org.eclipse.cdt.internal.core.newparser.IParserCallback#declaratorAbort(java.lang.Object, java.lang.Object)
*/
- public void declaratorAbort(Object container, Object declarator) {
- DeclSpecifier.Container decl = (DeclSpecifier.Container )container;
- Declarator toBeRemoved = (Declarator)declarator;
- decl.removeDeclarator( toBeRemoved );
+ public void declaratorAbort(Object declarator) {
currName = null;
- toBeRemoved = null;
}
/**
@@ -312,12 +316,6 @@
}
/**
- * @see org.eclipse.cdt.internal.core.parser.IParserCallback#classSpecifierSafe(java.lang.Object)
- */
- public void classSpecifierSafe(Object classSpecifier) {
- }
-
- /**
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#elaboratedTypeSpecifierBegin(java.lang.Object)
*/
public Object elaboratedTypeSpecifierBegin(Object container, Token classKey) {
@@ -359,7 +357,7 @@
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#simpleDeclSpecifierName(java.lang.Object)
*/
public void simpleDeclSpecifierName(Object declaration) {
- DeclSpecifier.Container decl = (DeclSpecifier.Container)declaration;
+ DeclSpecifier.IContainer decl = (DeclSpecifier.IContainer)declaration;
DeclSpecifier declSpec = decl.getDeclSpecifier();
declSpec.setName( currName );
}
Index: dom/org/eclipse/cdt/internal/core/dom/DeclSpecifier.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/DeclSpecifier.java,v
retrieving revision 1.1
diff -u -r1.1 DeclSpecifier.java
--- dom/org/eclipse/cdt/internal/core/dom/DeclSpecifier.java 9 Apr 2003 21:11:59 -0000 1.1
+++ dom/org/eclipse/cdt/internal/core/dom/DeclSpecifier.java 13 Apr 2003 23:33:45 -0000
@@ -252,14 +252,10 @@
return declSpecifierSeq & typeMask;
}
- public interface Container {
+ public interface IContainer {
public DeclSpecifier getDeclSpecifier();
-
- public void setDeclSpecifier(DeclSpecifier in);
-
public void addDeclarator(Object declarator);
- public void removeDeclarator(Object declarator);
public List getDeclarators();
};
Index: dom/org/eclipse/cdt/internal/core/dom/Declarator.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/Declarator.java,v
retrieving revision 1.10
diff -u -r1.10 Declarator.java
--- dom/org/eclipse/cdt/internal/core/dom/Declarator.java 9 Apr 2003 21:11:59 -0000 1.10
+++ dom/org/eclipse/cdt/internal/core/dom/Declarator.java 13 Apr 2003 23:33:45 -0000
@@ -6,19 +6,27 @@
-public class Declarator implements IExpressionOwner {
+public class Declarator implements IExpressionOwner, IDeclaratorOwner {
- public Declarator(DeclSpecifier.Container declaration) {
+ public Declarator(DeclSpecifier.IContainer declaration) {
this.declaration = declaration;
+ this.ownerDeclarator = null;
}
- private DeclSpecifier.Container declaration;
+ public Declarator( IDeclaratorOwner owner )
+ {
+ this.ownerDeclarator = owner;
+ this.declaration = null;
+ }
+
+ private final DeclSpecifier.IContainer declaration;
+ private final IDeclaratorOwner ownerDeclarator;
/**
* Returns the declaration.
* @return SimpleDeclaration
*/
- public DeclSpecifier.Container getDeclaration() {
+ public DeclSpecifier.IContainer getDeclaration() {
return declaration;
}
@@ -27,7 +35,7 @@
* @param declaration The declaration to set
*/
public void setDeclaration(SimpleDeclaration declaration) {
- this.declaration = declaration;
+
}
private Name name;
@@ -176,6 +184,28 @@
*/
public void setPureVirtual(boolean isPureVirtual) {
this.isPureVirtual = isPureVirtual;
+ }
+
+ private Declarator innerDeclarator = null;
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.internal.core.dom.IDeclaratorOwner#getDeclarator()
+ */
+ public Declarator getDeclarator() {
+ return innerDeclarator;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.internal.core.dom.IDeclaratorOwner#setDeclarator(org.eclipse.cdt.internal.core.dom.Declarator)
+ */
+ public void setDeclarator(Declarator input) {
+ innerDeclarator = input;
+ }
+
+ /**
+ * @return
+ */
+ public IDeclaratorOwner getOwnerDeclarator() {
+ return ownerDeclarator;
}
}
Index: dom/org/eclipse/cdt/internal/core/dom/IDeclaratorOwner.java
===================================================================
RCS file: dom/org/eclipse/cdt/internal/core/dom/IDeclaratorOwner.java
diff -N dom/org/eclipse/cdt/internal/core/dom/IDeclaratorOwner.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ dom/org/eclipse/cdt/internal/core/dom/IDeclaratorOwner.java 13 Apr 2003 23:33:45 -0000
@@ -0,0 +1,23 @@
+/**********************************************************************
+ * Created on Apr 13, 2003
+ *
+ * Copyright (c) 2002,2003 IBM/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 Ltd. - Rational Software - Initial API and implementation
+************************************************************************/
+package org.eclipse.cdt.internal.core.dom;
+
+/**
+ * @author jcamelon
+ *
+ */
+public interface IDeclaratorOwner {
+
+ public Declarator getDeclarator();
+ public void setDeclarator( Declarator input );
+}
Index: dom/org/eclipse/cdt/internal/core/dom/ParameterDeclaration.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/ParameterDeclaration.java,v
retrieving revision 1.7
diff -u -r1.7 ParameterDeclaration.java
--- dom/org/eclipse/cdt/internal/core/dom/ParameterDeclaration.java 13 Apr 2003 22:01:29 -0000 1.7
+++ dom/org/eclipse/cdt/internal/core/dom/ParameterDeclaration.java 13 Apr 2003 23:33:45 -0000
@@ -14,7 +14,7 @@
* To enable and disable the creation of type comments go to
* Window>Preferences>Java>Code Generation.
*/
-public class ParameterDeclaration extends Declaration implements DeclSpecifier.Container, TypeSpecifier.IOwner {
+public class ParameterDeclaration extends Declaration implements DeclSpecifier.IContainer, TypeSpecifier.IOwner {
private DeclSpecifier declSpec = null;
private TypeSpecifier typeSpecifier;
@@ -51,12 +51,6 @@
return declSpec;
}
- /**
- * @see org.eclipse.cdt.internal.core.dom.DeclarationSpecifier.CElementWrapper#setDeclSpecifier(org.eclipse.cdt.internal.core.dom.DeclarationSpecifier)
- */
- public void setDeclSpecifier(DeclSpecifier in) {
- declSpec = in;
- }
private List declarators = new LinkedList();
public void addDeclarator(Object declarator) {
@@ -67,10 +61,4 @@
return Collections.unmodifiableList( declarators );
}
- /**
- * @see org.eclipse.cdt.internal.core.newparser.util.DeclarationSpecifier.Container#removeDeclarator(java.lang.Object)
- */
- public void removeDeclarator(Object declarator) {
- declarators.remove( declarator );
- }
}
Index: dom/org/eclipse/cdt/internal/core/dom/SimpleDeclaration.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/SimpleDeclaration.java,v
retrieving revision 1.8
diff -u -r1.8 SimpleDeclaration.java
--- dom/org/eclipse/cdt/internal/core/dom/SimpleDeclaration.java 13 Apr 2003 22:01:29 -0000 1.8
+++ dom/org/eclipse/cdt/internal/core/dom/SimpleDeclaration.java 13 Apr 2003 23:33:45 -0000
@@ -5,7 +5,7 @@
import java.util.List;
-public class SimpleDeclaration extends Declaration implements DeclSpecifier.Container, IOffsetable, TypeSpecifier.IOwner {
+public class SimpleDeclaration extends Declaration implements DeclSpecifier.IContainer, IOffsetable, TypeSpecifier.IOwner {
private int startingOffset = 0, totalLength = 0;
private AccessSpecifier accessSpecifier = null;
@@ -25,11 +25,6 @@
return declSpec;
}
- public void setDeclSpecifier( DeclSpecifier in )
- {
- declSpec = in;
- }
-
/**
* This is valid when the type is t_type. It points to a
* classSpecifier, etc.
@@ -63,12 +58,6 @@
return Collections.unmodifiableList( declarators );
}
- /**
- * @see org.eclipse.cdt.internal.core.newparser.util.DeclarationSpecifier.Container#removeDeclarator(java.lang.Object)
- */
- public void removeDeclarator(Object declarator) {
- declarators.remove( declarator );
- }
/**
* @return
*/
Index: dom/org/eclipse/cdt/internal/core/dom/TranslationUnit.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/TranslationUnit.java,v
retrieving revision 1.7
diff -u -r1.7 TranslationUnit.java
--- dom/org/eclipse/cdt/internal/core/dom/TranslationUnit.java 11 Apr 2003 21:14:34 -0000 1.7
+++ dom/org/eclipse/cdt/internal/core/dom/TranslationUnit.java 13 Apr 2003 23:33:45 -0000
@@ -3,7 +3,6 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
-import java.util.LinkedList;
import java.util.List;
import java.util.NoSuchElementException;
@@ -12,7 +11,7 @@
*/
public class TranslationUnit implements IScope {
- private List declarations = new LinkedList();
+ private List declarations = new ArrayList();
private List macros = new ArrayList();
private List inclusions = new ArrayList();
Index: parser/ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/ChangeLog,v
retrieving revision 1.28
diff -u -r1.28 ChangeLog
--- parser/ChangeLog 13 Apr 2003 22:01:29 -0000 1.28
+++ parser/ChangeLog 13 Apr 2003 23:33:45 -0000
@@ -1,3 +1,7 @@
+2003-04-13 John Camelon
+ Minor cleanup of callbacks due to removal of NewModelBuilder.
+ Added parser support to partially fix bug36416 & bug36294. Also added minimal C-Model support for these fixes.
+
2003-04-11 John Camelon
Minimized the number of objects being returned from Parser callbacks.
Fixed CModelBuilder to handle errors better.
Index: parser/org/eclipse/cdt/internal/core/model/CModelBuilder.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/model/CModelBuilder.java,v
retrieving revision 1.7
diff -u -r1.7 CModelBuilder.java
--- parser/org/eclipse/cdt/internal/core/model/CModelBuilder.java 13 Apr 2003 22:01:29 -0000 1.7
+++ parser/org/eclipse/cdt/internal/core/model/CModelBuilder.java 13 Apr 2003 23:33:45 -0000
@@ -44,8 +44,6 @@
import org.eclipse.cdt.internal.core.dom.TranslationUnit;
import org.eclipse.cdt.internal.core.dom.TypeSpecifier;
import org.eclipse.cdt.internal.core.parser.Parser;
-import org.eclipse.cdt.internal.core.parser.ParserException;
-
public class CModelBuilder {
org.eclipse.cdt.internal.core.model.TranslationUnit translationUnit;
@@ -368,7 +366,8 @@
}
private FunctionDeclaration createFunctionSpecification(Parent parent, SimpleDeclaration simpleDeclaration, Declarator declarator, ParameterDeclarationClause pdc, boolean isTemplate){
- String declaratorName = declarator.getName().toString();
+ boolean pointerToFunction = declarator.getDeclarator() != null;
+ String declaratorName = pointerToFunction ? declarator.getDeclarator().getName().toString() : declarator.getName().toString();
DeclSpecifier declSpecifier = simpleDeclaration.getDeclSpecifier();
// getParameterTypes
List parameterList = pdc.getDeclarations();
@@ -439,7 +438,10 @@
parent.addChild( element );
// hook up the offsets
- element.setIdPos( declarator.getName().getStartOffset(), declarator.getName().length() );
+ if( pointerToFunction )
+ element.setIdPos( declarator.getDeclarator().getName().getStartOffset(), declarator.getDeclarator().getName().length() );
+ else
+ element.setIdPos( declarator.getName().getStartOffset(), declarator.getName().length() );
element.setPos(simpleDeclaration.getStartingOffset(), simpleDeclaration.getTotalLength());
return element;
}
Index: parser/org/eclipse/cdt/internal/core/parser/ExpressionEvaluator.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ExpressionEvaluator.java,v
retrieving revision 1.18
diff -u -r1.18 ExpressionEvaluator.java
--- parser/org/eclipse/cdt/internal/core/parser/ExpressionEvaluator.java 13 Apr 2003 22:01:29 -0000 1.18
+++ parser/org/eclipse/cdt/internal/core/parser/ExpressionEvaluator.java 13 Apr 2003 23:33:46 -0000
@@ -185,7 +185,7 @@
/**
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#declaratorAbort(java.lang.Object, java.lang.Object)
*/
- public void declaratorAbort(Object container, Object declarator) {
+ public void declaratorAbort(Object declarator) {
}
/**
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#declaratorEnd(java.lang.Object)
@@ -274,12 +274,6 @@
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#classSpecifierAbort(java.lang.Object)
*/
public void classSpecifierAbort(Object classSpecifier) {
- }
-
- /**
- * @see org.eclipse.cdt.internal.core.parser.IParserCallback#classSpecifierSafe(java.lang.Object)
- */
- public void classSpecifierSafe(Object classSpecifier) {
}
/**
Index: parser/org/eclipse/cdt/internal/core/parser/IParserCallback.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/IParserCallback.java,v
retrieving revision 1.17
diff -u -r1.17 IParserCallback.java
--- parser/org/eclipse/cdt/internal/core/parser/IParserCallback.java 13 Apr 2003 22:01:29 -0000 1.17
+++ parser/org/eclipse/cdt/internal/core/parser/IParserCallback.java 13 Apr 2003 23:33:46 -0000
@@ -32,7 +32,7 @@
public Object declaratorBegin(Object container);
public void declaratorId(Object declarator);
- public void declaratorAbort( Object container, Object declarator );
+ public void declaratorAbort( Object declarator );
public void declaratorPureVirtual( Object declarator );
public void declaratorCVModifier( Object declarator, Token modifier );
public void declaratorThrowsException( Object declarator );
@@ -58,7 +58,6 @@
public Object classSpecifierBegin(Object container, Token classKey);
public void classSpecifierName(Object classSpecifier);
public void classSpecifierAbort( Object classSpecifier );
- public void classSpecifierSafe( Object classSpecifier );
public void classMemberVisibility( Object classSpecifier, Token visibility );
public void classSpecifierEnd(Object classSpecifier, Token closingBrace );
Index: parser/org/eclipse/cdt/internal/core/parser/NullParserCallback.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/NullParserCallback.java,v
retrieving revision 1.17
diff -u -r1.17 NullParserCallback.java
--- parser/org/eclipse/cdt/internal/core/parser/NullParserCallback.java 13 Apr 2003 22:01:29 -0000 1.17
+++ parser/org/eclipse/cdt/internal/core/parser/NullParserCallback.java 13 Apr 2003 23:33:46 -0000
@@ -101,7 +101,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#declaratorAbort(java.lang.Object, java.lang.Object)
*/
- public void declaratorAbort(Object container, Object declarator) {
+ public void declaratorAbort(Object declarator) {
}
/* (non-Javadoc)
@@ -209,13 +209,6 @@
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#classSpecifierAbort(java.lang.Object)
*/
public void classSpecifierAbort(Object classSpecifier) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.internal.core.parser.IParserCallback#classSpecifierSafe(java.lang.Object)
- */
- public void classSpecifierSafe(Object classSpecifier) {
-
}
/* (non-Javadoc)
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.28
diff -u -r1.28 Parser.java
--- parser/org/eclipse/cdt/internal/core/parser/Parser.java 13 Apr 2003 22:01:29 -0000 1.28
+++ parser/org/eclipse/cdt/internal/core/parser/Parser.java 13 Apr 2003 23:33:46 -0000
@@ -1026,12 +1026,11 @@
if (LT(1) == Token.tLPAREN) {
consume();
- declarator(declarator);
+ Object subDeclarator = declarator(declarator);
consume(Token.tRPAREN);
- return declarator;
+ try{ callback.declaratorEnd( subDeclarator );} catch( Exception e ) {}
}
-
- if( LT(1) == Token.t_operator )
+ else if( LT(1) == Token.t_operator )
{
// we know this is an operator
Token operatorToken = consume( Token.t_operator );
@@ -1263,7 +1262,7 @@
if( LA(1).getType() == Token.tIDENTIFIER )
{
- try{ callback.declaratorAbort( container, declarator ); } catch( Exception e ) {}
+ try{ callback.declaratorAbort( declarator ); } catch( Exception e ) {}
declarator = null;
}
else
@@ -1433,8 +1432,6 @@
backup( mark );
throw backtrack;
}
- else
- try{ callback.classSpecifierSafe( classSpec ); } catch( Exception e ){}
// base clause
if (LT(1) == Token.tCOLON) {