diff --git a/core/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/DOMBuilder.java b/core/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/DOMBuilder.java index f934eee9463..27d6ded71a7 100644 --- a/core/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/DOMBuilder.java +++ b/core/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/DOMBuilder.java @@ -79,16 +79,30 @@ public class DOMBuilder implements IParserCallback * @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 @@ public class DOMBuilder implements IParserCallback * @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 @@ public class DOMBuilder implements IParserCallback /** * @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; } /** @@ -311,12 +315,6 @@ public class DOMBuilder implements IParserCallback cs.getOwner().setTypeSpecifier(null); } - /** - * @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) */ @@ -359,7 +357,7 @@ public class DOMBuilder implements IParserCallback * @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 ); } diff --git a/core/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/DeclSpecifier.java b/core/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/DeclSpecifier.java index 8a6f8230a93..c8ae2d9cdc1 100644 --- a/core/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/DeclSpecifier.java +++ b/core/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/DeclSpecifier.java @@ -252,14 +252,10 @@ public class DeclSpecifier { 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(); }; diff --git a/core/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/Declarator.java b/core/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/Declarator.java index e2299f5c2b3..46f971a7a27 100644 --- a/core/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/Declarator.java +++ b/core/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/Declarator.java @@ -6,19 +6,27 @@ import java.util.List; -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 @@ public class Declarator implements IExpressionOwner { * @param declaration The declaration to set */ public void setDeclaration(SimpleDeclaration declaration) { - this.declaration = declaration; + } private Name name; @@ -178,4 +186,26 @@ public class Declarator implements IExpressionOwner { 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; + } + } diff --git a/core/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/IDeclaratorOwner.java b/core/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/IDeclaratorOwner.java new file mode 100644 index 00000000000..e256ec86860 --- /dev/null +++ b/core/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/IDeclaratorOwner.java @@ -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 ); +} diff --git a/core/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/ParameterDeclaration.java b/core/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/ParameterDeclaration.java index 281badbd94b..0580ef94542 100644 --- a/core/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/ParameterDeclaration.java +++ b/core/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/ParameterDeclaration.java @@ -14,7 +14,7 @@ import java.util.List; * 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 @@ public class ParameterDeclaration extends Declaration implements DeclSpecifier.C 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 @@ public class ParameterDeclaration extends Declaration implements DeclSpecifier.C 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 ); - } } diff --git a/core/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/SimpleDeclaration.java b/core/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/SimpleDeclaration.java index 0c1e0fb2618..8d564e4dddc 100644 --- a/core/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/SimpleDeclaration.java +++ b/core/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/SimpleDeclaration.java @@ -5,7 +5,7 @@ import java.util.LinkedList; 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 @@ public class SimpleDeclaration extends Declaration implements DeclSpecifier.Cont 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 @@ public class SimpleDeclaration extends Declaration implements DeclSpecifier.Cont 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 */ diff --git a/core/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/TranslationUnit.java b/core/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/TranslationUnit.java index 799e36593a4..47af2a7a217 100644 --- a/core/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/TranslationUnit.java +++ b/core/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/TranslationUnit.java @@ -3,7 +3,6 @@ package org.eclipse.cdt.internal.core.dom; 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 @@ import java.util.NoSuchElementException; */ 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(); diff --git a/core/org.eclipse.cdt.core/parser/ChangeLog b/core/org.eclipse.cdt.core/parser/ChangeLog index 961b7378cb1..7b24739eae1 100644 --- a/core/org.eclipse.cdt.core/parser/ChangeLog +++ b/core/org.eclipse.cdt.core/parser/ChangeLog @@ -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. diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/model/CModelBuilder.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/model/CModelBuilder.java index 50d7082b5dd..d6cec088d94 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/model/CModelBuilder.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/model/CModelBuilder.java @@ -44,8 +44,6 @@ import org.eclipse.cdt.internal.core.dom.TemplateParameter; 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 @@ public class CModelBuilder { } 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 @@ public class CModelBuilder { 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; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ExpressionEvaluator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ExpressionEvaluator.java index c86cfc77ae2..2b335c0100e 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ExpressionEvaluator.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ExpressionEvaluator.java @@ -185,7 +185,7 @@ public class ExpressionEvaluator implements IParserCallback { /** * @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) @@ -276,12 +276,6 @@ public class ExpressionEvaluator implements IParserCallback { public void classSpecifierAbort(Object classSpecifier) { } - /** - * @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) */ diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/IParserCallback.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/IParserCallback.java index 8de48ebe451..326a78ebac5 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/IParserCallback.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/IParserCallback.java @@ -32,7 +32,7 @@ public interface IParserCallback { 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 interface IParserCallback { 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 ); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/NullParserCallback.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/NullParserCallback.java index 45c9252e58c..01117329717 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/NullParserCallback.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/NullParserCallback.java @@ -101,7 +101,7 @@ public class NullParserCallback implements IParserCallback { /* (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) @@ -211,13 +211,6 @@ public class NullParserCallback implements IParserCallback { 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) * @see org.eclipse.cdt.internal.core.parser.IParserCallback#classMemberVisibility(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token) */ diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java index 879a95c91fd..571baa24eb0 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java @@ -1026,12 +1026,11 @@ c, quick); 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 @@ c, quick); 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 @@ c, quick); backup( mark ); throw backtrack; } - else - try{ callback.classSpecifierSafe( classSpec ); } catch( Exception e ){} // base clause if (LT(1) == Token.tCOLON) { diff --git a/core/org.eclipse.cdt.ui.tests/ChangeLog b/core/org.eclipse.cdt.ui.tests/ChangeLog index 9479daeddd8..594537ecfa1 100644 --- a/core/org.eclipse.cdt.ui.tests/ChangeLog +++ b/core/org.eclipse.cdt.ui.tests/ChangeLog @@ -1,3 +1,6 @@ +2003-04-13 John Camelon + Added DOMTests::testPointersToFunctions. + 2003-04-11 John Camelon Added DOMTests::testBug36247(). diff --git a/core/org.eclipse.cdt.ui.tests/parser/org/eclipse/cdt/core/parser/tests/DOMTests.java b/core/org.eclipse.cdt.ui.tests/parser/org/eclipse/cdt/core/parser/tests/DOMTests.java index b1e704e1120..b8d6e298426 100644 --- a/core/org.eclipse.cdt.ui.tests/parser/org/eclipse/cdt/core/parser/tests/DOMTests.java +++ b/core/org.eclipse.cdt.ui.tests/parser/org/eclipse/cdt/core/parser/tests/DOMTests.java @@ -1231,6 +1231,37 @@ public class DOMTests extends TestCase { 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 @@ public class DOMTests extends TestCase { } } - }