Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: b33183bd746fe962946a5c962e6288b08874f1f1 (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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
/*******************************************************************************
 * Copyright (c) 2006, 2016 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:
 *     Mike Kucera (IBM Corporation) - initial API and implementation
 *     Markus Schorn (Wind River Systems)
 *     Thomas Corbat (IFS)
 *     Sergey Prigogin (Google)
 *******************************************************************************/
package org.eclipse.cdt.core.dom.ast.cpp;

import org.eclipse.cdt.core.dom.ast.IASTBinaryTypeIdExpression;
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTExpression;
import org.eclipse.cdt.core.dom.ast.IASTFunctionDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTInitializer;
import org.eclipse.cdt.core.dom.ast.IASTInitializerClause;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTProblem;
import org.eclipse.cdt.core.dom.ast.IASTProblemTypeId;
import org.eclipse.cdt.core.dom.ast.IASTReturnStatement;
import org.eclipse.cdt.core.dom.ast.IASTStatement;
import org.eclipse.cdt.core.dom.ast.IASTToken;
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
import org.eclipse.cdt.core.dom.ast.INodeFactory;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTEnumerationSpecifier.ScopeStyle;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUnaryTypeTransformation.Operator;
import org.eclipse.cdt.core.dom.ast.gnu.cpp.IGPPASTArrayRangeDesignator;
import org.eclipse.cdt.core.dom.parser.cpp.ICPPASTAttributeSpecifier;
import org.eclipse.cdt.core.parser.IScanner;

/**
 * Factory for AST nodes for the C++ programming language.
 *
 * @since 5.1
 * @noextend This interface is not intended to be extended by clients.
 * @noimplement This interface is not intended to be implemented by clients.
 */
public interface ICPPNodeFactory extends INodeFactory {
	/**
	 * @since 5.5
	 */
	public ICPPASTAliasDeclaration newAliasDeclaration(IASTName aliasName, ICPPASTTypeId aliasedType);

	/**
	 * @since 5.2
	 */
	@Override
	public ICPPASTArrayDeclarator newArrayDeclarator(IASTName name);

	/**
	 * @since 6.0
	 */
	public ICPPASTArrayDesignator newArrayDesignator(ICPPASTExpression exp);

	/**
	 * @since 6.0
	 */
	public IGPPASTArrayRangeDesignator newArrayRangeDesignatorGPP(ICPPASTExpression floor, ICPPASTExpression ceiling);

	@Override
	public ICPPASTArraySubscriptExpression newArraySubscriptExpression(IASTExpression arrayExpr, IASTExpression subscript);

	/**
	 * @since 5.2
	 */
	public ICPPASTArraySubscriptExpression newArraySubscriptExpression(IASTExpression arrayExpr, IASTInitializerClause subscript);

	/**
	 * @since 5.7
	 */
	public ICPPASTAttribute newAttribute(char[] name, char[] scope, IASTToken argumentClause, boolean packExpansion);

	/**
	 * @since 6.0
	 */
	public ICPPASTAttributeList newAttributeList();

	/**
	 * @since 5.8
	 */
	public ICPPASTBaseSpecifier newBaseSpecifier(ICPPASTNameSpecifier nameSpecifier, int visibility, boolean isVirtual);

	@Override
	public ICPPASTBinaryExpression newBinaryExpression(int op, IASTExpression expr1, IASTExpression expr2);

	/**
	 * @since 5.2
	 */
	public ICPPASTBinaryExpression newBinaryExpression(int op, IASTExpression expr1, IASTInitializerClause expr2);

	/**
	 * @since 5.3
	 */
	public IASTExpression newBinaryTypeIdExpression(IASTBinaryTypeIdExpression.Operator op, IASTTypeId type1, IASTTypeId type2);

	/**
	 * @since 5.3
	 */
	public ICPPASTCapture newCapture();

	/**
	 * @since 6.5
	 */
	public ICPPASTInitCapture newInitCapture(ICPPASTDeclarator declarator);

	@Override
	public ICPPASTCastExpression newCastExpression(int operator, IASTTypeId typeId, IASTExpression operand);

	public ICPPASTCatchHandler newCatchHandler(IASTDeclaration decl, IASTStatement body);

	/**
	 * @since 5.7
	 */
	public ICPPASTClassVirtSpecifier newClassVirtSpecifier(ICPPASTClassVirtSpecifier.SpecifierKind kind);

	@Override
	public ICPPASTCompositeTypeSpecifier newCompositeTypeSpecifier(int key, IASTName name);

	/**
	 * @since 5.2
	 */
	public ICPPASTConstructorChainInitializer newConstructorChainInitializer(IASTName id, IASTInitializer initializer);

	/**
	 * @since 5.2
	 */
	public ICPPASTConstructorInitializer newConstructorInitializer(IASTInitializerClause[] args);

	public ICPPASTConversionName newConversionName(IASTTypeId typeId);

	/**
	 * @since 5.2
	 */
	@Override
	public ICPPASTDeclarator newDeclarator(IASTName name);

	/**
	 * @since 5.6
	 */
	public ICPPASTDecltypeSpecifier newDecltypeSpecifier(ICPPASTExpression decltypeExpression);

	public ICPPASTDeleteExpression newDeleteExpression(IASTExpression operand);

	/**
	 * @since 6.0
	 */
	public ICPPASTDesignatedInitializer newDesignatedInitializer(ICPPASTInitializerClause initializer);

	@Override
	public ICPPASTElaboratedTypeSpecifier newElaboratedTypeSpecifier(int kind, IASTName name);

	/**
	 * @since 5.2
	 * @deprecated Use {@code newEnumerationSpecifier(ScopeToken, IASTName, ICPPASTDeclSpecifier)} instead.
	 * If {@code isScoped == true} is passed {@code ScopeToken.CLASS} is assumed.
	 */
	@Deprecated
	public ICPPASTEnumerationSpecifier newEnumerationSpecifier(boolean isScoped, IASTName name, ICPPASTDeclSpecifier baseType);

	/**
	 * @since 6.5
	 */
	public ICPPASTEnumerationSpecifier newEnumerationSpecifier(ScopeStyle scopeStyle, IASTName name, ICPPASTDeclSpecifier baseType);

	public ICPPASTExplicitTemplateInstantiation newExplicitTemplateInstantiation(IASTDeclaration declaration);

	@Override
	public ICPPASTExpressionList newExpressionList();

	/**
	 * @since 5.2
	 */
	@Override
	public ICPPASTFieldDeclarator newFieldDeclarator(IASTName name, IASTExpression bitFieldSize);

	/**
	 * @since 6.0
	 */
	public ICPPASTFieldDesignator newFieldDesignator(IASTName name);

	@Override
	public ICPPASTFieldReference newFieldReference(IASTName name, IASTExpression owner);

	public ICPPASTForStatement newForStatement();

	public ICPPASTForStatement newForStatement(IASTStatement init, IASTDeclaration condition,
			IASTExpression iterationExpression, IASTStatement body);

	@Override
	public ICPPASTForStatement newForStatement(IASTStatement init, IASTExpression condition,
			IASTExpression iterationExpression, IASTStatement body);

	/**
	 * @since 5.2
	 */
	@Override
	public ICPPASTFunctionCallExpression newFunctionCallExpression(IASTExpression idExpr, IASTInitializerClause[] arguments);

	@Override
	public ICPPASTFunctionDeclarator newFunctionDeclarator(IASTName name);

	@Override
	public ICPPASTFunctionDefinition newFunctionDefinition(IASTDeclSpecifier declSpecifier,
			IASTFunctionDeclarator declarator, IASTStatement bodyStatement);

	public ICPPASTFunctionWithTryBlock newFunctionTryBlock(IASTDeclSpecifier declSpecifier, IASTFunctionDeclarator declarator,
			IASTStatement bodyStatement);

	public ICPPASTIfStatement newIfStatement();

	public ICPPASTIfStatement newIfStatement(IASTDeclaration condition, IASTStatement then, IASTStatement elseClause);

	@Override
	public ICPPASTIfStatement newIfStatement(IASTExpression condition, IASTStatement then, IASTStatement elseClause);

	/**
	 * @since 5.2
	 */
	@Override
	public ICPPASTInitializerList newInitializerList();

	/**
	 * @since 5.3
	 */
	public ICPPASTLambdaExpression newLambdaExpression();

	public ICPPASTLinkageSpecification newLinkageSpecification(String literal);

	@Override
	public ICPPASTLiteralExpression newLiteralExpression(int kind, String rep);

	/**
	 * @since 6.5
	 */
	public ICPPASTLiteralExpression newLiteralExpression(int kind, String rep, char[] numericCompilerSuffixes);

	public ICPPASTNamespaceAlias newNamespaceAlias(IASTName alias, IASTName qualifiedName);

	public ICPPASTNamespaceDefinition newNamespaceDefinition(IASTName name);
	
	/**
	 * @since 6.0
	 */
	public ICPPASTNaryTypeIdExpression newNaryTypeIdExpression(ICPPASTNaryTypeIdExpression.Operator operator,
			ICPPASTTypeId[] operands);

	/**
	 * @since 5.2
	 */
	public ICPPASTNewExpression newNewExpression(IASTInitializerClause[] placement, IASTInitializer initializer, IASTTypeId typeId);

	public ICPPASTOperatorName newOperatorName(char[] name);

	/**
	 * Creates a new pack expansion expression for the given pattern.
	 * @since 5.2
	 */
	public ICPPASTPackExpansionExpression newPackExpansionExpression(IASTExpression pattern);

	@Override
	public ICPPASTParameterDeclaration newParameterDeclaration(IASTDeclSpecifier declSpec, IASTDeclarator declarator);

	public ICPPASTPointerToMember newPointerToMember(IASTName name);

	public IASTProblemTypeId newProblemTypeId(IASTProblem problem);

	/**
	 * Creates a {@link ICPPASTQualifiedName}.
	 * @since 5.7
	 */
	public ICPPASTQualifiedName newQualifiedName(ICPPASTName name);

	/**
	 * Creates an {@link ICPPASTQualifiedName} and adds name qualifiers for the
	 * elements of {@code nameQualifiers}. {@code nameQualifiers} cannot contain decltype specifiers
	 * for creation of {@link ICPPASTDecltypeSpecifier}.
	 * @since 5.11
	 */
	public ICPPASTQualifiedName newQualifiedName(String[] nameQualifiers, String name);

	/**
	 * @since 5.9
	 */
	@Override
	public ICPPASTName newName();

	/**
	 * @since 5.9
	 */
	@Override
	public ICPPASTName newName(char[] name);
	
	/**
	 * @since 6.1
	 */
	@Override
	public ICPPASTName newName(String name);

	/**
	 * @since 5.11
	 */
	public ICPPASTNamedTypeSpecifier newNamedTypeSpecifier(IASTName name);

	/**
	 * Creates a range based for statement.
	 * @since 5.3
	 */
	public ICPPASTRangeBasedForStatement newRangeBasedForStatement();

	/**
	 * Creates an lvalue or rvalue reference operator.
	 * @since 5.2
	 */
	public ICPPASTReferenceOperator newReferenceOperator(boolean isRValueReference);

	/**
	 * @since 5.2
	 */
	public IASTReturnStatement newReturnStatement(IASTInitializerClause retValue);

	@Override
	public ICPPASTSimpleDeclSpecifier newSimpleDeclSpecifier();

	/**
	 * @since 5.2
	 */
	public ICPPASTSimpleTypeConstructorExpression newSimpleTypeConstructorExpression(ICPPASTDeclSpecifier declSpec, IASTInitializer initializer);

	public ICPPASTSimpleTypeTemplateParameter newSimpleTypeTemplateParameter(int type, IASTName name, IASTTypeId typeId);

	/**
	 * Creates a new static assertion declaration with the given condition and message.
	 * @since 5.2
	 */
	public ICPPASTStaticAssertDeclaration newStaticAssertion(IASTExpression condition, ICPPASTLiteralExpression message);

	/**
	 * @since 6.5
	 */
	public ICPPASTStaticAssertDeclaration newStaticAssertion(IASTExpression condition);

	public ICPPASTSwitchStatement newSwitchStatement();

	public ICPPASTSwitchStatement newSwitchStatement(IASTDeclaration controller, IASTStatement body);

	@Override
	public ICPPASTSwitchStatement newSwitchStatement(IASTExpression controlloer, IASTStatement body);

	public ICPPASTTemplateDeclaration newTemplateDeclaration(IASTDeclaration declaration);

	public ICPPASTTemplatedTypeTemplateParameter newTemplatedTypeTemplateParameter(IASTName name, IASTExpression defaultValue);

	public ICPPASTTemplateId newTemplateId(IASTName templateName);

	public ICPPASTTemplateSpecialization newTemplateSpecialization(IASTDeclaration declaration);

	/**
	 * Creates a new translation unit that cooperates with the given scanner in order
	 * to track macro-expansions and location information.
	 * @scanner the preprocessor the translation unit interacts with.
	 * @since 5.2
	 */
	@Override
	public ICPPASTTranslationUnit newTranslationUnit(IScanner scanner);

	public ICPPASTTryBlockStatement newTryBlockStatement(IASTStatement body);

	@Override
	public ICPPASTNamedTypeSpecifier newTypedefNameSpecifier(IASTName name);

	/**
	 * @since 5.2
	 */
	@Override
	public ICPPASTTypeId newTypeId(IASTDeclSpecifier declSpecifier, IASTDeclarator declarator);

	@Override
	public ICPPASTTypeIdExpression newTypeIdExpression(int operator, IASTTypeId typeId);

	/**
	 * @since 5.6
	 */
	public ICPPASTTypeTransformationSpecifier newTypeTransformationSpecifier(Operator kind, ICPPASTTypeId typeId);

	@Override
	public ICPPASTUnaryExpression newUnaryExpression(int operator, IASTExpression operand);

	public ICPPASTUsingDeclaration newUsingDeclaration(IASTName name);

	public ICPPASTUsingDirective newUsingDirective(IASTName name);

	/**
	 * @since 5.7
	 */
	public ICPPASTVirtSpecifier newVirtSpecifier(ICPPASTVirtSpecifier.SpecifierKind kind);

	public ICPPASTVisibilityLabel newVisibilityLabel(int visibility);

	public ICPPASTWhileStatement newWhileStatement();

	public ICPPASTWhileStatement newWhileStatement(IASTDeclaration condition, IASTStatement body);

	@Override
	public ICPPASTWhileStatement newWhileStatement(IASTExpression condition, IASTStatement body);

	/**
	 * @deprecated Replaced by {@link #newConstructorChainInitializer(IASTName, IASTInitializer)}
	 * @noreference This method is not intended to be referenced by clients.
	 */
	@Deprecated
	public ICPPASTConstructorChainInitializer newConstructorChainInitializer(IASTName memberInitializerId, IASTExpression initializerValue);

	/**
	 * @deprecated Replaced by {@link #newConstructorInitializer(IASTInitializerClause[])}.
	 * @noreference This method is not intended to be referenced by clients.
	 */
	@Deprecated
	public ICPPASTConstructorInitializer newConstructorInitializer(IASTExpression exp);

	/**
	 * @deprecated Replaced by {@link #newBaseSpecifier(ICPPASTNameSpecifier, int, boolean)}
	 * @noreference This method is not intended to be referenced by clients.
	 */
	@Deprecated
	public ICPPASTBaseSpecifier newBaseSpecifier(IASTName name, int visibility, boolean isVirtual);

	/**
	 * @deprecated Replaced by {@link #newFunctionCallExpression(IASTExpression, IASTInitializerClause[])}.
	 * @noreference This method is not intended to be referenced by clients.
	 */
	@Override
	@Deprecated
	public ICPPASTFunctionCallExpression newFunctionCallExpression(IASTExpression idExpr, IASTExpression argList);

	/**
	 * @deprecated Replaced by {@link #newNewExpression(IASTInitializerClause[], IASTInitializer, IASTTypeId)}
	 * @noreference This method is not intended to be referenced by clients.
	 */
	@Deprecated
	public ICPPASTNewExpression newNewExpression(IASTExpression placement, IASTExpression initializer, IASTTypeId typeId);

	/**
	 * @deprecated Replaced by {@link #newQualifiedName(ICPPASTName)}.
	 * @noreference This method is not intended to be referenced by clients.
	 */
	@Deprecated
	public ICPPASTQualifiedName newQualifiedName();

	/**
	 * @deprecated Replaced by {@link #newReferenceOperator(boolean)}.
	 * @noreference This method is not intended to be referenced by clients.
	 */
	@Deprecated
	public ICPPASTReferenceOperator newReferenceOperator();

	/**
	 * @deprecated Replaced by {@link #newSimpleTypeConstructorExpression(ICPPASTDeclSpecifier, IASTInitializer)}
	 * @noreference This method is not intended to be referenced by clients.
	 */
	@Deprecated
	public ICPPASTTypenameExpression newTypenameExpression(IASTName qualifiedName, IASTExpression expr, boolean isTemplate);

	/**
	 * @deprecated Use newAttributeList() instead.
	 * @noreference This method is not intended to be referenced by clients.
	 * @since 5.7
	 */
	@Deprecated
	public ICPPASTAttributeSpecifier newAttributeSpecifier();
}

Back to the top