Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 51ee0f0f33c19324e3a539291de59431c20c8e14 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
/*******************************************************************************
 * Copyright (c) 2005 IBM Corporation 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:
 * IBM Rational Software - Initial API and implementation
 *******************************************************************************/
package org.eclipse.cdt.core.dom.ast;

/**
 * This interface is used to represent a unary expression in the AST.
 * 
 * @author jcamelon
 */
public interface IASTUnaryExpression extends IASTExpression {

	/**
	 * Prefix increment.
	 * <code>op_prefixIncr</code> ++exp
	 */
	public static final int op_prefixIncr = 0;

	/**
	 * Prefix decrement.
	 * <code>op_prefixDecr</code> --exp
	 */
	public static final int op_prefixDecr = 1;

	/**
	 * Operator plus.
	 * <code>op_plus</code> ==> + exp
	 */
	public static final int op_plus = 2;

	/**
	 * Operator minus.
	 * <code>op_minux</code> ==> -exp
	 */
	public static final int op_minus = 3;

	/**
	 *  Operator star.
	 *  <code>op_star</code> ==> *exp
	 */
	public static final int op_star = 4;

	/**
	 * Operator ampersand.
	 * <code>op_amper</code> ==> &exp
	 */
	public static final int op_amper = 5;

	/**
	 * Operator tilde.
	 * <code>op_tilde</code> ==> ~exp
	 */
	public static final int op_tilde = 6;

	/**
	 * not.
	 * <code>op_not</code> ==> ! exp
	 */
	public static final int op_not = 7;

	/**
	 * sizeof.
	 * <code>op_sizeof</code> ==> sizeof exp  
	 */
	public static final int op_sizeof = 8;

	/**
	 * Postfix increment.
	 * <code>op_postFixIncr</code> ==> exp++
	 */
	public static final int op_postFixIncr = 9;

	/**
	 * Postfix decrement.
	 * <code>op_bracketedPrimary</code> ==> exp--
	 */
	public static final int op_postFixDecr = 10;

	/**
	 * A bracketed expression.
	 * <code>op_bracketedPrimary</code> ==> ( exp )
	 */
	public static final int op_bracketedPrimary = 11;

	/**
	 * for c++, only. <code>op_throw</code> throw exp
	 */
	public static final int op_throw = 12;

	/**
	 * for c++, only. <code>op_typeid</code> = typeid( exp )
	 */
	public static final int op_typeid = 13;

	/**
	 * for gnu parsers, only. <code>op_typeof</code> is used for typeof( unaryExpression ) type
	 * expressions.
	 */
	public static final int op_typeof = 14;

	/**
	 * for gnu parsers, only. <code>op_alignOf</code> is used for __alignOf( unaryExpression ) type
	 * expressions.
	 */
	public static final int op_alignOf = 15;

	/**
	 * <code>op_last</code> is made available for subclasses.
	 * @deprecated all constants must be defined in this interface
	 */
	@Deprecated
	public static final int op_last = op_alignOf;

	/**
	 * Get the operator/kind.
	 * 
	 * @return (int)
	 */
	public int getOperator();

	/**
	 * Set the operator/kind.
	 * 
	 * @param value (int) value
	 */
	public void setOperator(int value);

	/**
	 * <code>OPERAND</code> represents the relationship between an <code>IASTUnaryExpression</code> and
	 * it's nested <code>IASTExpression</code>.
	 */
	public static final ASTNodeProperty OPERAND = new ASTNodeProperty("IASTUnaryExpression.OPERAND - IASTExpression (operand) for IASTUnaryExpression"); //$NON-NLS-1$

	/**
	 * Get the operand.
	 * 
	 * @return <code>IASTExpression</code>
	 */
	public IASTExpression getOperand();

	/**
	 * Set the operand.
	 * 
	 * @param expression <code>IASTExpression</code>
	 */
	public void setOperand(IASTExpression expression);

}

Back to the top