00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #if !defined(BOOST_WAVE_ADVANCED_PREPROCESSING_HOOKS_INCLUDED)
00011 #define BOOST_WAVE_ADVANCED_PREPROCESSING_HOOKS_INCLUDED
00012
00013
00014
00015 #include <cstdio>
00016 #include <ostream>
00017 #include <string>
00018
00019 #include <boost/assert.hpp>
00020 #include <boost/config.hpp>
00021
00022 #include <boost/wave/token_ids.hpp>
00023 #include <boost/wave/util/macro_helpers.hpp>
00024 #include <boost/wave/preprocessing_hooks.hpp>
00025
00026 #include "attributeListMap.h"
00027
00028 #define ROSE_WAVE_PSEUDO_FILE "<rose wave fix>"
00029
00030 #if 0
00031 namespace {
00032
00033 char const *get_directivename(boost::wave::token_id id)
00034 {
00035 using namespace boost::wave;
00036 switch (static_cast<unsigned int>(id)) {
00037 case T_PP_IFDEF: return "#ifdef";
00038 case T_PP_IFNDEF: return "#ifndef";
00039 case T_PP_IF: return "#if";
00040 case T_PP_ELSE: return "#else";
00041 case T_PP_ELIF: return "#elif";
00042 case T_PP_ENDIF: return "#endif";
00043 default:
00044 return "#unknown directive";
00045 }
00046 }
00047 }
00048
00049 #endif
00050
00052
00053
00054
00055
00056
00057
00058
00059
00061
00062 class advanced_preprocessing_hooks
00063 : public boost::wave::context_policies::default_preprocessing_hooks
00064 {
00065
00066 public:
00067 AttributeListMap* attributeListMap;
00068 std::list< token_type > tokens;
00069
00070 token_type lastPreprocDirective;
00071 int numberOfIfs;
00072
00073 std::string includeDirective;
00074 token_type includeDirectiveToken;
00075 bool skipping;
00076 bool updatingLastToken;
00077 token_type last_token;
00078 advanced_preprocessing_hooks()
00079 : attributeListMap(NULL)
00080 , tokens()
00081 , lastPreprocDirective()
00082 , numberOfIfs(0)
00083 , includeDirective()
00084 , skipping(false)
00085 , updatingLastToken(false)
00086 { }
00087
00088
00089
00091
00092
00093
00094
00095
00096
00098
00099
00100
00101
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00119
00120 template <typename ContextT, typename TokenT, typename ContainerT, typename IteratorT>
00121 bool expanding_function_like_macro(ContextT const& ctx,
00122 TokenT const& macrodef, std::vector<TokenT> const& formal_args,
00123 ContainerT const& definition,
00124 TokenT const& macrocall, std::vector<ContainerT> const& arguments,
00125 IteratorT const& seqstart, IteratorT const& seqend)
00126 {
00128
00129
00130
00131
00132
00133
00135
00136 attributeListMap->expanding_function_like_macro(macrodef, formal_args, definition, macrocall, arguments);
00137
00138 return false;
00139 }
00140
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00154
00155 template <typename ContextT, typename TokenT, typename ContainerT>
00156 bool expanding_object_like_macro(ContextT const& ctx, TokenT const& macro,
00157 ContainerT const& definition, TokenT const& macrocall)
00158 {
00159 attributeListMap->expanding_object_like_macro(macro, definition, macrocall);
00160 return false;
00161 }
00162
00164
00165
00166
00167
00168
00169
00170
00172 template <typename ContextT, typename ContainerT>
00173 void expanded_macro(ContextT const& ctx, ContainerT const& result)
00174 {
00175 attributeListMap->expanded_macro(result);
00176 }
00177
00179
00180
00181
00182
00183
00184
00185
00187 template <typename ContextT, typename ContainerT>
00188 void rescanned_macro(ContextT const& ctx, ContainerT const& result)
00189 {
00190 attributeListMap->rescanned_macro(result);
00191 }
00192
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00210
00211 template <typename ContextT>
00212 bool
00213 found_include_directive(ContextT const& ctx, std::string const& filename,
00214 bool include_next)
00215 {
00216 if(SgProject::get_verbose() >= 1)
00217 std::cout << "Found include directive: " << filename << std::endl;
00218
00219 includeDirective = filename;
00220 return false;
00221 }
00222
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00239 template <typename ContextT>
00240 void
00241 opened_include_file(ContextT const& ctx, std::string const& relname,
00242 std::string const& absname, bool is_system_include)
00243 {
00244
00245 if(SgProject::get_verbose() >= 1){
00246 std::cout << "openend include file relname: " << relname << " absname: " << absname << std::endl;
00247 std::cout << "it is connected to : " << includeDirective << std::endl;
00248 }
00249 attributeListMap->found_include_directive(includeDirectiveToken, relname, absname);
00250 }
00251
00253
00254
00255
00256
00258
00259 template <typename ContextT>
00260 void
00261 returning_from_include_file(ContextT const& ctx)
00262 {}
00263
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00290 template <typename ContextT, typename ContainerT>
00291 bool
00292 interpret_pragma(ContextT const &ctx, ContainerT &pending,
00293 typename ContextT::token_type const &option, ContainerT const &values,
00294 typename ContextT::token_type const &act_token)
00295 {
00296 return false;
00297 }
00298
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00320 template <typename ContextT, typename TokenT, typename ParametersT,
00321 typename DefinitionT>
00322 void
00323 defined_macro(ContextT const& ctx, TokenT const& macro_name,
00324 bool is_functionlike, ParametersT const& parameters,
00325 DefinitionT const& definition, bool is_predefined)
00326 {
00327 #if 0
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337 #endif
00338
00339 if( macro_name.get_position().get_file().size()!=0 )
00340 {
00341 if( (macro_name.get_position().get_file()!="<built-in>") )
00342 {
00343 attributeListMap->defined_macro(macro_name, is_functionlike, parameters, definition, is_predefined);
00344
00345 }
00346 }
00347 else
00348 {
00349 attributeListMap->defined_macro(macro_name, is_functionlike, parameters, definition, is_predefined);
00350 }
00351
00352
00353 token_type space = token_type(boost::wave::T_SPACE, " ", boost::wave::util::file_position_type(BOOST_WAVE_STRINGTYPE(ROSE_WAVE_PSEUDO_FILE), 0, 0));
00354 tokens.push_back(space);
00355 tokens.push_back(macro_name);
00356
00357 boost::wave::util::file_position_type filepos;
00358 if (
00359 macro_name.get_position().get_file().find("<default>") == std::string::npos &&
00360 macro_name.get_position().get_file().find("<built-in>") == std::string::npos &&
00361 macro_name.get_position().get_file().find("<command line>") == std::string::npos &&
00362 macro_name.get_position().get_file().find("rose_edg_required_macros_and_functions") == std::string::npos)
00363 filepos = boost::wave::util::file_position_type(BOOST_WAVE_STRINGTYPE(ROSE_WAVE_PSEUDO_FILE), 0, 0);
00364 else
00365 filepos = boost::wave::util::file_position_type(macro_name.get_position().get_file(), 0, 0);
00366
00367 if (is_functionlike)
00368 {
00369 token_type left = token_type(boost::wave::T_LEFTPAREN, "(", filepos);
00370 tokens.push_back(left);
00371 bool first = true;
00372 for (typename ParametersT::const_iterator i = parameters.begin(); i != parameters.end(); ++i)
00373 {
00374 if (!first)
00375 {
00376 token_type comma = token_type(boost::wave::T_COMMA, ",", filepos);
00377 tokens.push_back(comma);
00378 }
00379 tokens.push_back(*i);
00380 first = false;
00381 }
00382 token_type right = token_type(boost::wave::T_RIGHTPAREN, ")", filepos);
00383 tokens.push_back(right);
00384 }
00385 token_type space2 = token_type(boost::wave::T_SPACE, " ", filepos);
00386 tokens.push_back(space2);
00387 for (typename DefinitionT::const_iterator i = definition.begin(); i != definition.end(); ++i)
00388 {
00389 token_type space = token_type(boost::wave::T_SPACE, " ", filepos);
00390 tokens.push_back(space);
00391 tokens.push_back(*i);
00392 }
00393
00394 }
00395
00396
00398
00399
00400
00401
00402
00403
00404
00405
00407 template <typename ContextT, typename TokenT>
00408 bool
00409 found_directive(ContextT const& ctx, TokenT const& directive)
00410 {
00411 if(SgProject::get_verbose() >= 1)
00412 std::cout << "found_directive!" << std::endl;
00413
00414 skipping = false;
00415 lastPreprocDirective = directive;
00416
00417 using namespace boost::wave;
00418 token_id id = token_id(directive);
00419
00420 bool record = true;
00421 switch(id)
00422 {
00423 case T_PP_LINE:
00424 case T_PP_UNDEF:
00425 case T_PP_WARNING:
00426 case T_PP_DEFINE:
00427 record = false;
00428 break;
00429 case T_PP_IF:
00430 case T_PP_IFDEF:
00431 case T_PP_IFNDEF:
00432 case T_PP_ELSE:
00433 case T_PP_ELIF:
00434 break;
00435 case T_PP_ENDIF:
00436 case T_PP_ERROR:
00437 case T_PP_PRAGMA:
00438 case T_PP_INCLUDE:
00439 break;
00440 case T_PP_QHEADER:
00441 case T_PP_HHEADER:
00442 break;
00443 default:
00444 break;
00445 }
00446 if (record)
00447 attributeListMap->found_directive(directive);
00448
00449 attributeListMap->flush_token_stream();
00450 updatingLastToken = true;
00451
00452 if(SgProject::get_verbose() >= 1)
00453 {
00454 switch(id)
00455 {
00456 case T_PP_DEFINE: std::cout << "Directive is: #define\n"; break;
00457 case T_PP_IF: std::cout << "Directive is: #if\n"; break;
00458 case T_PP_IFDEF: std::cout << "Directive is: #ifdef\n"; break;
00459 case T_PP_IFNDEF: std::cout << "Directive is: #ifndef\n"; break;
00460 case T_PP_ELSE: std::cout << "Directive is: #else\n"; break;
00461 case T_PP_ELIF: std::cout << "Directive is: #elif\n"; break;
00462 case T_PP_ENDIF: std::cout << "Directive is: #endif\n"; break;
00463 case T_PP_ERROR: std::cout << "Directive is: #error\n"; break;
00464 case T_PP_LINE: std::cout << "Directive is: #line\n"; break;
00465 case T_PP_PRAGMA: std::cout << "Directive is: #pragma\n"; break;
00466 case T_PP_UNDEF: std::cout << "Directive is: #undef\n"; break;
00467 case T_PP_WARNING: std::cout << "Directive is: #warning\n"; break;
00468 case T_PP_INCLUDE: std::cout << "Directive is: #include \"...\"\n"; break;
00469 case T_PP_QHEADER: std::cout << "Directive is: #include <...>\n"; break;
00470 case T_PP_HHEADER: std::cout << "Directive is: #include ...\n"; break;
00471 default: std::cout << "Directive is: <something else>\n"; break;
00472 }
00473 }
00474
00475 last_token = directive;
00476 tokens.push_back(directive);
00477 return false;
00478 }
00479
00481
00482
00483
00484
00486 template <typename ContextT, typename TokenT>
00487 TokenT const& generated_token(ContextT const& ctx, TokenT const& token)
00488 {
00489 if(SgProject::get_verbose() >= 1)
00490 std::cout << "Generating token: ";
00491
00492 using namespace boost::wave;
00493 token_id id = token_id(token);
00494
00495 if(SgProject::get_verbose() >= 1)
00496 {
00497 switch(id)
00498 {
00499 case T_PP_DEFINE: std::cout << "#define: "; break;
00500 case T_PP_IF: std::cout << "#if: "; break;
00501 case T_PP_IFDEF: std::cout << "#ifdef: "; break;
00502 case T_PP_IFNDEF: std::cout << "#ifndef: "; break;
00503 case T_PP_ELSE: std::cout << "#else: "; break;
00504 case T_PP_ELIF: std::cout << "#elif: "; break;
00505 case T_PP_ENDIF: std::cout << "#endif: "; break;
00506 case T_PP_ERROR: std::cout << "#error: "; break;
00507 case T_PP_LINE: std::cout << "#line: "; break;
00508 case T_PP_PRAGMA: std::cout << "#pragma: "; break;
00509 case T_PP_UNDEF: std::cout << "#undef: "; break;
00510 case T_PP_WARNING: std::cout << "#warning: "; break;
00511 case T_PP_INCLUDE: std::cout << "#include \"...\": "; break;
00512 case T_PP_QHEADER: std::cout << "#include <...>: "; break;
00513 case T_PP_HHEADER: std::cout << "#include ...: "; break;
00514 default: std::cout << "<something else (" << id << ")>: "; break;
00515 }
00516
00517 if (token != token_type())
00518 std::cout << token.get_value().c_str() << std::endl;
00519 }
00520 return token;
00521 }
00522
00524
00525
00526
00527
00528
00529
00530
00531
00532
00533
00534
00536 template <typename ContextT, typename TokenT, typename ContainerT>
00537 bool
00538 evaluated_conditional_expression(ContextT const& ctx, TokenT const& directive, ContainerT const& expression, bool expression_value)
00539 {
00540 using namespace boost::wave;
00541 token_id id = token_id(directive);
00542
00543 ROSE_ASSERT(directive == lastPreprocDirective);
00544
00545 if(SgProject::get_verbose() >= 1)
00546 {
00547 std::cout << "Conditional: ";
00548 switch(id)
00549 {
00550 case T_PP_DEFINE: std::cout << "#define: "; break;
00551 case T_PP_IF: std::cout << "#if: "; break;
00552 case T_PP_IFDEF: std::cout << "#ifdef: "; break;
00553 case T_PP_IFNDEF: std::cout << "#ifndef: "; break;
00554 case T_PP_ELSE: std::cout << "#else: "; break;
00555 case T_PP_ELIF: std::cout << "#elif: "; break;
00556 case T_PP_ENDIF: std::cout << "#endif: "; break;
00557 case T_PP_ERROR: std::cout << "#error: "; break;
00558 case T_PP_LINE: std::cout << "#line: "; break;
00559 case T_PP_PRAGMA: std::cout << "#pragma: "; break;
00560 case T_PP_UNDEF: std::cout << "#undef: "; break;
00561 case T_PP_WARNING: std::cout << "#warning: "; break;
00562 case T_PP_INCLUDE: std::cout << "#include \"...\": "; break;
00563 case T_PP_QHEADER: std::cout << "#include <...>: "; break;
00564 case T_PP_HHEADER: std::cout << "#include ...: "; break;
00565 default: std::cout << "<something else (" << id << ")>: "; break;
00566 }
00567
00568 std::cout << directive.get_value().c_str() << std::endl;
00569 }
00570 token_type space = token_type(boost::wave::T_SPACE, " ", boost::wave::util::file_position_type(BOOST_WAVE_STRINGTYPE(ROSE_WAVE_PSEUDO_FILE), 0, 0));
00571 token_container whitespace;
00572 whitespace.push_back(space);
00573
00574 attributeListMap->update_token(lastPreprocDirective, whitespace, expression_value);
00575 attributeListMap->update_token(lastPreprocDirective, expression, expression_value);
00576
00577
00578 for (typename ContainerT::const_iterator i = expression.begin(); i != expression.end(); ++i)
00579 {
00580 token_type space = token_type(boost::wave::T_SPACE, " ", boost::wave::util::file_position_type(BOOST_WAVE_STRINGTYPE(ROSE_WAVE_PSEUDO_FILE), 0, 0));
00581 tokens.push_back(space);
00582 tokens.push_back(*i);
00583 }
00584
00585 token_type newline = token_type(boost::wave::T_NEWLINE, "\n", boost::wave::util::file_position_type(BOOST_WAVE_STRINGTYPE(ROSE_WAVE_PSEUDO_FILE), 0, 0));
00586 token_container whitespace2;
00587 whitespace2.push_back(newline);
00588 attributeListMap->update_token(lastPreprocDirective, whitespace2, expression_value);
00589
00590
00591
00592
00593 updatingLastToken = true;
00594
00595 last_token = directive;
00596 return false;
00597 }
00598
00600
00601
00602
00603
00604
00605
00606
00607
00609 template <typename ContextT, typename TokenT>
00610 void
00611 skipped_token(ContextT const& ctx, TokenT const& token)
00612 {
00613 using namespace boost::wave;
00614
00615
00616 if (token.get_position().get_file().size() == 0)
00617 return;
00618 if (token == last_token && token.get_position() == last_token.get_position())
00619 return;
00620
00621 token_id id = token_id(token);
00622 token_id lastid = token_id(lastPreprocDirective);
00623 if (lastPreprocDirective == token_type())
00624 {
00625 attributeListMap->skipped_token(token);
00626 }
00627 else if (token != lastPreprocDirective)
00628 {
00629 tokens.push_back(token);
00630
00631 if (id == T_NEWLINE)
00632 updatingLastToken = false;
00633
00634
00635 if (updatingLastToken)
00636 {
00637 token_container tc;
00638 tc.push_back(token);
00639 if(SgProject::get_verbose() >= 1)
00640 std::cout << "Updating previous token (" << lastPreprocDirective.get_value().c_str() << ") with token " << token.get_value().c_str() << std::endl;
00641 attributeListMap->update_token(lastPreprocDirective, tc, false);
00642 }
00643 else if (skipping || (lastid != T_PP_IF && lastid != T_PP_IFDEF && lastid != T_PP_IFNDEF && lastid != T_PP_ELIF))
00644 {
00645 attributeListMap->skipped_token(token);
00646 }
00647 }
00648
00649 switch(id)
00650 {
00651 case T_PP_DEFINE:
00652 case T_PP_IF:
00653 case T_PP_IFDEF:
00654 case T_PP_IFNDEF:
00655 case T_PP_ELSE:
00656 case T_PP_ELIF:
00657 case T_PP_ENDIF:
00658 case T_PP_ERROR:
00659 case T_PP_LINE:
00660 case T_PP_PRAGMA:
00661 case T_PP_UNDEF:
00662 case T_PP_WARNING:
00663 case T_PP_INCLUDE:
00664 case T_PP_QHEADER:
00665 case T_PP_HHEADER:
00666 lastPreprocDirective = token;
00667 break;
00668 default:
00669 break;
00670 }
00671
00672 if(SgProject::get_verbose() >= 1)
00673 {
00674 switch(id)
00675 {
00676 case T_PP_DEFINE: std::cout << "Skipped: #define\n"; break;
00677 case T_PP_IF: std::cout << "Skipped: #if\n"; break;
00678 case T_PP_IFDEF: std::cout << "Skipped: #ifdef\n"; break;
00679 case T_PP_IFNDEF: std::cout << "Skipped: #ifndef\n"; break;
00680 case T_PP_ELSE: std::cout << "Skipped: #else\n"; break;
00681 case T_PP_ELIF: std::cout << "Skipped: #elif\n"; break;
00682 case T_PP_ENDIF: std::cout << "Skipped: #endif\n"; break;
00683 case T_PP_ERROR: std::cout << "Skipped: #error\n"; break;
00684 case T_PP_LINE: std::cout << "Skipped: #line\n"; break;
00685 case T_PP_PRAGMA: std::cout << "Skipped: #pragma\n"; break;
00686 case T_PP_UNDEF: std::cout << "Skipped: #undef\n"; break;
00687 case T_PP_WARNING: std::cout << "Skipped: #warning\n"; break;
00688 case T_PP_INCLUDE: std::cout << "Skipped: #include \"...\"\n"; break;
00689 case T_PP_QHEADER: std::cout << "Skipped: #include <...>\n"; break;
00690 case T_PP_HHEADER: std::cout << "Skipped: #include ...\n"; break;
00691 default: std::cout << "Skipped: <something else (" << token.get_value().c_str() << ")>\n"; break;
00692 }
00693 if (lastPreprocDirective != token_type())
00694 std::cout << "\tskipping is " << skipping << "\tupdatingLastToken is " << updatingLastToken << "\tlastPreprocDirective is " << lastPreprocDirective.get_value().c_str() << std::endl;
00695 }
00696 skipping = true;
00697 last_token = token;
00698 }
00699
00701
00702
00703
00704
00705
00706
00707
00709 template <typename ContextT, typename TokenT>
00710 void
00711 undefined_macro(ContextT const& ctx, TokenT const& macro_name)
00712 {
00713 token_list_container tokListCont;
00714 tokListCont.push_back(macro_name);
00715 attributeListMap->found_directive(lastPreprocDirective,tokListCont, false);
00716
00717 token_type space = token_type(boost::wave::T_SPACE, " ", boost::wave::util::file_position_type(BOOST_WAVE_STRINGTYPE(ROSE_WAVE_PSEUDO_FILE), 0, 0));
00718 tokens.push_back(space);
00719 tokens.push_back(macro_name);
00720 }
00721
00722 #if 0
00723 template <typename ContainerT>
00724 void
00725 on_warning(ContainerT const& tokenStream)
00726 {
00727 attributeListMap->found_directive(lastPreprocDirective,tokenStream, false);
00728
00729 std::cout << "ON TOKEN WARNING: " << boost::wave::util::impl::as_string(tokenStream) << std::endl;
00730 }
00731 #endif
00732
00734
00735
00736
00737
00738
00739
00740
00741
00742
00743
00745 template <typename ContextT, typename ContainerT>
00746 bool
00747 found_warning_directive(ContextT const& ctx, ContainerT const& message)
00748 {
00749 attributeListMap->found_directive(lastPreprocDirective,message, false);
00750
00751 if(SgProject::get_verbose() >= 1)
00752 std::cout << "ON TOKEN WARNING: " << boost::wave::util::impl::as_string(message) << std::endl;
00753
00754
00755 return true;
00756 }
00757
00758
00760
00761
00762
00763
00764
00765
00766
00767
00768
00769
00770
00771
00772
00773
00774
00775
00777 template <typename ContextT, typename ContainerT>
00778 void
00779 found_line_directive(ContextT const& ctx, ContainerT const& arguments, unsigned int line, std::string const& filename)
00780 {
00781 std::string filenameString(filename.c_str());
00782
00783 if (SgProject::get_verbose() >= 1)
00784 std::cout << "On line found" << std::endl;
00785
00786
00787
00788
00789
00790
00791 attributeListMap->found_directive(lastPreprocDirective,arguments, false);
00792
00793 token_type space = token_type(boost::wave::T_SPACE, " ", boost::wave::util::file_position_type(BOOST_WAVE_STRINGTYPE(ROSE_WAVE_PSEUDO_FILE), 0, 0));
00794 token_container whitespace;
00795 whitespace.push_back(space);
00796
00797 attributeListMap->update_token(lastPreprocDirective, whitespace, false);
00798 attributeListMap->update_token(lastPreprocDirective, arguments, false);
00799
00800
00801 for (typename ContainerT::const_iterator i = arguments.begin(); i != arguments.end(); ++i)
00802 {
00803 token_type space = token_type(boost::wave::T_SPACE, " ", boost::wave::util::file_position_type(BOOST_WAVE_STRINGTYPE(ROSE_WAVE_PSEUDO_FILE), 0, 0));
00804 tokens.push_back(space);
00805 tokens.push_back(*i);
00806 }
00807 }
00808
00809
00810 template <typename ContextT, typename TokenT>
00811 bool
00812 may_skip_whitespace(ContextT const& ctx, TokenT& token, bool& skipped_newline)
00813 {
00814 if (token == lastPreprocDirective && token.get_position() == lastPreprocDirective.get_position())
00815 return false;
00816 if (token == last_token && token.get_position() == last_token.get_position())
00817 return false;
00818 if (SgProject::get_verbose() >= 1)
00819 if (token != TokenT())
00820 std::cout << "MAX_SKIP_WHITESPACE: " << token.get_value().c_str() << std::endl;
00821
00822 using namespace boost::wave;
00823 token_id id = token_id(token);
00824 if (id != T_EOF && id != T_EOI)
00825 tokens.push_back(token);
00826 if (id != T_EOF && id != T_EOI && id != T_NEWLINE)
00827 {
00828 if (SgProject::get_verbose() >= 1)
00829 std::cout << "Normal reported" << std::endl;
00830 attributeListMap->may_skip_whitespace(ctx, token, skipped_newline);
00831 }
00832 else if (skipping)
00833 {
00834 if (SgProject::get_verbose() >= 1)
00835 std::cout << "Skip leads to flushing" << std::endl;
00836 attributeListMap->flush_token_stream();
00837 }
00838 else
00839 {
00840 if (SgProject::get_verbose() >= 1)
00841 std::cout << "EOF or newline leads to flushing" << std::endl;
00842 attributeListMap->flush_token_stream();
00843 }
00844 return false;
00845 }
00846
00847 template <typename ContextT, typename ExceptionT>
00848 void throw_exception(ContextT const &ctx, ExceptionT const& e)
00849 {
00850 if (SgProject::get_verbose() >= 1)
00851 std::cout << "THROW_EXCEPTION" << std::endl;
00852 }
00853
00854 template <typename ContextT>
00855 void detected_include_guard(ContextT const &ctx, std::string const& filename, std::string const& include_guard)
00856 {
00857 if (SgProject::get_verbose() >= 1)
00858 std::cout << "DETECTED_INCLUDE_GUARD" << include_guard << " in file " << filename << std::endl;
00859 }
00860
00861 template <typename ContextT, typename TokenT>
00862 void detected_pragma_once(ContextT const &ctx, TokenT const& pragma_token, std::string const& filename)
00863 {
00864 if (SgProject::get_verbose() >= 1)
00865 std::cout << "DETECTED_PRAGMA_ONCE " << pragma_token.get_value() << " in file " << filename << std::endl;
00866 }
00867
00868 template <typename ContextT, typename ContainerT>
00869 bool found_error_directive(ContextT const &ctx, ContainerT const &message)
00870 {
00871 if (SgProject::get_verbose() >= 1)
00872 std::cout << "FOUND_ERROR_DIRECTIVE" << std::endl;
00873 return false;
00874 }
00875
00876
00877 #if 0
00878 bool need_comment;
00879 #endif
00880 };
00881
00882 #endif // !defined(BOOST_WAVE_ADVANCED_PREPROCESSING_HOOKS_INCLUDED)
00883