1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 17:35:35 +02:00

Removed IASTTypeId.getSymbol() as it was exposing an internal interface.

Removed warnings.
This commit is contained in:
John Camelon 2004-10-04 19:14:16 +00:00
parent ad9cde0b51
commit 9b1cc11593
4 changed files with 14 additions and 40 deletions

View file

@ -13,7 +13,6 @@ package org.eclipse.cdt.core.parser.ast;
import java.util.Iterator;
import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate;
import org.eclipse.cdt.internal.core.parser.pst.ISymbol;
/**
* @author jcamelon
@ -38,7 +37,6 @@ public interface IASTTypeId extends ISourceElementCallbackDelegate
public String getFullSignature();
public char[] getFullSignatureCharArray();
public ISymbol getTypeSymbol() throws ASTNotImplementedException;
/**
* @param manager
*/

View file

@ -4651,7 +4651,6 @@ public class Parser implements IParserData, IParser
case IToken.t_typename :
sdw.setTypenamed(true);
consume(IToken.t_typename);
IToken first = LA(1);
ITokenDuple duple = name(sdw.getScope(), CompletionKind.TYPE_REFERENCE,
KeywordSetKey.EMPTY);
sdw.setTypeName(duple);

View file

@ -1133,14 +1133,12 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
private void createConstructorReference( IASTNewExpressionDescriptor descriptor, IASTTypeId typeId, List references ){
ISymbol symbol = null;
try {
symbol = typeId.getTypeSymbol();
symbol = ((ASTTypeId)typeId).getTypeSymbol();
if( symbol.isType( ITypeInfo.t_type ) )
symbol = symbol.getTypeSymbol();
} catch (ASTNotImplementedException e) {
return;
}
if( symbol.isType( ITypeInfo.t_type ) )
symbol = symbol.getTypeSymbol();
if( symbol == null || !( symbol instanceof IDerivableContainerSymbol ) )
return;
@ -1712,15 +1710,8 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
if( ( kind == IASTExpression.Kind.NEW_TYPEID )
|| ( kind == IASTExpression.Kind.NEW_NEWTYPEID ) )
{
try
{
info = typeId.getTypeSymbol().getTypeInfo();
info.addPtrOperator( new ITypeInfo.PtrOp(ITypeInfo.PtrOp.t_pointer));
}
catch (ASTNotImplementedException e)
{
// will never happen
}
info = ((ASTTypeId)typeId).getTypeSymbol().getTypeInfo();
info.addPtrOperator( new ITypeInfo.PtrOp(ITypeInfo.PtrOp.t_pointer));
result = new ExpressionResult(info);
return result;
}
@ -1789,12 +1780,8 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
|| ( kind == IASTExpression.Kind.POSTFIX_REINTERPRET_CAST )
|| ( kind == IASTExpression.Kind.POSTFIX_CONST_CAST )
){
try{
info = TypeInfoProvider.newTypeInfo(typeId.getTypeSymbol().getTypeInfo());
}catch (ASTNotImplementedException e)
{
// will never happen
}
info = TypeInfoProvider.newTypeInfo(((ASTTypeId)typeId).getTypeSymbol().getTypeInfo());
result = new ExpressionResult(info);
return result;
}
@ -1836,14 +1823,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
// typeid
if( kind == IASTExpression.Kind.POSTFIX_TYPEID_TYPEID )
{
try
{
info = typeId.getTypeSymbol().getTypeInfo();
}
catch (ASTNotImplementedException e)
{
// will not ever happen from within CompleteParseASTFactory
}
info = ((ASTTypeId)typeId).getTypeSymbol().getTypeInfo();
result = new ExpressionResult(info);
return result;
}
@ -3062,10 +3042,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
provider.beginTypeConstruction();
if( defaultValue != null ){
try {
provider.setDefaultObj( defaultValue.getTypeSymbol().getTypeInfo() );
} catch ( ASTNotImplementedException e1 ) {
}
provider.setDefaultObj( ((ASTTypeId)defaultValue).getTypeSymbol().getTypeInfo() );
}
if( kind == ParamKind.TEMPLATE_LIST ){
ITemplateSymbol template = pst.newTemplateSymbol( identifier );

View file

@ -709,9 +709,9 @@ public class UndefinedTemplateSymbol extends BasicSymbol implements ITemplateSym
}
return symbol;
}
else {
throw new ParserSymbolTableException(ParserSymbolTableException.r_BadTemplateArgument);
}
throw new ParserSymbolTableException(ParserSymbolTableException.r_BadTemplateArgument);
}
else if (isType(ITypeInfo.t_templateParameter) && argMap.containsKey(this)) {
return ((ITypeInfo)argMap.get(this)).getTypeSymbol();