1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00
Removed warnings from SymbolTable & QuickParseCallback (removing implicit accessor generation).
	Made IASTElaboratedTypeSpecifier derive from IASTOffsetableNamedElement (as it should).  

TESTS
	Removed warnings from AutomatedIntegrationSuite.java (removing implicit accessor generation).
This commit is contained in:
John Camelon 2003-08-14 19:49:48 +00:00
parent 83c27c9bb1
commit 6acb69e971
12 changed files with 64 additions and 32 deletions

View file

@ -1,3 +1,6 @@
2003-08-14 John Camelon
Removed warnings from AutomatedIntegrationSuite.java (removing implicit accessor generation).
2003-08-14 John Camelon 2003-08-14 John Camelon
Added CompleteParseASTTest::testArrayModExpression(), testPointerVariable() & Added CompleteParseASTTest::testArrayModExpression(), testPointerVariable() &
testExceptionSpecification(). testExceptionSpecification().

View file

@ -55,8 +55,8 @@ public class AutomatedIntegrationSuite extends TestSuite
private int numberOfFailedTests = 0; private int numberOfFailedTests = 0;
private int numberOfFailedFailedTests = 0; private int numberOfFailedFailedTests = 0;
// switching to failed tests // switching to failed tests
private boolean failedTests = false; protected boolean failedTests = false;
private boolean skipTest = false; protected boolean skipTest = false;
public AutomatedIntegrationSuite() {} public AutomatedIntegrationSuite() {}
@ -220,14 +220,14 @@ public class AutomatedIntegrationSuite extends TestSuite
System.out.println(); System.out.println();
} }
private void startSuccessTests() { protected void startSuccessTests() {
failedTests = false; failedTests = false;
System.out.println(); System.out.println();
System.out.println("*** Starting success tests ***"); System.out.println("*** Starting success tests ***");
System.out.println(); System.out.println();
} }
private void startFailedTests() { protected void startFailedTests() {
failedTests = true; failedTests = true;
System.out.println(); System.out.println();
System.out.println("*** Starting failed tests ***"); System.out.println("*** Starting failed tests ***");

View file

@ -1,3 +1,7 @@
2003-08-14 John Camelon
Removed warnings from SymbolTable & QuickParseCallback (removing implicit accessor generation).
Made IASTElaboratedTypeSpecifier derive from IASTOffsetableNamedElement (as it should).
2003-08-14 John Camelon 2003-08-14 John Camelon
Added X-Reference support for ArrayModifiers and Exception Specifications. Added X-Reference support for ArrayModifiers and Exception Specifications.
Fixed Bug 41551 - HandleInclusion always throws ScannerException on local includes. Fixed Bug 41551 - HandleInclusion always throws ScannerException on local includes.

View file

@ -18,7 +18,7 @@ import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate;
* @author jcamelon * @author jcamelon
* *
*/ */
public interface IASTElaboratedTypeSpecifier extends IASTTypeSpecifier, IASTOffsetableElement, IASTQualifiedNameElement, ISourceElementCallbackDelegate { public interface IASTElaboratedTypeSpecifier extends IASTTypeSpecifier, IASTOffsetableElement, IASTQualifiedNameElement, ISourceElementCallbackDelegate, IASTOffsetableNamedElement {
public String getName(); public String getName();
public ASTClassKind getClassKind(); public ASTClassKind getClassKind();

View file

@ -27,9 +27,9 @@ import org.eclipse.cdt.core.parser.ast.IASTOffsetableElement;
public class QuickParseCallback extends NullSourceElementRequestor implements IQuickParseCallback public class QuickParseCallback extends NullSourceElementRequestor implements IQuickParseCallback
{ {
private IASTCompilationUnit compilationUnit = null; protected IASTCompilationUnit compilationUnit = null;
private List inclusions = new ArrayList(); protected List inclusions = new ArrayList();
private List macros = new ArrayList(); protected List macros = new ArrayList();
public Iterator getInclusions() public Iterator getInclusions()
{ {

View file

@ -27,7 +27,7 @@ public class TokenDuple implements ITokenDuple {
firstToken = first; firstToken = first;
lastToken = last; lastToken = last;
} }
private final IToken firstToken, lastToken; protected final IToken firstToken, lastToken;
/** /**
* @return * @return
*/ */

View file

@ -17,7 +17,7 @@ import org.eclipse.cdt.core.parser.ast.ASTClassKind;
import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException; import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException;
import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier; import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier;
import org.eclipse.cdt.internal.core.parser.ast.ASTQualifiedNamedElement; import org.eclipse.cdt.internal.core.parser.ast.ASTQualifiedNamedElement;
import org.eclipse.cdt.internal.core.parser.ast.Offsets; import org.eclipse.cdt.internal.core.parser.ast.NamedOffsets;
import org.eclipse.cdt.internal.core.parser.pst.ISymbol; import org.eclipse.cdt.internal.core.parser.pst.ISymbol;
/** /**
@ -29,7 +29,7 @@ public class ASTElaboratedTypeSpecifier extends ASTSymbol implements IASTElabora
private final boolean isForwardDeclaration; private final boolean isForwardDeclaration;
private final ASTClassKind kind; private final ASTClassKind kind;
private final ASTQualifiedNamedElement qualifiedName; private final ASTQualifiedNamedElement qualifiedName;
private Offsets offsets = new Offsets(); private NamedOffsets offsets = new NamedOffsets();
private final ASTReferenceStore store; private final ASTReferenceStore store;
/** /**
@ -38,11 +38,12 @@ public class ASTElaboratedTypeSpecifier extends ASTSymbol implements IASTElabora
* @param startingOffset * @param startingOffset
* @param endOffset * @param endOffset
*/ */
public ASTElaboratedTypeSpecifier(ISymbol checkSymbol, ASTClassKind kind, int startingOffset, int endOffset, List references, boolean isDecl ) public ASTElaboratedTypeSpecifier(ISymbol checkSymbol, ASTClassKind kind, int startingOffset, int nameOffset, int endOffset, List references, boolean isDecl )
{ {
super( checkSymbol ); super( checkSymbol );
this.kind = kind; this.kind = kind;
setStartingOffset( startingOffset ); setStartingOffset( startingOffset );
setNameOffset( nameOffset );
setEndingOffset( endOffset ); setEndingOffset( endOffset );
qualifiedName = new ASTQualifiedNamedElement( getOwnerScope(), checkSymbol.getName() ); qualifiedName = new ASTQualifiedNamedElement( getOwnerScope(), checkSymbol.getName() );
store = new ASTReferenceStore( references ); store = new ASTReferenceStore( references );
@ -126,4 +127,16 @@ public class ASTElaboratedTypeSpecifier extends ASTSymbol implements IASTElabora
{ {
return qualifiedName.getFullyQualifiedName(); return qualifiedName.getFullyQualifiedName();
} }
/* (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);
}
} }

View file

@ -1344,7 +1344,6 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
{ {
if( checkSymbol == null ) if( checkSymbol == null )
{ {
checkSymbol = pst.newDerivableContainerSymbol( lastToken.getImage(), pstType ); checkSymbol = pst.newDerivableContainerSymbol( lastToken.getImage(), pstType );
checkSymbol.setIsForwardDeclaration( true ); checkSymbol.setIsForwardDeclaration( true );
try try
@ -1357,7 +1356,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
} }
ASTElaboratedTypeSpecifier elab = ASTElaboratedTypeSpecifier elab =
new ASTElaboratedTypeSpecifier( checkSymbol, kind, startingOffset, endOffset, references, isForewardDecl ); new ASTElaboratedTypeSpecifier( checkSymbol, kind, startingOffset, name.getFirstToken().getOffset(), endOffset, references, isForewardDecl );
try try
{ {

View file

@ -16,7 +16,7 @@ import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException;
import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier; import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTScope; import org.eclipse.cdt.core.parser.ast.IASTScope;
import org.eclipse.cdt.internal.core.parser.ast.ASTQualifiedNamedElement; import org.eclipse.cdt.internal.core.parser.ast.ASTQualifiedNamedElement;
import org.eclipse.cdt.internal.core.parser.ast.Offsets; import org.eclipse.cdt.internal.core.parser.ast.NamedOffsets;
/** /**
* @author jcamelon * @author jcamelon
@ -25,7 +25,7 @@ import org.eclipse.cdt.internal.core.parser.ast.Offsets;
public class ASTElaboratedTypeSpecifier implements IASTElaboratedTypeSpecifier public class ASTElaboratedTypeSpecifier implements IASTElaboratedTypeSpecifier
{ {
private Offsets offsets = new Offsets(); private NamedOffsets offsets = new NamedOffsets();
private final String typeName; private final String typeName;
private final ASTClassKind classKind; private final ASTClassKind classKind;
private final ASTQualifiedNamedElement qualifiedName; private final ASTQualifiedNamedElement qualifiedName;
@ -35,12 +35,13 @@ public class ASTElaboratedTypeSpecifier implements IASTElaboratedTypeSpecifier
* @param startingOffset * @param startingOffset
* @param endOffset * @param endOffset
*/ */
public ASTElaboratedTypeSpecifier(IASTScope scope, ASTClassKind elaboratedClassKind, String typeName, int startingOffset, int endOffset) public ASTElaboratedTypeSpecifier(IASTScope scope, ASTClassKind elaboratedClassKind, String typeName, int startingOffset, int nameOffset, int endOffset)
{ {
classKind = elaboratedClassKind; classKind = elaboratedClassKind;
this.typeName = typeName; this.typeName = typeName;
offsets.setStartingOffset( startingOffset ); setStartingOffset( startingOffset );
offsets.setEndingOffset( endOffset ); setNameOffset( nameOffset );
setEndingOffset( endOffset );
qualifiedName = new ASTQualifiedNamedElement( scope, typeName ); qualifiedName = new ASTQualifiedNamedElement( scope, typeName );
} }
/* (non-Javadoc) /* (non-Javadoc)
@ -119,4 +120,16 @@ public class ASTElaboratedTypeSpecifier implements IASTElaboratedTypeSpecifier
public void exitScope(ISourceElementRequestor requestor) public void exitScope(ISourceElementRequestor requestor)
{ {
} }
/* (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);
}
} }

View file

@ -265,6 +265,6 @@ public class QuickParseASTFactory extends BaseASTFactory implements IASTFactory
public IASTElaboratedTypeSpecifier createElaboratedTypeSpecifier(IASTScope scope, ASTClassKind elaboratedClassKind, ITokenDuple typeName, int startingOffset, int endOffset, boolean isForewardDecl) public IASTElaboratedTypeSpecifier createElaboratedTypeSpecifier(IASTScope scope, ASTClassKind elaboratedClassKind, ITokenDuple typeName, int startingOffset, int endOffset, boolean isForewardDecl)
{ {
return new ASTElaboratedTypeSpecifier( scope, elaboratedClassKind, typeName.toString(), startingOffset, endOffset ); return new ASTElaboratedTypeSpecifier( scope, elaboratedClassKind, typeName.toString(), startingOffset, typeName.getFirstToken().getOffset(), endOffset );
} }
} }

View file

@ -82,7 +82,7 @@ public class ParserSymbolTable {
* @return Declaration * @return Declaration
* @throws ParserSymbolTableException * @throws ParserSymbolTableException
*/ */
static private void lookup( LookupData data, IContainerSymbol inSymbol ) throws ParserSymbolTableException static protected void lookup( LookupData data, IContainerSymbol inSymbol ) throws ParserSymbolTableException
{ {
if( data.type != TypeInfo.t_any && data.type.compareTo(TypeInfo.t_class) < 0 && data.upperType.compareTo(TypeInfo.t_union) > 0 ){ if( data.type != TypeInfo.t_any && data.type.compareTo(TypeInfo.t_class) < 0 && data.upperType.compareTo(TypeInfo.t_union) > 0 ){
throw new ParserSymbolTableException( ParserSymbolTableException.r_BadTypeInfo ); throw new ParserSymbolTableException( ParserSymbolTableException.r_BadTypeInfo );
@ -218,7 +218,7 @@ public class ParserSymbolTable {
* *
* Look for data.name in our collection _containedDeclarations * Look for data.name in our collection _containedDeclarations
*/ */
private static boolean lookupInContained( LookupData data, IContainerSymbol lookIn ){ protected static boolean lookupInContained( LookupData data, IContainerSymbol lookIn ){
boolean foundSomething = false; boolean foundSomething = false;
ISymbol temp = null; ISymbol temp = null;
@ -436,7 +436,7 @@ public class ParserSymbolTable {
* 3.4-1 "Name lookup may associate more than one declaration with a name if * 3.4-1 "Name lookup may associate more than one declaration with a name if
* it finds the name to be a function name" * it finds the name to be a function name"
*/ */
private static boolean isValidOverload( ISymbol origSymbol, ISymbol newSymbol ){ protected static boolean isValidOverload( ISymbol origSymbol, ISymbol newSymbol ){
TypeInfo.eType origType = origSymbol.getType(); TypeInfo.eType origType = origSymbol.getType();
TypeInfo.eType newType = newSymbol.getType(); TypeInfo.eType newType = newSymbol.getType();
@ -460,7 +460,7 @@ public class ParserSymbolTable {
return false; return false;
} }
private static boolean isValidOverload( LinkedList origList, ISymbol newSymbol ){ protected static boolean isValidOverload( LinkedList origList, ISymbol newSymbol ){
if( origList.size() == 1 ){ if( origList.size() == 1 ){
return isValidOverload( (ISymbol)origList.getFirst(), newSymbol ); return isValidOverload( (ISymbol)origList.getFirst(), newSymbol );
} else if ( origList.size() > 1 ){ } else if ( origList.size() > 1 ){
@ -534,7 +534,7 @@ public class ParserSymbolTable {
* all, when looking for functions with no parameters, an empty list must be * all, when looking for functions with no parameters, an empty list must be
* provided in data.parameters. * provided in data.parameters.
*/ */
static private ISymbol resolveAmbiguities( LookupData data ) throws ParserSymbolTableException{ static protected ISymbol resolveAmbiguities( LookupData data ) throws ParserSymbolTableException{
ISymbol decl = null; ISymbol decl = null;
ISymbol obj = null; ISymbol obj = null;
IContainerSymbol cls = null; IContainerSymbol cls = null;
@ -655,7 +655,7 @@ public class ParserSymbolTable {
} }
} }
static private IParameterizedSymbol resolveFunction( LookupData data, LinkedList functions ) throws ParserSymbolTableException{ static protected IParameterizedSymbol resolveFunction( LookupData data, LinkedList functions ) throws ParserSymbolTableException{
if( functions == null ){ if( functions == null ){
return null; return null;
} }
@ -983,7 +983,7 @@ public class ParserSymbolTable {
return -1; return -1;
} }
static private void getAssociatedScopes( ISymbol symbol, HashSet associated ){ static protected void getAssociatedScopes( ISymbol symbol, HashSet associated ){
if( symbol == null ){ if( symbol == null ){
return; return;
} }
@ -1027,7 +1027,7 @@ public class ParserSymbolTable {
} }
} }
static private boolean okToAddUsingDeclaration( ISymbol obj, IContainerSymbol context ){ static protected boolean okToAddUsingDeclaration( ISymbol obj, IContainerSymbol context ){
boolean okToAdd = false; boolean okToAdd = false;
//7.3.3-5 A using-declaration shall not name a template-id //7.3.3-5 A using-declaration shall not name a template-id
@ -1426,7 +1426,7 @@ public class ParserSymbolTable {
* remaining TypeInfo's represent the object. * remaining TypeInfo's represent the object.
*/ */
// TODO move this to ITypeInfo ? // TODO move this to ITypeInfo ?
static private TypeInfo getFlatTypeInfo( TypeInfo topInfo ){ static protected TypeInfo getFlatTypeInfo( TypeInfo topInfo ){
TypeInfo returnInfo = topInfo; TypeInfo returnInfo = topInfo;
TypeInfo info = null; TypeInfo info = null;
@ -1794,7 +1794,7 @@ public class ParserSymbolTable {
private LinkedList undoList = new LinkedList(); private LinkedList undoList = new LinkedList();
private HashSet markSet = new HashSet(); private HashSet markSet = new HashSet();
private void pushCommand( Command command ){ protected void pushCommand( Command command ){
undoList.addFirst( command ); undoList.addFirst( command );
} }
@ -3257,7 +3257,7 @@ public class ParserSymbolTable {
} }
private boolean isVirtual = false; private boolean isVirtual = false;
private ISymbol parent = null; protected ISymbol parent = null;
private final ASTAccessVisibility access; private final ASTAccessVisibility access;
private final int offset; private final int offset;
private final List references; private final List references;

View file

@ -114,7 +114,7 @@ public class TypeInfo {
//public static final eType t_templateParameter = new eType( 18 ); //public static final eType t_templateParameter = new eType( 18 );
public static class eType implements Comparable{ public static class eType implements Comparable{
private eType( int v ){ protected eType( int v ){
_val = v; _val = v;
} }