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:
parent
4fb6a86451
commit
1bb6d2eecc
25 changed files with 176 additions and 19 deletions
|
@ -19,6 +19,6 @@ import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
|||
* @noimplement This interface is not intended to be implemented by clients.
|
||||
* @since 5.4
|
||||
*/
|
||||
public interface ICPPASTExpression extends IASTExpression {
|
||||
|
||||
public interface ICPPASTExpression extends IASTExpression, ICPPASTInitializerClause {
|
||||
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
|
@ -19,7 +19,7 @@ import org.eclipse.cdt.core.dom.ast.IASTInitializerList;
|
|||
* @noextend This interface is not intended to be extended 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
|
||||
ICPPASTInitializerList copy();
|
||||
|
|
|
@ -44,6 +44,11 @@ public class CPPASTArraySubscriptExpression extends ASTNode
|
|||
private ICPPFunction overload= UNINITIALIZED_FUNCTION;
|
||||
|
||||
private IASTImplicitName[] implicitNames;
|
||||
@Override
|
||||
public ICPPInitClauseEvaluation getEvaluation() {
|
||||
// mstodo Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
public CPPASTArraySubscriptExpression() {
|
||||
}
|
||||
|
|
|
@ -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.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.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.ExpressionTypes.*;
|
||||
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.TDEF;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||
|
@ -50,7 +46,12 @@ public class CPPASTBinaryExpression extends ASTNode implements ICPPASTBinaryExpr
|
|||
private IASTInitializerClause operand2;
|
||||
private IType type;
|
||||
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() {
|
||||
}
|
||||
|
|
|
@ -27,6 +27,11 @@ public class CPPASTBinaryTypeIdExpression extends ASTNode implements ICPPASTExpr
|
|||
private Operator fOperator;
|
||||
private IASTTypeId fOperand1;
|
||||
private IASTTypeId fOperand2;
|
||||
@Override
|
||||
public ICPPInitClauseEvaluation getEvaluation() {
|
||||
// mstodo Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
public CPPASTBinaryTypeIdExpression() {
|
||||
}
|
||||
|
|
|
@ -34,6 +34,11 @@ public class CPPASTCastExpression extends ASTNode implements ICPPASTCastExpressi
|
|||
private IASTTypeId typeId;
|
||||
private IType fType;
|
||||
private ValueCategory fValueCategory;
|
||||
@Override
|
||||
public ICPPInitClauseEvaluation getEvaluation() {
|
||||
// mstodo Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
public CPPASTCastExpression() {
|
||||
}
|
||||
|
|
|
@ -35,6 +35,11 @@ public class CPPASTCompoundStatementExpression extends ASTNode implements IGNUAS
|
|||
|
||||
public CPPASTCompoundStatementExpression() {
|
||||
}
|
||||
@Override
|
||||
public ICPPInitClauseEvaluation getEvaluation() {
|
||||
// mstodo Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
public CPPASTCompoundStatementExpression(IASTCompoundStatement statement) {
|
||||
setCompoundStatement(statement);
|
||||
|
|
|
@ -54,6 +54,11 @@ public class CPPASTConditionalExpression extends ASTNode implements IASTConditio
|
|||
|
||||
public CPPASTConditionalExpression() {
|
||||
}
|
||||
@Override
|
||||
public ICPPInitClauseEvaluation getEvaluation() {
|
||||
// mstodo Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
public CPPASTConditionalExpression(IASTExpression condition, IASTExpression postive, IASTExpression negative) {
|
||||
setLogicalConditionExpression(condition);
|
||||
|
|
|
@ -32,6 +32,11 @@ public class CPPASTDeleteExpression extends ASTNode implements ICPPASTDeleteExpr
|
|||
private boolean isVectored;
|
||||
|
||||
private IASTImplicitName[] implicitNames = null;
|
||||
@Override
|
||||
public ICPPInitClauseEvaluation getEvaluation() {
|
||||
// mstodo Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
public CPPASTDeleteExpression() {
|
||||
}
|
||||
|
|
|
@ -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.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.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 static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.ExpressionTypes.*;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.ASTNodeProperty;
|
||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||
|
@ -52,6 +47,12 @@ public class CPPASTExpressionList extends ASTNode implements ICPPASTExpressionLi
|
|||
private IASTImplicitName[] implicitNames;
|
||||
private ICPPFunction[] overloads;
|
||||
|
||||
@Override
|
||||
public ICPPInitClauseEvaluation getEvaluation() {
|
||||
// mstodo Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CPPASTExpressionList copy() {
|
||||
return copy(CopyStyle.withoutLocations);
|
||||
|
|
|
@ -73,7 +73,12 @@ public class CPPASTFieldReference extends ASTNode
|
|||
setFieldName(name);
|
||||
setFieldOwner(owner);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ICPPInitClauseEvaluation getEvaluation() {
|
||||
// mstodo Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CPPASTFieldReference copy() {
|
||||
return copy(CopyStyle.withoutLocations);
|
||||
|
|
|
@ -71,6 +71,11 @@ public class CPPASTFunctionCallExpression extends ASTNode
|
|||
setFunctionNameExpression(functionName);
|
||||
setArguments(args);
|
||||
}
|
||||
@Override
|
||||
public ICPPInitClauseEvaluation getEvaluation() {
|
||||
// mstodo Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CPPASTFunctionCallExpression copy() {
|
||||
|
|
|
@ -58,6 +58,11 @@ public class CPPASTIdExpression extends ASTNode implements IASTIdExpression, ICP
|
|||
|
||||
public CPPASTIdExpression() {
|
||||
}
|
||||
@Override
|
||||
public ICPPInitClauseEvaluation getEvaluation() {
|
||||
// mstodo Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
public CPPASTIdExpression(IASTName name) {
|
||||
setName(name);
|
||||
|
|
|
@ -35,7 +35,12 @@ public class CPPASTInitializerList extends ASTNode implements ICPPASTInitializer
|
|||
public CPPASTInitializerList copy() {
|
||||
return copy(CopyStyle.withoutLocations);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ICPPInitClauseEvaluation getEvaluation() {
|
||||
// mstodo Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CPPASTInitializerList copy(CopyStyle style) {
|
||||
CPPASTInitializerList copy = new CPPASTInitializerList();
|
||||
|
|
|
@ -39,6 +39,11 @@ public class CPPASTLambdaExpression extends ASTNode implements ICPPASTLambdaExpr
|
|||
public CPPASTLambdaExpression() {
|
||||
fCaptureDefault= CaptureDefault.UNSPECIFIED;
|
||||
}
|
||||
@Override
|
||||
public ICPPInitClauseEvaluation getEvaluation() {
|
||||
// mstodo Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.dom.ast.IASTExpression#copy()
|
||||
|
|
|
@ -38,6 +38,11 @@ public class CPPASTLiteralExpression extends ASTNode implements ICPPASTLiteralEx
|
|||
|
||||
public CPPASTLiteralExpression() {
|
||||
}
|
||||
@Override
|
||||
public ICPPInitClauseEvaluation getEvaluation() {
|
||||
// mstodo Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
public CPPASTLiteralExpression(int kind, char[] value) {
|
||||
this.kind = kind;
|
||||
|
|
|
@ -58,7 +58,12 @@ public class CPPASTNewExpression extends ASTNode implements ICPPASTNewExpression
|
|||
setTypeId(typeId);
|
||||
setInitializer(initializer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ICPPInitClauseEvaluation getEvaluation() {
|
||||
// mstodo Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CPPASTNewExpression copy() {
|
||||
return copy(CopyStyle.withoutLocations);
|
||||
|
|
|
@ -41,6 +41,11 @@ public class CPPASTPackExpansionExpression extends ASTNode implements ICPPASTPac
|
|||
pattern.setPropertyInParent(ICPPASTPackExpansionExpression.PATTERN);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public ICPPInitClauseEvaluation getEvaluation() {
|
||||
// mstodo Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IASTExpression getPattern() {
|
||||
|
|
|
@ -33,7 +33,12 @@ public class CPPASTProblemExpression extends CPPASTProblemOwner implements IASTP
|
|||
public CPPASTProblemExpression copy() {
|
||||
return copy(CopyStyle.withoutLocations);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ICPPInitClauseEvaluation getEvaluation() {
|
||||
// mstodo Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CPPASTProblemExpression copy(CopyStyle style) {
|
||||
CPPASTProblemExpression copy = new CPPASTProblemExpression();
|
||||
|
|
|
@ -39,6 +39,11 @@ public class CPPASTSimpleTypeConstructorExpression extends ASTNode implements
|
|||
setDeclSpecifier(declSpec);
|
||||
setInitializer(init);
|
||||
}
|
||||
@Override
|
||||
public ICPPInitClauseEvaluation getEvaluation() {
|
||||
// mstodo Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CPPASTSimpleTypeConstructorExpression copy() {
|
||||
|
|
|
@ -32,6 +32,11 @@ public class CPPASTTypeIdExpression extends ASTNode implements ICPPASTTypeIdExpr
|
|||
this.op = op;
|
||||
setTypeId(typeId);
|
||||
}
|
||||
@Override
|
||||
public ICPPInitClauseEvaluation getEvaluation() {
|
||||
// mstodo Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CPPASTTypeIdExpression copy() {
|
||||
|
|
|
@ -31,6 +31,11 @@ public class CPPASTTypeIdInitializerExpression extends ASTTypeIdInitializerExpre
|
|||
public CPPASTTypeIdInitializerExpression(IASTTypeId typeId, IASTInitializer initializer) {
|
||||
super(typeId, initializer);
|
||||
}
|
||||
@Override
|
||||
public ICPPInitClauseEvaluation getEvaluation() {
|
||||
// mstodo Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IASTTypeIdInitializerExpression copy() {
|
||||
|
|
|
@ -60,6 +60,11 @@ public class CPPASTUnaryExpression extends ASTNode implements ICPPASTUnaryExpres
|
|||
|
||||
public CPPASTUnaryExpression() {
|
||||
}
|
||||
@Override
|
||||
public ICPPInitClauseEvaluation getEvaluation() {
|
||||
// mstodo Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
public CPPASTUnaryExpression(int operator, IASTExpression operand) {
|
||||
op = operator;
|
||||
|
|
|
@ -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();
|
||||
}
|
Loading…
Add table
Reference in a new issue