The Context Policy 上下文策略

Introduction 簡介
Header 'wave/preprocessing_hooks.hpp' synopsis 頭文件概要
Member functions 成員函數

Introduction 簡介

Please note that the following description relates to the new preprocessing hooks interface used by default starting with the Boost V1.35.0 release. If you are interested in the older interface please look here.
請注意,以下描述的是從 Boost V1.35.0 版本以後缺省使用的新的預處理鉤子接口。如果你對舊的接口有興趣,請查閱此處

The context policy is used to provide callback hooks, which are called from inside the library into the user code, whenever
上下文策略用於提供回調鉤子,這些鉤子用於在以下時候從庫的內部調用用戶的代碼:

This policy type is used as a template parameter to the boost::wave::context<> object, where the default policy provides empty hook functions only.
這個策略類型用作 boost::wave::context<> 對象的一個模板參數,缺省的策略只提供空的鉤子函數。

Header wave/preprocessing_hooks.hpp synopsis 頭文件概要

namespace boost {
namespace wave {
namespace context_policies {

struct default_preprocessing_hooks {

// general hook functions template <typename ContextT, typename TokenT>
bool found_directive(ContextT const &ctx,
TokenT const &directive);
template <typename ContextT, typename ExceptionT>
void throw_exception(ContextT const &ctx,
ExceptionT const& e);

// test, whether a given token may be skipped
template <typename ContextT>
bool may_skip_whitespace (ContextT const& ctx,
TokenT &token, bool &skipped_newline);
// Conditional compilation template <
typename ContextT, typename TokenT,
typename ContainerT
>
bool evaluated_conditional_expression(
ContextT const &ctx, TokenT const& directive,
ContainerT const& expression, bool expression_value);
template <typename ContextT, typename TokenT>
void skipped_token(ContextT const &ctx,
TokenT const& token);

template <typename ContextT, typename TokenT>
TokenT const& generated_token(ContextT const &ctx,
TokenT const& token);

// macro expansion tracing template < typename ContextT, typename TokenT, typename ContainerT,
typename IteratorT
>
bool expanding_function_like_macro(
ContextT const &ctx, TokenT const &macrodef,
std::vector<TokenT> const &formal_args,
ContainerT const &definition, TokenT const &macrocall,
std::vector<ContainerT> const &arguments,
IteratorT const &seqstart, Iterator const &seqend);

template <typename ContextT, typename TokenT, typename ContainerT>
bool expanding_object_like_macro(
ContextT const &ctx, TokenT const &macro,
ContainerT const &definition, TokenT const &macrocall);

template <typename ContextT, typename ContainerT>
void expanded_macro(ContextT const &ctx,
ContainerT const &result);

template <typename ContextT, typename ContainerT>
void rescanned_macro(ContextT const &ctx,
ContainerT const &result);

// include file tracing functions template <typename ContextT>
bool found_include_directive(ContextT const &ctx,
std::string const &filename, bool include_next);

template <typename ContextT>
void opened_include_file(ContextT const &ctx,
std::string const &relname, std::string const& absname,
bool is_system_include);

template <typename ContextT>
void returning_from_include_file(ContextT const &ctx);

// interpretation of #pragma's of the form // 'wave option[(value)]' template <typename ContextT, typename ContainerT>
bool interpret_pragma(ContextT const &ctx, ContainerT &pending,
typename ContextT::token_type const &option,
ContainerT const &values,
typename ContextT::token_type const &pragma_token);

// macro definition hooks template <
typename ContextT, typename TokenT, typename ParametersT, typename DefinitionT
>
void defined_macro(ContextT const &ctx, TokenT const &name, bool is_functionlike, ParametersT const &parameters,
DefinitionT const &definition, bool is_predefined);

template <typename ContextT, typename TokenT>
void undefined_macro(ContextT const &ctx,
TokenT const &name);

// #error and #warning directive hooks template <typename ContextT, typename ContainerT>
bool found_warning_directive(ContextT const &ctx,
ContainerT const &message);

template <typename ContextT, typename ContainerT>
bool found_error_directive(ContextT const &ctx,
ContainerT const &message);

// #line directive hook template <typename ContextT, typename ContainerT>
void found_line_directive(ContextT const &ctx,
ContainerT const &arguments, unsigned int line,
std::string const& filename);
};

}}} // namespace boost::wave::context_policies

Member functions 成員函數

General hook functions 普通鉤子函數

found_directive

    template <typename ContextT, typename TokenT>
bool found_directive(ContextT const& ctx, TokenT const &directive);

The function found_directive is called, whenever the preprocessor has detected one of the preprocessing directives (#define, #undef, #if, #idef, #ifndef, #elif, #endif, #error, #include, #pragma or #warning) .
當預處理器檢測到以下某一個預處理指令字(#define, #undef, #if, #idef, #ifndef, #elif, #endif, #error, #include, #pragma or #warning),函數 found_directive 將被調用。

The ctx parameter provides a reference to the context_type used during instantiation of the preprocessing iterators by the user. Note, this parameter was added for the Boost V1.35.0 release.
參數 ctx 提供了一個到 context_type 的引用,在用戶初始化預處理迭代器時使用。注意,該參數是在 Boost V1.35.0 版本中加入的。

The parameter directive refers to the token containing the detected preprocessing directive.
參數 directive 引向含有檢測到的預處理指令字的單詞。

If the return value is true, the directive will be skipped altogether, i.e. no preprocessing is done. The overall directive is replaced by a single newline character. If the return value is false, the directive is processed in the normal manner.
如果返回值為 true,則該指令字將被忽略,即不做任何預處理。整個指令被替換為一個換行符。如果返回值為 false,則該指令字被按正常方式處理。

throw_exception

        template <typename ContextT, typename ExceptionT>
void throw_exception(ContextT const &ctx,
ExceptionT const& e);

The function throw_exception is called, whenever a preprocessing exception occurs .
當發生一個預處理異常時,函數 throw_exception 將被調用。

The ctx parameter provides a reference to the context_type used during instantiation of the preprocessing iterators by the user. 
參數 ctx 提供了一個到 context_type 的引用,在用戶初始化預處理迭代器時使用。

The parameter e is the exception object containing detailed error information.
參數 e 為含有具體錯誤信息的異常對象。

may_skipwhitespace

    template <typename ContextT, typename TokenT>
bool may_skip_whitespace(ContextT const& ctx, TokenT &token,
bool& skipped_newline);

The function may_skipwhitespace will be called by the library, whenever a token is about to be returned to the calling application.
當一個單詞即將要被返回至調用的應用程序時,函數 may_skipwhitespace 將被調用。

The ctx parameter provides a reference to the context_type used during instantiation of the preprocessing iterators by the user. Note, this parameter was added for the Wave V1.2.4 release.
參數 ctx 提供了一個到 context_type 的引用,在用戶初始化預處理迭代器時使用。注意,這個參數是在 Wave V1.2.4 版本中被加入的。

The token parameter holds a reference to the current token. The policy is free to change this token if needed.
參數 token 持有一個到當前單詞的引用。如果需要,本策略可以隨意修改這個單詞。

The skipped_newline parameter holds a reference to a boolean value which should be set to true by the policy function whenever a newline is going to be skipped.
參數 skipped_newline 持有一個布爾值引用,如果要忽略換行符,則該值應被設為 true。

If the return value is true, the given token is skipped and the preprocessing continues to the next token. If the return value is false, the given token is returned to the calling application. Caution has to be used, because by returning true the policy function is able to force skipping even significant tokens not only whitespace.
如果返回值為 true,則給定的單詞將被忽略,預處理繼續下一個單詞。如果返回值為 false,則給定的單詞將被返回至調用的應用程序。必須要小心,因為這個策略函數可以通過返回 true 來迫使預處理器跳過空白以外的有意義的單詞。

Conditional compilation hook functions 條件編譯鉤子函數

evaluated_conditional_expression

    template <typename ContextT, typename TokenT, typename ContainerT>
bool evaluated_conditional_expression(ContextT const& ctx,
TokenT const& directive, ContainerT const& expression,
bool
expression_value);

The function evaluated_conditional_expression is called, whenever the preprocessor has encountered a #if, #elif, #ifdef or #ifndef directive. This hook gets passed the non-expanded conditional expression (as it was given in the analysed source file) and the result of the evaluation of this expression in the current preprocessing context.
當預處理器遇到 #if, #elif, #ifdef#ifndef 指令時,函數 evaluated_conditional_expression 將被調用。該鉤子獲得傳入的未擴展條件表達式(和在被分析的源文件中給出的一樣),和該表達式在當前預處理上下文中的求值結果。

The ctx parameter provides a reference to the context_type used during instantiation of the preprocessing iterators by the user. Note, this parameter was added for the Boost V1.35.0 release.
參數 ctx 提供了一個到 context_type 的引用,在用戶初始化預處理迭代器時使用。注意,該參數是在 Boost V1.35.0 版本中加入的。

The token parameter holds a reference to the evaluated directive token. 
參數 token 持有到被求值指令單詞的引用。

The parameter expression holds the non-expanded token sequence comprising the evaluated expression.
參數 expression 持有未擴展的包含被求值表達式的單詞序列。

The parameter expression_value contains the result of the evaluation of the expression in the current preprocessing context.
參數 expression_value 包含在當前預處理上下文中對表達式的求值結果。

The return value defines, whether the given expression has to be evaluated again, allowing to decide which of the conditional branches should be expanded. You need to return 'true' from this hook function to force the expression to be re-evaluated. Note, this was changed from a 'void' for the Boost V1.35.0 release. 
返回值定義了是否對給定表達式再次求值,可以決定哪一個條件分支被展開。你要從這個鉤子函數返回 'true' 以迫使表達式被再次求值。注意,這是從 Boost V1.35.0 版本起由 'void' 修改過來的。

skipped_token

    template <typename ContextT, typename TokenT>
void skipped_token(ContextT const& ctx, TokenT const& token);

The function skipped_token is called, whenever a token is about to be skipped due to a false preprocessor condition (code fragments to be skipped inside the not evaluated conditional #if/#else/#endif branches).
當一個單詞即將由於一個false的預處理條件(在不進行求值的條件 #if/#else/#endif 分支中的代碼片斷會被跳過)而被跳過時,函數 skipped_token 將被調用。

The ctx parameter provides a reference to the context_type used during instantiation of the preprocessing iterators by the user. Note, this parameter was added for the Boost V1.35.0 release.
參數 ctx 提供了一個到 context_type 的引用,在用戶初始化預處理迭代器時使用。注意,該參數是在 Boost V1.35.0 版本中加入的。

The parameter token refers to the token to be skipped.
參數 token 引向被跳過的單詞。

generated_token

    template <typename ContextT, typename TokenT>
TokenT const& generated_token(ContextT const& ctx, TokenT const& token);

The function generated_token is called, whenever a token is about to be returned from the library.
當一個單詞即將從本庫返回時,函數 generated_token 將被調用。

The ctx parameter provides a reference to the context_type used during instantiation of the preprocessing iterators by the user. Note, this parameter was added for the Boost V1.35.0 release.
參數 ctx 提供了一個到 context_type 的引用,在用戶初始化預處理迭代器時使用。注意,該參數是在 Boost V1.35.0 版本中加入的。

The parameter token refers to the token about to be returned from the library. This function may alter the token, but in this case it must be implemented with a non-const reference for the token parameter, allowing to modify the token in place.
參數 token 引向即將從本庫返回的單詞。該函數可能修改這個單詞,不過這種情況下必須對這個 token 參數用非常量引用來實現,以允許修改該單詞。

The default behavior is to return the passed token reference unchanged to the caller.
缺省的行為是返回未經修改的單詞引用。

Macro expansion tracking functions 宏擴展跟蹤函數

expanding_function_like_macro

    template <typename ContextT, typename TokenT, typename ContainerT>
bool expanding_function_like_macro(
ContextT const& ctx, TokenT const &macrodef,
std::vector<TokenT> const &formal_args,
ContainerT const &definition, TokenT const &macrocall,
std::vector<ContainerT> const &arguments,
IteratorT const &seqstart, Iterator const &seqend);

The function expanding_function_like_macro is called, whenever a function-like macro is to be expanded, i.e. before the actual expansion starts.
當一個類似於函數的宏被展開時,即在實際展開之前,函數 expanding_function_like_macro 將被調用。

The ctx parameter provides a reference to the context_type used during instantiation of the preprocessing iterators by the user. Note, this parameter was added for the Boost V1.35.0 release.
參數 ctx 提供了一個到 context_type 的引用,在用戶初始化預處理迭代器時使用。注意,該參數是在 Boost V1.35.0 版本中加入的。

The macroname parameter marks the position where the macro to expand is defined. It contains the token which identifies the macro name used inside the corresponding macro definition.
參數 macroname 標記了要展開的宏在哪裡被定義。它含有在相應宏定義中用於標識該宏的名字的單詞。

The formal_args parameter holds the formal arguments used during the definition of the macro.
參數 formal_args 持有在定義該宏時所使用的形參。

The definition parameter holds the macro definition for the macro to trace. This is a standard STL container which holds the token sequence identified during the macro definition as the macro replacement list.
參數 definition 持有對該宏進行跟蹤的宏定義。它是一個標準的STL容器,其中保存有在宏定義時標識為宏替換列表的單詞序列。

The macrocall parameter marks the position where this macro is invoked. It contains the token, which identifies the macro call inside the preprocessed input stream.
參數 macrocall 標記了該宏被調用的位置。它含有在預處理輸入流中標識這個宏調用的單詞。

The arguments parameter holds the macro arguments used during the invocation of the macro. This is a vector of standard STL containers which contain the token sequences identified at the position of the macro call as the arguments to be used during the macro expansion.
參數 arguments 持有在宏調用時使用的宏參數。它是一個標準STL容器的vector,其中含有在宏調用的位置上被標識為在宏擴展時使用的參數的單詞序列。

The parameters seqstart and seqend point into the input token stream allowing to access the whole token sequence comprising the macro invocation (starting with the opening parenthesis and ending after the closing one).
參數 seqstartseqend 指向輸入單詞流,可用於訪問整個組成宏調用的單詞序列(以左括號開始,以右括號結束)。

If the return value is true, the macro is not expanded, i.e. the overall macro invocation sequence, including the parameters are copied to the output without further processing . If the return value is false, the macro is expanded as expected. 
如果返回值為 true,則該宏不展開,即整個宏調用的序列,包括所有參數,都被不作處理地複製到輸出。如果返回值為 false,則該宏按預期展開。

expanding_object_like_macro

    template <typename ContextT, typename TokenT, typename ContainerT>
bool expanding_object_like_macro(
ContextT const& ctx, TokenT const &macro,
ContainerT const &definition, TokenT const &macrocall);

The function expanding_object_like_macro is called, whenever a object-like macro is to be expanded, i.e. before the actual expansion starts.
當一個類似於對象的宏被展開時,即在實際展開之前,函數 expanding_object_like_macro 將被調用。

The ctx parameter provides a reference to the context_type used during instantiation of the preprocessing iterators by the user. Note, this parameter was added for the Boost V1.35.0 release.
參數 ctx 提供了一個到 context_type 的引用,在用戶初始化預處理迭代器時使用。注意,該參數是在 Boost V1.35.0 版本中加入的。

The macroname parameter marks the position where the macro to expand is defined. It contains the token which identifies the macro name used inside the corresponding macro definition.
參數 macroname 標記了要展開的宏在哪裡被定義。它含有在相應宏定義中用於標識該宏的名字的單詞。

The definition parameter holds the macro definition for the macro to trace. This is a standard STL container which holds the token sequence identified during the macro definition as the macro replacement list.
參數 definition 持有對該宏進行跟蹤的宏定義。它是一個標準的STL容器,其中保存有在宏定義時標識為宏替換列表的單詞序列。

The macrocall parameter marks the position where this macro is invoked. It contains the token which identifies the macro call inside the preprocessed input stream.
參數 macrocall 標記了該宏被調用的位置。它含有在預處理輸入流中標識這個宏調用的單詞。

If the return value is true, the macro is not expanded, i.e. the macro symbol is copied to the output without further processing. If the return value is false, the macro is expanded as expected.
如果返回值為 true,則該宏不展開,即宏符號被不作處理地複製到輸出。如果返回值為 false,則該宏按預期展開。

expanded_macro

    template <typename ContextT, typename ContainerT>
void expanded_macro(ContextT const& ctx, ContainerT const &result);

The function expanded_macro is called whenever the expansion of a macro is finished, the replacement list is completely scanned and the identified macros herein are replaced by its corresponding expansion results, but before the rescanning process starts.
當一個宏的展開已完成,替換列表已完全掃瞄且此處所定義的宏都被替換為相應的展開結果,但未開始重掃瞄之前,函數 expanded_macro 將被調用。

The ctx parameter provides a reference to the context_type used during instantiation of the preprocessing iterators by the user. Note, this parameter was added for the Boost V1.35.0 release.
參數 ctx 提供了一個到 context_type 的引用,在用戶初始化預處理迭代器時使用。注意,該參數是在 Boost V1.35.0 版本中加入的。

The parameter result contains the the result of the macro expansion so far. This is a standard STL container containing the generated token sequence.
參數 result 含有到目前為止的宏展開結果。它是一個標準的STL容器,含有生成的單詞序列。

rescanned_macro

    template <typename ContextT, typename ContainerT>
void rescanned_macro(ContextT const& ctx, ContainerT const &result);

The function rescanned_macro is called whenever the rescanning of a macro is finished, i.e. the macro expansion is complete.
當一個宏的重掃瞄完成時,即宏的展開已完成,函數 rescanned_macro 將被調用。

The ctx parameter provides a reference to the context_type used during instantiation of the preprocessing iterators by the user. Note, this parameter was added for the Boost V1.35.0 release.
參數 ctx 提供了一個到 context_type 的引用,在用戶初始化預處理迭代器時使用。注意,該參數是在 Boost V1.35.0 版本中加入的。

The parameter result contains the the result of the whole macro expansion. This is a standard STL container containing the generated token sequence.
參數 result 含有到整個宏展開的結果。它是一個標準的STL容器,含有生成的單詞序列。

Include file tracing functions 頭文件跟蹤函數

found_include_directive

    template <typename ContextT>
bool found_include_directive(ContextT const& ctx,
std::string const &filename, bool include_next);

The function found_include_directive is called whenever whenever a #include directive was located..
當找到一個 #include 指令時,函數 found_include_directive 將被調用。

The ctx parameter provides a reference to the context_type used during instantiation of the preprocessing iterators by the user. Note, this parameter was added for the Boost V1.35.0 release.
參數 ctx 提供了一個到 context_type 的引用,在用戶初始化預處理迭代器時使用。注意,該參數是在 Boost V1.35.0 版本中加入的。

The parameter filename contains the (expanded) file name found after the #include directive. This has the format <file>, "file" or file. The formats <file> or "file" are used for #include directives found in the preprocessed token stream, the format file is used for files specified through the --force_include command line argument.
參數 filename 含有在 #include 指令後的(被展開的)文件名。其格式為 <file>, "file"file。在預處理輸入流中找到的 #include 指令使用格式 <file>"file",而格式 file 則用在以命令行參數 --force_include 指定的文件。

The parameter include_next is set to true if the found directive was a #include_next directive and the BOOST_WAVE_SUPPORT_INCLUDE_NEXT preprocessing constant was defined to something != 0.
如果找到的指令是 #include_next 指令且 BOOST_WAVE_SUPPORT_INCLUDE_NEXT 預處理常量被定義為 != 0,則參數 include_next 設為 true。

If the return value is true, the include directive is not executed, i.e. the file to include is not loaded nor processed. The overall directive is replaced by a single newline character. If the return value is false, the directive is executed in a normal manner.
如果返回值為 true,則不執行包含指令,即不導入也不處理要包含的文件。整個指令被替換為一個換行符。如果返回值為 false,則該指令按正常方式執行。

opened_include_file

    template <typename ContextT>
void opened_include_file(ContextT const& ctx,
std::string const &rel_filename, std::string const &abs_filename,
bool is_system_include);

The function opened_include_file is called whenever a file referred by an #include directive was successfully located and opened.
當一個以 #include 指令引用的文件被成功定位並打開時,函數 opened_include_file 將被調用。

The ctx parameter provides a reference to the context_type used during instantiation of the preprocessing iterators by the user. Note, this parameter was added for the Boost V1.35.0 release.
參數 ctx 提供了一個到 context_type 的引用,在用戶初始化預處理迭代器時使用。注意,該參數是在 Boost V1.35.0 版本中加入的。

The parameter rel_filename contains the (normalised) probably relative file system path of the opened file. The concrete format of this file name depends on the format of the include search path given to the library beforehand.
參數 rel_filename 含有被打開文件的(規範化的)文件系統相對路徑。該文件名的具體格式由預先指定給本庫的包含文件查找路徑的格式決定。

The parameter abs_filename contains the (normalised) full file system path of the opened file.
參數 abs_filename 含有被打開文件的(規範化的)文件系統完整路徑。

The is_system_include parameter denotes, if the given file was found as a result of a #include <...> directive.
參數 is_system_include 指明給定文件是否為一個 #include <...> 指令的查找結果。

returning_from_include_file

    template <typename ContextT>
void returning_from_include_file(ContextT const& ctx);

The function returning_from_include_file is called whenever an included file is about to be closed after it's processing is complete.
當一個頭文件在完成處理後即將被關閉時,函數 returning_from_include_file 將被調用。

The ctx parameter provides a reference to the context_type used during instantiation of the preprocessing iterators by the user. Note, this parameter was added for the Boost V1.35.0 release.
參數 ctx 提供了一個到 context_type 的引用,在用戶初始化預處理迭代器時使用。注意,該參數是在 Boost V1.35.0 版本中加入的。

Interpretation of #pragma's 對#pragma的解釋

interpret_pragma

    template <typename ContextT, typename ContextT, typename ContainerT>
bool interpret_pragma(ContextT const &ctx, ContainerT &pending,
typename ContextT::token_type const &option,
ContainerT const &values,
typename ContextT::token_type const &pragma_token);

The function interpret_pragma is called whenever an unrecognized #pragma wave ... or operator _Pragma("wave ...") is found in the input stream.
當在輸入流中發現一個未被識別的 #pragma wave ... 或操作符 _Pragma("wave ...") 時,函數 interpret_pragma 將被調用。

The ctx parameter provides a reference to the context_type used during instantiation of the preprocessing iterators by the user.
參數 ctx 提供了一個到 context_type 的引用,在用戶初始化預處理迭代器時使用。

The pending parameter may be used to push tokens back into the input stream which are to be used as the replacement text for the whole #pragma wave() directive. If this sequence is left empty, no replacement takes place, i.e. the interpreted directive is removed from the generated token stream.
參數 pending 可用於將單詞壓回至輸入流用作對整個 #pragma wave() 指令的替換文本。如果該序列留空,則沒有替換發生,即從生成的單詞流中將被解釋的指令去除。

The option parameter contains the name of the interpreted pragma.
參數 option 含有被解釋的 pragma 的名字。

The values parameter holds the value of the parameter provided to the pragma operator.
參數 values 持有提供給 pragma 操作符的參數值。

The pragma_token parameter contains the actual #pragma token which may be used for extraction of the location information for some error output.
參數 pragma_token 含有實際的 #pragma 單詞,可作某些錯誤輸出的位置信息提取之用。

If the return value is 'false', the whole #pragma directive is interpreted as unknown and a corresponding error message is issued. A return value of 'true' signs a successful interpretation of the given #pragma.
如果返回值為 'false',則整個 #pragma 指令被解釋為未知的,並引發一個相應的錯誤信息。返回值 'true' 則表示對給定 #pragma 的成功解釋。

Macro definition 宏定義

defined_macro

    template <
typename ContextT, typename TokenT, typename ParametersT, typename DefinitionT
>
void defined_macro(ContextT const& ctx,
TokenT const &name, bool is_functionlike,
ParametersT const &parameters, DefinitionT const &definition,
bool is_predefined);

The function defined_macro is called whenever a macro was defined successfully.
當一個宏被成功定義時,函數 defined_macro 將被調用。

The ctx parameter provides a reference to the context_type used during instantiation of the preprocessing iterators by the user. Note, this parameter was added for the Boost V1.35.0 release.
參數 ctx 提供了一個到 context_type 的引用,在用戶初始化預處理迭代器時使用。注意,該參數是在 Boost V1.35.0 版本中加入的。

The parameter name is a reference to the token holding the macro name.
參數 name 為指向持有該宏名字的單詞的引用。

The parameter is_functionlike is set to true whenever the newly defined macro is defined as a function like macro.
當新定義的宏被定義為一個類似於函數的宏時,參數 is_functionlike 設為 true。

The parameter parameters holds the parameter tokens for the macro definition. If the macro has no parameters or if it is a object like macro, then this container is empty.
參數 parameters 持有宏定義的參數單詞。如果該宏無參數或者是一個類似於對象的宏,則該容器為空。

The parameter definition contains the token sequence given as the replacement sequence (definition part) of the newly defined macro.
參數 definition 含有作為新定義的宏的替換序列(定義部分)而給定的單詞序列。

The parameter is_predefined is set to true for all macros predefined during the initialisation pahase of the library.
參數 is_predefined 對於所有在本庫初始化階段預定義的宏設為 true。

undefined_macro

    template <typename ContextT, typename TokenT>
void undefined_macro(ContextT const& ctx, TokenT const &name);

The function undefined_macro is called whenever a macro definition was removed successfully.
當一個宏定義被成功去除時,函數 undefined_macro 將被調用。

The ctx parameter provides a reference to the context_type used during instantiation of the preprocessing iterators by the user. Note, this parameter was added for the Boost V1.35.0 release.
參數 ctx 提供了一個到 context_type 的引用,在用戶初始化預處理迭代器時使用。注意,該參數是在 Boost V1.35.0 版本中加入的。

The parameter name holds the token of the macro which definition was removed.
參數 name 持有被去除定義的宏的單詞。

found_warning_drective

    template <typename ContextT, typename ContainerT>
bool found_warning_directive(ContextT const& ctx,
ContainerT const &message);

The function found_warning_directive is called whenever a #warning directive has been encountered. Note, this function was added for the Boost V1.35.0 release. This function will be called only if the BOOST_WAVE_SUPPORT_WARNING_DIRECTIVE compile time constant was defined to something not equal to zero (see the Compile Time Configuration for more information).
當遇到一個 #warning 指令時,函數 found_warning_directive 被調用。注意,該函數是在 Boost V1.35.0 版本中加入的。該函數僅當編譯期常量 BOOST_WAVE_SUPPORT_WARNING_DIRECTIVE 被定義為不等於零時才被調用(更多信息請見 編譯期配置)。

The ctx parameter provides a reference to the context_type used during instantiation of the preprocessing iterators by the user.
參數 ctx 提供了一個到 context_type 的引用,在用戶初始化預處理迭代器時使用。

The parameter message references the argument token sequence of the encountered #warning directive.
參數 message 為相應的 #warning 指令的參數單詞序列的引用。

If the return value is false, the library throws a preprocessor exception of the type warning_directive (normal execution continues), if the return value is true the execution continues as if no #warning directive has been found and the overall directive is replaced by a single newline.
如果返回值為 false,本庫將拋出一個類型為 warning_directive 的預處理器異常(繼續正常執行),如果返回值為 true,則好像沒有 #warning 指令一樣繼續執行,整個指令被替換為一個換行。

found_error_drective

    template <typename ContextT, typename ContainerT>
bool found_error_directive(ContextT const& ctx,
ContainerT const &message);

The function found_error_directive is called whenever a #error directive has been encountered. Note, this function was added for the Boost V1.35.0 release.
當遇到一個 #error 指令時,函數 found_error_directive 將被調用。注意,這個函數是在 Boost V1.35.0 版本中加入的。

The ctx parameter provides a reference to the context_type used during instantiation of the preprocessing iterators by the user.
參數 ctx 提供了一個到 context_type 的引用,在用戶初始化預處理迭代器時使用。

The parameter message references the argument token sequence of the encountered #error directive.
參數 message 為相應的 #error 指令的參數單詞序列的引用。

If the return value is false, the library throws a preprocessor exception of the type error_directive (normal execution continues), if the return value is true the execution continues as if no #error directive has been found and the overall directive is replaced by a single newline.
如果返回值為 false,本庫將拋出一個類型為 error_directive 的預處理器異常(繼續正常執行),如果返回值為 true,則好像沒有 #error 指令一樣繼續執行,整個指令被替換為一個換行。

found_line_drective

    template <typename ContextT, typename ContainerT>
void found_line_drective(ContextT const& ctx,
ContainerT const &arguments, unsigned int line,
std::string const& filename);

The function found_line_directive is called whenever a #line directive has been encountered. Note, this function was added for the Boost V1.35.0 release.
當遇到一個 #line 指令時,函數 found_line_directive 將被調用。注意,這個函數是在 Boost V1.35.0 版本中加入的。

The ctx parameter provides a reference to the context_type used during instantiation of the preprocessing iterators by the user.
參數 ctx 提供了一個到 context_type 的引用,在用戶初始化預處理迭代器時使用。

The parameter arguments references the argument token sequence of the encountered #line directive.
參數 arguments 為相應的 #line 指令的參數單詞序列的引用。

The parameter line contains the recognized line number from the #line directive.
參數 line 含有 #line 指令中識別到的行號。

The parameter filename references the recognized file name from the #line directive (if there was one given).
參數 filename 引向 #line 指令中識別到的文件名(如果有給出)。