41
|
1 |
/*
|
|
2 |
* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
* Constants related to source files
|
|
17 |
*
|
|
18 |
*/
|
|
19 |
package com.nokia.tracecompiler.source;
|
|
20 |
|
|
21 |
/**
|
|
22 |
* Constants related to source files
|
|
23 |
*
|
|
24 |
*/
|
|
25 |
public interface SourceConstants {
|
|
26 |
|
|
27 |
/**
|
|
28 |
* Space character as string
|
|
29 |
*/
|
|
30 |
final String SPACE = " "; //$NON-NLS-1$
|
|
31 |
|
|
32 |
/**
|
|
33 |
* Quote character as string
|
|
34 |
*/
|
|
35 |
final String QUOTE = "\""; //$NON-NLS-1$
|
|
36 |
|
|
37 |
/**
|
|
38 |
* '\' character as string
|
|
39 |
*/
|
|
40 |
final String BACKSLASH = "\\"; //$NON-NLS-1$
|
|
41 |
|
|
42 |
/**
|
|
43 |
* '_' character as string
|
|
44 |
*/
|
|
45 |
final String UNDERSCORE = "_"; //$NON-NLS-1$
|
|
46 |
|
|
47 |
/**
|
|
48 |
* Double underscore for header guards
|
|
49 |
*/
|
|
50 |
final String DOUBLE_UNDERSCORE = "__"; //$NON-NLS-1$
|
|
51 |
|
|
52 |
/**
|
|
53 |
* Semicolon character as string
|
|
54 |
*/
|
|
55 |
final String SEMICOLON = ";"; //$NON-NLS-1$
|
|
56 |
|
|
57 |
/**
|
|
58 |
* Colon character as string
|
|
59 |
*/
|
|
60 |
final String COLON = ":"; //$NON-NLS-1$
|
|
61 |
|
|
62 |
/**
|
|
63 |
* Period character as string
|
|
64 |
*/
|
|
65 |
final String PERIOD = "."; //$NON-NLS-1$
|
|
66 |
|
|
67 |
/**
|
|
68 |
* Tilde character as string
|
|
69 |
*/
|
|
70 |
final String TILDE = "~"; //$NON-NLS-1$
|
|
71 |
|
|
72 |
/**
|
|
73 |
* Opening brace as string
|
|
74 |
*/
|
|
75 |
final String OPENING_BRACE = "{"; //$NON-NLS-1$
|
|
76 |
|
|
77 |
/**
|
|
78 |
* Closing brace as string
|
|
79 |
*/
|
|
80 |
final String CLOSING_BRACE = "}"; //$NON-NLS-1$
|
|
81 |
|
|
82 |
/**
|
|
83 |
* Asterisk character
|
|
84 |
*/
|
|
85 |
final String ASTERISK = "*"; //$NON-NLS-1$
|
|
86 |
|
|
87 |
/**
|
|
88 |
* Space character
|
|
89 |
*/
|
|
90 |
final char SPACE_CHAR = ' ';
|
|
91 |
|
|
92 |
/**
|
|
93 |
* Colon character
|
|
94 |
*/
|
|
95 |
final char COLON_CHAR = ':';
|
|
96 |
|
|
97 |
/**
|
|
98 |
* Quote character
|
|
99 |
*/
|
|
100 |
final char QUOTE_CHAR = '\"';
|
|
101 |
|
|
102 |
/**
|
|
103 |
* '\' character
|
|
104 |
*/
|
|
105 |
final char BACKSLASH_CHAR = '\\';
|
|
106 |
|
|
107 |
/**
|
|
108 |
* '/' character
|
|
109 |
*/
|
|
110 |
final char FORWARD_SLASH_CHAR = '/';
|
|
111 |
|
|
112 |
/**
|
|
113 |
* '_' character
|
|
114 |
*/
|
|
115 |
final char UNDERSCORE_CHAR = '_';
|
|
116 |
|
|
117 |
/**
|
|
118 |
* '.' character
|
|
119 |
*/
|
|
120 |
final char PERIOD_CHAR = '.';
|
|
121 |
|
|
122 |
/**
|
|
123 |
* Line separator
|
|
124 |
*/
|
|
125 |
final String LINE_FEED = System.getProperty("line.separator"); //$NON-NLS-1$
|
|
126 |
|
|
127 |
/**
|
|
128 |
* Header extension (.h)
|
|
129 |
*/
|
|
130 |
final String HEADER_EXTENSION = ".h"; //$NON-NLS-1$
|
|
131 |
|
|
132 |
/**
|
|
133 |
* #define
|
|
134 |
*/
|
|
135 |
final String DEFINE = "#define"; //$NON-NLS-1$
|
|
136 |
|
|
137 |
/**
|
|
138 |
* #undef
|
|
139 |
*/
|
|
140 |
final String UNDEF = "#undef"; //$NON-NLS-1$
|
|
141 |
|
|
142 |
/**
|
|
143 |
* #include
|
|
144 |
*/
|
|
145 |
final String INCLUDE = "#include"; //$NON-NLS-1$
|
|
146 |
|
|
147 |
/**
|
|
148 |
* #ifdef
|
|
149 |
*/
|
|
150 |
final String IFDEF = "#ifdef"; //$NON-NLS-1$
|
|
151 |
|
|
152 |
/**
|
|
153 |
* #ifndef
|
|
154 |
*/
|
|
155 |
final String IFNDEF = "#ifndef"; //$NON-NLS-1$
|
|
156 |
|
|
157 |
/**
|
|
158 |
* #if
|
|
159 |
*/
|
|
160 |
final String IF = "#if"; //$NON-NLS-1$
|
|
161 |
|
|
162 |
/**
|
|
163 |
* defined
|
|
164 |
*/
|
|
165 |
final String DEFINED = "defined"; //$NON-NLS-1$
|
|
166 |
|
|
167 |
/**
|
|
168 |
* #else
|
|
169 |
*/
|
|
170 |
final String ELSE = "#else"; //$NON-NLS-1$
|
|
171 |
|
|
172 |
/**
|
|
173 |
* #endif
|
|
174 |
*/
|
|
175 |
final String ENDIF = "#endif"; //$NON-NLS-1$
|
|
176 |
|
|
177 |
/**
|
|
178 |
* Or
|
|
179 |
*/
|
|
180 |
final String OR = "||"; //$NON-NLS-1$
|
|
181 |
|
|
182 |
/**
|
|
183 |
* Return statement
|
|
184 |
*/
|
|
185 |
final String RETURN = "return"; //$NON-NLS-1$
|
|
186 |
|
|
187 |
/**
|
|
188 |
* One step up in path ("../")
|
|
189 |
*/
|
|
190 |
final String PATH_UP = "../"; //$NON-NLS-1$
|
|
191 |
|
|
192 |
/**
|
|
193 |
* This path ("./")
|
|
194 |
*/
|
|
195 |
final String THIS_PATH = "./"; //$NON-NLS-1$
|
|
196 |
|
|
197 |
/**
|
|
198 |
* inline
|
|
199 |
*/
|
|
200 |
final String INLINE = "inline"; //$NON-NLS-1$
|
|
201 |
|
|
202 |
/**
|
|
203 |
* void
|
|
204 |
*/
|
|
205 |
final String VOID = "void"; //$NON-NLS-1$
|
|
206 |
|
|
207 |
/**
|
|
208 |
* char
|
|
209 |
*/
|
|
210 |
final String CHAR = "char"; //$NON-NLS-1$
|
|
211 |
|
|
212 |
/**
|
|
213 |
* short
|
|
214 |
*/
|
|
215 |
final String SHORT = "short"; //$NON-NLS-1$
|
|
216 |
|
|
217 |
/**
|
|
218 |
* int
|
|
219 |
*/
|
|
220 |
final String INT = "int"; //$NON-NLS-1$
|
|
221 |
|
|
222 |
/**
|
|
223 |
* long
|
|
224 |
*/
|
|
225 |
final String LONG = "long"; //$NON-NLS-1$
|
|
226 |
|
|
227 |
/**
|
|
228 |
* unsigned
|
|
229 |
*/
|
|
230 |
final String UNSIGNED = "unsigned"; //$NON-NLS-1$
|
|
231 |
|
|
232 |
/**
|
|
233 |
* Parameter type qualifier list
|
|
234 |
*/
|
|
235 |
final String[] PARAMETER_QUALIFIERS = { "const", //$NON-NLS-1$
|
|
236 |
"volatile", UNSIGNED }; //$NON-NLS-1$
|
|
237 |
|
|
238 |
/**
|
|
239 |
* No parameters
|
|
240 |
*/
|
|
241 |
final String NO_PARAMETERS = "()"; //$NON-NLS-1$
|
|
242 |
|
|
243 |
/**
|
|
244 |
* Start of parameters
|
|
245 |
*/
|
|
246 |
final String START_PARAMETERS = "( "; //$NON-NLS-1$
|
|
247 |
|
|
248 |
/**
|
|
249 |
* Start of parameters with quote
|
|
250 |
*/
|
|
251 |
final String START_PARAMETERS_QUOTE = "( \""; //$NON-NLS-1$
|
|
252 |
|
|
253 |
/**
|
|
254 |
* Closing parenthesis with non-quoted last parameter
|
|
255 |
*/
|
|
256 |
final String END_PARAMETERS = " )"; //$NON-NLS-1$
|
|
257 |
|
|
258 |
/**
|
|
259 |
* Closing parenthesis with quoted last parameter
|
|
260 |
*/
|
|
261 |
final String END_PARAMETERS_QUOTE = "\" )"; //$NON-NLS-1$
|
|
262 |
|
|
263 |
/**
|
|
264 |
* Separator between end of quoted parameter and start of non-quoted
|
|
265 |
* parameter
|
|
266 |
*/
|
|
267 |
final String QUOTE_PARAMETER_SEPARATOR = "\", "; //$NON-NLS-1$
|
|
268 |
|
|
269 |
/**
|
|
270 |
* Separator between two parameters without quotes
|
|
271 |
*/
|
|
272 |
final String PARAMETER_SEPARATOR = ", "; //$NON-NLS-1$
|
|
273 |
|
|
274 |
/**
|
|
275 |
* Separator within for
|
|
276 |
*/
|
|
277 |
final String FOR_SEPARATOR = "; "; //$NON-NLS-1$
|
|
278 |
|
|
279 |
/**
|
|
280 |
* Separator between end of non-quoted parameter and start of quoted
|
|
281 |
* parameter
|
|
282 |
*/
|
|
283 |
final String PARAMETER_SEPARATOR_QUOTE = ", \""; //$NON-NLS-1$
|
|
284 |
|
|
285 |
/**
|
|
286 |
* if and the opening parenthesis
|
|
287 |
*/
|
|
288 |
final String START_IF = "if ( "; //$NON-NLS-1$
|
|
289 |
|
|
290 |
/**
|
|
291 |
* Sizeof and the opening parenthesis
|
|
292 |
*/
|
|
293 |
final String START_SIZEOF = "sizeof ( "; //$NON-NLS-1$
|
|
294 |
|
|
295 |
/**
|
|
296 |
* for and the opening parenthesis
|
|
297 |
*/
|
|
298 |
final String START_FOR = "for ( "; //$NON-NLS-1$
|
|
299 |
|
|
300 |
/**
|
|
301 |
* Assignment operation with spaces
|
|
302 |
*/
|
|
303 |
final String ASSIGN_WITH_SPACES = " = "; //$NON-NLS-1$
|
|
304 |
|
|
305 |
/**
|
|
306 |
* Assignment operation with out spaces
|
|
307 |
*/
|
|
308 |
final String ASSIGN_WITH_OUT_SPACES = "="; //$NON-NLS-1$
|
|
309 |
|
|
310 |
/**
|
|
311 |
* Less of equals for if-statements
|
|
312 |
*/
|
|
313 |
final String LESS_OR_EQUAL_THAN = " <= "; //$NON-NLS-1$
|
|
314 |
|
|
315 |
/**
|
|
316 |
* Less for if statements
|
|
317 |
*/
|
|
318 |
final String LESS_THAN = " < "; //$NON-NLS-1$
|
|
319 |
|
|
320 |
/**
|
|
321 |
* Starting bracket for array
|
|
322 |
*/
|
|
323 |
final String START_ARRAY = "[ "; //$NON-NLS-1$
|
|
324 |
|
|
325 |
/**
|
|
326 |
* Ending bracket for array
|
|
327 |
*/
|
|
328 |
final String END_ARRAY = " ]"; //$NON-NLS-1$
|
|
329 |
|
|
330 |
/**
|
|
331 |
* Pointer and space
|
|
332 |
*/
|
|
333 |
final String POINTER = "* "; //$NON-NLS-1$
|
|
334 |
|
|
335 |
/**
|
|
336 |
* Add operation with spaces
|
|
337 |
*/
|
|
338 |
final String ADD = " + "; //$NON-NLS-1$
|
|
339 |
|
|
340 |
/**
|
|
341 |
* Modulo operation with spaces
|
|
342 |
*/
|
|
343 |
final String MOD = " % "; //$NON-NLS-1$
|
|
344 |
|
|
345 |
/**
|
|
346 |
* Subtract with assignment
|
|
347 |
*/
|
|
348 |
final String SUBTRACT_ASSIGN = " -= "; //$NON-NLS-1$
|
|
349 |
|
|
350 |
/**
|
|
351 |
* Add with assignment
|
|
352 |
*/
|
|
353 |
final String ADD_ASSIGN = " += "; //$NON-NLS-1$
|
|
354 |
|
|
355 |
/**
|
|
356 |
* Not equal check
|
|
357 |
*/
|
|
358 |
final String NOT_EQUALS = " != "; //$NON-NLS-1$
|
|
359 |
|
|
360 |
/**
|
|
361 |
* Equal check
|
|
362 |
*/
|
|
363 |
final String EQUALS = " == "; //$NON-NLS-1$
|
|
364 |
|
|
365 |
/**
|
|
366 |
* Increment operation
|
|
367 |
*/
|
|
368 |
final String INCREMENT = "++"; //$NON-NLS-1$
|
|
369 |
|
|
370 |
/**
|
|
371 |
* Subtract operation with spaces
|
|
372 |
*/
|
|
373 |
final String SUBTRACT = " - "; //$NON-NLS-1$
|
|
374 |
|
|
375 |
/**
|
|
376 |
* class
|
|
377 |
*/
|
|
378 |
final String CLASS = "class"; //$NON-NLS-1$
|
|
379 |
|
|
380 |
/**
|
|
381 |
* public
|
|
382 |
*/
|
|
383 |
final String PUBLIC = "public"; //$NON-NLS-1$
|
|
384 |
|
|
385 |
/**
|
|
386 |
* private
|
|
387 |
*/
|
|
388 |
final String PRIVATE = "private"; //$NON-NLS-1$
|
|
389 |
|
|
390 |
/**
|
|
391 |
* Prefix for hex numbers
|
|
392 |
*/
|
|
393 |
final String HEX_PREFIX = "0x"; //$NON-NLS-1$
|
|
394 |
|
|
395 |
/**
|
|
396 |
* Prefix for hex numbers, upper case
|
|
397 |
*/
|
|
398 |
final String HEX_PREFIX_U = "0X"; //$NON-NLS-1$
|
|
399 |
|
|
400 |
/**
|
|
401 |
* Prefix for octal numbers
|
|
402 |
*/
|
|
403 |
final String OCTAL_PREFIX = "0"; //$NON-NLS-1$
|
|
404 |
|
|
405 |
/**
|
|
406 |
* 64-bit integer postfix
|
|
407 |
*/
|
|
408 |
final String I64_POSTFIX = "i64"; //$NON-NLS-1$
|
|
409 |
|
|
410 |
/**
|
|
411 |
* Size of long integer
|
|
412 |
*/
|
|
413 |
final int LONG_SIZE = 64; // CodForChk_Dis_Magic
|
|
414 |
|
|
415 |
/**
|
|
416 |
* Size of integer
|
|
417 |
*/
|
|
418 |
final int INT_SIZE = 32; // CodForChk_Dis_Magic
|
|
419 |
|
|
420 |
/**
|
|
421 |
* Size of short
|
|
422 |
*/
|
|
423 |
final int SHORT_SIZE = 16; // CodForChk_Dis_Magic
|
|
424 |
|
|
425 |
/**
|
|
426 |
* Size of byte
|
|
427 |
*/
|
|
428 |
final int BYTE_SIZE = 8; // CodForChk_Dis_Magic
|
|
429 |
|
|
430 |
/**
|
|
431 |
* Array type prefix
|
|
432 |
*/
|
|
433 |
final String OST_ARRAY_TYPE_PREFIX = "const TOstArray< "; //$NON-NLS-1$
|
|
434 |
|
|
435 |
/**
|
|
436 |
* Array type postfix
|
|
437 |
*/
|
|
438 |
final String OST_ARRAY_TYPE_POSTFIX = " >&"; //$NON-NLS-1$
|
|
439 |
|
|
440 |
/**
|
|
441 |
* Variable argument list indicator
|
|
442 |
*/
|
|
443 |
final String VARIABLE_ARG_LIST_INDICATOR = "..."; //$NON-NLS-1$
|
|
444 |
|
|
445 |
}
|