@@ -42,7 +42,7 @@ private class TPreprocessorBranchDirective = @ppd_branch or @ppd_else or @ppd_en
42
42
43
43
/**
44
44
* A C/C++ preprocessor branch related directive: `#if`, `#ifdef`,
45
- * `#ifndef`, `#elif`, `#else` or `#endif`.
45
+ * `#ifndef`, `#elif`, `#elifdef`, `#elifndef`, `# else` or `#endif`.
46
46
*/
47
47
class PreprocessorBranchDirective extends PreprocessorDirective , TPreprocessorBranchDirective {
48
48
/**
@@ -74,8 +74,8 @@ class PreprocessorBranchDirective extends PreprocessorDirective, TPreprocessorBr
74
74
}
75
75
76
76
/**
77
- * Gets the next `#elif`, `#else` or `#endif` matching this branching
78
- * directive.
77
+ * Gets the next `#elif`, `#elifdef`, `#elifndef`, `# else` or `#endif` matching
78
+ * this branching directive.
79
79
*
80
80
* For example `somePreprocessorBranchDirective.getIf().getNext()` gets
81
81
* the second directive in the same construct as
@@ -88,8 +88,8 @@ class PreprocessorBranchDirective extends PreprocessorDirective, TPreprocessorBr
88
88
}
89
89
90
90
/**
91
- * Gets the index of this branching directive within the matching #if,
92
- * #ifdef or #ifndef.
91
+ * Gets the index of this branching directive within the matching ` #if` ,
92
+ * ` #ifdef` or ` #ifndef` .
93
93
*/
94
94
private int getIndexInBranch ( PreprocessorBranch branch ) {
95
95
this =
@@ -102,8 +102,8 @@ class PreprocessorBranchDirective extends PreprocessorDirective, TPreprocessorBr
102
102
}
103
103
104
104
/**
105
- * A C/C++ preprocessor branching directive: `#if`, `#ifdef`, `#ifndef`, or
106
- * `#elif`.
105
+ * A C/C++ preprocessor branching directive: `#if`, `#ifdef`, `#ifndef`,
106
+ * `#elif`, `#elifdef`, or `#elifndef` .
107
107
*
108
108
* A branching directive has a condition and that condition may be evaluated
109
109
* at compile-time. As a result, the preprocessor will either take the
@@ -151,8 +151,8 @@ class PreprocessorBranch extends PreprocessorBranchDirective, @ppd_branch {
151
151
* #endif
152
152
* ```
153
153
* For the related notion of a directive which causes branching (which
154
- * includes `#if`, plus also `#ifdef`, `#ifndef`, and `#elif`), see
155
- * `PreprocessorBranch`.
154
+ * includes `#if`, plus also `#ifdef`, `#ifndef`, `#elif`, `#elifdef`,
155
+ * and `#elifndef`), see `PreprocessorBranch`.
156
156
*/
157
157
class PreprocessorIf extends PreprocessorBranch , @ppd_if {
158
158
override string toString ( ) { result = "#if " + this .getHead ( ) }
@@ -222,6 +222,40 @@ class PreprocessorElif extends PreprocessorBranch, @ppd_elif {
222
222
override string toString ( ) { result = "#elif " + this .getHead ( ) }
223
223
}
224
224
225
+ /**
226
+ * A C/C++ preprocessor `#elifdef` directive. For example there is a
227
+ * `PreprocessorElifdef` on the third line of the following code:
228
+ * ```
229
+ * #ifdef MYDEFINE1
230
+ * // ...
231
+ * #elifdef MYDEFINE2
232
+ * // ...
233
+ * #else
234
+ * // ...
235
+ * #endif
236
+ * ```
237
+ */
238
+ class PreprocessorElifdef extends PreprocessorBranch , @ppd_elifdef {
239
+ override string toString ( ) { result = "#elifdef " + this .getHead ( ) }
240
+ }
241
+
242
+ /**
243
+ * A C/C++ preprocessor `#elifndef` directive. For example there is a
244
+ * `PreprocessorElifndef` on the third line of the following code:
245
+ * ```
246
+ * #ifdef MYDEFINE1
247
+ * // ...
248
+ * #elifndef MYDEFINE2
249
+ * // ...
250
+ * #else
251
+ * // ...
252
+ * #endif
253
+ * ```
254
+ */
255
+ class PreprocessorElifndef extends PreprocessorBranch , @ppd_elifndef {
256
+ override string toString ( ) { result = "#elifndef " + this .getHead ( ) }
257
+ }
258
+
225
259
/**
226
260
* A C/C++ preprocessor `#endif` directive. For example there is a
227
261
* `PreprocessorEndif` on the third line of the following code:
0 commit comments