1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 299911: Introduce ICPPASTInitializerList

This commit is contained in:
Markus Schorn 2012-01-10 13:52:35 +01:00 committed by Sergey Prigogin
parent 4fb6a86451
commit 1bb6d2eecc
25 changed files with 176 additions and 19 deletions

View file

@ -19,6 +19,6 @@ import org.eclipse.cdt.core.dom.ast.IASTExpression;
* @noimplement This interface is not intended to be implemented by clients. * @noimplement This interface is not intended to be implemented by clients.
* @since 5.4 * @since 5.4
*/ */
public interface ICPPASTExpression extends IASTExpression { public interface ICPPASTExpression extends IASTExpression, ICPPASTInitializerClause {
} }

View file

@ -0,0 +1,30 @@
/*******************************************************************************
* Copyright (c) 2012 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Markus Schorn - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.dom.ast.cpp;
import org.eclipse.cdt.core.dom.ast.IASTInitializerClause;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInitClauseEvaluation;
/**
* C++ specific initializer clause
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
* @since 5.4
*/
public interface ICPPASTInitializerClause extends IASTInitializerClause {
/**
* Returns the evaluation object for this expression.
* @noreference This method is not intended to be referenced by clients.
*/
ICPPInitClauseEvaluation getEvaluation();
}

View file

@ -19,7 +19,7 @@ import org.eclipse.cdt.core.dom.ast.IASTInitializerList;
* @noextend This interface is not intended to be extended by clients. * @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients. * @noimplement This interface is not intended to be implemented by clients.
*/ */
public interface ICPPASTInitializerList extends IASTInitializerList, ICPPASTPackExpandable { public interface ICPPASTInitializerList extends IASTInitializerList, ICPPASTInitializerClause, ICPPASTPackExpandable {
@Override @Override
ICPPASTInitializerList copy(); ICPPASTInitializerList copy();

View file

@ -44,6 +44,11 @@ public class CPPASTArraySubscriptExpression extends ASTNode
private ICPPFunction overload= UNINITIALIZED_FUNCTION; private ICPPFunction overload= UNINITIALIZED_FUNCTION;
private IASTImplicitName[] implicitNames; private IASTImplicitName[] implicitNames;
@Override
public ICPPInitClauseEvaluation getEvaluation() {
// mstodo Auto-generated method stub
return null;
}
public CPPASTArraySubscriptExpression() { public CPPASTArraySubscriptExpression() {
} }

View file

@ -15,11 +15,7 @@ package org.eclipse.cdt.internal.core.dom.parser.cpp;
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE; import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE;
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.PRVALUE; import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.PRVALUE;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.ExpressionTypes.glvalueType; import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.ExpressionTypes.*;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.ExpressionTypes.prvalueType;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.ExpressionTypes.restoreTypedefs;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.ExpressionTypes.typeFromFunctionCall;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.ExpressionTypes.valueCategoryFromFunctionCall;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.TDEF; import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.TDEF;
import org.eclipse.cdt.core.dom.ast.ASTVisitor; import org.eclipse.cdt.core.dom.ast.ASTVisitor;
@ -50,7 +46,12 @@ public class CPPASTBinaryExpression extends ASTNode implements ICPPASTBinaryExpr
private IASTInitializerClause operand2; private IASTInitializerClause operand2;
private IType type; private IType type;
private ICPPFunction overload= UNINITIALIZED_FUNCTION; private ICPPFunction overload= UNINITIALIZED_FUNCTION;
private IASTImplicitName[] implicitNames; private IASTImplicitName[] implicitNames = null;
@Override
public ICPPInitClauseEvaluation getEvaluation() {
// mstodo Auto-generated method stub
return null;
}
public CPPASTBinaryExpression() { public CPPASTBinaryExpression() {
} }

View file

@ -27,6 +27,11 @@ public class CPPASTBinaryTypeIdExpression extends ASTNode implements ICPPASTExpr
private Operator fOperator; private Operator fOperator;
private IASTTypeId fOperand1; private IASTTypeId fOperand1;
private IASTTypeId fOperand2; private IASTTypeId fOperand2;
@Override
public ICPPInitClauseEvaluation getEvaluation() {
// mstodo Auto-generated method stub
return null;
}
public CPPASTBinaryTypeIdExpression() { public CPPASTBinaryTypeIdExpression() {
} }

View file

@ -34,6 +34,11 @@ public class CPPASTCastExpression extends ASTNode implements ICPPASTCastExpressi
private IASTTypeId typeId; private IASTTypeId typeId;
private IType fType; private IType fType;
private ValueCategory fValueCategory; private ValueCategory fValueCategory;
@Override
public ICPPInitClauseEvaluation getEvaluation() {
// mstodo Auto-generated method stub
return null;
}
public CPPASTCastExpression() { public CPPASTCastExpression() {
} }

View file

@ -35,6 +35,11 @@ public class CPPASTCompoundStatementExpression extends ASTNode implements IGNUAS
public CPPASTCompoundStatementExpression() { public CPPASTCompoundStatementExpression() {
} }
@Override
public ICPPInitClauseEvaluation getEvaluation() {
// mstodo Auto-generated method stub
return null;
}
public CPPASTCompoundStatementExpression(IASTCompoundStatement statement) { public CPPASTCompoundStatementExpression(IASTCompoundStatement statement) {
setCompoundStatement(statement); setCompoundStatement(statement);

View file

@ -54,6 +54,11 @@ public class CPPASTConditionalExpression extends ASTNode implements IASTConditio
public CPPASTConditionalExpression() { public CPPASTConditionalExpression() {
} }
@Override
public ICPPInitClauseEvaluation getEvaluation() {
// mstodo Auto-generated method stub
return null;
}
public CPPASTConditionalExpression(IASTExpression condition, IASTExpression postive, IASTExpression negative) { public CPPASTConditionalExpression(IASTExpression condition, IASTExpression postive, IASTExpression negative) {
setLogicalConditionExpression(condition); setLogicalConditionExpression(condition);

View file

@ -32,6 +32,11 @@ public class CPPASTDeleteExpression extends ASTNode implements ICPPASTDeleteExpr
private boolean isVectored; private boolean isVectored;
private IASTImplicitName[] implicitNames = null; private IASTImplicitName[] implicitNames = null;
@Override
public ICPPInitClauseEvaluation getEvaluation() {
// mstodo Auto-generated method stub
return null;
}
public CPPASTDeleteExpression() { public CPPASTDeleteExpression() {
} }

View file

@ -14,12 +14,7 @@ package org.eclipse.cdt.internal.core.dom.parser.cpp;
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE; import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE;
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.PRVALUE; import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.PRVALUE;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.ExpressionTypes.typeFromFunctionCall; import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.ExpressionTypes.*;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.ExpressionTypes.typeFromReturnType;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.ExpressionTypes.typeOrFunctionSet;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.ExpressionTypes.valueCat;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.ExpressionTypes.valueCategoryFromFunctionCall;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.ExpressionTypes.valueCategoryFromReturnType;
import org.eclipse.cdt.core.dom.ast.ASTNodeProperty; import org.eclipse.cdt.core.dom.ast.ASTNodeProperty;
import org.eclipse.cdt.core.dom.ast.ASTVisitor; import org.eclipse.cdt.core.dom.ast.ASTVisitor;
@ -52,6 +47,12 @@ public class CPPASTExpressionList extends ASTNode implements ICPPASTExpressionLi
private IASTImplicitName[] implicitNames; private IASTImplicitName[] implicitNames;
private ICPPFunction[] overloads; private ICPPFunction[] overloads;
@Override
public ICPPInitClauseEvaluation getEvaluation() {
// mstodo Auto-generated method stub
return null;
}
@Override @Override
public CPPASTExpressionList copy() { public CPPASTExpressionList copy() {
return copy(CopyStyle.withoutLocations); return copy(CopyStyle.withoutLocations);

View file

@ -73,6 +73,11 @@ public class CPPASTFieldReference extends ASTNode
setFieldName(name); setFieldName(name);
setFieldOwner(owner); setFieldOwner(owner);
} }
@Override
public ICPPInitClauseEvaluation getEvaluation() {
// mstodo Auto-generated method stub
return null;
}
@Override @Override
public CPPASTFieldReference copy() { public CPPASTFieldReference copy() {

View file

@ -71,6 +71,11 @@ public class CPPASTFunctionCallExpression extends ASTNode
setFunctionNameExpression(functionName); setFunctionNameExpression(functionName);
setArguments(args); setArguments(args);
} }
@Override
public ICPPInitClauseEvaluation getEvaluation() {
// mstodo Auto-generated method stub
return null;
}
@Override @Override
public CPPASTFunctionCallExpression copy() { public CPPASTFunctionCallExpression copy() {

View file

@ -58,6 +58,11 @@ public class CPPASTIdExpression extends ASTNode implements IASTIdExpression, ICP
public CPPASTIdExpression() { public CPPASTIdExpression() {
} }
@Override
public ICPPInitClauseEvaluation getEvaluation() {
// mstodo Auto-generated method stub
return null;
}
public CPPASTIdExpression(IASTName name) { public CPPASTIdExpression(IASTName name) {
setName(name); setName(name);

View file

@ -35,6 +35,11 @@ public class CPPASTInitializerList extends ASTNode implements ICPPASTInitializer
public CPPASTInitializerList copy() { public CPPASTInitializerList copy() {
return copy(CopyStyle.withoutLocations); return copy(CopyStyle.withoutLocations);
} }
@Override
public ICPPInitClauseEvaluation getEvaluation() {
// mstodo Auto-generated method stub
return null;
}
@Override @Override
public CPPASTInitializerList copy(CopyStyle style) { public CPPASTInitializerList copy(CopyStyle style) {

View file

@ -39,6 +39,11 @@ public class CPPASTLambdaExpression extends ASTNode implements ICPPASTLambdaExpr
public CPPASTLambdaExpression() { public CPPASTLambdaExpression() {
fCaptureDefault= CaptureDefault.UNSPECIFIED; fCaptureDefault= CaptureDefault.UNSPECIFIED;
} }
@Override
public ICPPInitClauseEvaluation getEvaluation() {
// mstodo Auto-generated method stub
return null;
}
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IASTExpression#copy() * @see org.eclipse.cdt.core.dom.ast.IASTExpression#copy()

View file

@ -38,6 +38,11 @@ public class CPPASTLiteralExpression extends ASTNode implements ICPPASTLiteralEx
public CPPASTLiteralExpression() { public CPPASTLiteralExpression() {
} }
@Override
public ICPPInitClauseEvaluation getEvaluation() {
// mstodo Auto-generated method stub
return null;
}
public CPPASTLiteralExpression(int kind, char[] value) { public CPPASTLiteralExpression(int kind, char[] value) {
this.kind = kind; this.kind = kind;

View file

@ -58,6 +58,11 @@ public class CPPASTNewExpression extends ASTNode implements ICPPASTNewExpression
setTypeId(typeId); setTypeId(typeId);
setInitializer(initializer); setInitializer(initializer);
} }
@Override
public ICPPInitClauseEvaluation getEvaluation() {
// mstodo Auto-generated method stub
return null;
}
@Override @Override
public CPPASTNewExpression copy() { public CPPASTNewExpression copy() {

View file

@ -41,6 +41,11 @@ public class CPPASTPackExpansionExpression extends ASTNode implements ICPPASTPac
pattern.setPropertyInParent(ICPPASTPackExpansionExpression.PATTERN); pattern.setPropertyInParent(ICPPASTPackExpansionExpression.PATTERN);
} }
} }
@Override
public ICPPInitClauseEvaluation getEvaluation() {
// mstodo Auto-generated method stub
return null;
}
@Override @Override
public IASTExpression getPattern() { public IASTExpression getPattern() {

View file

@ -33,6 +33,11 @@ public class CPPASTProblemExpression extends CPPASTProblemOwner implements IASTP
public CPPASTProblemExpression copy() { public CPPASTProblemExpression copy() {
return copy(CopyStyle.withoutLocations); return copy(CopyStyle.withoutLocations);
} }
@Override
public ICPPInitClauseEvaluation getEvaluation() {
// mstodo Auto-generated method stub
return null;
}
@Override @Override
public CPPASTProblemExpression copy(CopyStyle style) { public CPPASTProblemExpression copy(CopyStyle style) {

View file

@ -39,6 +39,11 @@ public class CPPASTSimpleTypeConstructorExpression extends ASTNode implements
setDeclSpecifier(declSpec); setDeclSpecifier(declSpec);
setInitializer(init); setInitializer(init);
} }
@Override
public ICPPInitClauseEvaluation getEvaluation() {
// mstodo Auto-generated method stub
return null;
}
@Override @Override
public CPPASTSimpleTypeConstructorExpression copy() { public CPPASTSimpleTypeConstructorExpression copy() {

View file

@ -32,6 +32,11 @@ public class CPPASTTypeIdExpression extends ASTNode implements ICPPASTTypeIdExpr
this.op = op; this.op = op;
setTypeId(typeId); setTypeId(typeId);
} }
@Override
public ICPPInitClauseEvaluation getEvaluation() {
// mstodo Auto-generated method stub
return null;
}
@Override @Override
public CPPASTTypeIdExpression copy() { public CPPASTTypeIdExpression copy() {

View file

@ -31,6 +31,11 @@ public class CPPASTTypeIdInitializerExpression extends ASTTypeIdInitializerExpre
public CPPASTTypeIdInitializerExpression(IASTTypeId typeId, IASTInitializer initializer) { public CPPASTTypeIdInitializerExpression(IASTTypeId typeId, IASTInitializer initializer) {
super(typeId, initializer); super(typeId, initializer);
} }
@Override
public ICPPInitClauseEvaluation getEvaluation() {
// mstodo Auto-generated method stub
return null;
}
@Override @Override
public IASTTypeIdInitializerExpression copy() { public IASTTypeIdInitializerExpression copy() {

View file

@ -60,6 +60,11 @@ public class CPPASTUnaryExpression extends ASTNode implements ICPPASTUnaryExpres
public CPPASTUnaryExpression() { public CPPASTUnaryExpression() {
} }
@Override
public ICPPInitClauseEvaluation getEvaluation() {
// mstodo Auto-generated method stub
return null;
}
public CPPASTUnaryExpression(int operator, IASTExpression operand) { public CPPASTUnaryExpression(int operator, IASTExpression operand) {
op = operator; op = operator;

View file

@ -0,0 +1,30 @@
/*******************************************************************************
* Copyright (c) 2012 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Markus Schorn - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory;
import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.IValue;
/**
* Assists in evaluating expressions.
*/
public interface ICPPInitClauseEvaluation {
boolean isInitializerList();
boolean isTypeDependent();
boolean isValueDependent();
IType getTypeOrFunctionSet();
IValue getValue();
ValueCategory getCategory();
}