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

Bug 299911: Introduce ICPPASTExpression

This commit is contained in:
Markus Schorn 2012-01-10 12:56:05 +01:00
parent 95601e7475
commit cec2ec3b6c
21 changed files with 51 additions and 25 deletions

View file

@ -19,7 +19,7 @@ import org.eclipse.cdt.core.dom.ast.IASTImplicitNameOwner;
* @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 ICPPASTArraySubscriptExpression extends IASTArraySubscriptExpression, IASTImplicitNameOwner { public interface ICPPASTArraySubscriptExpression extends IASTArraySubscriptExpression, ICPPASTExpression, IASTImplicitNameOwner {
@Override @Override
public ICPPASTArraySubscriptExpression copy(); public ICPPASTArraySubscriptExpression copy();

View file

@ -21,7 +21,7 @@ import org.eclipse.cdt.core.dom.ast.IASTImplicitNameOwner;
* @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 ICPPASTBinaryExpression extends IASTBinaryExpression, IASTImplicitNameOwner { public interface ICPPASTBinaryExpression extends IASTBinaryExpression, ICPPASTExpression, IASTImplicitNameOwner {
/** /**
* <code>op_pmdot</code> pointer-to-member field dereference. * <code>op_pmdot</code> pointer-to-member field dereference.
*/ */

View file

@ -18,7 +18,7 @@ import org.eclipse.cdt.core.dom.ast.IASTCastExpression;
* @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 ICPPASTCastExpression extends IASTCastExpression { public interface ICPPASTCastExpression extends IASTCastExpression, ICPPASTExpression {
/** /**
* <code>op_dynamic_cast</code> is used for dynamic_cast<>'s. * <code>op_dynamic_cast</code> is used for dynamic_cast<>'s.
*/ */

View file

@ -21,7 +21,7 @@ import org.eclipse.cdt.core.dom.ast.IASTImplicitNameOwner;
* @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 ICPPASTDeleteExpression extends IASTExpression, IASTImplicitNameOwner { public interface ICPPASTDeleteExpression extends ICPPASTExpression, IASTImplicitNameOwner {
/** /**
* <code>OPERAND</code> is the expression representing the pointer being * <code>OPERAND</code> is the expression representing the pointer being
* deleted. * deleted.

View file

@ -0,0 +1,24 @@
/*******************************************************************************
* 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.IASTExpression;
/**
* Interface for c++ expressions.
* @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 ICPPASTExpression extends IASTExpression {
}

View file

@ -19,7 +19,7 @@ import org.eclipse.cdt.core.dom.ast.IASTImplicitNameOwner;
* @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 ICPPASTExpressionList extends IASTExpressionList, IASTImplicitNameOwner { public interface ICPPASTExpressionList extends IASTExpressionList, ICPPASTExpression, IASTImplicitNameOwner {
@Override @Override
public ICPPASTExpressionList copy(); public ICPPASTExpressionList copy();

View file

@ -22,7 +22,7 @@ import org.eclipse.cdt.core.dom.ast.IType;
* @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 ICPPASTFieldReference extends IASTFieldReference, IASTImplicitNameOwner { public interface ICPPASTFieldReference extends IASTFieldReference, ICPPASTExpression, IASTImplicitNameOwner {
/** /**
* Was template keyword used? * Was template keyword used?
*/ */

View file

@ -19,7 +19,7 @@ import org.eclipse.cdt.core.dom.ast.IASTImplicitNameOwner;
* @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 ICPPASTFunctionCallExpression extends IASTFunctionCallExpression, IASTImplicitNameOwner { public interface ICPPASTFunctionCallExpression extends IASTFunctionCallExpression, ICPPASTExpression, IASTImplicitNameOwner {
@Override @Override
ICPPASTFunctionCallExpression copy(); ICPPASTFunctionCallExpression copy();

View file

@ -12,7 +12,6 @@ package org.eclipse.cdt.core.dom.ast.cpp;
import org.eclipse.cdt.core.dom.ast.ASTNodeProperty; import org.eclipse.cdt.core.dom.ast.ASTNodeProperty;
import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement; import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement;
import org.eclipse.cdt.core.dom.ast.IASTExpression;
import org.eclipse.cdt.core.dom.ast.IASTImplicitName; import org.eclipse.cdt.core.dom.ast.IASTImplicitName;
import org.eclipse.cdt.core.dom.ast.IASTImplicitNameOwner; import org.eclipse.cdt.core.dom.ast.IASTImplicitNameOwner;
@ -23,7 +22,7 @@ import org.eclipse.cdt.core.dom.ast.IASTImplicitNameOwner;
* @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 ICPPASTLambdaExpression extends IASTExpression, IASTImplicitNameOwner { public interface ICPPASTLambdaExpression extends ICPPASTExpression, IASTImplicitNameOwner {
ASTNodeProperty CAPTURE = new ASTNodeProperty("ICPPASTLambdaExpression - CAPTURE [ICPPASTCapture]"); //$NON-NLS-1$ ASTNodeProperty CAPTURE = new ASTNodeProperty("ICPPASTLambdaExpression - CAPTURE [ICPPASTCapture]"); //$NON-NLS-1$
ASTNodeProperty DECLARATOR = new ASTNodeProperty("ICPPASTLambdaExpression - DECLARATOR [ICPPASTFunctionDeclarator]"); //$NON-NLS-1$ ASTNodeProperty DECLARATOR = new ASTNodeProperty("ICPPASTLambdaExpression - DECLARATOR [ICPPASTFunctionDeclarator]"); //$NON-NLS-1$
ASTNodeProperty BODY = new ASTNodeProperty("ICPPASTLambdaExpression - BODY [IASTCompoundStatement]"); //$NON-NLS-1$ ASTNodeProperty BODY = new ASTNodeProperty("ICPPASTLambdaExpression - BODY [IASTCompoundStatement]"); //$NON-NLS-1$

View file

@ -18,7 +18,7 @@ import org.eclipse.cdt.core.dom.ast.IASTLiteralExpression;
* @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 ICPPASTLiteralExpression extends IASTLiteralExpression { public interface ICPPASTLiteralExpression extends IASTLiteralExpression, ICPPASTExpression {
/** /**
* <code>lk_this</code> represents the 'this' keyword. * <code>lk_this</code> represents the 'this' keyword.

View file

@ -25,7 +25,7 @@ import org.eclipse.cdt.core.dom.ast.IASTTypeId;
* @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 ICPPASTNewExpression extends IASTExpression, IASTImplicitNameOwner { public interface ICPPASTNewExpression extends ICPPASTExpression, IASTImplicitNameOwner {
public static final ASTNodeProperty NEW_PLACEMENT = new ASTNodeProperty( public static final ASTNodeProperty NEW_PLACEMENT = new ASTNodeProperty(
"ICPPASTNewExpression.NEW_PLACEMENT [IASTExpression]"); //$NON-NLS-1$ "ICPPASTNewExpression.NEW_PLACEMENT [IASTExpression]"); //$NON-NLS-1$

View file

@ -21,7 +21,7 @@ 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.2 * @since 5.2
*/ */
public interface ICPPASTPackExpansionExpression extends IASTExpression { public interface ICPPASTPackExpansionExpression extends ICPPASTExpression {
/** /**
* Represents the relationship between a pack-expansion and its pattern. * Represents the relationship between a pack-expansion and its pattern.

View file

@ -25,7 +25,7 @@ import org.eclipse.cdt.core.dom.ast.IASTInitializer;
* @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 ICPPASTSimpleTypeConstructorExpression extends IASTExpression { public interface ICPPASTSimpleTypeConstructorExpression extends ICPPASTExpression {
/** /**
* @since 5.2 * @since 5.2
*/ */

View file

@ -17,7 +17,7 @@ import org.eclipse.cdt.core.dom.ast.IASTTypeIdExpression;
* @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 ICPPASTTypeIdExpression extends IASTTypeIdExpression { public interface ICPPASTTypeIdExpression extends IASTTypeIdExpression, ICPPASTExpression {
public static final int op_typeid = IASTTypeIdExpression.op_typeid; public static final int op_typeid = IASTTypeIdExpression.op_typeid;

View file

@ -19,7 +19,7 @@ import org.eclipse.cdt.core.dom.ast.IASTUnaryExpression;
* @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 ICPPASTUnaryExpression extends IASTUnaryExpression, IASTImplicitNameOwner { public interface ICPPASTUnaryExpression extends IASTUnaryExpression, ICPPASTExpression, IASTImplicitNameOwner {
/** /**
* <code>op_throw</code> throw exp * <code>op_throw</code> throw exp
*/ */

View file

@ -19,10 +19,11 @@ import org.eclipse.cdt.core.dom.ast.IASTBinaryTypeIdExpression;
import org.eclipse.cdt.core.dom.ast.IASTTypeId; import org.eclipse.cdt.core.dom.ast.IASTTypeId;
import org.eclipse.cdt.core.dom.ast.ISemanticProblem; import org.eclipse.cdt.core.dom.ast.ISemanticProblem;
import org.eclipse.cdt.core.dom.ast.IType; import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExpression;
import org.eclipse.cdt.internal.core.dom.parser.ASTNode; import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
import org.eclipse.cdt.internal.core.dom.parser.ProblemType; import org.eclipse.cdt.internal.core.dom.parser.ProblemType;
public class CPPASTBinaryTypeIdExpression extends ASTNode implements IASTBinaryTypeIdExpression { public class CPPASTBinaryTypeIdExpression extends ASTNode implements ICPPASTExpression, IASTBinaryTypeIdExpression {
private Operator fOperator; private Operator fOperator;
private IASTTypeId fOperand1; private IASTTypeId fOperand1;
private IASTTypeId fOperand2; private IASTTypeId fOperand2;

View file

@ -20,6 +20,7 @@ import org.eclipse.cdt.core.dom.ast.IASTExpressionStatement;
import org.eclipse.cdt.core.dom.ast.IASTStatement; import org.eclipse.cdt.core.dom.ast.IASTStatement;
import org.eclipse.cdt.core.dom.ast.ISemanticProblem; import org.eclipse.cdt.core.dom.ast.ISemanticProblem;
import org.eclipse.cdt.core.dom.ast.IType; import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExpression;
import org.eclipse.cdt.core.dom.ast.gnu.IGNUASTCompoundStatementExpression; import org.eclipse.cdt.core.dom.ast.gnu.IGNUASTCompoundStatementExpression;
import org.eclipse.cdt.internal.core.dom.parser.ASTNode; import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
import org.eclipse.cdt.internal.core.dom.parser.ProblemType; import org.eclipse.cdt.internal.core.dom.parser.ProblemType;
@ -27,7 +28,7 @@ import org.eclipse.cdt.internal.core.dom.parser.ProblemType;
/** /**
* Gnu-extension: ({ ... }) * Gnu-extension: ({ ... })
*/ */
public class CPPASTCompoundStatementExpression extends ASTNode implements IGNUASTCompoundStatementExpression { public class CPPASTCompoundStatementExpression extends ASTNode implements IGNUASTCompoundStatementExpression, ICPPASTExpression {
private IASTCompoundStatement statement; private IASTCompoundStatement statement;

View file

@ -15,10 +15,7 @@ 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.core.dom.ast.IASTExpression.ValueCategory.XVALUE; import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.XVALUE;
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.prvalueType;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.CVTYPE; import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.*;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.REF;
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.getNestedType;
import org.eclipse.cdt.core.dom.ast.ASTVisitor; import org.eclipse.cdt.core.dom.ast.ASTVisitor;
import org.eclipse.cdt.core.dom.ast.DOMException; import org.eclipse.cdt.core.dom.ast.DOMException;
@ -30,6 +27,7 @@ import org.eclipse.cdt.core.dom.ast.IASTUnaryExpression;
import org.eclipse.cdt.core.dom.ast.IBasicType.Kind; import org.eclipse.cdt.core.dom.ast.IBasicType.Kind;
import org.eclipse.cdt.core.dom.ast.ISemanticProblem; import org.eclipse.cdt.core.dom.ast.ISemanticProblem;
import org.eclipse.cdt.core.dom.ast.IType; import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExpression;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBasicType; import org.eclipse.cdt.core.dom.ast.cpp.ICPPBasicType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType; import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction; import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
@ -47,7 +45,7 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.ExpressionTypes;
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil; import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil;
public class CPPASTConditionalExpression extends ASTNode implements IASTConditionalExpression, public class CPPASTConditionalExpression extends ASTNode implements IASTConditionalExpression,
IASTAmbiguityParent { ICPPASTExpression, IASTAmbiguityParent {
private IASTExpression fCondition; private IASTExpression fCondition;
private IASTExpression fPositive; private IASTExpression fPositive;
private IASTExpression fNegative; private IASTExpression fNegative;

View file

@ -32,6 +32,7 @@ import org.eclipse.cdt.core.dom.ast.IProblemBinding;
import org.eclipse.cdt.core.dom.ast.ISemanticProblem; import org.eclipse.cdt.core.dom.ast.ISemanticProblem;
import org.eclipse.cdt.core.dom.ast.IType; import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.IVariable; import org.eclipse.cdt.core.dom.ast.IVariable;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExpression;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFieldReference; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFieldReference;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDefinition; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDefinition;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName;
@ -49,7 +50,7 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics;
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor; import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil; import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil;
public class CPPASTIdExpression extends ASTNode implements IASTIdExpression, ICPPASTCompletionContext { public class CPPASTIdExpression extends ASTNode implements IASTIdExpression, ICPPASTExpression, ICPPASTCompletionContext {
private static final ICPPASTFieldReference NOT_INITIALIZED = new CPPASTFieldReference(); private static final ICPPASTFieldReference NOT_INITIALIZED = new CPPASTFieldReference();
private IASTName name; private IASTName name;

View file

@ -16,9 +16,10 @@ import org.eclipse.cdt.core.dom.ast.IASTProblem;
import org.eclipse.cdt.core.dom.ast.IASTProblemExpression; import org.eclipse.cdt.core.dom.ast.IASTProblemExpression;
import org.eclipse.cdt.core.dom.ast.ISemanticProblem; import org.eclipse.cdt.core.dom.ast.ISemanticProblem;
import org.eclipse.cdt.core.dom.ast.IType; import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExpression;
import org.eclipse.cdt.internal.core.dom.parser.ProblemType; import org.eclipse.cdt.internal.core.dom.parser.ProblemType;
public class CPPASTProblemExpression extends CPPASTProblemOwner implements IASTProblemExpression { public class CPPASTProblemExpression extends CPPASTProblemOwner implements IASTProblemExpression, ICPPASTExpression {
public CPPASTProblemExpression() { public CPPASTProblemExpression() {
super(); super();

View file

@ -16,13 +16,14 @@ import org.eclipse.cdt.core.dom.ast.IASTInitializer;
import org.eclipse.cdt.core.dom.ast.IASTTypeId; import org.eclipse.cdt.core.dom.ast.IASTTypeId;
import org.eclipse.cdt.core.dom.ast.IASTTypeIdInitializerExpression; import org.eclipse.cdt.core.dom.ast.IASTTypeIdInitializerExpression;
import org.eclipse.cdt.core.dom.ast.IType; import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExpression;
import org.eclipse.cdt.internal.core.dom.parser.ASTTypeIdInitializerExpression; import org.eclipse.cdt.internal.core.dom.parser.ASTTypeIdInitializerExpression;
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor; import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
/** /**
* C++ variant of type id initializer expression. type-id { initializer } * C++ variant of type id initializer expression. type-id { initializer }
*/ */
public class CPPASTTypeIdInitializerExpression extends ASTTypeIdInitializerExpression { public class CPPASTTypeIdInitializerExpression extends ASTTypeIdInitializerExpression implements ICPPASTExpression {
private CPPASTTypeIdInitializerExpression() { private CPPASTTypeIdInitializerExpression() {
} }