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
Added CompleteParseASTTest::testArrayModExpression(), testPointerVariable() &
testExceptionSpecification().

View file

@ -55,8 +55,8 @@ public class AutomatedIntegrationSuite extends TestSuite
private int numberOfFailedTests = 0;
private int numberOfFailedFailedTests = 0;
// switching to failed tests
private boolean failedTests = false;
private boolean skipTest = false;
protected boolean failedTests = false;
protected boolean skipTest = false;
public AutomatedIntegrationSuite() {}
@ -220,14 +220,14 @@ public class AutomatedIntegrationSuite extends TestSuite
System.out.println();
}
private void startSuccessTests() {
protected void startSuccessTests() {
failedTests = false;
System.out.println();
System.out.println("*** Starting success tests ***");
System.out.println();
}
private void startFailedTests() {
protected void startFailedTests() {
failedTests = true;
System.out.println();
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
Added X-Reference support for ArrayModifiers and Exception Specifications.
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
*
*/
public interface IASTElaboratedTypeSpecifier extends IASTTypeSpecifier, IASTOffsetableElement, IASTQualifiedNameElement, ISourceElementCallbackDelegate {
public interface IASTElaboratedTypeSpecifier extends IASTTypeSpecifier, IASTOffsetableElement, IASTQualifiedNameElement, ISourceElementCallbackDelegate, IASTOffsetableNamedElement {
public String getName();
public ASTClassKind getClassKind();

View file

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

View file

@ -27,7 +27,7 @@ public class TokenDuple implements ITokenDuple {
firstToken = first;
lastToken = last;
}
private final IToken firstToken, lastToken;
protected final IToken firstToken, lastToken;
/**
* @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.IASTElaboratedTypeSpecifier;
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;
/**
@ -29,7 +29,7 @@ public class ASTElaboratedTypeSpecifier extends ASTSymbol implements IASTElabora
private final boolean isForwardDeclaration;
private final ASTClassKind kind;
private final ASTQualifiedNamedElement qualifiedName;
private Offsets offsets = new Offsets();
private NamedOffsets offsets = new NamedOffsets();
private final ASTReferenceStore store;
/**
@ -38,11 +38,12 @@ public class ASTElaboratedTypeSpecifier extends ASTSymbol implements IASTElabora
* @param startingOffset
* @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 );
this.kind = kind;
setStartingOffset( startingOffset );
setNameOffset( nameOffset );
setEndingOffset( endOffset );
qualifiedName = new ASTQualifiedNamedElement( getOwnerScope(), checkSymbol.getName() );
store = new ASTReferenceStore( references );
@ -126,4 +127,16 @@ public class ASTElaboratedTypeSpecifier extends ASTSymbol implements IASTElabora
{
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 )
{
checkSymbol = pst.newDerivableContainerSymbol( lastToken.getImage(), pstType );
checkSymbol.setIsForwardDeclaration( true );
try
@ -1357,7 +1356,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
}
ASTElaboratedTypeSpecifier elab =
new ASTElaboratedTypeSpecifier( checkSymbol, kind, startingOffset, endOffset, references, isForewardDecl );
new ASTElaboratedTypeSpecifier( checkSymbol, kind, startingOffset, name.getFirstToken().getOffset(), endOffset, references, isForewardDecl );
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.IASTScope;
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
@ -25,7 +25,7 @@ import org.eclipse.cdt.internal.core.parser.ast.Offsets;
public class ASTElaboratedTypeSpecifier implements IASTElaboratedTypeSpecifier
{
private Offsets offsets = new Offsets();
private NamedOffsets offsets = new NamedOffsets();
private final String typeName;
private final ASTClassKind classKind;
private final ASTQualifiedNamedElement qualifiedName;
@ -35,12 +35,13 @@ public class ASTElaboratedTypeSpecifier implements IASTElaboratedTypeSpecifier
* @param startingOffset
* @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;
this.typeName = typeName;
offsets.setStartingOffset( startingOffset );
offsets.setEndingOffset( endOffset );
setStartingOffset( startingOffset );
setNameOffset( nameOffset );
setEndingOffset( endOffset );
qualifiedName = new ASTQualifiedNamedElement( scope, typeName );
}
/* (non-Javadoc)
@ -119,4 +120,16 @@ public class ASTElaboratedTypeSpecifier implements IASTElaboratedTypeSpecifier
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)
{
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
* @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 ){
throw new ParserSymbolTableException( ParserSymbolTableException.r_BadTypeInfo );
@ -218,7 +218,7 @@ public class ParserSymbolTable {
*
* 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;
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
* 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 newType = newSymbol.getType();
@ -460,7 +460,7 @@ public class ParserSymbolTable {
return false;
}
private static boolean isValidOverload( LinkedList origList, ISymbol newSymbol ){
protected static boolean isValidOverload( LinkedList origList, ISymbol newSymbol ){
if( origList.size() == 1 ){
return isValidOverload( (ISymbol)origList.getFirst(), newSymbol );
} 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
* provided in data.parameters.
*/
static private ISymbol resolveAmbiguities( LookupData data ) throws ParserSymbolTableException{
static protected ISymbol resolveAmbiguities( LookupData data ) throws ParserSymbolTableException{
ISymbol decl = null;
ISymbol obj = 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 ){
return null;
}
@ -983,7 +983,7 @@ public class ParserSymbolTable {
return -1;
}
static private void getAssociatedScopes( ISymbol symbol, HashSet associated ){
static protected void getAssociatedScopes( ISymbol symbol, HashSet associated ){
if( symbol == null ){
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;
//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.
*/
// TODO move this to ITypeInfo ?
static private TypeInfo getFlatTypeInfo( TypeInfo topInfo ){
static protected TypeInfo getFlatTypeInfo( TypeInfo topInfo ){
TypeInfo returnInfo = topInfo;
TypeInfo info = null;
@ -1794,7 +1794,7 @@ public class ParserSymbolTable {
private LinkedList undoList = new LinkedList();
private HashSet markSet = new HashSet();
private void pushCommand( Command command ){
protected void pushCommand( Command command ){
undoList.addFirst( command );
}
@ -3257,7 +3257,7 @@ public class ParserSymbolTable {
}
private boolean isVirtual = false;
private ISymbol parent = null;
protected ISymbol parent = null;
private final ASTAccessVisibility access;
private final int offset;
private final List references;

View file

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