HPCW 3.0
Loading...
Searching...
No Matches
CMakeDoxygenFilter.cpp File Reference
#include <cstdlib>
#include <string>
#include <fstream>
#include <iostream>
#include <assert.h>
Include dependency graph for CMakeDoxygenFilter.cpp:

Go to the source code of this file.

Classes

struct  ci_char_traits
 
class  CMakeLexer
 
class  CMakeParser
 

Macros

#define STRINGIFY(a)   #a
 
#define DOUBLESTRINGIFY(a)   STRINGIFY(a)
 

Typedefs

typedef std::basic_string< char, ci_char_traitsci_string
 

Functions

int main (int argc, char **argv)
 

Macro Definition Documentation

◆ DOUBLESTRINGIFY

#define DOUBLESTRINGIFY ( a)    STRINGIFY(a)

Definition at line 447 of file CMakeDoxygenFilter.cpp.

◆ STRINGIFY

#define STRINGIFY ( a)    #a

Definition at line 446 of file CMakeDoxygenFilter.cpp.

Typedef Documentation

◆ ci_string

typedef std::basic_string<char, ci_char_traits> ci_string

Definition at line 68 of file CMakeDoxygenFilter.cpp.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 449 of file CMakeDoxygenFilter.cpp.

450{
451 assert(argc > 1);
452
453 for (int i = 1; i < argc; ++i)
454 {
455 std::ifstream ifs(argv[i]);
456 std::ostream& os = std::cout;
457
458 #ifdef USE_NAMESPACE
459 os << "namespace " << DOUBLESTRINGIFY(USE_NAMESPACE) << " {\n";
460 #endif
461
462 CMakeParser parser(ifs, os);
463 parser.nextToken();
464 while (ifs.good())
465 {
466 switch (parser.curToken())
467 {
469 return ifs.get(); // eat EOF
471 parser.handleMacro();
472 break;
474 parser.handleFunction();
475 break;
477 parser.handleSet();
478 break;
480 parser.handleDoxygenComment();
481 break;
482 default:
483 parser.handleTopLevelExpression();
484 break;
485 }
486 }
487
488 #ifdef USE_NAMESPACE
489 os << "}\n";
490 #endif
491 }
492
493 return EXIT_SUCCESS;
494}
#define DOUBLESTRINGIFY(a)