#include <policy.h>
Static Public Member Functions | |
static size_t | comment (const_edge< policy_default, CTTL_STD_STRING > &substr_) |
Defines CTTL grammar production rule matching C and C++ comments. | |
template<typename SubstrT > | |
static size_t | match (SubstrT &substr_) |
Defines CTTL grammar production rule to evaluate grammar expression matching white space characters combined with C and C++ comments. | |
static size_t | space_and_comment (const_edge< policy_default, CTTL_STD_STRING > &substr_) |
Defines CTTL grammar production rule matching white space characters combined with C and C++ comments. |
Definition at line 836 of file policy.h.
static size_t cttl::policy_space< flag_cpp_comments >::comment | ( | const_edge< policy_default, CTTL_STD_STRING > & | substr_ | ) | [static] |
Defines CTTL grammar production rule matching C and C++ comments.
substr_ | references parseable substring. |
Definition at line 931 of file policy.h.
00932 { 00933 typedef const_edge< policy_default, CTTL_STD_STRING >::char_T char_T; 00934 return ( 00935 begin( char_T( '/' ) ) 00936 + 00937 ( 00938 ( symbol( char_T( '/' ) ) + symbol( char_T( '/' ) ) + !begin( symbol( char_T( '\n' ) ) | end() ) ) 00939 | 00940 ( symbol( char_T( '/' ) ) + symbol( char_T( '*' ) ) + !!( symbol( char_T( '*' ) ) + symbol( char_T( '/' ) ) ) ) 00941 ) 00942 ).match( substr_ ); 00943 }
static size_t cttl::policy_space< flag_cpp_comments >::match | ( | SubstrT & | substr_ | ) | [static] |
Defines CTTL grammar production rule to evaluate grammar expression matching white space characters combined with C and C++ comments.
SubstrT | specifies type of the parseable substring, such as cttl::const_edge or cttl::edge. |
substr_ | references parseable substring. |
Reimplemented from cttl::policy_default.
Reimplemented in cttl::policy_space< flag_greedy|flag_cpp_comments >.
Definition at line 864 of file policy.h.
00865 { 00866 CTTL_TRACE_SILENT( true ); 00867 size_t ungreedy_offset = substr_.first.offset(); 00868 ( 00869 true ^ rule( policy_space< flag_cpp_comments >::space_and_comment ) 00870 00871 ).match( substr_ ); 00872 00873 // policy_space is ungreedy: 00874 return ungreedy_offset; 00875 }
static size_t cttl::policy_space< flag_cpp_comments >::space_and_comment | ( | const_edge< policy_default, CTTL_STD_STRING > & | substr_ | ) | [static] |
Defines CTTL grammar production rule matching white space characters combined with C and C++ comments.
substr_ | references parseable substring. |
Definition at line 888 of file policy.h.
00889 { 00890 return ( 00891 ( 00892 entity( isspace ) 00893 + 00894 ( 00895 ( 00896 rule( policy_space< flag_cpp_comments >::comment ) 00897 + 00898 rule( policy_space< flag_cpp_comments >::space_and_comment ) 00899 ) 00900 | 00901 begin( true ) 00902 ) 00903 ) 00904 | 00905 ( 00906 rule( policy_space< flag_cpp_comments >::comment ) 00907 + 00908 ( 00909 rule( policy_space< flag_cpp_comments >::space_and_comment ) 00910 | 00911 begin( true ) 00912 ) 00913 ) 00914 | 00915 begin( true ) 00916 00917 ).match( substr_ ); 00918 }