* Build the vector of header words. * Used by BOTH ASFormatter.cpp and ASBeautifier.cpp * * @param headers a reference to the vector to be built. */
| 234 | * @param headers a reference to the vector to be built. |
| 235 | */ |
| 236 | void ASResource::buildHeaders(vector<const string*>* headers, int fileType, bool beautifier) |
| 237 | { |
| 238 | headers->push_back(&AS_IF); |
| 239 | headers->push_back(&AS_ELSE); |
| 240 | headers->push_back(&AS_FOR); |
| 241 | headers->push_back(&AS_WHILE); |
| 242 | headers->push_back(&AS_DO); |
| 243 | headers->push_back(&AS_SWITCH); |
| 244 | headers->push_back(&AS_CASE); |
| 245 | headers->push_back(&AS_DEFAULT); |
| 246 | headers->push_back(&AS_TRY); |
| 247 | headers->push_back(&AS_CATCH); |
| 248 | |
| 249 | if (fileType == C_TYPE) |
| 250 | { |
| 251 | headers->push_back(&_AS_TRY); // __try |
| 252 | headers->push_back(&_AS_FINALLY); // __finally |
| 253 | headers->push_back(&_AS_EXCEPT); // __except |
| 254 | } |
| 255 | if (fileType == JAVA_TYPE) |
| 256 | { |
| 257 | headers->push_back(&AS_FINALLY); |
| 258 | headers->push_back(&AS_SYNCHRONIZED); |
| 259 | } |
| 260 | |
| 261 | if (fileType == SHARP_TYPE) |
| 262 | { |
| 263 | headers->push_back(&AS_FINALLY); |
| 264 | headers->push_back(&AS_FOREACH); |
| 265 | headers->push_back(&AS_LOCK); |
| 266 | headers->push_back(&AS_FIXED); |
| 267 | headers->push_back(&AS_GET); |
| 268 | headers->push_back(&AS_SET); |
| 269 | headers->push_back(&AS_ADD); |
| 270 | headers->push_back(&AS_REMOVE); |
| 271 | } |
| 272 | |
| 273 | if (beautifier) |
| 274 | { |
| 275 | if (fileType == C_TYPE) |
| 276 | { |
| 277 | headers->push_back(&AS_TEMPLATE); |
| 278 | } |
| 279 | |
| 280 | if (fileType == JAVA_TYPE) |
| 281 | { |
| 282 | headers->push_back(&AS_STATIC); // for static constructor |
| 283 | } |
| 284 | } |
| 285 | sort(headers->begin(), headers->end(), sortOnName); |
| 286 | } |
| 287 | |
| 288 | /** |
| 289 | * Build the vector of indentable headers. |
nothing calls this directly
no outgoing calls
no test coverage detected