Package org.eclipse.cdt.core.dom.ast
Interface IASTUnaryExpression
- All Superinterfaces:
IASTExpression,IASTInitializerClause,IASTNode
- All Known Subinterfaces:
ICPPASTUnaryExpression,IGNUASTUnaryExpression
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.ValueCategoryNested classes/interfaces inherited from interface org.eclipse.cdt.core.dom.ast.IASTNode
IASTNode.CopyStyle -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intFor GCC parsers, only.static final intOperator ampersand.static final intA bracketed expression.static final intFor GCC parsers in C++ mode, only: '__integer_pack ( expression )'static final intFor GCC parsers, only.static final intOperator minus.static final intFor C++, only: noexcept ( expression )static final intnot.static final intOperator plus.static final intPostfix decrement.static final intPostfix increment.static final intPrefix decrement.static final intPrefix increment.static final intsizeof.static final intFor C++, only: 'sizeof...static final intOperator star.static final intFor C++, only.static final intOperator tilde.static final intFor C++, only.static final intDeprecated.Shall not be used, 'typeof something' is not an expression, it's a declaration specifier.static final ASTNodePropertyOPERANDrepresents the relationship between anIASTUnaryExpressionand it's nestedIASTExpression.Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTExpression
EMPTY_EXPRESSION_ARRAYFields inherited from interface org.eclipse.cdt.core.dom.ast.IASTNode
EMPTY_NODE_ARRAY -
Method Summary
Modifier and TypeMethodDescriptioncopy()Returns a mutable copy of the tree rooted at this node.copy(IASTNode.CopyStyle style) Returns a mutable copy of the tree rooted at this node.Returns the operand.intReturns 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, isLValueMethods 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 Details
-
op_prefixIncr
static final int op_prefixIncrPrefix increment.op_prefixIncr: ++exp- See Also:
-
op_prefixDecr
static final int op_prefixDecrPrefix decrement.op_prefixDecr: --exp- See Also:
-
op_plus
static final int op_plusOperator plus.op_plus: +exp- See Also:
-
op_minus
static final int op_minusOperator minus.op_minux: -exp- See Also:
-
op_star
static final int op_starOperator star.op_star: *exp- See Also:
-
op_amper
static final int op_amperOperator ampersand.op_amper: &exp- See Also:
-
op_tilde
static final int op_tildeOperator tilde.op_tilde: ~exp- See Also:
-
op_not
static final int op_notnot.op_not: !exp- See Also:
-
op_sizeof
static final int op_sizeofsizeof.op_sizeof: sizeof exp- See Also:
-
op_postFixIncr
static final int op_postFixIncrPostfix increment.op_postFixIncr: exp++- See Also:
-
op_postFixDecr
static final int op_postFixDecrPostfix decrement.op_postFixDecr: exp--- See Also:
-
op_bracketedPrimary
static final int op_bracketedPrimaryA bracketed expression.op_bracketedPrimary: ( exp )- See Also:
-
op_throw
static final int op_throwFor C++, only.op_throw: throw exp- See Also:
-
op_typeid
static final int op_typeidFor C++, only.op_typeid: typeid( exp )- See Also:
-
op_typeof
Deprecated.Shall not be used, 'typeof something' is not an expression, it's a declaration specifier.- See Also:
- Restriction:
- This field is not intended to be referenced by clients.
-
op_alignOf
static final int op_alignOfFor GCC parsers, only.op_alignOfis used for __alignOf( unaryExpression ) type expressions.- See Also:
-
op_sizeofParameterPack
static final int op_sizeofParameterPackFor C++, only: 'sizeof... ( parameterPack )'- Since:
- 5.2
- See Also:
-
op_noexcept
static final int op_noexceptFor C++, only: noexcept ( expression )- Since:
- 5.5
- See Also:
-
op_labelReference
static final int op_labelReferenceFor GCC parsers, only.op_labelReferenceis used for &&label type expressions.- Since:
- 5.8
- See Also:
-
op_integerPack
static final int op_integerPackFor GCC parsers in C++ mode, only: '__integer_pack ( expression )'- Since:
- 6.11
- See Also:
-
OPERAND
OPERANDrepresents the relationship between anIASTUnaryExpressionand it's nestedIASTExpression.
-
-
Method Details
-
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
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
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
-