[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[cdt-patch] Applied [HEAD] 1st pass @ parsing function bodies
|
CORE/UI
First pass of parsing function bodies with X-Reference information.
Updated IASTFactory/ISourceElementRequestor to include IASTCodeScope
constructs, clients should keep this in mind and update their
implementations.
TESTS
Updated ASTFailedTests::testBug39702() to fail more accurately.
Added testSimpleFunctionBody(), testSimpleForLoop() to
CompleteParseASTTest.java.
JohnC
Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/ChangeLog,v
retrieving revision 1.160
diff -u -r1.160 ChangeLog
--- ChangeLog 4 Sep 2003 19:07:21 -0000 1.160
+++ ChangeLog 4 Sep 2003 20:41:17 -0000
@@ -1,3 +1,8 @@
+2003-09-04 John Camelon
+ First pass of parsing function bodies with X-Reference information.
+ Updated IASTFactory/ISourceElementRequestor to include IASTCodeScope
+ constructs, clients should keep this in mind and update their implementations.
+
2003-09-04 Alain Magloire
Faulty logic when checking the build console preferences.
Index: src/org/eclipse/cdt/internal/ui/compare/SourceElementRequestorAdapter.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/SourceElementRequestorAdapter.java,v
retrieving revision 1.1
diff -u -r1.1 SourceElementRequestorAdapter.java
--- src/org/eclipse/cdt/internal/ui/compare/SourceElementRequestorAdapter.java 30 Aug 2003 05:21:06 -0000 1.1
+++ src/org/eclipse/cdt/internal/ui/compare/SourceElementRequestorAdapter.java 4 Sep 2003 20:41:17 -0000
@@ -32,6 +32,7 @@
import org.eclipse.cdt.core.parser.ast.IASTMethodReference;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceReference;
+import org.eclipse.cdt.core.parser.ast.IASTScope;
import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation;
import org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization;
@@ -290,6 +291,22 @@
* @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitTemplateSpecialization(org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization)
*/
public void exitTemplateSpecialization(IASTTemplateSpecialization specialization) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterCodeBlock(org.eclipse.cdt.core.parser.ast.IASTScope)
+ */
+ public void enterCodeBlock(IASTScope scope) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitCodeBlock(org.eclipse.cdt.core.parser.ast.IASTScope)
+ */
+ public void exitCodeBlock(IASTScope scope) {
+ // TODO Auto-generated method stub
+
}
}
Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/ChangeLog,v
retrieving revision 1.76
diff -u -r1.76 ChangeLog
--- ChangeLog 4 Sep 2003 14:39:07 -0000 1.76
+++ ChangeLog 4 Sep 2003 20:40:58 -0000
@@ -1,3 +1,7 @@
+2003-09-04 John Camelon
+ Updated ASTFailedTests::testBug39702() to fail more accurately.
+ Added testSimpleFunctionBody(), testSimpleForLoop() to CompleteParseASTTest.java.
+
2003-09-04 Hoda Amer
Call to ASTExpression getTypeId() changed to getTypeIdString().
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.11
diff -u -r1.11 ASTFailedTests.java
--- failures/org/eclipse/cdt/core/parser/failedTests/ASTFailedTests.java 28 Aug 2003 15:02:29 -0000 1.11
+++ failures/org/eclipse/cdt/core/parser/failedTests/ASTFailedTests.java 4 Sep 2003 20:40:58 -0000
@@ -272,9 +272,7 @@
catch (IOException ioe)
{
}
- Iterator declarations = parse(code.toString()).getDeclarations();
- IASTDeclaration d = (IASTDeclaration)declarations.next();
- assertFalse( "Should be 1 declaration, not 2", !declarations.hasNext() );
+ assertCodeFailsFullParse(code.toString());
}
public void testBug39703() throws Exception
{
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.19
diff -u -r1.19 CompleteParseASTTest.java
--- parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java 3 Sep 2003 15:16:03 -0000 1.19
+++ parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java 4 Sep 2003 20:40:58 -0000
@@ -506,7 +506,7 @@
public void testBug41520() throws Exception
{
- Iterator i = parse( "const int x = 666, y( x );").getDeclarations();
+ Iterator i = parse( "const int x = 666; const int y( x );").getDeclarations();
IASTVariable variableX = (IASTVariable)i.next();
IASTVariable variableY = (IASTVariable)i.next();
assertFalse( i.hasNext() );
@@ -552,7 +552,7 @@
public void testIsDestructor() throws Exception
{
- Iterator i = parse( "class A{ public: A(); }; \n A::~A() {}; \n" ).getDeclarations();
+ Iterator i = parse( "class A{ public: ~A(); }; \n A::~A() {}; \n" ).getDeclarations();
IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();
IASTMethod method = (IASTMethod)i.next();
assertTrue (method.isDestructor());
@@ -567,4 +567,34 @@
IASTClassSpecifier classB = (IASTClassSpecifier) ((IASTAbstractTypeSpecifierDeclaration)sub.next()).getTypeSpecifier();
IASTClassSpecifier structA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)( getDeclarations( classB ).next())).getTypeSpecifier();
}
+
+ public void testSimpleFunctionBody() throws Exception
+ {
+ Iterator i = parse( "class A { int f1(); }; const int x = 4; int f() { return x; } int A::f1() { return x; }").getDeclarations();
+ IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();
+ IASTMethod method_prototype = (IASTMethod)getDeclarations(classA).next();
+ IASTVariable x = (IASTVariable) i.next();
+ IASTFunction function_f = (IASTFunction) i.next();
+ IASTMethod method_f = (IASTMethod)i.next();
+ assertEquals( method_f.getName(), method_prototype.getName() );
+ assertFalse( i.hasNext() );
+ assertEquals( callback.getReferences().size(), 3 );
+ IASTVariableReference referenceX = (IASTVariableReference) callback.getReferences().get(0);
+ assertEquals( referenceX.getReferencedElement(), x );
+ IASTClassReference referenceA = (IASTClassReference) callback.getReferences().get(1);
+ assertEquals( referenceA.getReferencedElement(), classA );
+ referenceX = (IASTVariableReference) callback.getReferences().get(2);
+ assertEquals( referenceX.getReferencedElement(), x );
+ }
+
+
+ public void testSimpleForLoop() throws Exception
+ {
+ Iterator i = parse( "const int FIVE = 5; void f() { int x = 0; for( int i = 0; i < FIVE; ++i ) { x += i; } }").getDeclarations();
+ IASTVariable five = (IASTVariable) i.next();
+ IASTFunction f = (IASTFunction) i.next();
+ assertFalse( i.hasNext() );
+ assertEquals( callback.getReferences().size(), 5 );
+ }
+
}
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.1
diff -u -r1.1 CompleteParseBaseTest.java
--- parser/org/eclipse/cdt/core/parser/tests/CompleteParseBaseTest.java 25 Aug 2003 15:19:06 -0000 1.1
+++ parser/org/eclipse/cdt/core/parser/tests/CompleteParseBaseTest.java 4 Sep 2003 20:40:58 -0000
@@ -523,6 +523,22 @@
{
return forewardDecls;
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterCodeBlock(org.eclipse.cdt.core.parser.ast.IASTScope)
+ */
+ public void enterCodeBlock(IASTScope scope) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitCodeBlock(org.eclipse.cdt.core.parser.ast.IASTScope)
+ */
+ public void exitCodeBlock(IASTScope scope) {
+ // TODO Auto-generated method stub
+
+ }
}
protected Iterator getDeclarations(IASTScope scope)
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.47
diff -u -r1.47 DOMBuilder.java
--- dom/org/eclipse/cdt/internal/core/dom/DOMBuilder.java 12 Aug 2003 20:40:04 -0000 1.47
+++ dom/org/eclipse/cdt/internal/core/dom/DOMBuilder.java 4 Sep 2003 20:40:13 -0000
@@ -29,6 +29,7 @@
import org.eclipse.cdt.core.parser.ast.IASTMethodReference;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceReference;
+import org.eclipse.cdt.core.parser.ast.IASTScope;
import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation;
@@ -959,4 +960,18 @@
// TODO Auto-generated method stub
}
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterCodeBlock(org.eclipse.cdt.core.parser.ast.IASTScope)
+ */
+ public void enterCodeBlock(IASTScope scope) {
+ // TODO Auto-generated method stub
+
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitCodeBlock(org.eclipse.cdt.core.parser.ast.IASTScope)
+ */
+ public void exitCodeBlock(IASTScope scope) {
+ // TODO Auto-generated method stub
+
+ }
}
Index: index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexerRequestor.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexerRequestor.java,v
retrieving revision 1.12
diff -u -r1.12 SourceIndexerRequestor.java
--- index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexerRequestor.java 20 Aug 2003 20:53:50 -0000 1.12
+++ index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexerRequestor.java 4 Sep 2003 20:40:14 -0000
@@ -36,6 +36,7 @@
import org.eclipse.cdt.core.parser.ast.IASTMethodReference;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceReference;
+import org.eclipse.cdt.core.parser.ast.IASTScope;
import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation;
import org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization;
@@ -416,4 +417,18 @@
public void acceptElaboratedForewardDeclaration(IASTElaboratedTypeSpecifier elaboratedType){
indexer.addElaboratedForwardDeclaration(elaboratedType);
}
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterCodeBlock(org.eclipse.cdt.core.parser.ast.IASTScope)
+ */
+ public void enterCodeBlock(IASTScope scope) {
+ // TODO Auto-generated method stub
+
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitCodeBlock(org.eclipse.cdt.core.parser.ast.IASTScope)
+ */
+ public void exitCodeBlock(IASTScope scope) {
+ // TODO Auto-generated method stub
+
+ }
}
Index: parser/ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/ChangeLog,v
retrieving revision 1.109
diff -u -r1.109 ChangeLog
--- parser/ChangeLog 3 Sep 2003 20:57:44 -0000 1.109
+++ parser/ChangeLog 4 Sep 2003 20:40:14 -0000
@@ -1,3 +1,8 @@
+2003-09-04 John Camelon
+ First pass of parsing function bodies with X-Reference information.
+ Updated IASTFactory/ISourceElementRequestor to include IASTCodeScope
+ constructs, clients should keep this in mind and update their implementations.
+
2003-09-03 Andrew Niefer
fix bug in PST that prevents > 2 constructors
Index: parser/org/eclipse/cdt/core/parser/ISourceElementRequestor.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ISourceElementRequestor.java,v
retrieving revision 1.10
diff -u -r1.10 ISourceElementRequestor.java
--- parser/org/eclipse/cdt/core/parser/ISourceElementRequestor.java 12 Aug 2003 20:40:04 -0000 1.10
+++ parser/org/eclipse/cdt/core/parser/ISourceElementRequestor.java 4 Sep 2003 20:40:14 -0000
@@ -29,6 +29,7 @@
import org.eclipse.cdt.core.parser.ast.IASTMethodReference;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceReference;
+import org.eclipse.cdt.core.parser.ast.IASTScope;
import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation;
import org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization;
@@ -60,6 +61,8 @@
public void enterFunctionBody( IASTFunction function );
public void exitFunctionBody( IASTFunction function );
+ public void enterCodeBlock( IASTScope scope );
+ public void exitCodeBlock( IASTScope scope );
public void enterCompilationUnit( IASTCompilationUnit compilationUnit );
public void enterInclusion( IASTInclusion inclusion );
Index: parser/org/eclipse/cdt/core/parser/ast/IASTCodeScope.java
===================================================================
RCS file: parser/org/eclipse/cdt/core/parser/ast/IASTCodeScope.java
diff -N parser/org/eclipse/cdt/core/parser/ast/IASTCodeScope.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ parser/org/eclipse/cdt/core/parser/ast/IASTCodeScope.java 4 Sep 2003 20:40:14 -0000
@@ -0,0 +1,19 @@
+/*
+ * Created on Sep 2, 2003
+ *
+ * To change the template for this generated file go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+package org.eclipse.cdt.core.parser.ast;
+
+import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate;
+
+/**
+ * @author jcamelon
+ *
+ * To change the template for this generated type comment go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+public interface IASTCodeScope extends IASTScope, ISourceElementCallbackDelegate{
+
+}
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.28
diff -u -r1.28 IASTFactory.java
--- parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java 4 Sep 2003 14:39:15 -0000 1.28
+++ parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java 4 Sep 2003 20:40:14 -0000
@@ -11,7 +11,6 @@
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;
@@ -191,8 +190,15 @@
public IASTTypedefDeclaration createTypedef( IASTScope scope, String name, IASTAbstractDeclaration mapping, int startingOffset, int nameOffset ) throws ASTSemanticException;
public IASTAbstractTypeSpecifierDeclaration createTypeSpecDeclaration( IASTScope scope, IASTTypeSpecifier typeSpecifier, IASTTemplate template, int startingOffset, int endingOffset);
+
+ public boolean queryIsTypeName( IASTScope scope, ITokenDuple nameInQuestion );
static final String DOUBLE_COLON = "::";
static final String TELTA = "~";
+ /**
+ * @param scope
+ * @return
+ */
+ public IASTCodeScope createNewCodeBlock(IASTScope scope);
}
Index: parser/org/eclipse/cdt/internal/core/parser/NullSourceElementRequestor.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/NullSourceElementRequestor.java,v
retrieving revision 1.10
diff -u -r1.10 NullSourceElementRequestor.java
--- parser/org/eclipse/cdt/internal/core/parser/NullSourceElementRequestor.java 12 Aug 2003 20:40:04 -0000 1.10
+++ parser/org/eclipse/cdt/internal/core/parser/NullSourceElementRequestor.java 4 Sep 2003 20:40:14 -0000
@@ -21,6 +21,7 @@
import org.eclipse.cdt.core.parser.ast.IASTMethodReference;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceReference;
+import org.eclipse.cdt.core.parser.ast.IASTScope;
import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation;
import org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization;
@@ -405,5 +406,21 @@
{
// TODO Auto-generated method stub
- }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterCodeBlock(org.eclipse.cdt.core.parser.ast.IASTScope)
+ */
+ public void enterCodeBlock(IASTScope scope) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitCodeBlock(org.eclipse.cdt.core.parser.ast.IASTScope)
+ */
+ public void exitCodeBlock(IASTScope scope) {
+ // TODO Auto-generated method stub
+
+ }
}
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.100
diff -u -r1.100 Parser.java
--- parser/org/eclipse/cdt/internal/core/parser/Parser.java 4 Sep 2003 14:39:15 -0000 1.100
+++ parser/org/eclipse/cdt/internal/core/parser/Parser.java 4 Sep 2003 20:40:15 -0000
@@ -33,6 +33,7 @@
import org.eclipse.cdt.core.parser.ast.IASTASMDefinition;
import org.eclipse.cdt.core.parser.ast.IASTArrayModifier;
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
+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.IASTElaboratedTypeSpecifier;
@@ -704,11 +705,19 @@
{
backup( mark );
- simpleDeclaration(
- SimpleDeclarationStrategy.TRY_VARIABLE,
- false,
- scope,
- ownerTemplate);
+ try
+ {
+ simpleDeclaration(
+ SimpleDeclarationStrategy.TRY_VARIABLE,
+ false,
+ scope,
+ ownerTemplate);
+ }
+ catch( Backtrack b3 )
+ {
+ backup( mark );
+ throw b3;
+ }
}
}
}
@@ -853,7 +862,6 @@
sdw.isUnsigned(), sdw.isTypeNamed()));
} catch( ASTSemanticException se )
{
- failParse();
throw backtrack;
}
@@ -902,13 +910,11 @@
}
catch (ASTSemanticException e)
{
- failParse();
throw backtrack;
}
Iterator i = l.iterator();
if (hasFunctionBody && l.size() != 1)
{
- failParse();
throw backtrack; //TODO Should be an IProblem
}
if (i.hasNext()) // no need to do this unless we have a declarator
@@ -928,7 +934,7 @@
IASTDeclaration declaration = (IASTDeclaration)i.next();
declaration.enterScope( requestor );
- handleFunctionBody(declarator);
+ handleFunctionBody((IASTScope)declaration);
((IASTOffsetableElement)declaration).setEndingOffset(
lastToken.getEndOffset());
@@ -948,7 +954,7 @@
}
}
- protected void handleFunctionBody(Declarator d) throws Backtrack, EndOfFile
+ protected void handleFunctionBody(IASTScope scope) throws Backtrack, EndOfFile
{
if ( mode == ParserMode.QUICK_PARSE ) // TODO - Enable parsing within function bodies i.e. mode == ParserMode.QUICK_PARSE)
{
@@ -971,7 +977,7 @@
}
else
{
- functionBody();
+ functionBody(scope);
}
}
/**
@@ -1668,15 +1674,22 @@
IToken mark = mark();
if (LT(1) == IToken.tCOLONCOLON)
- last = consume();
+ last = consume( IToken.tCOLONCOLON );
// TODO - whacky way to deal with destructors, please revisit
if (LT(1) == IToken.tCOMPL)
consume();
switch (LT(1))
{
case IToken.tIDENTIFIER :
- last = consume();
- last = consumeTemplateParameters(last);
+ last = consume(IToken.tIDENTIFIER);
+ IToken secondMark = mark();
+ try
+ {
+ last = consumeTemplateParameters(last);
+ } catch( Backtrack bt )
+ {
+ backup( secondMark );
+ }
break;
default :
backup(mark);
@@ -1753,12 +1766,20 @@
}
else if (LT(1) == IToken.tLPAREN)
{
+ IToken mark = mark();
// initializer in constructor
- consume(IToken.tLPAREN); // EAT IT!
- IASTExpression astExpression = null;
- astExpression = expression(sdw.getScope());
- consume(IToken.tRPAREN);
- d.setConstructorExpression(astExpression);
+ try
+ {
+ consume(IToken.tLPAREN); // EAT IT!
+ IASTExpression astExpression = null;
+ astExpression = expression(sdw.getScope());
+ consume(IToken.tRPAREN);
+ d.setConstructorExpression(astExpression);
+ } catch( Backtrack bt )
+ {
+ backup( mark );
+ throw bt;
+ }
}
sdw.addDeclarator(d);
return d;
@@ -1902,35 +1923,57 @@
if( forKR )
throw backtrack;
+
+
// temporary fix for initializer/function declaration ambiguity
if (!LA(2).looksLikeExpression() && strategy != SimpleDeclarationStrategy.TRY_VARIABLE )
{
- // parameterDeclarationClause
- d.setIsFunction(true);
- // TODO need to create a temporary scope object here
- consume();
- boolean seenParameter = false;
- parameterDeclarationLoop : for (;;)
- {
- switch (LT(1))
- {
- case IToken.tRPAREN :
- consume();
- break parameterDeclarationLoop;
- case IToken.tELIPSE :
- consume();
- break;
- case IToken.tCOMMA :
- consume();
- seenParameter = false;
- break;
- default :
- if (seenParameter)
- throw backtrack;
- parameterDeclaration(d, scope);
- seenParameter = true;
- }
- }
+ boolean failed = false;
+ if( LT(2) == IToken.tIDENTIFIER )
+ {
+ IToken newMark = mark();
+ consume( IToken.tLPAREN );
+
+ try
+ {
+ if( ! astFactory.queryIsTypeName( scope, name() ) )
+ failed = true;
+ } catch( Backtrack b )
+ {
+ failed = true;
+ }
+
+ backup( newMark );
+ }
+ if( !failed )
+ {
+ // parameterDeclarationClause
+ d.setIsFunction(true);
+ // TODO need to create a temporary scope object here
+ consume(IToken.tLPAREN);
+ boolean seenParameter = false;
+ parameterDeclarationLoop : for (;;)
+ {
+ switch (LT(1))
+ {
+ case IToken.tRPAREN :
+ consume();
+ break parameterDeclarationLoop;
+ case IToken.tELIPSE :
+ consume();
+ break;
+ case IToken.tCOMMA :
+ consume();
+ seenParameter = false;
+ break;
+ default :
+ if (seenParameter)
+ throw backtrack;
+ parameterDeclaration(d, scope);
+ seenParameter = true;
+ }
+ }
+ }
if (LT(1) == IToken.tCOLON)
{
@@ -2550,9 +2593,9 @@
*
* @throws Backtrack request a backtrack
*/
- protected void functionBody() throws Backtrack
+ protected void functionBody( IASTScope scope ) throws Backtrack
{
- compoundStatement();
+ compoundStatement( scope, false );
}
/**
* Parses a statement.
@@ -2565,67 +2608,80 @@
switch (LT(1))
{
case IToken.t_case :
- consume();
- constantExpression(scope);
+ consume(IToken.t_case);
+ IASTExpression constant_expression = constantExpression(scope);
+ constant_expression.acceptElement(requestor);
consume(IToken.tCOLON);
- statement(null);
+ statement(scope);
return;
case IToken.t_default :
- consume();
+ consume(IToken.t_default);
consume(IToken.tCOLON);
- statement(null);
+ statement(scope);
return;
case IToken.tLBRACE :
- compoundStatement();
+ compoundStatement(scope, true);
return;
case IToken.t_if :
- consume();
+ consume( IToken.t_if );
consume(IToken.tLPAREN);
- condition();
+ condition( scope );
consume(IToken.tRPAREN);
- statement(null);
+ if( LT(1) != IToken.tLBRACE )
+ statement( astFactory.createNewCodeBlock( scope ) );
+ else
+ statement(scope);
if (LT(1) == IToken.t_else)
{
- consume();
- statement(null);
+ consume( IToken.t_else );
+ if( LT(1) != IToken.tLBRACE )
+ statement( astFactory.createNewCodeBlock( scope ) );
+ else
+ statement( scope );
}
return;
case IToken.t_switch :
consume();
consume(IToken.tLPAREN);
- condition();
+ condition(scope);
consume(IToken.tRPAREN);
- statement(null);
+ statement(scope);
return;
case IToken.t_while :
- consume();
+ consume(IToken.t_while);
consume(IToken.tLPAREN);
- condition();
+ condition(scope);
consume(IToken.tRPAREN);
- statement(null);
+ if( LT(1) != IToken.tLBRACE )
+ statement(astFactory.createNewCodeBlock(scope));
+ else
+ statement(scope);
return;
case IToken.t_do :
- consume();
- statement(null);
+ consume(IToken.t_do);
+ if( LT(1) != IToken.tLBRACE )
+ statement(astFactory.createNewCodeBlock(scope));
+ else
+ statement(scope);
consume(IToken.t_while);
consume(IToken.tLPAREN);
- condition();
+ condition(scope);
consume(IToken.tRPAREN);
return;
case IToken.t_for :
consume();
consume(IToken.tLPAREN);
- forInitStatement();
+ forInitStatement(scope);
if (LT(1) != IToken.tSEMI)
- condition();
+ condition(scope);
consume(IToken.tSEMI);
if (LT(1) != IToken.tRPAREN)
- {
- //TODO get rid of NULL
- expression(scope);
+ {
+ IASTExpression finalExpression = expression(scope);
+ finalExpression.acceptElement(requestor);
}
consume(IToken.tRPAREN);
- statement(null);
+ statement(scope);
return;
case IToken.t_break :
consume();
@@ -2639,8 +2695,8 @@
consume();
if (LT(1) != IToken.tSEMI)
{
- //TODO get rid of NULL
- expression(scope);
+ IASTExpression retVal = expression(scope);
+ retVal.acceptElement(requestor);
}
consume(IToken.tSEMI);
return;
@@ -2651,14 +2707,14 @@
return;
case IToken.t_try :
consume();
- compoundStatement();
+ compoundStatement(scope,true);
while (LT(1) == IToken.t_catch)
{
consume();
consume(IToken.tLPAREN);
- declaration(null, null); // was exceptionDeclaration
+ declaration(scope, null); // was exceptionDeclaration
consume(IToken.tRPAREN);
- compoundStatement();
+ compoundStatement(scope, true);
}
return;
case IToken.tSEMI :
@@ -2669,50 +2725,97 @@
// label
if (LT(1) == IToken.tIDENTIFIER && LT(2) == IToken.tCOLON)
{
- consume();
- consume();
- statement(null);
+ consume(IToken.tIDENTIFIER);
+ consume(IToken.tCOLON);
+ statement(scope);
return;
}
// expressionStatement
// Note: the function style cast ambiguity is handled in expression
// Since it only happens when we are in a statement
+ IToken mark = mark();
try
{
- expression(scope);
+ IASTExpression thisExpression = expression(scope);
consume(IToken.tSEMI);
+ thisExpression.acceptElement( requestor );
return;
}
catch (Backtrack b)
{
+ backup( mark );
}
// declarationStatement
- declaration(null, null);
+ declaration(scope, null);
}
}
+
/**
* @throws Backtrack
*/
- protected void condition() throws Backtrack
+ protected void condition( IASTScope scope ) throws Backtrack
{
- // TO DO
+ IASTExpression someExpression = expression( scope );
+ someExpression.acceptElement(requestor);
+ //TODO type-specifier-seq declarator = assignment expression
}
+
/**
* @throws Backtrack
*/
- protected void forInitStatement() throws Backtrack
+ protected void forInitStatement( IASTScope scope ) throws Backtrack
{
- // TO DO
+ try
+ {
+ simpleDeclarationStrategyUnion(scope,null);
+ }
+ catch( Backtrack bt )
+ {
+ try
+ {
+ IASTExpression e = expression( scope );
+ e.acceptElement(requestor);
+ }
+ catch( Backtrack b )
+ {
+ failParse();
+ throw b;
+ }
+ }
+
}
/**
* @throws Backtrack
*/
- protected void compoundStatement() throws Backtrack
+ protected void compoundStatement( IASTScope scope, boolean createNewScope ) throws Backtrack
{
consume(IToken.tLBRACE);
+
+ IASTCodeScope newScope = null;
+ if( createNewScope )
+ {
+ newScope = astFactory.createNewCodeBlock(scope);
+ newScope.enterScope( requestor );
+ }
+ IToken checkToken = null;
while (LT(1) != IToken.tRBRACE)
- statement(null);
- consume();
+ {
+ checkToken = LA(1);
+ try
+ {
+ statement(createNewScope ? newScope : scope );
+ }
+ catch( Backtrack b )
+ {
+ failParse();
+ if( LA(1) == checkToken )
+ errorHandling();
+ }
+ }
+
+ consume(IToken.tRBRACE);
+ if( createNewScope )
+ newScope.exitScope( requestor );
}
/**
* @param expression
@@ -2757,61 +2860,79 @@
* @param expression
* @throws Backtrack
*/
- protected IASTExpression assignmentExpression( IASTScope scope )
- throws Backtrack
- {
- if (LT(1) == IToken.t_throw)
- {
- return throwExpression(scope);
- }
- IASTExpression conditionalExpression =
- conditionalExpression(scope);
- // if the condition not taken, try assignment operators
- if (conditionalExpression != null
- && conditionalExpression.getExpressionKind()
- == IASTExpression.Kind.CONDITIONALEXPRESSION_HARD)
- return conditionalExpression;
- switch (LT(1))
- {
- case IToken.tASSIGN :
- return assignmentOperatorExpression( scope,
- IASTExpression.Kind.ASSIGNMENTEXPRESSION_NORMAL);
- case IToken.tSTARASSIGN :
- return assignmentOperatorExpression(scope,
- IASTExpression.Kind.ASSIGNMENTEXPRESSION_MULT);
- case IToken.tDIVASSIGN :
- return assignmentOperatorExpression(scope,
- IASTExpression.Kind.ASSIGNMENTEXPRESSION_DIV);
- case IToken.tMODASSIGN :
- return assignmentOperatorExpression(scope,
- IASTExpression.Kind.ASSIGNMENTEXPRESSION_MOD);
- case IToken.tPLUSASSIGN :
- return assignmentOperatorExpression(scope,
- IASTExpression.Kind.ASSIGNMENTEXPRESSION_PLUS);
- case IToken.tMINUSASSIGN :
- return assignmentOperatorExpression(scope,
- IASTExpression.Kind.ASSIGNMENTEXPRESSION_MINUS);
- case IToken.tSHIFTRASSIGN :
- return assignmentOperatorExpression(scope,
- IASTExpression.Kind.ASSIGNMENTEXPRESSION_RSHIFT);
- case IToken.tSHIFTLASSIGN :
- return assignmentOperatorExpression(scope,
- IASTExpression.Kind.ASSIGNMENTEXPRESSION_LSHIFT);
- case IToken.tAMPERASSIGN :
- return assignmentOperatorExpression(scope,
- IASTExpression.Kind.ASSIGNMENTEXPRESSION_AND);
- case IToken.tXORASSIGN :
- return assignmentOperatorExpression(scope,
- IASTExpression.Kind.ASSIGNMENTEXPRESSION_XOR);
- case IToken.tBITORASSIGN :
- return assignmentOperatorExpression(scope,
- IASTExpression.Kind.ASSIGNMENTEXPRESSION_OR);
- }
- return conditionalExpression;
- }
+ protected IASTExpression assignmentExpression(IASTScope scope)
+ throws Backtrack {
+ if (LT(1) == IToken.t_throw) {
+ return throwExpression(scope);
+ }
+ IASTExpression conditionalExpression = conditionalExpression(scope);
+ // if the condition not taken, try assignment operators
+ if (conditionalExpression != null
+ && conditionalExpression.getExpressionKind()
+ == IASTExpression.Kind.CONDITIONALEXPRESSION_HARD)
+ return conditionalExpression;
+ switch (LT(1)) {
+ case IToken.tASSIGN :
+ return assignmentOperatorExpression(
+ scope,
+ IASTExpression.Kind.ASSIGNMENTEXPRESSION_NORMAL,
+ conditionalExpression);
+ case IToken.tSTARASSIGN :
+ return assignmentOperatorExpression(
+ scope,
+ IASTExpression.Kind.ASSIGNMENTEXPRESSION_MULT,
+ conditionalExpression);
+ case IToken.tDIVASSIGN :
+ return assignmentOperatorExpression(
+ scope,
+ IASTExpression.Kind.ASSIGNMENTEXPRESSION_DIV,
+ conditionalExpression);
+ case IToken.tMODASSIGN :
+ return assignmentOperatorExpression(
+ scope,
+ IASTExpression.Kind.ASSIGNMENTEXPRESSION_MOD,
+ conditionalExpression);
+ case IToken.tPLUSASSIGN :
+ return assignmentOperatorExpression(
+ scope,
+ IASTExpression.Kind.ASSIGNMENTEXPRESSION_PLUS,
+ conditionalExpression);
+ case IToken.tMINUSASSIGN :
+ return assignmentOperatorExpression(
+ scope,
+ IASTExpression.Kind.ASSIGNMENTEXPRESSION_MINUS,
+ conditionalExpression);
+ case IToken.tSHIFTRASSIGN :
+ return assignmentOperatorExpression(
+ scope,
+ IASTExpression.Kind.ASSIGNMENTEXPRESSION_RSHIFT,
+ conditionalExpression);
+ case IToken.tSHIFTLASSIGN :
+ return assignmentOperatorExpression(
+ scope,
+ IASTExpression.Kind.ASSIGNMENTEXPRESSION_LSHIFT,
+ conditionalExpression);
+ case IToken.tAMPERASSIGN :
+ return assignmentOperatorExpression(
+ scope,
+ IASTExpression.Kind.ASSIGNMENTEXPRESSION_AND,
+ conditionalExpression);
+ case IToken.tXORASSIGN :
+ return assignmentOperatorExpression(
+ scope,
+ IASTExpression.Kind.ASSIGNMENTEXPRESSION_XOR,
+ conditionalExpression);
+ case IToken.tBITORASSIGN :
+ return assignmentOperatorExpression(
+ scope,
+ IASTExpression.Kind.ASSIGNMENTEXPRESSION_OR,
+ conditionalExpression);
+ }
+ return conditionalExpression;
+ }
protected IASTExpression assignmentOperatorExpression(
IASTScope scope,
- IASTExpression.Kind kind)
+ IASTExpression.Kind kind, IASTExpression lhs )
throws EndOfFile, Backtrack
{
IToken t = consume();
@@ -2822,8 +2943,8 @@
return astFactory.createExpression(
scope,
kind,
- assignmentExpression,
- null,
+ lhs,
+ assignmentExpression,
null,
null,
"", null);
Index: parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTCodeScope.java
===================================================================
RCS file: parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTCodeScope.java
diff -N parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTCodeScope.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTCodeScope.java 4 Sep 2003 20:40:15 -0000
@@ -0,0 +1,48 @@
+/*
+ * Created on Sep 2, 2003
+ *
+ * To change the template for this generated file go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+package org.eclipse.cdt.internal.core.parser.ast.complete;
+
+import org.eclipse.cdt.core.parser.ISourceElementRequestor;
+import org.eclipse.cdt.core.parser.ast.IASTCodeScope;
+import org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol;
+
+/**
+ * @author jcamelon
+ *
+ * To change the template for this generated type comment go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+public class ASTCodeScope extends ASTScope implements IASTCodeScope {
+
+ /**
+ * @param newScope
+ */
+ public ASTCodeScope(IContainerSymbol newScope) {
+ super( newScope );
+ }
+
+ /* (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) {
+ requestor.enterCodeBlock( this );
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor)
+ */
+ public void exitScope(ISourceElementRequestor requestor) {
+ requestor.exitCodeBlock( this );
+ }
+
+}
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.25
diff -u -r1.25 CompleteParseASTFactory.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java 4 Sep 2003 14:39:15 -0000 1.25
+++ parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java 4 Sep 2003 20:40:16 -0000
@@ -27,6 +27,7 @@
import org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTArrayModifier;
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
+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.IASTElaboratedTypeSpecifier;
@@ -102,7 +103,7 @@
// looking for a function
result = startingScope.qualifiedFunctionLookup(name, new LinkedList(parameters));
}else{
- // looking for a class
+ // looking for something else
result = startingScope.qualifiedLookup(name, type);
}
if( result != null )
@@ -1008,7 +1009,7 @@
(IParameterizedSymbol) lookupQualifiedName(parentScope, functionName, TypeInfo.t_function, parameters, 0, functionReferences, false);
if(methodDeclaration != null){
ASTMethodReference reference = (ASTMethodReference) functionReferences.iterator().next();
- visibility = ((IASTMethod)reference.getReferencedElement()).getVisiblity();
+ visibility = ((IASTMethod)reference.getReferencedElement()).getVisiblity();
}
return createMethod(scope, functionName, parameters, returnType,
exception, isInline, isFriend, isStatic, startOffset, offset,
@@ -1246,27 +1247,34 @@
if( returnType.getTypeSpecifier() != null )
setParameter( symbol, returnType, false, references );
setParameters( symbol, references, parameters.iterator() );
-
- try
- {
- ownerScope.addSymbol( symbol );
- }
- catch (ParserSymbolTableException e)
- {
- throw new ASTSemanticException();
- }
-
+
// check constructor / destructor if no return type
if ( returnType.getTypeSpecifier() == null ){
if(parentName.indexOf(DOUBLE_COLON) != -1){
parentName = parentName.substring(parentName.lastIndexOf(DOUBLE_COLON) + DOUBLE_COLON.length());
}
- if( parentName.equals(name) ){
+ if( parentName.equals(name) ){
isConstructor = true;
- } else if(name.startsWith(TELTA) && parentName.equals(name.substring(1))){
- isDestructor = true;
- }
+ } else if(name.startsWith(TELTA) && parentName.equals(name.substring(1))){
+ isDestructor = true;
+ }
}
+
+ try
+ {
+ if( !isConstructor )
+ ownerScope.addSymbol( symbol );
+ else
+ {
+ symbol.setType( TypeInfo.t_constructor );
+ ((IDerivableContainerSymbol)ownerScope).addConstructor( symbol );
+ }
+ }
+ catch (ParserSymbolTableException e)
+ {
+ throw new ASTSemanticException();
+ }
+
ASTMethod method = new ASTMethod( symbol, parameters, returnType, exception, startOffset, nameOffset, ownerTemplate, references, isConstructor, isDestructor, isPureVirtual, visibility, constructorChain );
try
@@ -1642,4 +1650,36 @@
}
return astAlias;
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createNewCodeBlock(org.eclipse.cdt.core.parser.ast.IASTScope)
+ */
+ public IASTCodeScope createNewCodeBlock(IASTScope scope) {
+ IContainerSymbol symbol = scopeToSymbol( scope );
+
+ IContainerSymbol newScope = pst.newContainerSymbol("");
+ newScope.setContainingSymbol(symbol);
+
+ return new ASTCodeScope( newScope );
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTFactory#queryIsTypeName(org.eclipse.cdt.core.parser.ITokenDuple)
+ */
+ public boolean queryIsTypeName(IASTScope scope, ITokenDuple nameInQuestion) {
+ ISymbol lookupSymbol = null;
+ try {
+ lookupSymbol =
+ lookupQualifiedName(
+ scopeToSymbol(scope),
+ nameInQuestion,
+ new ArrayList(),
+ false);
+ } catch (ASTSemanticException e) {
+ // won't get thrown
+ }
+ if( lookupSymbol == null ) return false;
+ if( lookupSymbol.isType( TypeInfo.t_type, TypeInfo.t_enumeration ) ) return true;
+ return false;
+ }
}
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.30
diff -u -r1.30 QuickParseASTFactory.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java 4 Sep 2003 14:39:15 -0000 1.30
+++ parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java 4 Sep 2003 20:40:16 -0000
@@ -12,7 +12,6 @@
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.ASTAccessVisibility;
import org.eclipse.cdt.core.parser.ast.ASTClassKind;
@@ -22,6 +21,7 @@
import org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
+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.IASTElaboratedTypeSpecifier;
@@ -276,4 +276,18 @@
{
return new ASTNamespaceAlias( scope, identifier, alias.toString(), startingOffset, nameOffset, endOffset );
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createNewCodeBlock(org.eclipse.cdt.core.parser.ast.IASTScope)
+ */
+ public IASTCodeScope createNewCodeBlock(IASTScope scope) {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTFactory#queryIsTypeName(org.eclipse.cdt.core.parser.ITokenDuple)
+ */
+ public boolean queryIsTypeName(IASTScope scope, ITokenDuple nameInQuestion) {
+ return true; // we have no information to say that it is not
+ }
}
Index: search/org/eclipse/cdt/internal/core/search/matching/MatchLocator.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/MatchLocator.java,v
retrieving revision 1.21
diff -u -r1.21 MatchLocator.java
--- search/org/eclipse/cdt/internal/core/search/matching/MatchLocator.java 26 Aug 2003 19:15:58 -0000 1.21
+++ search/org/eclipse/cdt/internal/core/search/matching/MatchLocator.java 4 Sep 2003 20:40:16 -0000
@@ -453,4 +453,20 @@
System.out.println("(" + Thread.currentThread() + ") " + log);
}
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterCodeBlock(org.eclipse.cdt.core.parser.ast.IASTScope)
+ */
+ public void enterCodeBlock(IASTScope scope) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitCodeBlock(org.eclipse.cdt.core.parser.ast.IASTScope)
+ */
+ public void exitCodeBlock(IASTScope scope) {
+ // TODO Auto-generated method stub
+
+ }
+
}