1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-09-10 12:03:16 +02:00
Added CompleteParse - UsingDirective & UsingDeclarations w/namespace/class/field variable references.
	Added CompleteParse support for enumeration specifiers and references in variables & fields.  
	Stubbed out other Scopes/Declarations for COMPLETE_PARSE mode to allow indexer team to switch over ASAP. 

TESTS
	Updated CompleteParseASTTests.
This commit is contained in:
John Camelon 2003-07-24 13:47:20 +00:00
parent d67f2b25cf
commit 9d44e90798
32 changed files with 2198 additions and 96 deletions

View file

@ -1,3 +1,6 @@
2003-07-24 John Camelon
Updated CompleteParseASTTests.
2003-07-22 John Camelon
Updated CompleteParseASTTests.

View file

@ -34,6 +34,7 @@ import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit;
import org.eclipse.cdt.core.parser.ast.IASTDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTEnumerationReference;
import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTEnumerator;
import org.eclipse.cdt.core.parser.ast.IASTField;
import org.eclipse.cdt.core.parser.ast.IASTFieldReference;
import org.eclipse.cdt.core.parser.ast.IASTFunction;
@ -661,4 +662,57 @@ public class CompleteParseASTTest extends TestCase
assertEquals( f.getName(), "x" );
assertEquals( ((IASTSimpleTypeSpecifier)f.getAbstractDeclaration().getTypeSpecifier()).getType(), IASTSimpleTypeSpecifier.Type.DOUBLE );
}
public void testUsingClauses() throws Exception
{
Iterator declarations = parse( "namespace A { namespace B { int x; class C { static int y = 5; }; } } \n using namespace A::B;\n using A::B::x;using A::B::C;using A::B::C::y;").getDeclarations();
IASTNamespaceDefinition namespaceA = (IASTNamespaceDefinition)declarations.next();
IASTNamespaceDefinition namespaceB = (IASTNamespaceDefinition)getDeclarations( namespaceA ).next();
Iterator i = getDeclarations( namespaceB );
IASTVariable variableX = (IASTVariable)i.next();
IASTClassSpecifier classC = ((IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier());
IASTField fieldY = (IASTField)getDeclarations( classC ).next();
assertQualifiedName( fieldY.getFullyQualifiedName(), new String [] { "A", "B", "C", "y" } );
IASTUsingDirective directive = (IASTUsingDirective)declarations.next();
assertEquals( directive.getNamespaceDefinition(), namespaceB );
IASTUsingDeclaration declaration = (IASTUsingDeclaration)declarations.next();
assertEquals( declaration.getUsingType(), variableX );
declaration = (IASTUsingDeclaration)declarations.next();
assertEquals( declaration.getUsingType(), classC );
declaration = (IASTUsingDeclaration)declarations.next();
assertEquals( declaration.getUsingType(), fieldY );
assertEquals( callback.getReferences().size(), 12 );
}
public void testEnumerations() throws Exception
{
Iterator declarations = parse( "namespace A { enum E { e1, e2, e3 }; E varE;}").getDeclarations();
IASTNamespaceDefinition namespaceA = (IASTNamespaceDefinition)declarations.next();
Iterator namespaceMembers = getDeclarations( namespaceA );
IASTEnumerationSpecifier enumE = (IASTEnumerationSpecifier)((IASTAbstractTypeSpecifierDeclaration)namespaceMembers.next()).getTypeSpecifier();
assertEquals( enumE.getName(), "E");
assertQualifiedName( enumE.getFullyQualifiedName(), new String [] { "A", "E" } );
Iterator enumerators = enumE.getEnumerators();
IASTEnumerator enumerator_e1 = (IASTEnumerator)enumerators.next();
IASTEnumerator enumerator_e2 = (IASTEnumerator)enumerators.next();
IASTEnumerator enumerator_e3 = (IASTEnumerator)enumerators.next();
assertFalse( enumerators.hasNext() );
assertEquals( enumerator_e1.getName(), "e1");
assertEquals( enumerator_e2.getName(), "e2");
assertEquals( enumerator_e3.getName(), "e3");
IASTVariable varE = (IASTVariable)namespaceMembers.next();
assertEquals( ((IASTSimpleTypeSpecifier)varE.getAbstractDeclaration().getTypeSpecifier()).getTypeSpecifier(), enumE );
}
protected void assertQualifiedName(String [] fromAST, String [] theTruth)
{
assertNotNull( fromAST );
assertNotNull( theTruth );
assertEquals( fromAST.length, theTruth.length );
for( int i = 0; i < fromAST.length; ++i )
{
assertEquals( fromAST[i], theTruth[i]);
}
}
}

View file

@ -1,3 +1,8 @@
2003-07-24 John Camelon
Added CompleteParse - UsingDirective & UsingDeclarations w/namespace/class/field variable references.
Added CompleteParse support for enumeration specifiers and references in variables & fields.
Stubbed out other Scopes/Declarations for COMPLETE_PARSE mode to allow indexer team to switch over ASAP.
2003-07-22 John Camelon
Added in preliminary support for Field/Variable w/cross references on their types.

View file

@ -20,6 +20,5 @@ import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate;
*/
public interface IASTEnumerationSpecifier extends ISourceElementCallbackDelegate, IASTScopedTypeSpecifier, IASTOffsetableNamedElement {
public void addEnumerator( IASTEnumerator enumerator );
public Iterator getEnumerators();
}

View file

@ -40,7 +40,7 @@ public interface IASTFactory
public IASTUsingDeclaration createUsingDeclaration(
IASTScope scope,
boolean isTypeName,
ITokenDuple name, int startingOffset, int endingOffset);
ITokenDuple name, int startingOffset, int endingOffset) throws ASTSemanticException;
public IASTASMDefinition createASMDefinition(
IASTScope scope,
String assembly,
@ -82,12 +82,12 @@ public interface IASTFactory
public IASTEnumerationSpecifier createEnumerationSpecifier(
IASTScope scope,
String name,
int startingOffset, int nameOffset);
int startingOffset, int nameOffset) throws ASTSemanticException;
public void addEnumerator(
IASTEnumerationSpecifier enumeration,
String string,
int startingOffset,
int endingOffset, IASTExpression initialValue);
int endingOffset, IASTExpression initialValue)throws ASTSemanticException;
public IASTExpression createExpression(
IASTExpression.Kind kind,
IASTExpression lhs,
@ -162,9 +162,9 @@ public interface IASTFactory
ASTAccessVisibility visibility);
public IASTVariable createVariable(IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression,
IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, int startingOffset, int nameOffset );
IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, int startingOffset, int nameOffset ) throws ASTSemanticException;
public IASTField createField( IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, int startingOffset, int nameOffset, ASTAccessVisibility visibility);
public IASTField createField( IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, int startingOffset, int nameOffset, ASTAccessVisibility visibility) throws ASTSemanticException;
public IASTParameterDeclaration createParameterDeclaration( boolean isConst, IASTTypeSpecifier getTypeSpecifier, List pointerOperators, List arrayModifiers, String parameterName, IASTInitializerClause initializerClause );

View file

@ -18,5 +18,6 @@ public interface IASTUsingDeclaration extends IASTDeclaration, IASTOffsetableEle
public boolean isTypename();
public String usingTypeName();
public IASTDeclaration getUsingType() throws ASTNotImplementedException;
}

View file

@ -18,6 +18,7 @@ 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.ASTPointerOperator;
import org.eclipse.cdt.core.parser.ast.ASTSemanticException;
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTFactory;
@ -298,7 +299,7 @@ public class DeclarationWrapper implements IDeclaratorOwner
/**
* @param requestor
*/
public List createASTNodes(IASTFactory astFactory)
public List createASTNodes(IASTFactory astFactory) throws ASTSemanticException
{
this.astFactory = astFactory;
Iterator i = declarators.iterator();
@ -310,7 +311,7 @@ public class DeclarationWrapper implements IDeclaratorOwner
/**
* @param declarator
*/
private IASTDeclaration createASTNode(Declarator declarator)
private IASTDeclaration createASTNode(Declarator declarator) throws ASTSemanticException
{
boolean isWithinClass = (getScope() instanceof IASTClassSpecifier); //TODO fix this for COMPLETE_PARSE
boolean isFunction = declarator.isFunction();
@ -418,7 +419,7 @@ public class DeclarationWrapper implements IDeclaratorOwner
* @param declarator
* @return
*/
private IASTField createFieldASTNode(Declarator declarator)
private IASTField createFieldASTNode(Declarator declarator) throws ASTSemanticException
{
return astFactory.createField(
scope,
@ -468,7 +469,7 @@ public class DeclarationWrapper implements IDeclaratorOwner
* @param declarator
* @return
*/
private IASTVariable createVariableASTNode(Declarator declarator)
private IASTVariable createVariableASTNode(Declarator declarator) throws ASTSemanticException
{
return astFactory.createVariable(
scope,

View file

@ -294,8 +294,21 @@ public class Parser implements IParser
if (LT(1) == IToken.tSEMI)
{
IToken last = consume(IToken.tSEMI);
IASTUsingDeclaration declaration =
astFactory.createUsingDeclaration(scope, typeName, name, firstToken.getOffset(), last.getEndOffset());
IASTUsingDeclaration declaration = null;
try
{
declaration =
astFactory.createUsingDeclaration(
scope,
typeName,
name,
firstToken.getOffset(),
last.getEndOffset());
}
catch (ASTSemanticException e)
{
}
declaration.acceptElement( requestor );
}
else
@ -768,7 +781,7 @@ public class Parser implements IParser
declSpecifierSeq(false, tryConstructor, sdw);
try
{
if (sdw.getTypeSpecifier() == null )
if (sdw.getTypeSpecifier() == null && sdw.getSimpleType() != IASTSimpleTypeSpecifier.Type.UNSPECIFIED )
sdw.setTypeSpecifier(
astFactory.createSimpleTypeSpecifier(
scope,
@ -830,7 +843,15 @@ public class Parser implements IParser
if( forKR ) return;
List l = sdw.createASTNodes(astFactory);
List l = null;
try
{
l = sdw.createASTNodes(astFactory);
}
catch (ASTSemanticException e)
{
throw backtrack;
}
Iterator i = l.iterator();
if (hasFunctionBody && l.size() != 1)
{
@ -2128,14 +2149,21 @@ public class Parser implements IParser
}
if (LT(1) == IToken.tLBRACE)
{
IASTEnumerationSpecifier enumeration =
astFactory.createEnumerationSpecifier(
sdw.getScope(),
((identifier == null) ? "" : identifier.getImage()),
mark.getOffset(),
((identifier == null)
? mark.getOffset()
: identifier.getOffset()));
IASTEnumerationSpecifier enumeration = null;
try
{
enumeration = astFactory.createEnumerationSpecifier(
sdw.getScope(),
((identifier == null) ? "" : identifier.getImage()),
mark.getOffset(),
((identifier == null)
? mark.getOffset()
: identifier.getOffset()));
}
catch (ASTSemanticException e)
{
}
consume(IToken.tLBRACE);
while (LT(1) != IToken.tRBRACE)
{
@ -2157,24 +2185,38 @@ public class Parser implements IParser
if (LT(1) == IToken.tRBRACE)
{
astFactory.addEnumerator(
enumeration,
enumeratorIdentifier.getImage(),
enumeratorIdentifier.getOffset(),
enumeratorIdentifier.getEndOffset(),
initialValue);
try
{
astFactory.addEnumerator(
enumeration,
enumeratorIdentifier.getImage(),
enumeratorIdentifier.getOffset(),
enumeratorIdentifier.getEndOffset(),
initialValue);
}
catch (ASTSemanticException e1)
{
}
break;
}
if (LT(1) != IToken.tCOMMA)
{
throw backtrack;
}
astFactory.addEnumerator(
enumeration,
enumeratorIdentifier.getImage(),
enumeratorIdentifier.getOffset(),
enumeratorIdentifier.getEndOffset(),
initialValue);
try
{
astFactory.addEnumerator(
enumeration,
enumeratorIdentifier.getImage(),
enumeratorIdentifier.getOffset(),
enumeratorIdentifier.getEndOffset(),
initialValue);
}
catch (ASTSemanticException e1)
{
}
consume(IToken.tCOMMA);
}
IToken t = consume(IToken.tRBRACE);

View file

@ -0,0 +1,98 @@
/**********************************************************************
* Copyright (c) 2002,2003 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 Rational Software - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.internal.core.parser.ast.complete;
import org.eclipse.cdt.core.parser.ISourceElementRequestor;
import org.eclipse.cdt.core.parser.ast.IASTASMDefinition;
import org.eclipse.cdt.core.parser.ast.IASTScope;
/**
* @author jcamelon
*
*/
public class ASTASMDefinition implements IASTASMDefinition
{
/**
*
*/
public ASTASMDefinition()
{
super();
// TODO Auto-generated constructor stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTASMDefinition#getBody()
*/
public String getBody()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int)
*/
public void setStartingOffset(int o)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int)
*/
public void setEndingOffset(int o)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset()
*/
public int getStartingOffset()
{
// TODO Auto-generated method stub
return 0;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset()
*/
public int getEndingOffset()
{
// TODO Auto-generated method stub
return 0;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTScopedElement#getOwnerScope()
*/
public IASTScope getOwnerScope()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void acceptElement(ISourceElementRequestor requestor)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void enterScope(ISourceElementRequestor requestor)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void exitScope(ISourceElementRequestor requestor)
{
// TODO Auto-generated method stub
}
}

View file

@ -0,0 +1,76 @@
/**********************************************************************
* Copyright (c) 2002,2003 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 Rational Software - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.internal.core.parser.ast.complete;
import org.eclipse.cdt.core.parser.ast.ASTClassKind;
import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier;
/**
* @author jcamelon
*
*/
public class ASTElaboratedTypeSpecifier implements IASTElaboratedTypeSpecifier
{
/**
*
*/
public ASTElaboratedTypeSpecifier()
{
super();
// TODO Auto-generated constructor stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier#getName()
*/
public String getName()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier#getClassKind()
*/
public ASTClassKind getClassKind()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int)
*/
public void setStartingOffset(int o)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int)
*/
public void setEndingOffset(int o)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset()
*/
public int getStartingOffset()
{
// TODO Auto-generated method stub
return 0;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset()
*/
public int getEndingOffset()
{
// TODO Auto-generated method stub
return 0;
}
}

View file

@ -0,0 +1,64 @@
/**********************************************************************
* Copyright (c) 2002,2003 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 Rational Software - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.internal.core.parser.ast.complete;
import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate;
import org.eclipse.cdt.core.parser.ISourceElementRequestor;
import org.eclipse.cdt.core.parser.ast.IASTEnumerationReference;
import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier;
/**
* @author jcamelon
*
*/
public class ASTEnumerationReference
extends ASTReference
implements IASTEnumerationReference
{
private final IASTEnumerationSpecifier referencedElement;
/**
* @param offset
* @param string
* @param specifier
*/
public ASTEnumerationReference(int offset, String string, IASTEnumerationSpecifier specifier)
{
super( offset, string );
referencedElement = specifier;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTReference#getReferencedElement()
*/
public ISourceElementCallbackDelegate getReferencedElement()
{
return referencedElement;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void acceptElement(ISourceElementRequestor requestor)
{
requestor.acceptEnumerationReference( this );
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void enterScope(ISourceElementRequestor requestor)
{
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void exitScope(ISourceElementRequestor requestor)
{
}
}

View file

@ -0,0 +1,135 @@
/**********************************************************************
* Copyright (c) 2002,2003 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 Rational Software - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.internal.core.parser.ast.complete;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.eclipse.cdt.core.parser.ISourceElementRequestor;
import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTEnumerator;
import org.eclipse.cdt.internal.core.parser.ast.ASTQualifiedNamedElement;
import org.eclipse.cdt.internal.core.parser.ast.NamedOffsets;
import org.eclipse.cdt.internal.core.parser.pst.ISymbol;
/**
* @author jcamelon
*
*/
public class ASTEnumerationSpecifier
extends ASTSymbol
implements IASTEnumerationSpecifier
{
private NamedOffsets offsets = new NamedOffsets();
private final ASTQualifiedNamedElement qualifiedName;
/**
* @param symbol
*/
public ASTEnumerationSpecifier(ISymbol symbol, int startingOffset, int nameOffset )
{
super(symbol);
setStartingOffset(startingOffset);
setNameOffset( startingOffset );
qualifiedName = new ASTQualifiedNamedElement( getOwnerScope(), symbol.getName() );
}
private List enumerators = new ArrayList();
public void addEnumerator(IASTEnumerator enumerator)
{
enumerators.add(enumerator);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier#getEnumerators()
*/
public Iterator getEnumerators()
{
return enumerators.iterator();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void acceptElement(ISourceElementRequestor requestor)
{
requestor.acceptEnumerationSpecifier(this);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void enterScope(ISourceElementRequestor requestor)
{
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void exitScope(ISourceElementRequestor requestor)
{
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getName()
*/
public String getName()
{
return getSymbol().getName();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameOffset()
*/
public int getNameOffset()
{
return offsets.getNameOffset();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameOffset(int)
*/
public void setNameOffset(int o)
{
offsets.setNameOffset(o);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTQualifiedNameElement#getFullyQualifiedName()
*/
public String[] getFullyQualifiedName()
{
return qualifiedName.getFullyQualifiedName();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int)
*/
public void setStartingOffset(int o)
{
offsets.setStartingOffset( o );
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int)
*/
public void setEndingOffset(int o)
{
offsets.setEndingOffset( o );
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset()
*/
public int getStartingOffset()
{
return offsets.getStartingOffset();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset()
*/
public int getEndingOffset()
{
return offsets.getEndingOffset();
}
}

View file

@ -0,0 +1,122 @@
/**********************************************************************
* Copyright (c) 2002,2003 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 Rational Software - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.internal.core.parser.ast.complete;
import org.eclipse.cdt.core.parser.ISourceElementRequestor;
import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTEnumerator;
import org.eclipse.cdt.core.parser.ast.IASTExpression;
import org.eclipse.cdt.internal.core.parser.ast.Offsets;
import org.eclipse.cdt.internal.core.parser.pst.ISymbol;
/**
* @author jcamelon
*
*/
public class ASTEnumerator extends ASTSymbol implements IASTEnumerator
{
private Offsets offsets = new Offsets();
private final IASTExpression initialValue;
/**
* @param enumeratorSymbol
* @param startingOffset
* @param endingOffset
* @param initialValue
*/
public ASTEnumerator(ISymbol enumeratorSymbol, int startingOffset, int endingOffset, IASTExpression initialValue)
{
super( enumeratorSymbol );
setStartingOffset(startingOffset);
setEndingOffset( endingOffset );
this.initialValue = initialValue;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTEnumerator#getOwnerEnumerationSpecifier()
*/
public IASTEnumerationSpecifier getOwnerEnumerationSpecifier()
{
return (IASTEnumerationSpecifier)getSymbol().getContainingSymbol().getASTExtension();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTEnumerator#getInitialValue()
*/
public IASTExpression getInitialValue()
{
return initialValue;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getName()
*/
public String getName()
{
return symbol.getName();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameOffset()
*/
public int getNameOffset()
{
return getStartingOffset();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameOffset(int)
*/
public void setNameOffset(int o)
{
setStartingOffset(o);
}
/* (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)
{
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void exitScope(ISourceElementRequestor requestor)
{
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int)
*/
public void setStartingOffset(int o)
{
offsets.setStartingOffset(o);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int)
*/
public void setEndingOffset(int o)
{
offsets.setEndingOffset(o);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset()
*/
public int getStartingOffset()
{
return offsets.getStartingOffset();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset()
*/
public int getEndingOffset()
{
return offsets.getEndingOffset();
}
}

View file

@ -0,0 +1,64 @@
/**********************************************************************
* Copyright (c) 2002,2003 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 Rational Software - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.internal.core.parser.ast.complete;
import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate;
import org.eclipse.cdt.core.parser.ISourceElementRequestor;
import org.eclipse.cdt.core.parser.ast.IASTField;
import org.eclipse.cdt.core.parser.ast.IASTFieldReference;
import org.eclipse.cdt.core.parser.ast.IASTReference;
/**
* @author jcamelon
*
*/
public class ASTFieldReference
extends ASTReference
implements IASTReference, IASTFieldReference
{
private final IASTField referencedElement;
/**
* @param offset
* @param string
* @param field
*/
public ASTFieldReference(int offset, String string, IASTField field)
{
super(offset, string);
referencedElement = field;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTReference#getReferencedElement()
*/
public ISourceElementCallbackDelegate getReferencedElement()
{
return referencedElement;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void acceptElement(ISourceElementRequestor requestor)
{
requestor.acceptFieldReference(this);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void enterScope(ISourceElementRequestor requestor)
{
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void exitScope(ISourceElementRequestor requestor)
{
}
}

View file

@ -0,0 +1,206 @@
/**********************************************************************
* Copyright (c) 2002,2003 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 Rational Software - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.internal.core.parser.ast.complete;
import java.util.Iterator;
import org.eclipse.cdt.core.parser.ISourceElementRequestor;
import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException;
import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification;
import org.eclipse.cdt.core.parser.ast.IASTFunction;
import org.eclipse.cdt.core.parser.ast.IASTScope;
import org.eclipse.cdt.core.parser.ast.IASTTemplate;
/**
* @author jcamelon
*
*/
public class ASTFunction implements IASTFunction
{
/**
*
*/
public ASTFunction()
{
super();
// TODO Auto-generated constructor stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFunction#isInline()
*/
public boolean isInline()
{
// TODO Auto-generated method stub
return false;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFunction#isFriend()
*/
public boolean isFriend()
{
// TODO Auto-generated method stub
return false;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFunction#isStatic()
*/
public boolean isStatic()
{
// TODO Auto-generated method stub
return false;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getName()
*/
public String getName()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFunction#getReturnType()
*/
public IASTAbstractDeclaration getReturnType()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFunction#getParameters()
*/
public Iterator getParameters()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFunction#getExceptionSpec()
*/
public IASTExceptionSpecification getExceptionSpec()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFunction#setHasFunctionBody(boolean)
*/
public void setHasFunctionBody(boolean b)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFunction#hasFunctionBody()
*/
public boolean hasFunctionBody()
{
// TODO Auto-generated method stub
return false;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTScope#getDeclarations()
*/
public Iterator getDeclarations() throws ASTNotImplementedException
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameOffset()
*/
public int getNameOffset()
{
// TODO Auto-generated method stub
return 0;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameOffset(int)
*/
public void setNameOffset(int o)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTTemplatedDeclaration#getOwnerTemplateDeclaration()
*/
public IASTTemplate getOwnerTemplateDeclaration()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTQualifiedNameElement#getFullyQualifiedName()
*/
public String[] getFullyQualifiedName()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int)
*/
public void setStartingOffset(int o)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int)
*/
public void setEndingOffset(int o)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset()
*/
public int getStartingOffset()
{
// TODO Auto-generated method stub
return 0;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset()
*/
public int getEndingOffset()
{
// TODO Auto-generated method stub
return 0;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTScopedElement#getOwnerScope()
*/
public IASTScope getOwnerScope()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void acceptElement(ISourceElementRequestor requestor)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void enterScope(ISourceElementRequestor requestor)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void exitScope(ISourceElementRequestor requestor)
{
// TODO Auto-generated method stub
}
}

View file

@ -0,0 +1,109 @@
/**********************************************************************
* Copyright (c) 2002,2003 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 Rational Software - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.internal.core.parser.ast.complete;
import java.util.Iterator;
import org.eclipse.cdt.core.parser.ISourceElementRequestor;
import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException;
import org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification;
import org.eclipse.cdt.core.parser.ast.IASTScope;
/**
* @author jcamelon
*
*/
public class ASTLinkageSpecification implements IASTLinkageSpecification
{
/**
*
*/
public ASTLinkageSpecification()
{
super();
// TODO Auto-generated constructor stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification#getLinkageString()
*/
public String getLinkageString()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTScope#getDeclarations()
*/
public Iterator getDeclarations() throws ASTNotImplementedException
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int)
*/
public void setStartingOffset(int o)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int)
*/
public void setEndingOffset(int o)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset()
*/
public int getStartingOffset()
{
// TODO Auto-generated method stub
return 0;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset()
*/
public int getEndingOffset()
{
// TODO Auto-generated method stub
return 0;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTScopedElement#getOwnerScope()
*/
public IASTScope getOwnerScope()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void acceptElement(ISourceElementRequestor requestor)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void enterScope(ISourceElementRequestor requestor)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void exitScope(ISourceElementRequestor requestor)
{
// TODO Auto-generated method stub
}
}

View file

@ -0,0 +1,271 @@
/**********************************************************************
* Copyright (c) 2002,2003 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 Rational Software - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.internal.core.parser.ast.complete;
import java.util.Iterator;
import org.eclipse.cdt.core.parser.ISourceElementRequestor;
import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException;
import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification;
import org.eclipse.cdt.core.parser.ast.IASTMethod;
import org.eclipse.cdt.core.parser.ast.IASTScope;
import org.eclipse.cdt.core.parser.ast.IASTTemplate;
/**
* @author jcamelon
*
*/
public class ASTMethod implements IASTMethod
{
/**
*
*/
public ASTMethod()
{
super();
// TODO Auto-generated constructor stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTMethod#isVirtual()
*/
public boolean isVirtual()
{
// TODO Auto-generated method stub
return false;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTMethod#isExplicit()
*/
public boolean isExplicit()
{
// TODO Auto-generated method stub
return false;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTMethod#isConstructor()
*/
public boolean isConstructor()
{
// TODO Auto-generated method stub
return false;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTMethod#isDestructor()
*/
public boolean isDestructor()
{
// TODO Auto-generated method stub
return false;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTMethod#isConst()
*/
public boolean isConst()
{
// TODO Auto-generated method stub
return false;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTMethod#isVolatile()
*/
public boolean isVolatile()
{
// TODO Auto-generated method stub
return false;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTMethod#isPureVirtual()
*/
public boolean isPureVirtual()
{
// TODO Auto-generated method stub
return false;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFunction#isInline()
*/
public boolean isInline()
{
// TODO Auto-generated method stub
return false;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFunction#isFriend()
*/
public boolean isFriend()
{
// TODO Auto-generated method stub
return false;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFunction#isStatic()
*/
public boolean isStatic()
{
// TODO Auto-generated method stub
return false;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getName()
*/
public String getName()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFunction#getReturnType()
*/
public IASTAbstractDeclaration getReturnType()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFunction#getParameters()
*/
public Iterator getParameters()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFunction#getExceptionSpec()
*/
public IASTExceptionSpecification getExceptionSpec()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFunction#setHasFunctionBody(boolean)
*/
public void setHasFunctionBody(boolean b)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFunction#hasFunctionBody()
*/
public boolean hasFunctionBody()
{
// TODO Auto-generated method stub
return false;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTMember#getVisiblity()
*/
public ASTAccessVisibility getVisiblity()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTScope#getDeclarations()
*/
public Iterator getDeclarations() throws ASTNotImplementedException
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameOffset()
*/
public int getNameOffset()
{
// TODO Auto-generated method stub
return 0;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameOffset(int)
*/
public void setNameOffset(int o)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTTemplatedDeclaration#getOwnerTemplateDeclaration()
*/
public IASTTemplate getOwnerTemplateDeclaration()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTQualifiedNameElement#getFullyQualifiedName()
*/
public String[] getFullyQualifiedName()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int)
*/
public void setStartingOffset(int o)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int)
*/
public void setEndingOffset(int o)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset()
*/
public int getStartingOffset()
{
// TODO Auto-generated method stub
return 0;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset()
*/
public int getEndingOffset()
{
// TODO Auto-generated method stub
return 0;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTScopedElement#getOwnerScope()
*/
public IASTScope getOwnerScope()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void acceptElement(ISourceElementRequestor requestor)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void enterScope(ISourceElementRequestor requestor)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void exitScope(ISourceElementRequestor requestor)
{
// TODO Auto-generated method stub
}
}

View file

@ -0,0 +1,81 @@
/**********************************************************************
* Copyright (c) 2002,2003 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 Rational Software - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.internal.core.parser.ast.complete;
import java.util.Iterator;
import org.eclipse.cdt.core.parser.ast.IASTInitializerClause;
import org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier;
/**
* @author jcamelon
*
*/
public class ASTParameterDeclaration implements IASTParameterDeclaration
{
/**
*
*/
public ASTParameterDeclaration()
{
super();
// TODO Auto-generated constructor stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration#getName()
*/
public String getName()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration#getDefaultValue()
*/
public IASTInitializerClause getDefaultValue()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration#isConst()
*/
public boolean isConst()
{
// TODO Auto-generated method stub
return false;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration#getPointerOperators()
*/
public Iterator getPointerOperators()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration#getArrayModifiers()
*/
public Iterator getArrayModifiers()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTTypeSpecifierOwner#getTypeSpecifier()
*/
public IASTTypeSpecifier getTypeSpecifier()
{
// TODO Auto-generated method stub
return null;
}
}

View file

@ -0,0 +1,124 @@
/**********************************************************************
* Copyright (c) 2002,2003 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 Rational Software - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.internal.core.parser.ast.complete;
import java.util.Iterator;
import org.eclipse.cdt.core.parser.ISourceElementRequestor;
import org.eclipse.cdt.core.parser.ast.IASTDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTScope;
import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration;
/**
* @author jcamelon
*
*/
public class ASTTemplateDeclaration implements IASTTemplateDeclaration
{
/**
*
*/
public ASTTemplateDeclaration()
{
super();
// TODO Auto-generated constructor stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration#isExported()
*/
public boolean isExported()
{
// TODO Auto-generated method stub
return false;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTTemplate#getOwnedDeclaration()
*/
public IASTDeclaration getOwnedDeclaration()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTTemplate#setOwnedDeclaration(org.eclipse.cdt.core.parser.ast.IASTDeclaration)
*/
public void setOwnedDeclaration(IASTDeclaration declaration)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTTemplateParameterList#getTemplateParameters()
*/
public Iterator getTemplateParameters()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int)
*/
public void setStartingOffset(int o)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int)
*/
public void setEndingOffset(int o)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset()
*/
public int getStartingOffset()
{
// TODO Auto-generated method stub
return 0;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset()
*/
public int getEndingOffset()
{
// TODO Auto-generated method stub
return 0;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTScopedElement#getOwnerScope()
*/
public IASTScope getOwnerScope()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void acceptElement(ISourceElementRequestor requestor)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void enterScope(ISourceElementRequestor requestor)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void exitScope(ISourceElementRequestor requestor)
{
// TODO Auto-generated method stub
}
}

View file

@ -0,0 +1,106 @@
/**********************************************************************
* Copyright (c) 2002,2003 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 Rational Software - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.internal.core.parser.ast.complete;
import org.eclipse.cdt.core.parser.ISourceElementRequestor;
import org.eclipse.cdt.core.parser.ast.IASTDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTScope;
import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation;
/**
* @author jcamelon
*
*/
public class ASTTemplateInstantiation implements IASTTemplateInstantiation
{
/**
*
*/
public ASTTemplateInstantiation()
{
super();
// TODO Auto-generated constructor stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTTemplate#getOwnedDeclaration()
*/
public IASTDeclaration getOwnedDeclaration()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTTemplate#setOwnedDeclaration(org.eclipse.cdt.core.parser.ast.IASTDeclaration)
*/
public void setOwnedDeclaration(IASTDeclaration declaration)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int)
*/
public void setStartingOffset(int o)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int)
*/
public void setEndingOffset(int o)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset()
*/
public int getStartingOffset()
{
// TODO Auto-generated method stub
return 0;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset()
*/
public int getEndingOffset()
{
// TODO Auto-generated method stub
return 0;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTScopedElement#getOwnerScope()
*/
public IASTScope getOwnerScope()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void acceptElement(ISourceElementRequestor requestor)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void enterScope(ISourceElementRequestor requestor)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void exitScope(ISourceElementRequestor requestor)
{
// TODO Auto-generated method stub
}
}

View file

@ -0,0 +1,106 @@
/**********************************************************************
* Copyright (c) 2002,2003 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 Rational Software - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.internal.core.parser.ast.complete;
import org.eclipse.cdt.core.parser.ISourceElementRequestor;
import org.eclipse.cdt.core.parser.ast.IASTDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTScope;
import org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization;
/**
* @author jcamelon
*
*/
public class ASTTemplateSpecialization implements IASTTemplateSpecialization
{
/**
*
*/
public ASTTemplateSpecialization()
{
super();
// TODO Auto-generated constructor stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTTemplate#getOwnedDeclaration()
*/
public IASTDeclaration getOwnedDeclaration()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTTemplate#setOwnedDeclaration(org.eclipse.cdt.core.parser.ast.IASTDeclaration)
*/
public void setOwnedDeclaration(IASTDeclaration declaration)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int)
*/
public void setStartingOffset(int o)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int)
*/
public void setEndingOffset(int o)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset()
*/
public int getStartingOffset()
{
// TODO Auto-generated method stub
return 0;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset()
*/
public int getEndingOffset()
{
// TODO Auto-generated method stub
return 0;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTScopedElement#getOwnerScope()
*/
public IASTScope getOwnerScope()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void acceptElement(ISourceElementRequestor requestor)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void enterScope(ISourceElementRequestor requestor)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void exitScope(ISourceElementRequestor requestor)
{
// TODO Auto-generated method stub
}
}

View file

@ -0,0 +1,130 @@
/**********************************************************************
* Copyright (c) 2002,2003 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 Rational Software - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.internal.core.parser.ast.complete;
import org.eclipse.cdt.core.parser.ISourceElementRequestor;
import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTScope;
import org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration;
/**
* @author jcamelon
*
*/
public class ASTTypedef implements IASTTypedefDeclaration
{
/**
*
*/
public ASTTypedef()
{
super();
// TODO Auto-generated constructor stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getName()
*/
public String getName()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration#getAbstractDeclarator()
*/
public IASTAbstractDeclaration getAbstractDeclarator()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameOffset()
*/
public int getNameOffset()
{
// TODO Auto-generated method stub
return 0;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameOffset(int)
*/
public void setNameOffset(int o)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTQualifiedNameElement#getFullyQualifiedName()
*/
public String[] getFullyQualifiedName()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTScopedElement#getOwnerScope()
*/
public IASTScope getOwnerScope()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void acceptElement(ISourceElementRequestor requestor)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void enterScope(ISourceElementRequestor requestor)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void exitScope(ISourceElementRequestor requestor)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int)
*/
public void setStartingOffset(int o)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int)
*/
public void setEndingOffset(int o)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset()
*/
public int getStartingOffset()
{
// TODO Auto-generated method stub
return 0;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset()
*/
public int getEndingOffset()
{
// TODO Auto-generated method stub
return 0;
}
}

View file

@ -0,0 +1,123 @@
/**********************************************************************
* Copyright (c) 2002,2003 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 Rational Software - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.internal.core.parser.ast.complete;
import java.util.List;
import org.eclipse.cdt.core.parser.ISourceElementRequestor;
import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException;
import org.eclipse.cdt.core.parser.ast.IASTDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement;
import org.eclipse.cdt.core.parser.ast.IASTScope;
import org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration;
import org.eclipse.cdt.internal.core.parser.ast.Offsets;
/**
* @author jcamelon
*
*/
public class ASTUsingDeclaration implements IASTUsingDeclaration
{
private final IASTScope ownerScope;
private final boolean isTypeName;
private final IASTDeclaration declaration;
private Offsets offsets = new Offsets();
private final ASTReferenceStore delegate;
/**
*
*/
public ASTUsingDeclaration( IASTScope ownerScope, IASTDeclaration declaration, boolean isTypeName, int startingOffset, int endingOffset, List references )
{
this.ownerScope = ownerScope;
this.isTypeName = isTypeName;
this.declaration = declaration;
setStartingOffset(startingOffset);
setEndingOffset(endingOffset);
delegate = new ASTReferenceStore( references );
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration#isTypename()
*/
public boolean isTypename()
{
return isTypeName;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration#usingTypeName()
*/
public String usingTypeName()
{
return ((IASTOffsetableNamedElement)declaration).getName();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int)
*/
public void setStartingOffset(int o)
{
offsets.setStartingOffset(o);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int)
*/
public void setEndingOffset(int o)
{
offsets.setEndingOffset(o);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset()
*/
public int getStartingOffset()
{
return offsets.getStartingOffset();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset()
*/
public int getEndingOffset()
{
return offsets.getEndingOffset();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTScopedElement#getOwnerScope()
*/
public IASTScope getOwnerScope()
{
return ownerScope;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void acceptElement(ISourceElementRequestor requestor)
{
requestor.acceptUsingDeclaration( this );
delegate.processReferences(requestor);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void enterScope(ISourceElementRequestor requestor)
{
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void exitScope(ISourceElementRequestor requestor)
{
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration#getUsingType()
*/
public IASTDeclaration getUsingType() throws ASTNotImplementedException
{
return declaration;
}
}

View file

@ -0,0 +1,65 @@
/**********************************************************************
* Copyright (c) 2002,2003 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 Rational Software - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.internal.core.parser.ast.complete;
import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate;
import org.eclipse.cdt.core.parser.ISourceElementRequestor;
import org.eclipse.cdt.core.parser.ast.IASTReference;
import org.eclipse.cdt.core.parser.ast.IASTVariable;
import org.eclipse.cdt.core.parser.ast.IASTVariableReference;
/**
* @author jcamelon
*
*/
public class ASTVariableReference
extends ASTReference
implements IASTReference, IASTVariableReference
{
private final IASTVariable referencedElement;
/**
* @param offset
* @param string
* @param variable
*/
public ASTVariableReference(int offset, String string, IASTVariable variable)
{
super( offset, string );
referencedElement = variable;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTReference#getReferencedElement()
*/
public ISourceElementCallbackDelegate getReferencedElement()
{
return referencedElement;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void acceptElement(ISourceElementRequestor requestor)
{
requestor.acceptVariableReference( this );
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void enterScope(ISourceElementRequestor requestor)
{
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
public void exitScope(ISourceElementRequestor requestor)
{
}
}

View file

@ -66,6 +66,7 @@ import org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol;
import org.eclipse.cdt.internal.core.parser.pst.IDerivableContainerSymbol;
import org.eclipse.cdt.internal.core.parser.pst.ISymbol;
import org.eclipse.cdt.internal.core.parser.pst.ISymbolASTExtension;
import org.eclipse.cdt.internal.core.parser.pst.ISymbolOwner;
import org.eclipse.cdt.internal.core.parser.pst.NamespaceSymbolExtension;
import org.eclipse.cdt.internal.core.parser.pst.ParserSymbolTable;
import org.eclipse.cdt.internal.core.parser.pst.ParserSymbolTableException;
@ -101,11 +102,10 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
if( ! iter.hasNext() )
throw new ASTSemanticException();
IToken t1 = (IToken)iter.next();
IContainerSymbol symbol = null;
List references = new ArrayList();
symbol = getScopeToSearchUpon(scope, t1, references );
symbol = getScopeToSearchUpon(scope, (IToken)duple.getFirstToken(), iter );
while( iter.hasNext() )
{
@ -134,24 +134,19 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
protected IContainerSymbol getScopeToSearchUpon(
IASTScope currentScope,
IToken firstToken, List references ) throws ASTSemanticException
IToken firstToken, Iterator iterator ) throws ASTSemanticException
{
IContainerSymbol symbol = null;
if( firstToken.getType() == IToken.tCOLONCOLON )
symbol = pst.getCompilationUnit();
else
{
try
{
symbol = (IContainerSymbol)scopeToSymbol(currentScope).Lookup( firstToken.getImage() );
references.add( createReference( symbol, firstToken.getImage(), firstToken.getOffset() ));
}
catch( ParserSymbolTableException pste )
{
}
}
return symbol;
if( firstToken.getType() == IToken.tCOLONCOLON )
{
iterator.next();
return pst.getCompilationUnit();
}
else
{
return (IContainerSymbol)scopeToSymbol(currentScope);
}
}
protected IContainerSymbol scopeToSymbol(IASTScope currentScope)
{
@ -165,10 +160,44 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
boolean isTypeName,
ITokenDuple name,
int startingOffset,
int endingOffset)
int endingOffset) throws ASTSemanticException
{
// TODO Auto-generated method stub
return null;
List references = new ArrayList();
Iterator iter = name.iterator();
if( ! iter.hasNext() )
throw new ASTSemanticException();
ISymbol symbol = getScopeToSearchUpon( scope, name.getFirstToken(), iter );
while( iter.hasNext() )
{
IToken t = (IToken)iter.next();
if( t.getType() == IToken.tCOLONCOLON ) continue;
try
{
if( t != name.getLastToken() )
symbol = ((IContainerSymbol)symbol).LookupNestedNameSpecifier( t.getImage() );
else
symbol = ((IContainerSymbol)symbol).Lookup( t.getImage() );
}
catch (ParserSymbolTableException e)
{
throw new ASTSemanticException();
}
references.add( createReference( symbol, t.getImage(), t.getOffset() ) );
}
try
{
scopeToSymbol(scope).addUsingDeclaration( name.getLastToken().getImage(), symbol.getContainingSymbol() );
}
catch (ParserSymbolTableException e)
{
throw new ASTSemanticException();
}
return new ASTUsingDeclaration( scope,
symbol.getASTExtension().getPrimaryDeclaration(), isTypeName, startingOffset, endingOffset, references );
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createASMDefinition(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, int, int)
@ -179,8 +208,8 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
int first,
int last)
{
// TODO Auto-generated method stub
return null;
// TODO Fix This
return new ASTASMDefinition();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createNamespaceDefinition(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, int, int)
@ -290,8 +319,8 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
String spec,
int startingOffset)
{
// TODO Auto-generated method stub
return null;
// TODO FIX THIS
return new ASTLinkageSpecification();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createClassSpecifier(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, org.eclipse.cdt.core.parser.ast.ASTClassKind, org.eclipse.cdt.core.parser.ast.IASTClassSpecifier.ClassNameType, org.eclipse.cdt.core.parser.ast.ASTAccessVisibility, org.eclipse.cdt.core.parser.ast.IASTTemplate, int, int)
@ -356,10 +385,9 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
if( ! iterator.hasNext() )
throw new ASTSemanticException();
IToken t1 = (IToken)iterator.next();
IContainerSymbol symbol = null;
symbol = getScopeToSearchUpon(astClassSpec.getOwnerScope(), t1, references );
symbol = getScopeToSearchUpon(astClassSpec, (IToken)parentClassName.getFirstToken(), iterator );
while( iterator.hasNext() )
{
@ -384,7 +412,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
* @param string
* @return
*/
private IASTReference createReference(ISymbol symbol, String string, int offset ) throws ASTSemanticException
protected IASTReference createReference(ISymbol symbol, String string, int offset ) throws ASTSemanticException
{
if( symbol.getType() == TypeInfo.t_namespace )
{
@ -396,8 +424,29 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
{
return new ASTClassReference( offset, string, (IASTClassSpecifier)symbol.getASTExtension().getPrimaryDeclaration() );
}
// else if( symbol.getType() == ParserSymbolTable.TypeInfo.t_enumeration )
// return new
else if( symbol.getType() == TypeInfo.t_enumeration )
return new ASTEnumerationReference( offset, string, (IASTEnumerationSpecifier)symbol.getASTExtension().getPrimaryDeclaration() );
else if( ( symbol.getType() == TypeInfo.t_type ) ||
( symbol.getType() == TypeInfo.t_bool )||
( symbol.getType() == TypeInfo.t_char ) ||
( symbol.getType() == TypeInfo.t_wchar_t )||
( symbol.getType() == TypeInfo.t_int ) ||
( symbol.getType() == TypeInfo.t_float )||
( symbol.getType() == TypeInfo.t_double ) ||
( symbol.getType() == TypeInfo.t_void ) )
{
if( symbol.getContainingSymbol().getType() == TypeInfo.t_class ||
symbol.getContainingSymbol().getType() == TypeInfo.t_struct ||
symbol.getContainingSymbol().getType() == TypeInfo.t_union )
{
return new ASTFieldReference( offset, string, (IASTField)symbol.getASTExtension().getPrimaryDeclaration());
}
else
{
return new ASTVariableReference( offset, string, (IASTVariable)symbol.getASTExtension().getPrimaryDeclaration());
}
}
throw new ASTSemanticException();
}
@ -410,8 +459,8 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
int startingOffset,
int endOffset)
{
// TODO Auto-generated method stub
return null;
//TODO FIX THIS
return new ASTElaboratedTypeSpecifier();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createEnumerationSpecifier(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, int, int)
@ -420,10 +469,32 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
IASTScope scope,
String name,
int startingOffset,
int nameOffset)
int nameOffset) throws ASTSemanticException
{
// TODO Auto-generated method stub
return null;
IContainerSymbol containerSymbol = scopeToSymbol(scope);
TypeInfo.eType pstType = TypeInfo.t_enumeration;
IDerivableContainerSymbol classSymbol = pst.newDerivableContainerSymbol( name, pstType );
try
{
containerSymbol.addSymbol( classSymbol );
}
catch (ParserSymbolTableException e)
{
throw new ASTSemanticException();
}
ASTEnumerationSpecifier enumSpecifier = new ASTEnumerationSpecifier( classSymbol, startingOffset, nameOffset );
try
{
attachSymbolExtension(classSymbol, enumSpecifier );
}
catch (ExtensionException e1)
{
throw new ASTSemanticException();
}
return enumSpecifier;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#addEnumerator(org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier, java.lang.String, int, int, org.eclipse.cdt.core.parser.ast.IASTExpression)
@ -433,9 +504,30 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
String string,
int startingOffset,
int endingOffset,
IASTExpression initialValue)
IASTExpression initialValue) throws ASTSemanticException
{
// TODO Auto-generated method stub
IContainerSymbol enumerationSymbol = (IContainerSymbol)((ISymbolOwner)enumeration).getSymbol();
ISymbol enumeratorSymbol = pst.newSymbol( string, TypeInfo.t_enumerator );
try
{
enumerationSymbol.addSymbol( enumeratorSymbol );
}
catch (ParserSymbolTableException e1)
{
throw new ASTSemanticException();
}
ASTEnumerator enumerator = new ASTEnumerator( enumeratorSymbol, startingOffset, endingOffset, initialValue );
((ASTEnumerationSpecifier)enumeration).addEnumerator( enumerator );
try
{
attachSymbolExtension( enumeratorSymbol, enumerator );
}
catch (ExtensionException e)
{
throw new ASTSemanticException();
}
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createExpression(org.eclipse.cdt.core.parser.ast.IASTExpression.Kind, org.eclipse.cdt.core.parser.ast.IASTExpression, org.eclipse.cdt.core.parser.ast.IASTExpression, org.eclipse.cdt.core.parser.ast.IASTExpression, java.lang.String, java.lang.String, java.lang.String, org.eclipse.cdt.core.parser.ast.IASTExpression.IASTNewExpressionDescriptor)
@ -450,7 +542,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
String literal,
IASTNewExpressionDescriptor newDescriptor)
{
// TODO Auto-generated method stub
// TODO FIX THIS
return null;
}
/* (non-Javadoc)
@ -458,7 +550,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
*/
public IASTNewExpressionDescriptor createNewDescriptor()
{
// TODO Auto-generated method stub
// TODO FIX THIS
return null;
}
/* (non-Javadoc)
@ -553,7 +645,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
Iterator i = typeName.iterator();
IToken first = typeName.getFirstToken();
IContainerSymbol typeSymbol = null;
ISymbol typeSymbol = null;
if( first.getType() == IToken.tCOLONCOLON )
{
typeSymbol = pst.getCompilationUnit();
@ -571,7 +663,11 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
try
{
typeSymbol = typeSymbol.LookupNestedNameSpecifier( current.getImage());
if( current != typeName.getLastToken() )
typeSymbol = ((IContainerSymbol)typeSymbol).LookupNestedNameSpecifier( current.getImage());
else
typeSymbol = ((IContainerSymbol)typeSymbol).Lookup( current.getImage());
references.add( createReference( typeSymbol, current.getImage(), current.getOffset() ));
}
catch (ParserSymbolTableException e)
@ -607,7 +703,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
IASTTemplate ownerTemplate)
{
// TODO Auto-generated method stub
return null;
return new ASTFunction();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createAbstractDeclaration(boolean, org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier, java.util.List, java.util.List)
@ -645,7 +741,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
ASTAccessVisibility visibility)
{
// TODO Auto-generated method stub
return null;
return new ASTMethod();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createVariable(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, boolean, org.eclipse.cdt.core.parser.ast.IASTInitializerClause, org.eclipse.cdt.core.parser.ast.IASTExpression, org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration, boolean, boolean, boolean, boolean, int, int)
@ -662,7 +758,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
boolean isRegister,
boolean isStatic,
int startingOffset,
int nameOffset)
int nameOffset) throws ASTSemanticException
{
List references = new ArrayList();
ISymbol newSymbol = cloneSimpleTypeSymbol(scope, name, abstractDeclaration, references);
@ -675,7 +771,16 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
isStatic,
newSymbol);
return new ASTVariable( newSymbol, abstractDeclaration, initializerClause, bitfieldExpression, startingOffset, nameOffset, references );
ASTVariable variable = new ASTVariable( newSymbol, abstractDeclaration, initializerClause, bitfieldExpression, startingOffset, nameOffset, references );
try
{
attachSymbolExtension(newSymbol, variable );
}
catch (ExtensionException e)
{
throw new ASTSemanticException();
}
return variable;
}
private void setSymbolBits(
boolean isAuto,
@ -693,7 +798,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
newSymbol.getTypeInfo().setBit( isStatic, TypeInfo.isStatic );
newSymbol.getTypeInfo().setBit( abstractDeclaration.isConst(), TypeInfo.isConst );
}
private ISymbol cloneSimpleTypeSymbol(
protected ISymbol cloneSimpleTypeSymbol(
IASTScope scope,
String name,
IASTAbstractDeclaration abstractDeclaration,
@ -734,7 +839,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
boolean isStatic,
int startingOffset,
int nameOffset,
ASTAccessVisibility visibility)
ASTAccessVisibility visibility) throws ASTSemanticException
{
List references = new ArrayList();
ISymbol newSymbol = cloneSimpleTypeSymbol(scope, name, abstractDeclaration, references);
@ -746,8 +851,16 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
isRegister,
isStatic,
newSymbol);
return new ASTField( newSymbol, abstractDeclaration, initializerClause, bitfieldExpression, startingOffset, nameOffset, references, visibility );
ASTField field = new ASTField( newSymbol, abstractDeclaration, initializerClause, bitfieldExpression, startingOffset, nameOffset, references, visibility );
try
{
attachSymbolExtension(newSymbol, field );
}
catch (ExtensionException e)
{
throw new ASTSemanticException();
}
return field;
}
@ -763,7 +876,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
IASTInitializerClause initializerClause)
{
// TODO Auto-generated method stub
return null;
return new ASTParameterDeclaration();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createTemplateDeclaration(org.eclipse.cdt.core.parser.ast.IASTScope, java.util.List, boolean, int)
@ -775,7 +888,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
int startingOffset)
{
// TODO Auto-generated method stub
return null;
return new ASTTemplateDeclaration();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createTemplateParameter(org.eclipse.cdt.core.parser.ast.IASTTemplateParameter.ParamKind, java.lang.String, java.lang.String, org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration, java.util.List)
@ -798,7 +911,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
int startingOffset)
{
// TODO Auto-generated method stub
return null;
return new ASTTemplateInstantiation();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createTemplateSpecialization(org.eclipse.cdt.core.parser.ast.IASTScope, int)
@ -808,7 +921,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
int startingOffset)
{
// TODO Auto-generated method stub
return null;
return new ASTTemplateSpecialization();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createTypedef(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration, int, int)
@ -821,7 +934,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
int nameOffset)
{
// TODO Auto-generated method stub
return null;
return new ASTTypedef();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createTypeSpecDeclaration(org.eclipse.cdt.core.parser.ast.IASTScope, org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier, org.eclipse.cdt.core.parser.ast.IASTTemplate, int, int)

View file

@ -101,9 +101,7 @@ public class ASTEnumerationSpecifier extends ASTScopedTypeSpecifier
{
return Collections.unmodifiableList( enumerators ).iterator();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier#addEnumerator(org.eclipse.cdt.core.parser.ast.IASTEnumerator)
*/
public void addEnumerator(IASTEnumerator enumerator)
{
enumerators.add(enumerator);

View file

@ -42,7 +42,6 @@ public class ASTEnumerator
offsets.setStartingOffset( startingOffset );
offsets.setNameOffset( startingOffset );
offsets.setEndingOffset( endingOffset );
enumeration.addEnumerator(this);
this.initialValue = initialValue;
}
/* (non-Javadoc)

View file

@ -11,6 +11,8 @@
package org.eclipse.cdt.internal.core.parser.ast.quick;
import org.eclipse.cdt.core.parser.ISourceElementRequestor;
import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException;
import org.eclipse.cdt.core.parser.ast.IASTDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTScope;
import org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration;
import org.eclipse.cdt.internal.core.parser.ast.Offsets;
@ -96,4 +98,11 @@ public class ASTUsingDeclaration
public void exitScope(ISourceElementRequestor requestor)
{
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration#getUsingType()
*/
public IASTDeclaration getUsingType() throws ASTNotImplementedException
{
throw new ASTNotImplementedException();
}
}

View file

@ -153,6 +153,7 @@ public class QuickParseASTFactory extends BaseASTFactory implements IASTFactory
public void addEnumerator(IASTEnumerationSpecifier enumeration, String string, int startingOffset, int endingOffset, IASTExpression initialValue)
{
IASTEnumerator enumerator = new ASTEnumerator( enumeration, string, startingOffset, endingOffset, initialValue );
((ASTEnumerationSpecifier)enumeration).addEnumerator( enumerator );
}
/* (non-Javadoc)

View file

@ -14,7 +14,6 @@ import java.util.Iterator;
import java.util.NoSuchElementException;
import org.eclipse.cdt.internal.core.parser.ast.complete.ASTSymbol;
import org.eclipse.cdt.internal.core.parser.pst.ISymbolASTExtension.ExtensionException;
/**
* @author jcamelon

View file

@ -16,7 +16,6 @@ import java.util.List;
import java.util.NoSuchElementException;
import org.eclipse.cdt.internal.core.parser.ast.complete.ASTSymbol;
import org.eclipse.cdt.internal.core.parser.pst.ISymbolASTExtension.ExtensionException;
/**
* @author jcamelon

View file

@ -14,7 +14,6 @@ import java.util.Iterator;
import java.util.NoSuchElementException;
import org.eclipse.cdt.internal.core.parser.ast.complete.ASTSymbol;
import org.eclipse.cdt.internal.core.parser.pst.ISymbolASTExtension.ExtensionException;
/**