Package org.eclipse.cdt.core.dom.ast
Interface IASTUnaryExpression
-
- All Superinterfaces:
IASTExpression,IASTInitializerClause,IASTNode
- All Known Subinterfaces:
ICPPASTUnaryExpression,IGNUASTUnaryExpression
public interface IASTUnaryExpression extends IASTExpression
This interface is used to represent a unary expression in the AST.- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.cdt.core.dom.ast.IASTExpression
IASTExpression.ValueCategory
-
Nested classes/interfaces inherited from interface org.eclipse.cdt.core.dom.ast.IASTNode
IASTNode.CopyStyle
-
-
Field Summary
Fields Modifier and Type Field Description static intop_alignOfFor GCC parsers, only.static intop_amperOperator ampersand.static intop_bracketedPrimaryA bracketed expression.static intop_integerPackFor GCC parsers in C++ mode, only: '__integer_pack ( expression )'static intop_labelReferenceFor GCC parsers, only.static intop_minusOperator minus.static intop_noexceptFor C++, only: noexcept ( expression )static intop_notnot.static intop_plusOperator plus.static intop_postFixDecrPostfix decrement.static intop_postFixIncrPostfix increment.static intop_prefixDecrPrefix decrement.static intop_prefixIncrPrefix increment.static intop_sizeofsizeof.static intop_sizeofParameterPackFor C++, only: 'sizeof...static intop_starOperator star.static intop_throwFor C++, only.static intop_tildeOperator tilde.static intop_typeidFor C++, only.static intop_typeofDeprecated.Shall not be used, 'typeof something' is not an expression, it's a declaration specifier.static ASTNodePropertyOPERANDOPERANDrepresents the relationship between anIASTUnaryExpressionand it's nestedIASTExpression.-
Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTExpression
EMPTY_EXPRESSION_ARRAY
-
Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTNode
EMPTY_NODE_ARRAY
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IASTUnaryExpressioncopy()Returns a mutable copy of the tree rooted at this node.IASTUnaryExpressioncopy(IASTNode.CopyStyle style)Returns a mutable copy of the tree rooted at this node.IASTExpressiongetOperand()Returns the operand.intgetOperator()Returns the operator/kind.voidsetOperand(IASTExpression expression)Sets the operand.voidsetOperator(int operator)Sets the operator/kind.-
Methods inherited from interface org.eclipse.cdt.core.dom.ast.IASTExpression
getExpressionType, getValueCategory, isLValue
-
Methods inherited from interface org.eclipse.cdt.core.dom.ast.IASTNode
accept, contains, getChildren, getContainingFilename, getFileLocation, getLeadingSyntax, getNodeLocations, getOriginalNode, getParent, getPropertyInParent, getRawSignature, getSyntax, getTrailingSyntax, getTranslationUnit, isActive, isFrozen, isPartOfTranslationUnitFile, setParent, setPropertyInParent
-
-
-
-
Field Detail
-
op_prefixIncr
static final int op_prefixIncr
Prefix increment.op_prefixIncr: ++exp- See Also:
- Constant Field Values
-
op_prefixDecr
static final int op_prefixDecr
Prefix decrement.op_prefixDecr: --exp- See Also:
- Constant Field Values
-
op_plus
static final int op_plus
Operator plus.op_plus: +exp- See Also:
- Constant Field Values
-
op_minus
static final int op_minus
Operator minus.op_minux: -exp- See Also:
- Constant Field Values
-
op_star
static final int op_star
Operator star.op_star: *exp- See Also:
- Constant Field Values
-
op_amper
static final int op_amper
Operator ampersand.op_amper: &exp- See Also:
- Constant Field Values
-
op_tilde
static final int op_tilde
Operator tilde.op_tilde: ~exp- See Also:
- Constant Field Values
-
op_not
static final int op_not
not.op_not: !exp- See Also:
- Constant Field Values
-
op_sizeof
static final int op_sizeof
sizeof.op_sizeof: sizeof exp- See Also:
- Constant Field Values
-
op_postFixIncr
static final int op_postFixIncr
Postfix increment.op_postFixIncr: exp++- See Also:
- Constant Field Values
-
op_postFixDecr
static final int op_postFixDecr
Postfix decrement.op_postFixDecr: exp--- See Also:
- Constant Field Values
-
op_bracketedPrimary
static final int op_bracketedPrimary
A bracketed expression.op_bracketedPrimary: ( exp )- See Also:
- Constant Field Values
-
op_throw
static final int op_throw
For C++, only.op_throw: throw exp- See Also:
- Constant Field Values
-
op_typeid
static final int op_typeid
For C++, only.op_typeid: typeid( exp )- See Also:
- Constant Field Values
-
op_typeof
@Deprecated static final int op_typeof
Deprecated.Shall not be used, 'typeof something' is not an expression, it's a declaration specifier.- See Also:
- Constant Field Values
- Restriction:
- This field is not intended to be referenced by clients.
-
op_alignOf
static final int op_alignOf
For GCC parsers, only.op_alignOfis used for __alignOf( unaryExpression ) type expressions.- See Also:
- Constant Field Values
-
op_sizeofParameterPack
static final int op_sizeofParameterPack
For C++, only: 'sizeof... ( parameterPack )'- Since:
- 5.2
- See Also:
- Constant Field Values
-
op_noexcept
static final int op_noexcept
For C++, only: noexcept ( expression )- Since:
- 5.5
- See Also:
- Constant Field Values
-
op_labelReference
static final int op_labelReference
For GCC parsers, only.op_labelReferenceis used for &&label type expressions.- Since:
- 5.8
- See Also:
- Constant Field Values
-
op_integerPack
static final int op_integerPack
For GCC parsers in C++ mode, only: '__integer_pack ( expression )'- Since:
- 6.11
- See Also:
- Constant Field Values
-
OPERAND
static final ASTNodeProperty OPERAND
OPERANDrepresents the relationship between anIASTUnaryExpressionand it's nestedIASTExpression.
-
-
Method Detail
-
getOperator
int getOperator()
Returns the operator/kind.- Returns:
- the operator, one of
op_*constants defined in this interface.
-
setOperator
void setOperator(int operator)
Sets the operator/kind.- Parameters:
operator- the operator, one ofop_*constants defined in this interface.
-
getOperand
IASTExpression getOperand()
Returns the operand.- Returns:
IASTExpression
-
setOperand
void setOperand(IASTExpression expression)
Sets the operand.- Parameters:
expression-IASTExpression
-
copy
IASTUnaryExpression copy()
Description copied from interface:IASTNodeReturns a mutable copy of the tree rooted at this node. The following postconditions hold:copy.getParent() == null copy.getPropertyInParent() == null copy.isFrozen() == false
Preprocessor nodes do not currently support being copied. Implicit name nodes are not copied, instead they can be regenerated if required.Calling this method is equivalent to
copy(CopyStyle.withoutLocations).- Specified by:
copyin interfaceIASTExpression- Specified by:
copyin interfaceIASTInitializerClause- Specified by:
copyin interfaceIASTNode- Since:
- 5.1
-
copy
IASTUnaryExpression copy(IASTNode.CopyStyle style)
Description copied from interface:IASTNodeReturns a mutable copy of the tree rooted at this node. The following postconditions hold:copy.getParent() == null copy.getPropertyInParent() == null copy.isFrozen() == false
Preprocessor nodes do not currently support being copied. Implicit name nodes are not copied, instead they can be regenerated if required.- Specified by:
copyin interfaceIASTExpression- Specified by:
copyin interfaceIASTInitializerClause- Specified by:
copyin interfaceIASTNode- Parameters:
style-IASTNode.CopyStylecreate a copy with or without locations. Please seeIASTNode.CopyStylefor restrictions on copies with Locations.- Since:
- 5.3
-
-