1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00
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.
This commit is contained in:
John Camelon 2003-09-04 20:47:05 +00:00
parent 55efa70a8a
commit 619b617056
18 changed files with 566 additions and 177 deletions

View file

@ -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 2003-09-04 Hoda Amer
Call to ASTExpression getTypeId() changed to getTypeIdString(). Call to ASTExpression getTypeId() changed to getTypeIdString().

View file

@ -272,9 +272,7 @@ public class ASTFailedTests extends BaseASTTest
catch (IOException ioe) catch (IOException ioe)
{ {
} }
Iterator declarations = parse(code.toString()).getDeclarations(); assertCodeFailsFullParse(code.toString());
IASTDeclaration d = (IASTDeclaration)declarations.next();
assertFalse( "Should be 1 declaration, not 2", !declarations.hasNext() );
} }
public void testBug39703() throws Exception public void testBug39703() throws Exception
{ {

View file

@ -506,7 +506,7 @@ public class CompleteParseASTTest extends CompleteParseBaseTest
public void testBug41520() throws Exception 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 variableX = (IASTVariable)i.next();
IASTVariable variableY = (IASTVariable)i.next(); IASTVariable variableY = (IASTVariable)i.next();
assertFalse( i.hasNext() ); assertFalse( i.hasNext() );
@ -552,7 +552,7 @@ public class CompleteParseASTTest extends CompleteParseBaseTest
public void testIsDestructor() throws Exception 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(); IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();
IASTMethod method = (IASTMethod)i.next(); IASTMethod method = (IASTMethod)i.next();
assertTrue (method.isDestructor()); assertTrue (method.isDestructor());
@ -567,4 +567,34 @@ public class CompleteParseASTTest extends CompleteParseBaseTest
IASTClassSpecifier classB = (IASTClassSpecifier) ((IASTAbstractTypeSpecifierDeclaration)sub.next()).getTypeSpecifier(); IASTClassSpecifier classB = (IASTClassSpecifier) ((IASTAbstractTypeSpecifierDeclaration)sub.next()).getTypeSpecifier();
IASTClassSpecifier structA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)( getDeclarations( classB ).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 );
}
} }

View file

@ -524,6 +524,22 @@ public class CompleteParseBaseTest extends TestCase
return forewardDecls; 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) protected Iterator getDeclarations(IASTScope scope)
{ {

View file

@ -29,6 +29,7 @@ import org.eclipse.cdt.core.parser.ast.IASTMethod;
import org.eclipse.cdt.core.parser.ast.IASTMethodReference; import org.eclipse.cdt.core.parser.ast.IASTMethodReference;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition; import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceReference; 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.IASTSimpleTypeSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration; import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation; import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation;
@ -959,4 +960,18 @@ public class DOMBuilder implements ISourceElementRequestor
// TODO Auto-generated method stub // 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
}
} }

View file

@ -36,6 +36,7 @@ import org.eclipse.cdt.core.parser.ast.IASTMethod;
import org.eclipse.cdt.core.parser.ast.IASTMethodReference; import org.eclipse.cdt.core.parser.ast.IASTMethodReference;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition; import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceReference; 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.IASTTemplateDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation; import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation;
import org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization; import org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization;
@ -416,4 +417,18 @@ public class SourceIndexerRequestor implements ISourceElementRequestor, IIndexCo
public void acceptElaboratedForewardDeclaration(IASTElaboratedTypeSpecifier elaboratedType){ public void acceptElaboratedForewardDeclaration(IASTElaboratedTypeSpecifier elaboratedType){
indexer.addElaboratedForwardDeclaration(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
}
} }

View file

@ -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 2003-09-03 Andrew Niefer
fix bug in PST that prevents > 2 constructors fix bug in PST that prevents > 2 constructors

View file

@ -29,6 +29,7 @@ import org.eclipse.cdt.core.parser.ast.IASTMethod;
import org.eclipse.cdt.core.parser.ast.IASTMethodReference; import org.eclipse.cdt.core.parser.ast.IASTMethodReference;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition; import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceReference; 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.IASTTemplateDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation; import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation;
import org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization; import org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization;
@ -60,6 +61,8 @@ public interface ISourceElementRequestor {
public void enterFunctionBody( IASTFunction function ); public void enterFunctionBody( IASTFunction function );
public void exitFunctionBody( IASTFunction function ); public void exitFunctionBody( IASTFunction function );
public void enterCodeBlock( IASTScope scope );
public void exitCodeBlock( IASTScope scope );
public void enterCompilationUnit( IASTCompilationUnit compilationUnit ); public void enterCompilationUnit( IASTCompilationUnit compilationUnit );
public void enterInclusion( IASTInclusion inclusion ); public void enterInclusion( IASTInclusion inclusion );

View file

@ -0,0 +1,19 @@
/*
* Created on Sep 2, 2003
*
* To change the template for this generated file go to
* Window&gt;Preferences&gt;Java&gt;Code Generation&gt;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&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
*/
public interface IASTCodeScope extends IASTScope, ISourceElementCallbackDelegate{
}

View file

@ -11,7 +11,6 @@
package org.eclipse.cdt.core.parser.ast; package org.eclipse.cdt.core.parser.ast;
import java.util.List; import java.util.List;
import org.eclipse.cdt.core.parser.IToken;
import org.eclipse.cdt.core.parser.ITokenDuple; import org.eclipse.cdt.core.parser.ITokenDuple;
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier.ClassNameType; import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier.ClassNameType;
import org.eclipse.cdt.core.parser.ast.IASTExpression.IASTNewExpressionDescriptor; import org.eclipse.cdt.core.parser.ast.IASTExpression.IASTNewExpressionDescriptor;
@ -192,7 +191,14 @@ public interface IASTFactory
public IASTAbstractTypeSpecifierDeclaration createTypeSpecDeclaration( IASTScope scope, IASTTypeSpecifier typeSpecifier, IASTTemplate template, int startingOffset, int endingOffset); 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 DOUBLE_COLON = "::";
static final String TELTA = "~"; static final String TELTA = "~";
/**
* @param scope
* @return
*/
public IASTCodeScope createNewCodeBlock(IASTScope scope);
} }

View file

@ -21,6 +21,7 @@ import org.eclipse.cdt.core.parser.ast.IASTMethod;
import org.eclipse.cdt.core.parser.ast.IASTMethodReference; import org.eclipse.cdt.core.parser.ast.IASTMethodReference;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition; import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceReference; 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.IASTTemplateDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation; import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation;
import org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization; import org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization;
@ -406,4 +407,20 @@ public class NullSourceElementRequestor implements ISourceElementRequestor
// TODO Auto-generated method stub // 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
}
} }

View file

@ -33,6 +33,7 @@ import org.eclipse.cdt.core.parser.ast.ASTSemanticException;
import org.eclipse.cdt.core.parser.ast.IASTASMDefinition; import org.eclipse.cdt.core.parser.ast.IASTASMDefinition;
import org.eclipse.cdt.core.parser.ast.IASTArrayModifier; import org.eclipse.cdt.core.parser.ast.IASTArrayModifier;
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier; 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.IASTCompilationUnit;
import org.eclipse.cdt.core.parser.ast.IASTDeclaration; import org.eclipse.cdt.core.parser.ast.IASTDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier; import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier;
@ -704,11 +705,19 @@ public class Parser implements IParser
{ {
backup( mark ); backup( mark );
simpleDeclaration( try
SimpleDeclarationStrategy.TRY_VARIABLE, {
false, simpleDeclaration(
scope, SimpleDeclarationStrategy.TRY_VARIABLE,
ownerTemplate); false,
scope,
ownerTemplate);
}
catch( Backtrack b3 )
{
backup( mark );
throw b3;
}
} }
} }
} }
@ -853,7 +862,6 @@ public class Parser implements IParser
sdw.isUnsigned(), sdw.isTypeNamed())); sdw.isUnsigned(), sdw.isTypeNamed()));
} catch( ASTSemanticException se ) } catch( ASTSemanticException se )
{ {
failParse();
throw backtrack; throw backtrack;
} }
@ -902,13 +910,11 @@ public class Parser implements IParser
} }
catch (ASTSemanticException e) catch (ASTSemanticException e)
{ {
failParse();
throw backtrack; throw backtrack;
} }
Iterator i = l.iterator(); Iterator i = l.iterator();
if (hasFunctionBody && l.size() != 1) if (hasFunctionBody && l.size() != 1)
{ {
failParse();
throw backtrack; //TODO Should be an IProblem throw backtrack; //TODO Should be an IProblem
} }
if (i.hasNext()) // no need to do this unless we have a declarator if (i.hasNext()) // no need to do this unless we have a declarator
@ -928,7 +934,7 @@ public class Parser implements IParser
IASTDeclaration declaration = (IASTDeclaration)i.next(); IASTDeclaration declaration = (IASTDeclaration)i.next();
declaration.enterScope( requestor ); declaration.enterScope( requestor );
handleFunctionBody(declarator); handleFunctionBody((IASTScope)declaration);
((IASTOffsetableElement)declaration).setEndingOffset( ((IASTOffsetableElement)declaration).setEndingOffset(
lastToken.getEndOffset()); lastToken.getEndOffset());
@ -948,7 +954,7 @@ public class Parser implements IParser
} }
} }
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) if ( mode == ParserMode.QUICK_PARSE ) // TODO - Enable parsing within function bodies i.e. mode == ParserMode.QUICK_PARSE)
{ {
@ -971,7 +977,7 @@ public class Parser implements IParser
} }
else else
{ {
functionBody(); functionBody(scope);
} }
} }
/** /**
@ -1668,15 +1674,22 @@ public class Parser implements IParser
IToken mark = mark(); IToken mark = mark();
if (LT(1) == IToken.tCOLONCOLON) if (LT(1) == IToken.tCOLONCOLON)
last = consume(); last = consume( IToken.tCOLONCOLON );
// TODO - whacky way to deal with destructors, please revisit // TODO - whacky way to deal with destructors, please revisit
if (LT(1) == IToken.tCOMPL) if (LT(1) == IToken.tCOMPL)
consume(); consume();
switch (LT(1)) switch (LT(1))
{ {
case IToken.tIDENTIFIER : case IToken.tIDENTIFIER :
last = consume(); last = consume(IToken.tIDENTIFIER);
last = consumeTemplateParameters(last); IToken secondMark = mark();
try
{
last = consumeTemplateParameters(last);
} catch( Backtrack bt )
{
backup( secondMark );
}
break; break;
default : default :
backup(mark); backup(mark);
@ -1753,12 +1766,20 @@ public class Parser implements IParser
} }
else if (LT(1) == IToken.tLPAREN) else if (LT(1) == IToken.tLPAREN)
{ {
IToken mark = mark();
// initializer in constructor // initializer in constructor
consume(IToken.tLPAREN); // EAT IT! try
IASTExpression astExpression = null; {
astExpression = expression(sdw.getScope()); consume(IToken.tLPAREN); // EAT IT!
consume(IToken.tRPAREN); IASTExpression astExpression = null;
d.setConstructorExpression(astExpression); astExpression = expression(sdw.getScope());
consume(IToken.tRPAREN);
d.setConstructorExpression(astExpression);
} catch( Backtrack bt )
{
backup( mark );
throw bt;
}
} }
sdw.addDeclarator(d); sdw.addDeclarator(d);
return d; return d;
@ -1902,35 +1923,57 @@ public class Parser implements IParser
if( forKR ) if( forKR )
throw backtrack; throw backtrack;
// temporary fix for initializer/function declaration ambiguity // temporary fix for initializer/function declaration ambiguity
if (!LA(2).looksLikeExpression() && strategy != SimpleDeclarationStrategy.TRY_VARIABLE ) if (!LA(2).looksLikeExpression() && strategy != SimpleDeclarationStrategy.TRY_VARIABLE )
{ {
// parameterDeclarationClause boolean failed = false;
d.setIsFunction(true); if( LT(2) == IToken.tIDENTIFIER )
// TODO need to create a temporary scope object here {
consume(); IToken newMark = mark();
boolean seenParameter = false; consume( IToken.tLPAREN );
parameterDeclarationLoop : for (;;)
{ try
switch (LT(1)) {
{ if( ! astFactory.queryIsTypeName( scope, name() ) )
case IToken.tRPAREN : failed = true;
consume(); } catch( Backtrack b )
break parameterDeclarationLoop; {
case IToken.tELIPSE : failed = true;
consume(); }
break;
case IToken.tCOMMA : backup( newMark );
consume(); }
seenParameter = false; if( !failed )
break; {
default : // parameterDeclarationClause
if (seenParameter) d.setIsFunction(true);
throw backtrack; // TODO need to create a temporary scope object here
parameterDeclaration(d, scope); consume(IToken.tLPAREN);
seenParameter = true; 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) if (LT(1) == IToken.tCOLON)
{ {
@ -2550,9 +2593,9 @@ public class Parser implements IParser
* *
* @throws Backtrack request a backtrack * @throws Backtrack request a backtrack
*/ */
protected void functionBody() throws Backtrack protected void functionBody( IASTScope scope ) throws Backtrack
{ {
compoundStatement(); compoundStatement( scope, false );
} }
/** /**
* Parses a statement. * Parses a statement.
@ -2565,67 +2608,80 @@ public class Parser implements IParser
switch (LT(1)) switch (LT(1))
{ {
case IToken.t_case : case IToken.t_case :
consume(); consume(IToken.t_case);
constantExpression(scope); IASTExpression constant_expression = constantExpression(scope);
constant_expression.acceptElement(requestor);
consume(IToken.tCOLON); consume(IToken.tCOLON);
statement(null); statement(scope);
return; return;
case IToken.t_default : case IToken.t_default :
consume(); consume(IToken.t_default);
consume(IToken.tCOLON); consume(IToken.tCOLON);
statement(null); statement(scope);
return; return;
case IToken.tLBRACE : case IToken.tLBRACE :
compoundStatement(); compoundStatement(scope, true);
return; return;
case IToken.t_if : case IToken.t_if :
consume(); consume( IToken.t_if );
consume(IToken.tLPAREN); consume(IToken.tLPAREN);
condition(); condition( scope );
consume(IToken.tRPAREN); consume(IToken.tRPAREN);
statement(null); if( LT(1) != IToken.tLBRACE )
statement( astFactory.createNewCodeBlock( scope ) );
else
statement(scope);
if (LT(1) == IToken.t_else) if (LT(1) == IToken.t_else)
{ {
consume(); consume( IToken.t_else );
statement(null); if( LT(1) != IToken.tLBRACE )
statement( astFactory.createNewCodeBlock( scope ) );
else
statement( scope );
} }
return; return;
case IToken.t_switch : case IToken.t_switch :
consume(); consume();
consume(IToken.tLPAREN); consume(IToken.tLPAREN);
condition(); condition(scope);
consume(IToken.tRPAREN); consume(IToken.tRPAREN);
statement(null); statement(scope);
return; return;
case IToken.t_while : case IToken.t_while :
consume();
consume(IToken.tLPAREN);
condition();
consume(IToken.tRPAREN);
statement(null);
return;
case IToken.t_do :
consume();
statement(null);
consume(IToken.t_while); consume(IToken.t_while);
consume(IToken.tLPAREN); consume(IToken.tLPAREN);
condition(); condition(scope);
consume(IToken.tRPAREN);
if( LT(1) != IToken.tLBRACE )
statement(astFactory.createNewCodeBlock(scope));
else
statement(scope);
return;
case IToken.t_do :
consume(IToken.t_do);
if( LT(1) != IToken.tLBRACE )
statement(astFactory.createNewCodeBlock(scope));
else
statement(scope);
consume(IToken.t_while);
consume(IToken.tLPAREN);
condition(scope);
consume(IToken.tRPAREN); consume(IToken.tRPAREN);
return; return;
case IToken.t_for : case IToken.t_for :
consume(); consume();
consume(IToken.tLPAREN); consume(IToken.tLPAREN);
forInitStatement(); forInitStatement(scope);
if (LT(1) != IToken.tSEMI) if (LT(1) != IToken.tSEMI)
condition(); condition(scope);
consume(IToken.tSEMI); consume(IToken.tSEMI);
if (LT(1) != IToken.tRPAREN) if (LT(1) != IToken.tRPAREN)
{ {
//TODO get rid of NULL IASTExpression finalExpression = expression(scope);
expression(scope); finalExpression.acceptElement(requestor);
} }
consume(IToken.tRPAREN); consume(IToken.tRPAREN);
statement(null); statement(scope);
return; return;
case IToken.t_break : case IToken.t_break :
consume(); consume();
@ -2639,8 +2695,8 @@ public class Parser implements IParser
consume(); consume();
if (LT(1) != IToken.tSEMI) if (LT(1) != IToken.tSEMI)
{ {
//TODO get rid of NULL IASTExpression retVal = expression(scope);
expression(scope); retVal.acceptElement(requestor);
} }
consume(IToken.tSEMI); consume(IToken.tSEMI);
return; return;
@ -2651,14 +2707,14 @@ public class Parser implements IParser
return; return;
case IToken.t_try : case IToken.t_try :
consume(); consume();
compoundStatement(); compoundStatement(scope,true);
while (LT(1) == IToken.t_catch) while (LT(1) == IToken.t_catch)
{ {
consume(); consume();
consume(IToken.tLPAREN); consume(IToken.tLPAREN);
declaration(null, null); // was exceptionDeclaration declaration(scope, null); // was exceptionDeclaration
consume(IToken.tRPAREN); consume(IToken.tRPAREN);
compoundStatement(); compoundStatement(scope, true);
} }
return; return;
case IToken.tSEMI : case IToken.tSEMI :
@ -2669,50 +2725,97 @@ public class Parser implements IParser
// label // label
if (LT(1) == IToken.tIDENTIFIER && LT(2) == IToken.tCOLON) if (LT(1) == IToken.tIDENTIFIER && LT(2) == IToken.tCOLON)
{ {
consume(); consume(IToken.tIDENTIFIER);
consume(); consume(IToken.tCOLON);
statement(null); statement(scope);
return; return;
} }
// expressionStatement // expressionStatement
// Note: the function style cast ambiguity is handled in expression // Note: the function style cast ambiguity is handled in expression
// Since it only happens when we are in a statement // Since it only happens when we are in a statement
IToken mark = mark();
try try
{ {
expression(scope); IASTExpression thisExpression = expression(scope);
consume(IToken.tSEMI); consume(IToken.tSEMI);
thisExpression.acceptElement( requestor );
return; return;
} }
catch (Backtrack b) catch (Backtrack b)
{ {
backup( mark );
} }
// declarationStatement // declarationStatement
declaration(null, null); declaration(scope, null);
} }
} }
/** /**
* @throws Backtrack * @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( IASTScope scope ) throws Backtrack
{
try
{
simpleDeclarationStrategyUnion(scope,null);
}
catch( Backtrack bt )
{
try
{
IASTExpression e = expression( scope );
e.acceptElement(requestor);
}
catch( Backtrack b )
{
failParse();
throw b;
}
}
} }
/** /**
* @throws Backtrack * @throws Backtrack
*/ */
protected void forInitStatement() throws Backtrack protected void compoundStatement( IASTScope scope, boolean createNewScope ) throws Backtrack
{
// TO DO
}
/**
* @throws Backtrack
*/
protected void compoundStatement() throws Backtrack
{ {
consume(IToken.tLBRACE); consume(IToken.tLBRACE);
IASTCodeScope newScope = null;
if( createNewScope )
{
newScope = astFactory.createNewCodeBlock(scope);
newScope.enterScope( requestor );
}
IToken checkToken = null;
while (LT(1) != IToken.tRBRACE) 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 * @param expression
@ -2757,61 +2860,79 @@ public class Parser implements IParser
* @param expression * @param expression
* @throws Backtrack * @throws Backtrack
*/ */
protected IASTExpression assignmentExpression( IASTScope scope ) protected IASTExpression assignmentExpression(IASTScope scope)
throws Backtrack throws Backtrack {
{ if (LT(1) == IToken.t_throw) {
if (LT(1) == IToken.t_throw) return throwExpression(scope);
{ }
return throwExpression(scope); IASTExpression conditionalExpression = conditionalExpression(scope);
} // if the condition not taken, try assignment operators
IASTExpression conditionalExpression = if (conditionalExpression != null
conditionalExpression(scope); && conditionalExpression.getExpressionKind()
// if the condition not taken, try assignment operators == IASTExpression.Kind.CONDITIONALEXPRESSION_HARD)
if (conditionalExpression != null return conditionalExpression;
&& conditionalExpression.getExpressionKind() switch (LT(1)) {
== IASTExpression.Kind.CONDITIONALEXPRESSION_HARD) case IToken.tASSIGN :
return conditionalExpression; return assignmentOperatorExpression(
switch (LT(1)) scope,
{ IASTExpression.Kind.ASSIGNMENTEXPRESSION_NORMAL,
case IToken.tASSIGN : conditionalExpression);
return assignmentOperatorExpression( scope, case IToken.tSTARASSIGN :
IASTExpression.Kind.ASSIGNMENTEXPRESSION_NORMAL); return assignmentOperatorExpression(
case IToken.tSTARASSIGN : scope,
return assignmentOperatorExpression(scope, IASTExpression.Kind.ASSIGNMENTEXPRESSION_MULT,
IASTExpression.Kind.ASSIGNMENTEXPRESSION_MULT); conditionalExpression);
case IToken.tDIVASSIGN : case IToken.tDIVASSIGN :
return assignmentOperatorExpression(scope, return assignmentOperatorExpression(
IASTExpression.Kind.ASSIGNMENTEXPRESSION_DIV); scope,
case IToken.tMODASSIGN : IASTExpression.Kind.ASSIGNMENTEXPRESSION_DIV,
return assignmentOperatorExpression(scope, conditionalExpression);
IASTExpression.Kind.ASSIGNMENTEXPRESSION_MOD); case IToken.tMODASSIGN :
case IToken.tPLUSASSIGN : return assignmentOperatorExpression(
return assignmentOperatorExpression(scope, scope,
IASTExpression.Kind.ASSIGNMENTEXPRESSION_PLUS); IASTExpression.Kind.ASSIGNMENTEXPRESSION_MOD,
case IToken.tMINUSASSIGN : conditionalExpression);
return assignmentOperatorExpression(scope, case IToken.tPLUSASSIGN :
IASTExpression.Kind.ASSIGNMENTEXPRESSION_MINUS); return assignmentOperatorExpression(
case IToken.tSHIFTRASSIGN : scope,
return assignmentOperatorExpression(scope, IASTExpression.Kind.ASSIGNMENTEXPRESSION_PLUS,
IASTExpression.Kind.ASSIGNMENTEXPRESSION_RSHIFT); conditionalExpression);
case IToken.tSHIFTLASSIGN : case IToken.tMINUSASSIGN :
return assignmentOperatorExpression(scope, return assignmentOperatorExpression(
IASTExpression.Kind.ASSIGNMENTEXPRESSION_LSHIFT); scope,
case IToken.tAMPERASSIGN : IASTExpression.Kind.ASSIGNMENTEXPRESSION_MINUS,
return assignmentOperatorExpression(scope, conditionalExpression);
IASTExpression.Kind.ASSIGNMENTEXPRESSION_AND); case IToken.tSHIFTRASSIGN :
case IToken.tXORASSIGN : return assignmentOperatorExpression(
return assignmentOperatorExpression(scope, scope,
IASTExpression.Kind.ASSIGNMENTEXPRESSION_XOR); IASTExpression.Kind.ASSIGNMENTEXPRESSION_RSHIFT,
case IToken.tBITORASSIGN : conditionalExpression);
return assignmentOperatorExpression(scope, case IToken.tSHIFTLASSIGN :
IASTExpression.Kind.ASSIGNMENTEXPRESSION_OR); return assignmentOperatorExpression(
} scope,
return conditionalExpression; 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( protected IASTExpression assignmentOperatorExpression(
IASTScope scope, IASTScope scope,
IASTExpression.Kind kind) IASTExpression.Kind kind, IASTExpression lhs )
throws EndOfFile, Backtrack throws EndOfFile, Backtrack
{ {
IToken t = consume(); IToken t = consume();
@ -2822,8 +2943,8 @@ public class Parser implements IParser
return astFactory.createExpression( return astFactory.createExpression(
scope, scope,
kind, kind,
assignmentExpression, lhs,
null, assignmentExpression,
null, null,
null, null,
"", null); "", null);

View file

@ -0,0 +1,48 @@
/*
* Created on Sep 2, 2003
*
* To change the template for this generated file go to
* Window&gt;Preferences&gt;Java&gt;Code Generation&gt;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&gt;Preferences&gt;Java&gt;Code Generation&gt;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 );
}
}

View file

@ -27,6 +27,7 @@ import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration; import org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTArrayModifier; import org.eclipse.cdt.core.parser.ast.IASTArrayModifier;
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier; 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.IASTCompilationUnit;
import org.eclipse.cdt.core.parser.ast.IASTConstructorMemberInitializer; import org.eclipse.cdt.core.parser.ast.IASTConstructorMemberInitializer;
import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier; import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier;
@ -102,7 +103,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
// looking for a function // looking for a function
result = startingScope.qualifiedFunctionLookup(name, new LinkedList(parameters)); result = startingScope.qualifiedFunctionLookup(name, new LinkedList(parameters));
}else{ }else{
// looking for a class // looking for something else
result = startingScope.qualifiedLookup(name, type); result = startingScope.qualifiedLookup(name, type);
} }
if( result != null ) if( result != null )
@ -1008,7 +1009,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
(IParameterizedSymbol) lookupQualifiedName(parentScope, functionName, TypeInfo.t_function, parameters, 0, functionReferences, false); (IParameterizedSymbol) lookupQualifiedName(parentScope, functionName, TypeInfo.t_function, parameters, 0, functionReferences, false);
if(methodDeclaration != null){ if(methodDeclaration != null){
ASTMethodReference reference = (ASTMethodReference) functionReferences.iterator().next(); ASTMethodReference reference = (ASTMethodReference) functionReferences.iterator().next();
visibility = ((IASTMethod)reference.getReferencedElement()).getVisiblity(); visibility = ((IASTMethod)reference.getReferencedElement()).getVisiblity();
} }
return createMethod(scope, functionName, parameters, returnType, return createMethod(scope, functionName, parameters, returnType,
exception, isInline, isFriend, isStatic, startOffset, offset, exception, isInline, isFriend, isStatic, startOffset, offset,
@ -1247,26 +1248,33 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
setParameter( symbol, returnType, false, references ); setParameter( symbol, returnType, false, references );
setParameters( symbol, references, parameters.iterator() ); setParameters( symbol, references, parameters.iterator() );
// 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) ){
isConstructor = true;
} else if(name.startsWith(TELTA) && parentName.equals(name.substring(1))){
isDestructor = true;
}
}
try try
{ {
ownerScope.addSymbol( symbol ); if( !isConstructor )
ownerScope.addSymbol( symbol );
else
{
symbol.setType( TypeInfo.t_constructor );
((IDerivableContainerSymbol)ownerScope).addConstructor( symbol );
}
} }
catch (ParserSymbolTableException e) catch (ParserSymbolTableException e)
{ {
throw new ASTSemanticException(); 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) ){
isConstructor = true;
} else if(name.startsWith(TELTA) && parentName.equals(name.substring(1))){
isDestructor = true;
}
}
ASTMethod method = new ASTMethod( symbol, parameters, returnType, exception, startOffset, nameOffset, ownerTemplate, references, isConstructor, isDestructor, isPureVirtual, visibility, constructorChain ); ASTMethod method = new ASTMethod( symbol, parameters, returnType, exception, startOffset, nameOffset, ownerTemplate, references, isConstructor, isDestructor, isPureVirtual, visibility, constructorChain );
try try
@ -1642,4 +1650,36 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
} }
return astAlias; 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;
}
} }

View file

@ -12,7 +12,6 @@ package org.eclipse.cdt.internal.core.parser.ast.quick;
import java.util.List; import java.util.List;
import org.eclipse.cdt.core.parser.IToken;
import org.eclipse.cdt.core.parser.ITokenDuple; import org.eclipse.cdt.core.parser.ITokenDuple;
import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
import org.eclipse.cdt.core.parser.ast.ASTClassKind; import org.eclipse.cdt.core.parser.ast.ASTClassKind;
@ -22,6 +21,7 @@ import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration; import org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier; import org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier; 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.IASTCompilationUnit;
import org.eclipse.cdt.core.parser.ast.IASTConstructorMemberInitializer; import org.eclipse.cdt.core.parser.ast.IASTConstructorMemberInitializer;
import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier; import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier;
@ -276,4 +276,18 @@ public class QuickParseASTFactory extends BaseASTFactory implements IASTFactory
{ {
return new ASTNamespaceAlias( scope, identifier, alias.toString(), startingOffset, nameOffset, endOffset ); 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
}
} }

View file

@ -453,4 +453,20 @@ public class MatchLocator implements ISourceElementRequestor, ICSearchConstants
System.out.println("(" + Thread.currentThread() + ") " + log); 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
}
} }

View file

@ -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 2003-09-04 Alain Magloire
Faulty logic when checking the build console preferences. Faulty logic when checking the build console preferences.

View file

@ -32,6 +32,7 @@ import org.eclipse.cdt.core.parser.ast.IASTMethod;
import org.eclipse.cdt.core.parser.ast.IASTMethodReference; import org.eclipse.cdt.core.parser.ast.IASTMethodReference;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition; import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceReference; 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.IASTTemplateDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation; import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation;
import org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization; import org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization;
@ -292,4 +293,20 @@ public class SourceElementRequestorAdapter implements ISourceElementRequestor {
public void exitTemplateSpecialization(IASTTemplateSpecialization specialization) { 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
}
} }