??xml version="1.0" encoding="utf-8" standalone="yes"?>国产一区二区精品久久,免费日韩av片,欧美国产欧美亚洲国产日韩mv天天看完整 http://www.shnenglu.com/shifan3/category/3011.htmlEverything is template...zh-cnMon, 19 May 2008 20:19:07 GMTMon, 19 May 2008 20:19:07 GMT60[yc]伪typeofhttp://www.shnenglu.com/shifan3/archive/2006/12/21/16690.htmlshifan3shifan3Thu, 21 Dec 2006 06:29:00 GMThttp://www.shnenglu.com/shifan3/archive/2006/12/21/16690.htmlhttp://www.shnenglu.com/shifan3/comments/16690.htmlhttp://www.shnenglu.com/shifan3/archive/2006/12/21/16690.html#Feedback5http://www.shnenglu.com/shifan3/comments/commentRss/16690.htmlhttp://www.shnenglu.com/shifan3/services/trackbacks/16690.html
发信? shifan (学习云技?, 杉K: C++
?nbsp; ? 伪typeof
发信? 飘ؓ水云?(Tue Dec 19 16:38:45 2006), 转信
 1 /*
 2 用标准C++实现typeof是不可能?br> 3 q个是我写的一个approached typeof
 4 所有需要被静态反出来的cd必须先用DECL_TYPE注册
 5 模板如果仅仅带有1个参数可以用DECL_TEMPLATE_1注册
 6 多个参数的模板还不支持。?br> 7 主要是没惛_~码
 8 
 9 d能注?4个类?br>10 可以通过MAX_TYPE_NUMBER讄
11 
12 支持的模板嵌套层数大Uؓ32 Q?nbsp;log2(MAX_TYPE_NUMBER)
13 MAX_TYPE_NUMBER必须?的整ơ数q?br>14 */
15 namespace my_typeof
16 {
17 
18   const int MAX_TYPE_NUMBER = 64;
19 
20   template <int N>
21   struct dummy
22   {
23     int a[N];
24   };
25 
26 
27   template <int N, typename Arg1>
28   struct select_by_number_1;
29 
30   template <int N>
31   struct select_by_number
32   {
33     typedef typename select_by_number_1<% MAX_TYPE_NUMBER, typename
34 select_by_number</ MAX_TYPE_NUMBER>::type>::type type;
35   };
36 
37 
38   template <typename T>
39   struct number_of
40   {
41     static const int v = sizeof(generic_f(*(T*)0)) / sizeof(int);
42   };
43 
44 
45 #define DECL_TYPE(T, N) \
46   namespace my_typeof{  \
47   template<>\
48   struct select_by_number<N> \
49   {\
50     typedef T type;\
51   };\
52   dummy <N> generic_f(const T&);}
53 
54 
55 #define DECL_TEMPLATE_1(T, N) \
56   namespace my_typeof{        \
57   template<typename Arg1>\
58   struct select_by_number_1<N, Arg1>\
59   {\
60     typedef T<Arg1> type;\
61   };\
62   template <typename Arg1>\
63   dummy<+ number_of<Arg1>::v * MAX_TYPE_NUMBER > generic_f(const T<Arg1>&);}
64 
65 
66 
67 #define TYPE_OF(x) my_typeof::select_by_number<sizeof(my_typeof::generic_f(x)) /
68 sizeof (int)>::type
69 
70 }
71 
72 
73 //sample
74 #include <iostream>
75 #include <vector>
76 #include <list>
77 
78 
79 DECL_TYPE(int1);
80 DECL_TEMPLATE_1(std::vector, 2);
81 DECL_TEMPLATE_1(std::list, 3);
82 DECL_TYPE(double4)
83 
84 using namespace std;
85 int main(intchar*[])
86 {
87   vector<list<vector<list<double> > > > v1;
88   TYPE_OF(v1) v2;
89   v1 = v2;
90   return 0;
91 }
92 
93 


--
You well 撒法QYou well all 撒法Q?br>
?内容修改:·shifan ?Dec 21 14:21:57 修改本文内容·[FROM: shifan]
?来源:·飘ؓ水云?freecity.cn·[FROM: shifan]


shifan3 2006-12-21 14:29 发表评论
]]>
[yc]Multi Bit Maskhttp://www.shnenglu.com/shifan3/archive/2006/10/26/14264.htmlshifan3shifan3Thu, 26 Oct 2006 15:37:00 GMThttp://www.shnenglu.com/shifan3/archive/2006/10/26/14264.htmlhttp://www.shnenglu.com/shifan3/comments/14264.htmlhttp://www.shnenglu.com/shifan3/archive/2006/10/26/14264.html#Feedback2http://www.shnenglu.com/shifan3/comments/commentRss/14264.htmlhttp://www.shnenglu.com/shifan3/services/trackbacks/14264.htmlboost的integer/integer_mask.hpp仅仅做了单个位的bit mask
要多个位必须写很多遍high_bit_mask_t
使用low_bits_mask_t也不能完全解决问?br>所以自qTypelist的那U写法写了一?/p>

用法举例
bit_mask<INT_LIST_2(2, 3)>::valueq回一个|该值的W??位被|ؓ1
其余位ؓ0

 

  1 
  2 namespace multi_bit_mask
  3 {
  4     namespace details
  5     {
  6 
  7         template <typename T>
  8         struct get_size
  9         {
 10             enum {size = sizeof(T)}; 
 11         };
 12 
 13         template <int Bit>
 14         struct bit_storage
 15         {
 16             typedef typename bit_storage<Bit - 1>::storage_type storage_type;
 17         };
 18 
 19         //---------platform dependency-----------------------
 20 
 21         typedef unsigned int smallest_storage_type;
 22         typedef unsigned long long largest_storage_type;
 23 
 24         
 25 
 26         template <>
 27         struct bit_storage<0>
 28         {
 29             typedef smallest_storage_type storage_type;
 30         };
 31 
 32         template <>
 33         struct bit_storage<get_size<smallest_storage_type>::size * 8>
 34         {
 35             typedef largest_storage_type storage_type;
 36         };
 37 
 38         //disable the 65th bit
 39         template <>
 40         struct bit_storage<get_size<largest_storage_type>::size * 8>
 41         {
 42             typedef void storage_type;
 43         };
 44         
 45         //---------end of platform dependency----------------
 46 
 47 
 48         template <unsigned int N, typename Next>
 49         struct int_list
 50         {
 51             typedef typename bit_storage<N>::storage_type storage_type;
 52             static const storage_type value = N;
 53             typedef Next next;
 54         };
 55 
 56         struct null_type{};
 57 
 58         template<typename T1, typename T2, bool is_first>
 59         struct selector
 60         {
 61             typedef T1 type;
 62         };
 63 
 64         template<typename T1, typename T2>
 65         struct compare_type
 66         {
 67             const static bool is_larger = sizeof(T1) > sizeof(T2);
 68             typedef typename selector<T1, T2, is_larger>::type large_type;
 69             typedef typename selector<T1, T2, !is_larger>::type small_type;
 70         };
 71 
 72 
 73 
 74         template<typename T1, typename T2>
 75         struct selector<T1, T2, false>
 76         {
 77             typedef T2 type;
 78         };
 79 
 80         template <typename List>
 81         class find_largest_storage
 82         {
 83             typedef typename find_largest_storage<typename List::next>::storage_type T1;
 84             typedef typename bit_storage<List::value>::storage_type T2;
 85         public:
 86             typedef typename compare_type<T1, T2>::large_type storage_type;
 87         };
 88 
 89         template <>
 90         class find_largest_storage<null_type>
 91         {
 92         public:
 93             typedef smallest_storage_type storage_type;
 94         };    
 95 
 96         
 97     }
 98 
 99 
100         
101 
102 
103     template <int N>
104     struct single_bit_mask
105     {
106         typedef typename details::bit_storage<N>::storage_type storage_type;
107         static const storage_type value 
108             = static_cast<storage_type>(single_bit_mask<- 1>::value) * 2;
109     };
110 
111     template <>
112     struct single_bit_mask<0>
113     {
114         typedef details::bit_storage<0>::storage_type storage_type;
115         static const storage_type value = 1;
116     };
117 
118     
119     typedef details::null_type null_type;
120 
121     template <int N, typename Next>
122     struct int_list_t : public details::int_list<N, Next> {};
123 
124     template <typename List>
125     struct bit_mask
126     {
127     public:
128 
129         typedef typename details::find_largest_storage<List>::storage_type storage_type;
130     
131         static const storage_type value 
132             = static_cast<storage_type>(single_bit_mask<List::value>::value) 
133             | static_cast<storage_type>(bit_mask<typename List::next>::value);
134     };
135 
136     template <>
137     struct bit_mask<null_type>
138     {
139         typedef details::bit_storage<0>::storage_type storage_type;
140         static const storage_type value = 0;
141     };
142 
143     
144 
145     
146 
147     #define INT_LIST_1(n1) multi_bit_mask::int_list_t<n1, multi_bit_mask::null_type>
148     #define INT_LIST_2(n1, n2) multi_bit_mask::int_list_t<n1, INT_LIST_1(n2) > 
149     #define INT_LIST_3(n1, n2, n3) multi_bit_mask::int_list_t<n1, INT_LIST_2(n2, n3) > 
150     #define INT_LIST_4(n1, n2, n3, n4) multi_bit_mask::int_list_t<n1, INT_LIST_3(n2, n3, n4) > 
151     #define INT_LIST_5(n1, n2, n3, n4, n5) multi_bit_mask::int_list_t<n1, INT_LIST_4(n2, n3, n4, n5) > 
152     #define INT_LIST_6(n1, n2, n3, n4, n5, n6) multi_bit_mask::int_list_t<n1, INT_LIST_5(n2, n3, n4, n5, n6) > 
153     #define INT_LIST_7(n1, n2, n3, n4, n5, n6, n7) multi_bit_mask::int_list_t<n1, INT_LIST_6(n2, n3, n4, n5, n6, n7) > 
154     #define INT_LIST_8(n1, n2, n3, n4, n5, n6, n7, n8) multi_bit_mask::int_list_t<n1, INT_LIST_7(n2, n3, n4, n5, n6, n7, n8) > 
155     
156 }
157 
158 
159 


sample

#include  < iostream >
#include 
" multi_bit_mask.h "
using   namespace  std;
int  main()
{
    cout 
<<  multi_bit_mask::bit_mask < INT_LIST_1( 1 ) > ::value  <<  endl;
    cout 
<<  multi_bit_mask::bit_mask < INT_LIST_5( 0 1 2 3 4 ) > ::value  <<  endl;
    cout 
<<  multi_bit_mask::bit_mask < INT_LIST_7( 0 1 2 3 4 4 2 ) > ::value  <<  endl;
    


shifan3 2006-10-26 23:37 发表评论
]]>
[yc]Xpressive?/title><link>http://www.shnenglu.com/shifan3/archive/2006/07/27/10590.html</link><dc:creator>shifan3</dc:creator><author>shifan3</author><pubDate>Thu, 27 Jul 2006 08:27:00 GMT</pubDate><guid>http://www.shnenglu.com/shifan3/archive/2006/07/27/10590.html</guid><wfw:comment>http://www.shnenglu.com/shifan3/comments/10590.html</wfw:comment><comments>http://www.shnenglu.com/shifan3/archive/2006/07/27/10590.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.shnenglu.com/shifan3/comments/commentRss/10590.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/shifan3/services/trackbacks/10590.html</trackback:ping><description><![CDATA[Xpressive是一个C++的正则表辑ּ库,目前是Boost的候选库?br>Xpressive和Boost.Regex的区别很大。首先,Xpressive是一个纯头文件的库,也是_在用之前不需要预先编译。其ơ,Xpressive支持cM于Spirit的静态语义定义?br><br>我们先来看一个例子: <p> </p> <div style="BORDER-RIGHT: rgb(204,204,204) 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: rgb(204,204,204) 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: rgb(204,204,204) 1px solid; WIDTH: 98%; PADDING-TOP: 4px; BORDER-BOTTOM: rgb(204,204,204) 1px solid; BACKGROUND-COLOR: rgb(238,238,238)"><span style="COLOR: rgb(0,0,0)">#include </span><span style="COLOR: rgb(0,0,0)"><</span><span style="COLOR: rgb(0,0,0)">iostream</span><span style="COLOR: rgb(0,0,0)">></span><span style="COLOR: rgb(0,0,0)"><br>#include </span><span style="COLOR: rgb(0,0,0)"><</span><span style="COLOR: rgb(0,0,0)">boost</span><span style="COLOR: rgb(0,0,0)">/</span><span style="COLOR: rgb(0,0,0)">xpressive</span><span style="COLOR: rgb(0,0,0)">/</span><span style="COLOR: rgb(0,0,0)">xpressive.hpp</span><span style="COLOR: rgb(0,0,0)">></span><span style="COLOR: rgb(0,0,0)"><br><br></span><span style="COLOR: rgb(0,0,255)">using</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,255)">namespace</span><span style="COLOR: rgb(0,0,0)"> boost::xpressive;<br><br></span><span style="COLOR: rgb(0,0,255)">int</span><span style="COLOR: rgb(0,0,0)"> main()<br>{<br>    std::</span><span style="COLOR: rgb(0,0,255)">string</span><span style="COLOR: rgb(0,0,0)"> hello( </span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">hello world!</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)"> );<br><br>    sregex rex </span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)"> sregex::compile( </span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">(\\w+) (\\w+)!</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)"> );<br>    smatch what;<br><br>    </span><span style="COLOR: rgb(0,0,255)">if</span><span style="COLOR: rgb(0,0,0)">( regex_match( hello, what, rex ) )<br>    {<br>        std::cout </span><span style="COLOR: rgb(0,0,0)"><<</span><span style="COLOR: rgb(0,0,0)"> what[</span><span style="COLOR: rgb(0,0,0)">0</span><span style="COLOR: rgb(0,0,0)">] </span><span style="COLOR: rgb(0,0,0)"><<</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">\n</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">; </span><span style="COLOR: rgb(0,128,0)">//</span><span style="COLOR: rgb(0,128,0)"> whole match</span><span style="COLOR: rgb(0,128,0)"><br></span><span style="COLOR: rgb(0,0,0)">        std::cout </span><span style="COLOR: rgb(0,0,0)"><<</span><span style="COLOR: rgb(0,0,0)"> what[</span><span style="COLOR: rgb(0,0,0)">1</span><span style="COLOR: rgb(0,0,0)">] </span><span style="COLOR: rgb(0,0,0)"><<</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">\n</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">; </span><span style="COLOR: rgb(0,128,0)">//</span><span style="COLOR: rgb(0,128,0)"> first capture</span><span style="COLOR: rgb(0,128,0)"><br></span><span style="COLOR: rgb(0,0,0)">        std::cout </span><span style="COLOR: rgb(0,0,0)"><<</span><span style="COLOR: rgb(0,0,0)"> what[</span><span style="COLOR: rgb(0,0,0)">2</span><span style="COLOR: rgb(0,0,0)">] </span><span style="COLOR: rgb(0,0,0)"><<</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">\n</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">; </span><span style="COLOR: rgb(0,128,0)">//</span><span style="COLOR: rgb(0,128,0)"> second capture</span><span style="COLOR: rgb(0,128,0)"><br></span><span style="COLOR: rgb(0,0,0)">    }<br><br>    </span><span style="COLOR: rgb(0,0,255)">return</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">0</span><span style="COLOR: rgb(0,0,0)">;<br>}</span></div> <p>q是使用Xpressive动态语义定义的例子Q其中sregex::compile函数~译一个表C正则文法的Ԍq返回一个正则对象sregex<br>使用regex_match来用这个正则对象匹配一个串。结果储存在what?br>其中what[0]q回整个Ԍwhat[1]~what[n]q回文法中用于标记的部分(用小括号括v来的部分)<br>最后将输出<br>     hello world!<br>     hello<br>     world</p> <p>如果惛_一个串中查扄合该文法的子Ԍ可以使用regex_searchQ用法和regex_match一P此外q可以用regex_replace来进行替换?br></p> <p> </p> <p><br>静态文法:<br>Xpressive除了可以用compile来分析一个文法串之外Q还可以用类gSpirit的方式来静态的指定文法Q?br></p> <div style="BORDER-RIGHT: rgb(204,204,204) 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: rgb(204,204,204) 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: rgb(204,204,204) 1px solid; WIDTH: 98%; PADDING-TOP: 4px; BORDER-BOTTOM: rgb(204,204,204) 1px solid; BACKGROUND-COLOR: rgb(238,238,238)"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: rgb(0,0,0)">sregex re </span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">$</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">>></span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">+</span><span style="COLOR: rgb(0,0,0)">_d </span><span style="COLOR: rgb(0,0,0)">>></span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">.</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">>></span><span style="COLOR: rgb(0,0,0)"> _d </span><span style="COLOR: rgb(0,0,0)">>></span><span style="COLOR: rgb(0,0,0)"> _d;</span></div> <p>q将定义一个表C金额的Ԍ其中_d表示一个数字,相当于串 $\d+.\d\d<br>q样定义文法比之前的动态定义更加高效,q且q有一个附加的好处Q?br>分定义Q?/p> <div style="BORDER-RIGHT: rgb(204,204,204) 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: rgb(204,204,204) 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: rgb(204,204,204) 1px solid; WIDTH: 98%; PADDING-TOP: 4px; BORDER-BOTTOM: rgb(204,204,204) 1px solid; BACKGROUND-COLOR: rgb(238,238,238)"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: rgb(0,0,0)">sregex re </span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">$</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">>></span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">+</span><span style="COLOR: rgb(0,0,0)">_d </span><span style="COLOR: rgb(0,0,0)">>></span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">.</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">>></span><span style="COLOR: rgb(0,0,0)"> _d </span><span style="COLOR: rgb(0,0,0)">>></span><span style="COLOR: rgb(0,0,0)"> _d;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>sregex s </span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">(</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">>></span><span style="COLOR: rgb(0,0,0)"> re </span><span style="COLOR: rgb(0,0,0)">>></span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">)</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">;</span></div> <p>q样s表示为用括号括v来的re<br>通过分定义Q文法能被表C的更加清楚?br>更加的是,分定义q可以向后引用,因此能够分析EBNF</p> <div style="BORDER-RIGHT: rgb(204,204,204) 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: rgb(204,204,204) 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: rgb(204,204,204) 1px solid; WIDTH: 98%; PADDING-TOP: 4px; BORDER-BOTTOM: rgb(204,204,204) 1px solid; BACKGROUND-COLOR: rgb(238,238,238)"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: rgb(0,0,0)">sregex group, factor, term, expression;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>group       </span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">(</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">>></span><span style="COLOR: rgb(0,0,0)"> by_ref(expression) </span><span style="COLOR: rgb(0,0,0)">>></span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">)</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>factor      </span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">+</span><span style="COLOR: rgb(0,0,0)">_d </span><span style="COLOR: rgb(0,0,0)">|</span><span style="COLOR: rgb(0,0,0)"> group;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>term        </span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)"> factor </span><span style="COLOR: rgb(0,0,0)">>></span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">*</span><span style="COLOR: rgb(0,0,0)">((</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">*</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">>></span><span style="COLOR: rgb(0,0,0)"> factor) </span><span style="COLOR: rgb(0,0,0)">|</span><span style="COLOR: rgb(0,0,0)"> (</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">/</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">>></span><span style="COLOR: rgb(0,0,0)"> factor));<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>expression  </span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)"> term </span><span style="COLOR: rgb(0,0,0)">>></span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">*</span><span style="COLOR: rgb(0,0,0)">((</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">+</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">>></span><span style="COLOR: rgb(0,0,0)"> term) </span><span style="COLOR: rgb(0,0,0)">|</span><span style="COLOR: rgb(0,0,0)"> (</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">>></span><span style="COLOR: rgb(0,0,0)"> term));</span></div> <p>expression定义了一个四则表辑ּQ注意其中group的定义?br>q里必须使用by_ref是因为Xpressive默认是值拷贝,如果q里使用默认的方式,那么会造成一个无限@环?br><br><br>Xpressive可以在这里下?br><a >http://boost-consulting.com/vault/index.php?PHPSESSID=f1d4af8b742cfa7adae7aab373cfc535&direction=0&order=&directory=Strings%20-%20Text%20Processing&PHPSESSID=f1d4af8b742cfa7adae7aab373cfc535</a><br>内有详细的文?/p> <img src ="http://www.shnenglu.com/shifan3/aggbug/10590.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/shifan3/" target="_blank">shifan3</a> 2006-07-27 16:27 <a href="http://www.shnenglu.com/shifan3/archive/2006/07/27/10590.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[yc]乱序Policy手法http://www.shnenglu.com/shifan3/archive/2006/07/24/10384.htmlshifan3shifan3Sun, 23 Jul 2006 17:06:00 GMThttp://www.shnenglu.com/shifan3/archive/2006/07/24/10384.htmlhttp://www.shnenglu.com/shifan3/comments/10384.htmlhttp://www.shnenglu.com/shifan3/archive/2006/07/24/10384.html#Feedback8http://www.shnenglu.com/shifan3/comments/commentRss/10384.htmlhttp://www.shnenglu.com/shifan3/services/trackbacks/10384.html看了546@C++@Freecity之后Q发觉非常有意?由此产生一些想?/p>

很多时候写一个类的时候,需要多个模版参敎ͼ例如一个遗传算法的法c,需要一个模版参数来指定交配方式Q另一个模版参数来指定子代选择的方式,q要一个参数来指定变异的方式。那么一般来_q个cM写成Q?/p>

template<class T                                                //描述问题的一个类
        , class CrossPolicy = AvgCrossPolicy                        //杂交方式
        , class SelectPolicy = DefaultSelectPolicy                //子代选择的方?br>        , class VariationPolicy = ReverseVariationPolicy>        //变异方式
class Gene
        : private AvgCrossPolicy
        , private SelectPolicy
        , private VariationPolicy
{
        ....
};

q样用户要用该cȝ时候,可以直接指定TQ就行了Q然而如果要指定变异方式Q那么就必须把所有的参数都显式的写出来,很不方便

546提供了一U有效的ҎQ可以让我们仅仅指定变异参数Q而不用写出另两个Policy
甚至允许我们以Q意的序书写几个Policy参数Q都不会有问?/p>

预备知识:
TypeList
一个TypeList是一个类型的容器
template <typename Type_, typename Next_>
struct TypeList
{
        typedef Type_ Type;
        typedef Next_ Next;
};
q就是一个TypeList?br>看这个写法,是不是像一个链表?
首先定义一个类型来表示链表:class NullType{};
现在一个包含了2个类型的TypeList可以写为:
TypeList<T1, TypeList<T2, NullType>  >

如何在一个TypeList中查找一个类型的子类Q?br>首先要有一个IsDerivedFrom<Base, T>
q个比较?br>template<class Base, class T>
class IsDerivedFrom
{
        struct large{char a[2];};
        static char pred(Base*);
        static large pred(...);
public:
        enum {Is = sizeof(pred((T*)0)) == sizeof(char)};
};

然后FindChild容易了
template <class List, class Base>
struct FindChild
{
        template <bool IsChild>
        struct Select
        {
                typedef typename List::Type Type;
        };

        template <>
        struct Select<false>
        {
                typedef typename FindChild<typename List::Next, Base>::Type Type;
        };

        typedef typename Select<IsDerivedFrom<Base, typename List::Type> >::Type Type;
};

当然q要对一些特D情况进行特化,例如NullType
template <class Base>
struct FindChild<NullType, Base>
{
        typedef NullType Type;
};
q里使用NullType来表明没扑ֈ

实际操作Q?br>首先需要给3个Policy3个基c,分别?br>class AvgCrossPolicyBase{};
class SelectPolicyBase{};
class VariationPolicyBase{};
内容为空p了,q样也没有虚函数调用的开销


然后声明一个类来表C默认情况:
class DefaultPolicy{};

定义一个宏
#define TYPELIST_3_N(a, b, c) TypeList<a, TypeList<b, TypeList<c, NullType> > >

下面要写一些选择?用于把合适的cd选择出来Q如果没扑ֈQ则要用默认的cd
template <class List, class Base, class DefaultType>
struct Selector
{
        template <class RetType>
        struct Judge
        {
                typedef RetType Type;
        };
       
        template<>
        struct Judge<NullType>
        {
                typedef DefaultType Type;
        };
        typedef typename Judge<typename FindChild<List, Base>::Type >::Type Type;
};

好啦Q现在整个类的声明可以写?/p>

template<class T
        , class CrossPolicy_ = DefaultPolicy
        , class SelectPolicy_ = DefaultPolicy
        , class VariationPolicy_ = DefaultPolicy     //其后的参数用户不可指?br>        , class List = TYPELIST_3_N(CrossPolicy_, SelectPolicy_, VariationPolicy_)
        , class CrossPolicy = typename Selector<List, CrossPolicyBase,  AvgCrossPolicy>::Type
        , class SelectPolicy = typename Selector<List,  SelectPolicyBase,  DefaultSelectPolicy>::Type
        , class VariationPolicy = typename Selector<List,  VariationPolicyBase,  ReverseVariationPolicy>::Type
        >
class Gene
        : private CrossPolicy
        , private SelectPolicy
        , private VariationPolicy
{
       
        ....
};


其中W?-7个参敎ͼListQCrossPolicyQSelectPolicy和VariationPolicyQ是不由用户指定的,仅仅是ؓ了v一个别?br>W一个参数T必须指定Q然?Q?Q?q?个参数就可以L的改变顺序了
例如Q可以写Gene<T, DefaultSelectPolicy, AvgCrossPolicy>而不会有M问题
如果不想要最后面几个参数的话也行Q但是代码就要稍微长一?br>而且最好在c里面进?个typedef
typedef typename Selector<List, CrossPolicyBase,  AvgCrossPolicy>::Type CrossPolicy;
{,以便在实现的时候?/p>

shifan3 2006-07-24 01:06 发表评论
]]>
[yc]自己实现LambdaQ第二部分)http://www.shnenglu.com/shifan3/archive/2006/07/15/10099.htmlshifan3shifan3Sat, 15 Jul 2006 07:32:00 GMThttp://www.shnenglu.com/shifan3/archive/2006/07/15/10099.htmlhttp://www.shnenglu.com/shifan3/comments/10099.htmlhttp://www.shnenglu.com/shifan3/archive/2006/07/15/10099.html#Feedback0http://www.shnenglu.com/shifan3/comments/commentRss/10099.htmlhttp://www.shnenglu.com/shifan3/services/trackbacks/10099.html阅读全文

shifan3 2006-07-15 15:32 发表评论
]]>
[yc]自己实现Lambdahttp://www.shnenglu.com/shifan3/archive/2006/06/09/8334.htmlshifan3shifan3Fri, 09 Jun 2006 05:23:00 GMThttp://www.shnenglu.com/shifan3/archive/2006/06/09/8334.htmlhttp://www.shnenglu.com/shifan3/comments/8334.htmlhttp://www.shnenglu.com/shifan3/archive/2006/06/09/8334.html#Feedback6http://www.shnenglu.com/shifan3/comments/commentRss/8334.htmlhttp://www.shnenglu.com/shifan3/services/trackbacks/8334.html阅读全文

shifan3 2006-06-09 13:23 发表评论
]]>
[yc]boost::spirit初体?/title><link>http://www.shnenglu.com/shifan3/archive/2005/12/18/1857.html</link><dc:creator>shifan3</dc:creator><author>shifan3</author><pubDate>Sun, 18 Dec 2005 04:02:00 GMT</pubDate><guid>http://www.shnenglu.com/shifan3/archive/2005/12/18/1857.html</guid><wfw:comment>http://www.shnenglu.com/shifan3/comments/1857.html</wfw:comment><comments>http://www.shnenglu.com/shifan3/archive/2005/12/18/1857.html#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://www.shnenglu.com/shifan3/comments/commentRss/1857.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/shifan3/services/trackbacks/1857.html</trackback:ping><description><![CDATA[<p><font face="Courier New">    最qؓ了解析SQL语法Q怀着试一试的心态去Mboost的spirit库,因ؓ该库的文档的介里写着LL parser framework  represents parsers directly as EBNF grammars in inlined C++。看着frameworkq个词自然觉得这个库很牛BQ试用了一下果然如此?br>    所谓EBNFx展巴克斯范式Q是一U描qContext-Free Language的文法。在目前常见的非自然语言中,大部分都可以用EBNF表示。例如:<br><span id="hvzpftn" class=identifier>      group  </span><span id="hvzpftn" class=special>::=</span><span id="hvzpftn" class=literal>'('</span><span id="hvzpftn" class=identifier><span id="hvzpftn" class=identifier>exp </span></span></font><font face="Courier New"><span id="hvzpftn" class=literal>')'<br></span>      <span id="hvzpftn" class=identifier>factor </span><span id="hvzpftn" class=special>::=</span><span id="hvzpftn" class=identifier>integer</span><span id="hvzpftn" class=special>|</span></font> <font face="Courier New"><span id="hvzpftn" class=identifier>group<br></span>      <span id="hvzpftn" class=identifier>term   </span><span id="hvzpftn" class=special>::=</span><span id="hvzpftn" class=identifier>factor</span><span id="hvzpftn" class=special>((</span><span id="hvzpftn" class=literal>'*'</span><span id="hvzpftn" class=identifier>factor</span><span id="hvzpftn" class=special>)</span><span id="hvzpftn" class=special>|</span><span id="hvzpftn" class=special>(</span><span id="hvzpftn" class=literal>'/'</span><span id="hvzpftn" class=identifier>factor</span></font> <font face="Courier New"><span id="hvzpftn" class=special>))*<br></span>      <span id="hvzpftn" class=identifier>exp    </span><span id="hvzpftn" class=special>::=</span><span id="hvzpftn" class=identifier>term</span><span id="hvzpftn" class=special>((</span><span id="hvzpftn" class=literal>'+'</span><span id="hvzpftn" class=identifier>term</span><span id="hvzpftn" class=special>)</span><span id="hvzpftn" class=special>|</span><span id="hvzpftn" class=special>(</span><span id="hvzpftn" class=literal>'-'</span><span id="hvzpftn" class=identifier>term</span></font> <span id="hvzpftn" class=special><font face="Courier New">))*<br>q是一个整数表辑ּ的EBNF。该D|q用spirit在C++中的实现则是Q?br>   </font> </span></p> <div style="BORDER-RIGHT: rgb(204,204,204) 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: rgb(204,204,204) 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: rgb(204,204,204) 1px solid; WIDTH: 98%; PADDING-TOP: 4px; BORDER-BOTTOM: rgb(204,204,204) 1px solid; BACKGROUND-COLOR: rgb(238,238,238)"><font face="Courier New">   <img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: rgb(0,0,0)">rule</span><span style="COLOR: rgb(0,0,0)"><></span><span style="COLOR: rgb(0,0,0)"> group, factor, term, exp;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>   group  </span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">(</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">>></span><span style="COLOR: rgb(0,0,0)"> exp </span><span style="COLOR: rgb(0,0,0)">>></span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">)</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>   factor </span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)"> int_p </span><span style="COLOR: rgb(0,0,0)">|</span><span style="COLOR: rgb(0,0,0)"> group;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>   term   </span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)"> factor </span><span style="COLOR: rgb(0,0,0)">>></span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">*</span><span style="COLOR: rgb(0,0,0)">((</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">*</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">>></span><span style="COLOR: rgb(0,0,0)"> factor) </span><span style="COLOR: rgb(0,0,0)">|</span><span style="COLOR: rgb(0,0,0)"> (</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">/</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">>></span><span style="COLOR: rgb(0,0,0)"> factor));<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>   exp    </span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)"> term </span><span style="COLOR: rgb(0,0,0)">>></span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">*</span><span style="COLOR: rgb(0,0,0)">((</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">+</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">>></span><span style="COLOR: rgb(0,0,0)"> term) </span><span style="COLOR: rgb(0,0,0)">|</span><span style="COLOR: rgb(0,0,0)"> (</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">>></span><span style="COLOR: rgb(0,0,0)"> term));<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span></font> </div> <p><font face="Courier New">q里使用=代替::=, ?gt;>代替I格q接。ƈ且由于C++语法所限,EBNF中后|的*在spirit中改为前|?br>{式左边的单词被UCؓ一个ruleQ等式右边ؓrule的定义。我们可以看Z个group是一个exp加上一ҎP一个factor是一个整数或者一个group,一个term是一个或多个factor?/q接Q一个exp是一个或多个term?-q接。处于最端的exp可以据此识别Z下表辑ּ<br></font><font face="Courier New"><span id="hvzpftn" class=number>   </span> </font></p> <div style="BORDER-RIGHT: rgb(204,204,204) 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: rgb(204,204,204) 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: rgb(204,204,204) 1px solid; WIDTH: 98%; PADDING-TOP: 4px; BORDER-BOTTOM: rgb(204,204,204) 1px solid; BACKGROUND-COLOR: rgb(238,238,238)"><font face="Courier New">   <img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: rgb(0,0,0)">12345</span><span style="COLOR: rgb(0,0,0)"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>   </span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">12345</span><span style="COLOR: rgb(0,0,0)"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>   </span><span style="COLOR: rgb(0,0,0)">+</span><span style="COLOR: rgb(0,0,0)">12345</span><span style="COLOR: rgb(0,0,0)"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>   </span><span style="COLOR: rgb(0,0,0)">1</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">+</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">2</span><span style="COLOR: rgb(0,0,0)"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>   </span><span style="COLOR: rgb(0,0,0)">1</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">*</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">2</span><span style="COLOR: rgb(0,0,0)"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>   </span><span style="COLOR: rgb(0,0,0)">1</span><span style="COLOR: rgb(0,0,0)">/</span><span style="COLOR: rgb(0,0,0)">2</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">+</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">3</span><span style="COLOR: rgb(0,0,0)">/</span><span style="COLOR: rgb(0,0,0)">4</span><span style="COLOR: rgb(0,0,0)"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>   </span><span style="COLOR: rgb(0,0,0)">1</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">+</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">2</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">+</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">3</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">+</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">4</span><span style="COLOR: rgb(0,0,0)"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>   </span><span style="COLOR: rgb(0,0,0)">1</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">*</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">2</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">*</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">3</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">*</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">4</span><span style="COLOR: rgb(0,0,0)"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>   (</span><span style="COLOR: rgb(0,0,0)">1</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">+</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">2</span><span style="COLOR: rgb(0,0,0)">) </span><span style="COLOR: rgb(0,0,0)">*</span><span style="COLOR: rgb(0,0,0)"> (</span><span style="COLOR: rgb(0,0,0)">3</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">+</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">4</span><span style="COLOR: rgb(0,0,0)">)<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>   (</span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">1</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">+</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">2</span><span style="COLOR: rgb(0,0,0)">) </span><span style="COLOR: rgb(0,0,0)">*</span><span style="COLOR: rgb(0,0,0)"> (</span><span style="COLOR: rgb(0,0,0)">3</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">+</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">4</span><span style="COLOR: rgb(0,0,0)">)<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>   </span><span style="COLOR: rgb(0,0,0)">1</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">+</span><span style="COLOR: rgb(0,0,0)"> ((</span><span style="COLOR: rgb(0,0,0)">6</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">*</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">200</span><span style="COLOR: rgb(0,0,0)">) </span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">20</span><span style="COLOR: rgb(0,0,0)">) </span><span style="COLOR: rgb(0,0,0)">/</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">6</span><span style="COLOR: rgb(0,0,0)"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>   (</span><span style="COLOR: rgb(0,0,0)">1</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">+</span><span style="COLOR: rgb(0,0,0)"> (</span><span style="COLOR: rgb(0,0,0)">2</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">+</span><span style="COLOR: rgb(0,0,0)"> (</span><span style="COLOR: rgb(0,0,0)">3</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">+</span><span style="COLOR: rgb(0,0,0)"> (</span><span style="COLOR: rgb(0,0,0)">4</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">+</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">5</span><span style="COLOR: rgb(0,0,0)">))))<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span></font> </div> <p><font face="Courier New">    得到一个rule之后Q我们就可以?/font> <span id="hvzpftn" class=identifier><font face="Courier New">parse函数对一个串q行识别了。例?br>         </font> </span></p> <div style="BORDER-RIGHT: rgb(204,204,204) 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: rgb(204,204,204) 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: rgb(204,204,204) 1px solid; WIDTH: 98%; PADDING-TOP: 4px; BORDER-BOTTOM: rgb(204,204,204) 1px solid; BACKGROUND-COLOR: rgb(238,238,238)"><span style="COLOR: rgb(0,0,0)"><font face="Courier New">         parse(</font> </span><span style="COLOR: rgb(0,0,0)"><font face="Courier New">"</font> </span><span style="COLOR: rgb(0,0,0)"><font face="Courier New">(1 + (2 + (3 + (4 + 5))))</font> </span><span style="COLOR: rgb(0,0,0)"><font face="Courier New">"</font> </span><span style="COLOR: rgb(0,0,0)"><font face="Courier New">, exp);</font> </span></div> <p><font face="Courier New"><br>该函数返回一个结构parse_infoQ可以通过讉K其中的full成员来判断是否成功识别,也可以访问stop成员来获知失败的位置。这里要特别提一点,关于各个W号之间的空|spirit的文档的正文说的是给parse再传一个参数space_pQ通知parse跌所有的I格Q然而在FAQ中又提到Q如果用以上方法定义ruleQ第三个参数传space_p会失败。原因是使用rule默认定义的规则被UCؓcharacter level parsingQ即字符U别解析Q而parse的第3个参C适用于phrase level parsingQ即语法U别解析。要使用W?个参数可以有几种Ҏ?br>      1。在parse的第二个参数直接传入一个EBNF表达式,不创建rule对象?br>         <span id="hvzpftn" class=identifier></span></font> </p> <div style="BORDER-RIGHT: rgb(204,204,204) 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: rgb(204,204,204) 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: rgb(204,204,204) 1px solid; WIDTH: 98%; PADDING-TOP: 4px; BORDER-BOTTOM: rgb(204,204,204) 1px solid; BACKGROUND-COLOR: rgb(238,238,238)"><span style="COLOR: rgb(0,0,0)"><font face="Courier New">            parse(</font> </span><span style="COLOR: rgb(0,0,0)"><font face="Courier New">"</font> </span><span style="COLOR: rgb(0,0,0)"><font face="Courier New">hello world</font> </span><span style="COLOR: rgb(0,0,0)"><font face="Courier New">"</font> </span><span style="COLOR: rgb(0,0,0)"><font face="Courier New">, </font> </span><span style="COLOR: rgb(0,0,0)"><font face="Courier New">*</font> </span><span style="COLOR: rgb(0,0,0)"><font face="Courier New">anychar_p, space_p);  </font> </span></div> <p><font face="Courier New"><span id="hvzpftn" class=special><br>      2。以rule<phrase_scanner_t>创徏rule?br>         </span> </font></p> <div style="BORDER-RIGHT: rgb(204,204,204) 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: rgb(204,204,204) 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: rgb(204,204,204) 1px solid; WIDTH: 98%; PADDING-TOP: 4px; BORDER-BOTTOM: rgb(204,204,204) 1px solid; BACKGROUND-COLOR: rgb(238,238,238)"><span style="COLOR: rgb(0,0,0)"><font face="Courier New">            rule</font> </span><span style="COLOR: rgb(0,0,0)"><font face="Courier New"><</font> </span><span style="COLOR: rgb(0,0,0)"><font face="Courier New">phrase_scanner_t</font> </span><span style="COLOR: rgb(0,0,0)"><font face="Courier New">></font> </span><span style="COLOR: rgb(0,0,0)"><font face="Courier New"> exp; </font> </span></div> <p><font face="Courier New">注意虽然可以用这两个办法屏蔽I格Q但是这样可能完全改变EBNF文法的语义,其是在语言本n需要识别空格的时候。对于这U情况,可以不用第三个参数Qƈ在需要出现空格的地方加上space_p,或?space_p?space_pQ其??分别表示后面的符可l出Cơ以上和0ơ以上。例如一个以I格分隔的整数列表可以写成int_p >> *(+space_p >> int_p)<br>   如上使用parse可以识别一个串Q但q不能做更多的操作,例如语法里的各个成分提取出来。对于这L需求,可以通过actor实现。下面是使用actor的一个简单例?br>   <span id="hvzpftn" class=keyword></span></font> </p> <div style="BORDER-RIGHT: rgb(204,204,204) 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: rgb(204,204,204) 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: rgb(204,204,204) 1px solid; WIDTH: 98%; PADDING-TOP: 4px; BORDER-BOTTOM: rgb(204,204,204) 1px solid; BACKGROUND-COLOR: rgb(238,238,238)"><font face="Courier New"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>   <span style="COLOR: rgb(0,0,255)">bool</span><span style="COLOR: rgb(0,0,0)"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>   parse_numbers(</span><span style="COLOR: rgb(0,0,255)">char</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,255)">const</span><span style="COLOR: rgb(0,0,0)">*</span><span style="COLOR: rgb(0,0,0)"> str, vector</span><span style="COLOR: rgb(0,0,0)"><</span><span style="COLOR: rgb(0,0,255)">double</span><span style="COLOR: rgb(0,0,0)">>&</span><span style="COLOR: rgb(0,0,0)"> v)<br><img id=Codehighlighter1_61_247_Open_Image onclick="this.style.display='none'; Codehighlighter1_61_247_Open_Text.style.display='none'; Codehighlighter1_61_247_Closed_Image.style.display='inline'; Codehighlighter1_61_247_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_61_247_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_61_247_Closed_Text.style.display='none'; Codehighlighter1_61_247_Open_Image.style.display='inline'; Codehighlighter1_61_247_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top>   </span><span id=Codehighlighter1_61_247_Closed_Text style="BORDER-RIGHT: rgb(128,128,128) 1px solid; BORDER-TOP: rgb(128,128,128) 1px solid; DISPLAY: none; BORDER-LEFT: rgb(128,128,128) 1px solid; BORDER-BOTTOM: rgb(128,128,128) 1px solid; BACKGROUND-COLOR: rgb(255,255,255)"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_61_247_Open_Text><span style="COLOR: rgb(0,0,0)">{<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>      </span><span style="COLOR: rgb(0,0,255)">return</span><span style="COLOR: rgb(0,0,0)"> parse(str,<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>   </span><span style="COLOR: rgb(0,128,0)">//</span><span style="COLOR: rgb(0,128,0)">  Begin grammar</span><span style="COLOR: rgb(0,128,0)"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: rgb(0,0,0)">      (<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>         real_p[push_back_a(v)] </span><span style="COLOR: rgb(0,0,0)">>></span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">*</span><span style="COLOR: rgb(0,0,0)">(</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">,</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">>></span><span style="COLOR: rgb(0,0,0)"> real_p[push_back_a(v)])<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>      )<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>      ,<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>      </span><span style="COLOR: rgb(0,128,0)">//</span><span style="COLOR: rgb(0,128,0)">  End grammar</span><span style="COLOR: rgb(0,128,0)"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: rgb(0,0,0)">      space_p).full;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>   }</span></span><span style="COLOR: rgb(0,0,0)"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span></font> </div> <p><font face="Courier New">注意?span class=identifier>real_p后面的[]Q中括号里面是一个仿函数Q函数指针或者函数对象)Q该仿函数具有如下调用型?br>   </span></font> </p> <div style="BORDER-RIGHT: rgb(204,204,204) 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: rgb(204,204,204) 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: rgb(204,204,204) 1px solid; WIDTH: 98%; PADDING-TOP: 4px; BORDER-BOTTOM: rgb(204,204,204) 1px solid; BACKGROUND-COLOR: rgb(238,238,238)"><font face="Courier New">   <img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: rgb(0,0,255)">void</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,255)">operator</span><span style="COLOR: rgb(0,0,0)">()(IterT first, IterT last) </span><span style="COLOR: rgb(0,0,255)">const</span><span style="COLOR: rgb(0,0,0)">;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>   </span><span style="COLOR: rgb(0,0,255)">void</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,255)">operator</span><span style="COLOR: rgb(0,0,0)">()(NumT val) </span><span style="COLOR: rgb(0,0,255)">const</span><span style="COLOR: rgb(0,0,0)">;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>   </span><span style="COLOR: rgb(0,0,255)">void</span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,255)">operator</span><span style="COLOR: rgb(0,0,0)">()(CharT ch) </span><span style="COLOR: rgb(0,0,255)">const</span><span style="COLOR: rgb(0,0,0)">;</span></font> </div> <p><span id="hvzpftn" class=special><span id="hvzpftn" class=special><span id="hvzpftn" class=special><font face="Courier New"><br>一旦spase发现了匹?span class=identifier>real_p的子Ԍ׃调用该functor。不同的rule可能会对应不同的调用型别?/span><br>W一个型别针对一般规则,first和lastZ个指向字W的q代器(一般ؓchar*Q?匚w的子串ؓ[first, last)<br>W二个型别针Ҏ字型规则Q如real_p和int_p, 参数val是一个数字类型?br>W三个性别针对单字W型规则Q如space_p, 参数ch是一个字W类型?br><span id="hvzpftn" class=identifier>real_p</span><span id="hvzpftn" class=special>[</span><span id="hvzpftn" class=identifier>push_back_a</span><span id="hvzpftn" class=special>(</span><span id="hvzpftn" class=identifier>v</span><span id="hvzpftn" class=special>)]中的push_back_a是一个spirit已经定义好的functorQ它会将匚w好的内容依照匚w到的旉序调用v的push_back函数加入到v中?br><br>   到此spirit的常用功能就都介l完了。要详细深入了解可以参考spirit的文档?br><br>最后在题一个注意要炏Vspirit的各UEBNFq接都是指针q接Q因此才能在expression被赋值前在group的定义里面用。所以在使用EBNF的时候一定要心不要局部变量的rule提供l全局或者类成员变量使用Q例如:<br>   </span></font> </span></span></span></p> <div style="BORDER-RIGHT: rgb(204,204,204) 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: rgb(204,204,204) 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: rgb(204,204,204) 1px solid; WIDTH: 98%; PADDING-TOP: 4px; BORDER-BOTTOM: rgb(204,204,204) 1px solid; BACKGROUND-COLOR: rgb(238,238,238)"><font face="Courier New">   <img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: rgb(0,0,255)">class</span><span style="COLOR: rgb(0,0,0)"> A<br><img id=Codehighlighter1_11_166_Open_Image onclick="this.style.display='none'; Codehighlighter1_11_166_Open_Text.style.display='none'; Codehighlighter1_11_166_Closed_Image.style.display='inline'; Codehighlighter1_11_166_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_11_166_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_11_166_Closed_Text.style.display='none'; Codehighlighter1_11_166_Open_Image.style.display='inline'; Codehighlighter1_11_166_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top>   </span><span id=Codehighlighter1_11_166_Closed_Text style="BORDER-RIGHT: rgb(128,128,128) 1px solid; BORDER-TOP: rgb(128,128,128) 1px solid; DISPLAY: none; BORDER-LEFT: rgb(128,128,128) 1px solid; BORDER-BOTTOM: rgb(128,128,128) 1px solid; BACKGROUND-COLOR: rgb(255,255,255)"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_11_166_Open_Text><span style="COLOR: rgb(0,0,0)">{<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>      rule</span><span style="COLOR: rgb(0,0,0)"><></span><span style="COLOR: rgb(0,0,0)"> s;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>      A()<br><img id=Codehighlighter1_45_161_Open_Image onclick="this.style.display='none'; Codehighlighter1_45_161_Open_Text.style.display='none'; Codehighlighter1_45_161_Closed_Image.style.display='inline'; Codehighlighter1_45_161_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_45_161_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_45_161_Closed_Text.style.display='none'; Codehighlighter1_45_161_Open_Image.style.display='inline'; Codehighlighter1_45_161_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>      </span><span id=Codehighlighter1_45_161_Closed_Text style="BORDER-RIGHT: rgb(128,128,128) 1px solid; BORDER-TOP: rgb(128,128,128) 1px solid; DISPLAY: none; BORDER-LEFT: rgb(128,128,128) 1px solid; BORDER-BOTTOM: rgb(128,128,128) 1px solid; BACKGROUND-COLOR: rgb(255,255,255)"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_45_161_Open_Text><span style="COLOR: rgb(0,0,0)">{<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>         rule</span><span style="COLOR: rgb(0,0,0)"><></span><span style="COLOR: rgb(0,0,0)"> r </span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)"> int_p </span><span style="COLOR: rgb(0,0,0)">|</span><span style="COLOR: rgb(0,0,0)"> hex_p;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>         s </span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)"> r </span><span style="COLOR: rgb(0,0,0)">>></span><span style="COLOR: rgb(0,0,0)"> </span><span style="COLOR: rgb(0,0,0)">*</span><span style="COLOR: rgb(0,0,0)">(</span><span style="COLOR: rgb(0,0,0)">+</span><span style="COLOR: rgb(0,0,0)">space_p </span><span style="COLOR: rgb(0,0,0)">>></span><span style="COLOR: rgb(0,0,0)"> r); </span><span style="COLOR: rgb(0,128,0)">//</span><span style="COLOR: rgb(0,128,0)">error, r destructed after return </span><span style="COLOR: rgb(0,128,0)"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top></span><span style="COLOR: rgb(0,0,0)">      }</span></span><span style="COLOR: rgb(0,0,0)"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>   }</span></span><span style="COLOR: rgb(0,0,0)">;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span></font> </div> <p><span id="hvzpftn" class=special><span id="hvzpftn" class=identifier><font face="Courier New"><span id="hvzpftn" class=special><span id="hvzpftn" class=identifier><span id="hvzpftn" class=special><span id="hvzpftn" class=special><span id="hvzpftn" class=special><span id="hvzpftn" class=special>如果真想使用局部作用域Q可以在局部的rule前面加上static.</span> </span></span></span></span></span></font></span></span></p> <img src ="http://www.shnenglu.com/shifan3/aggbug/1857.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/shifan3/" target="_blank">shifan3</a> 2005-12-18 12:02 <a href="http://www.shnenglu.com/shifan3/archive/2005/12/18/1857.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <a href="http://www.shnenglu.com/">青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品</a> <div style="position:fixed;left:-9000px;top:-9000px;"><font id="pjuwb"></font><button id="pjuwb"><pre id="pjuwb"></pre></button><sub id="pjuwb"></sub><tbody id="pjuwb"><var id="pjuwb"><address id="pjuwb"></address></var></tbody><listing id="pjuwb"><label id="pjuwb"><strong id="pjuwb"></strong></label></listing><wbr id="pjuwb"><small id="pjuwb"><tbody id="pjuwb"></tbody></small></wbr><ins id="pjuwb"><xmp id="pjuwb"></xmp></ins><style id="pjuwb"></style><label id="pjuwb"><em id="pjuwb"><li id="pjuwb"></li></em></label><samp id="pjuwb"></samp><menu id="pjuwb"><input id="pjuwb"></input></menu><pre id="pjuwb"><tbody id="pjuwb"><tfoot id="pjuwb"><button id="pjuwb"></button></tfoot></tbody></pre><form id="pjuwb"></form><i id="pjuwb"><style id="pjuwb"><label id="pjuwb"><sup id="pjuwb"></sup></label></style></i><li id="pjuwb"><table id="pjuwb"><abbr id="pjuwb"></abbr></table></li><video id="pjuwb"></video><dfn id="pjuwb"></dfn><progress id="pjuwb"></progress><strong id="pjuwb"></strong><mark id="pjuwb"></mark><em id="pjuwb"></em><tbody id="pjuwb"><p id="pjuwb"><strike id="pjuwb"><acronym id="pjuwb"></acronym></strike></p></tbody><option id="pjuwb"></option><strike id="pjuwb"></strike><u id="pjuwb"></u><td id="pjuwb"><center id="pjuwb"><tr id="pjuwb"></tr></center></td><em id="pjuwb"><mark id="pjuwb"><em id="pjuwb"><tt id="pjuwb"></tt></em></mark></em><strong id="pjuwb"></strong><wbr id="pjuwb"></wbr><s id="pjuwb"></s><strong id="pjuwb"></strong><legend id="pjuwb"></legend><nav id="pjuwb"></nav><dl id="pjuwb"><th id="pjuwb"><dl id="pjuwb"></dl></th></dl><noframes id="pjuwb"><ins id="pjuwb"></ins></noframes><font id="pjuwb"></font><strike id="pjuwb"><i id="pjuwb"><style id="pjuwb"><label id="pjuwb"></label></style></i></strike><output id="pjuwb"></output><thead id="pjuwb"><pre id="pjuwb"></pre></thead><source id="pjuwb"></source><menuitem id="pjuwb"><wbr id="pjuwb"></wbr></menuitem><pre id="pjuwb"><span id="pjuwb"><pre id="pjuwb"><big id="pjuwb"></big></pre></span></pre><cite id="pjuwb"><fieldset id="pjuwb"><s id="pjuwb"><rt id="pjuwb"></rt></s></fieldset></cite><big id="pjuwb"><progress id="pjuwb"><big id="pjuwb"></big></progress></big><samp id="pjuwb"><delect id="pjuwb"></delect></samp><dl id="pjuwb"></dl><strike id="pjuwb"><nav id="pjuwb"><dl id="pjuwb"><strong id="pjuwb"></strong></dl></nav></strike><tbody id="pjuwb"><b id="pjuwb"><optgroup id="pjuwb"><rp id="pjuwb"></rp></optgroup></b></tbody><em id="pjuwb"></em><xmp id="pjuwb"><blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote></xmp> <i id="pjuwb"><abbr id="pjuwb"><i id="pjuwb"><abbr id="pjuwb"></abbr></i></abbr></i><center id="pjuwb"><acronym id="pjuwb"><center id="pjuwb"></center></acronym></center><pre id="pjuwb"></pre><ul id="pjuwb"><thead id="pjuwb"></thead></ul><blockquote id="pjuwb"><pre id="pjuwb"><sup id="pjuwb"></sup></pre></blockquote><acronym id="pjuwb"></acronym><big id="pjuwb"><s id="pjuwb"></s></big><th id="pjuwb"></th><th id="pjuwb"></th><tbody id="pjuwb"></tbody><thead id="pjuwb"><strike id="pjuwb"></strike></thead><th id="pjuwb"><dl id="pjuwb"><wbr id="pjuwb"></wbr></dl></th><dl id="pjuwb"><strong id="pjuwb"></strong></dl><abbr id="pjuwb"><noframes id="pjuwb"><noscript id="pjuwb"></noscript></noframes></abbr><td id="pjuwb"><ol id="pjuwb"></ol></td><li id="pjuwb"><noscript id="pjuwb"><abbr id="pjuwb"></abbr></noscript></li><small id="pjuwb"><bdo id="pjuwb"><nav id="pjuwb"></nav></bdo></small><style id="pjuwb"></style><optgroup id="pjuwb"><table id="pjuwb"></table></optgroup><center id="pjuwb"><tr id="pjuwb"><dfn id="pjuwb"></dfn></tr></center><th id="pjuwb"></th><u id="pjuwb"></u><tfoot id="pjuwb"><legend id="pjuwb"><i id="pjuwb"></i></legend></tfoot><mark id="pjuwb"></mark><meter id="pjuwb"></meter><nav id="pjuwb"></nav><acronym id="pjuwb"><pre id="pjuwb"><acronym id="pjuwb"><ul id="pjuwb"></ul></acronym></pre></acronym><acronym id="pjuwb"><pre id="pjuwb"><acronym id="pjuwb"><ul id="pjuwb"></ul></acronym></pre></acronym><nobr id="pjuwb"></nobr><sub id="pjuwb"><th id="pjuwb"><menuitem id="pjuwb"><wbr id="pjuwb"></wbr></menuitem></th></sub><thead id="pjuwb"><sub id="pjuwb"></sub></thead><ul id="pjuwb"><address id="pjuwb"><menuitem id="pjuwb"><meter id="pjuwb"></meter></menuitem></address></ul><dfn id="pjuwb"></dfn><pre id="pjuwb"></pre><input id="pjuwb"><cite id="pjuwb"><fieldset id="pjuwb"></fieldset></cite></input><u id="pjuwb"><form id="pjuwb"><u id="pjuwb"></u></form></u><kbd id="pjuwb"><em id="pjuwb"><mark id="pjuwb"></mark></em></kbd><tr id="pjuwb"></tr><del id="pjuwb"><form id="pjuwb"><address id="pjuwb"></address></form></del><tfoot id="pjuwb"><legend id="pjuwb"><ol id="pjuwb"><dl id="pjuwb"></dl></ol></legend></tfoot><menu id="pjuwb"><nobr id="pjuwb"><th id="pjuwb"><nobr id="pjuwb"></nobr></th></nobr></menu><fieldset id="pjuwb"></fieldset><pre id="pjuwb"><blockquote id="pjuwb"><samp id="pjuwb"></samp></blockquote></pre><xmp id="pjuwb"><sup id="pjuwb"><pre id="pjuwb"></pre></sup></xmp><span id="pjuwb"><progress id="pjuwb"></progress></span><font id="pjuwb"></font><var id="pjuwb"><abbr id="pjuwb"></abbr></var><strong id="pjuwb"><label id="pjuwb"><i id="pjuwb"><legend id="pjuwb"></legend></i></label></strong><tr id="pjuwb"><em id="pjuwb"><em id="pjuwb"><output id="pjuwb"></output></em></em></tr><thead id="pjuwb"><strike id="pjuwb"></strike></thead> <acronym id="pjuwb"></acronym><i id="pjuwb"></i><tt id="pjuwb"></tt><rt id="pjuwb"><source id="pjuwb"><rt id="pjuwb"></rt></source></rt><strike id="pjuwb"><acronym id="pjuwb"></acronym></strike><del id="pjuwb"></del><font id="pjuwb"><output id="pjuwb"><ins id="pjuwb"><output id="pjuwb"></output></ins></output></font><kbd id="pjuwb"><tr id="pjuwb"><kbd id="pjuwb"></kbd></tr></kbd><pre id="pjuwb"><sup id="pjuwb"><delect id="pjuwb"><samp id="pjuwb"></samp></delect></sup></pre><samp id="pjuwb"></samp><track id="pjuwb"></track><tr id="pjuwb"></tr><center id="pjuwb"></center><fieldset id="pjuwb"></fieldset><i id="pjuwb"></i><td id="pjuwb"></td><rt id="pjuwb"></rt><object id="pjuwb"></object><pre id="pjuwb"><progress id="pjuwb"><sub id="pjuwb"><thead id="pjuwb"></thead></sub></progress></pre><kbd id="pjuwb"><tr id="pjuwb"><option id="pjuwb"></option></tr></kbd><output id="pjuwb"><ins id="pjuwb"></ins></output><ol id="pjuwb"></ol><source id="pjuwb"></source><strong id="pjuwb"></strong><ruby id="pjuwb"></ruby><sub id="pjuwb"><meter id="pjuwb"><menuitem id="pjuwb"><meter id="pjuwb"></meter></menuitem></meter></sub><pre id="pjuwb"></pre><center id="pjuwb"></center><tr id="pjuwb"><tbody id="pjuwb"><xmp id="pjuwb"><dd id="pjuwb"></dd></xmp></tbody></tr><video id="pjuwb"></video><pre id="pjuwb"></pre><form id="pjuwb"><optgroup id="pjuwb"></optgroup></form><samp id="pjuwb"></samp><kbd id="pjuwb"></kbd><strong id="pjuwb"><option id="pjuwb"></option></strong><object id="pjuwb"></object><abbr id="pjuwb"><noframes id="pjuwb"><abbr id="pjuwb"></abbr></noframes></abbr><ul id="pjuwb"><del id="pjuwb"><button id="pjuwb"><pre id="pjuwb"></pre></button></del></ul><abbr id="pjuwb"></abbr><strong id="pjuwb"><code id="pjuwb"><strong id="pjuwb"></strong></code></strong><option id="pjuwb"></option><optgroup id="pjuwb"><bdo id="pjuwb"><code id="pjuwb"></code></bdo></optgroup><mark id="pjuwb"><em id="pjuwb"><font id="pjuwb"></font></em></mark><acronym id="pjuwb"><code id="pjuwb"></code></acronym><dl id="pjuwb"></dl><em id="pjuwb"></em><object id="pjuwb"><input id="pjuwb"><object id="pjuwb"></object></input></object><output id="pjuwb"><dd id="pjuwb"></dd></output><option id="pjuwb"><button id="pjuwb"><option id="pjuwb"></option></button></option><small id="pjuwb"></small></div> <a href="http://7redy.com" target="_blank">ŷ</a>| <a href="http://sh-hxjdkj.com" target="_blank">þҹɫƷһ</a>| <a href="http://www-188444.com" target="_blank">ŷձ</a>| <a href="http://ipx758.com" target="_blank">þþ˳ӰƬһۿ </a>| <a href="http://555hhu.com" target="_blank">޺һ</a>| <a href="http://aimashe.com" target="_blank">þþƷŷպ</a>| <a href="http://www-442336.com" target="_blank">߹ۿһ</a>| <a href="http://bby99.com" target="_blank">ѳ߹ۿƵ</a>| <a href="http://70909g.com" target="_blank">ŷxartϵ߹ۿ</a>| <a href="http://555346.com" target="_blank">պҹߵӰ</a>| <a href="http://4449998.com" target="_blank">Ʒ99þþþþ</a>| <a href="http://2015xiaomingkankan.com" target="_blank">ŷպһ</a>| <a href="http://www3344uh.com" target="_blank">ӰԺ</a>| <a href="http://www-438686.com" target="_blank">ŷһ</a>| <a href="http://hjaa7.com" target="_blank">޹պ</a>| <a href="http://855821.com" target="_blank">һɫþۺ޾Ʒ</a>| <a href="http://5a07.com" target="_blank">Ʒһ߹ۿվ </a>| <a href="http://621767.com" target="_blank">ŮƵ</a>| <a href="http://zooxoft.com" target="_blank">Ʒݾþ</a>| <a href="http://www8xoy.com" target="_blank">avһ</a>| <a href="http://8946286.com" target="_blank">ŷŷ</a>| <a href="http://077229.com" target="_blank">ŷһһ</a>| <a href="http://wwwsfsf11.com" target="_blank">˾a߾Ʒ</a>| <a href="http://www37999.com" target="_blank">һӰ߹ۿ</a>| <a href="http://by2866.com" target="_blank">ҹ޸</a>| <a href="http://saomm18.com" target="_blank">պ444www</a>| <a href="http://772ss.com" target="_blank">һ߲</a>| <a href="http://wwwyinyinai149.com" target="_blank">ɫƬ</a>| <a href="http://333666333.com" target="_blank">99Ʒþþþþþþþ </a>| <a href="http://495177.com" target="_blank">ŷƬ߹ۿһ</a>| <a href="http://124909.com" target="_blank">ŷպһ</a>| <a href="http://filark.com" target="_blank">Ѽһ</a>| <a href="http://xmt86.com" target="_blank">ҹ</a>| <a href="http://zhongrenma.com" target="_blank">ŮƷƵһ</a>| <a href="http://kdy444.com" target="_blank">ŷһҹƵ߹ۿ</a>| <a href="http://sdgs6788.com" target="_blank">ŷƷaa</a>| <a href="http://3644688.com" target="_blank">ɫƷƵ߹ۿ</a>| <a href="http://100736.com" target="_blank">ŷպһ߹ۿ</a>| <a href="http://86868o.com" target="_blank">þƵֻоƷ</a>| <a href="http://70909g.com" target="_blank">Ʒþþ91</a>| <a href="http://xiaokd666.com" target="_blank">ؼؼŷһ</a>| <a href="http://98956888.com" target="_blank">׾Ʒһ</a>| <a href="http://szjyf668.com" target="_blank">պƵ</a>| <a href="http://492541.com" target="_blank">޾Ƶ߹ۿ</a>| <a href="http://bx989.com" target="_blank">ŷ߹ۿƵ</a>| <a href="http://gyzhoucheng.com" target="_blank">ӰԺһ</a>| <a href="http://gjjlzs.com" target="_blank">ŷպ</a>| <a href="http://jxchunlong.com" target="_blank">avһ</a>| <a href="http://wwwavtb2049.com" target="_blank">һѹۿ</a>| <a href="http://csmgxun.com" target="_blank">ҹŮֱ</a>| <a href="http://maiiyou.com" target="_blank">Ϸһ</a>| <a href="http://6673328.com" target="_blank">þþþһ</a>| <a href="http://360inns.com" target="_blank">ëƬһ</a>| <a href="http://48488a.com" target="_blank">ҹƷþþ99ȸ</a>| <a href="http://obatshaka.com" target="_blank">ƷƵxxx</a>| <a href="http://sdtricoop.com" target="_blank">պƵһ</a>| <a href="http://czjrby.com" target="_blank">99ۺϵӰƵ</a>| <a href="http://www-82622.com" target="_blank">ͼƬ</a>| <a href="http://www-94889.com" target="_blank">ģдһ</a>| <a href="http://4449992.com" target="_blank">Ƶһ߹ۿ</a>| <a href="http://wwmm9.com" target="_blank">ŷպྫƷһ</a>| <a href="http://mide776.com" target="_blank">һõþۺĻ</a>| <a href="http://devwang.com" target="_blank">ŷ龫Ʒþþþþú</a>| <a href="http://8880850.com" target="_blank">պƷ</a>| <a href="http://www23009.com" target="_blank">߹ۿŷ</a>| <a href="http://1588vip.com" target="_blank">þþҾƷ</a>| <a href="http://www-yh6.com" target="_blank">һ</a>| <a href="http://3315588.com" target="_blank">޹Ʒþþþϼ</a>| <a href="http://281191.com" target="_blank">þþþžžž</a>| <a href="http://ttdy20.com" target="_blank">鶹߹ۿ</a>| <a href="http://77smsm.com" target="_blank">޹ŷƷ</a>| <a href="http://755795.com" target="_blank">ŷһ</a>| <a href="http://330310c.com" target="_blank">޾Ʒŷ</a>| <a href="http://cm1-100.com" target="_blank">ӰԺɫ޼ۺ</a>| <a href="http://8x1080x.com" target="_blank">ձŷ</a>| <a href="http://czsanlin.com" target="_blank">ŷ߹ۿwww</a>| <a href="http://shno1steel.com" target="_blank">þۺhezyo</a>| <a href="http://xpj493.com" target="_blank">޴Ƶ</a>| <a href="http://66hhmm.com" target="_blank">ŷþþþþþþ</a>| <a href="http://www-6410c.com" target="_blank">һþþƷ</a>| <a href="http://725443.com" target="_blank">ŷһƵ</a>| <a href="http://my777752.com" target="_blank">һþþ</a>| <a href="http://df7166.com" target="_blank">þ97</a>| <a href="http://by33336.com" target="_blank">޹Ƶ</a>| <a href="http://497n.com" target="_blank">ҹӰ</a>| <a href="http://sishengnv.com" target="_blank">Ʒһ</a>| <a href="http://stt788.com" target="_blank">ģдһ</a>| <a href="http://jpqueyou.com" target="_blank">˳߹ۿվ</a>| <a href="http://lampreydb.com" target="_blank">һһ</a>| <a href="http://345521.com" target="_blank">vŷvձvv</a>| <a href="http://77777gao.com" target="_blank">ŷ</a>| <a href="http://fuqiba.com" target="_blank">ҹƷƵ</a>| <a href="http://www297777.com" target="_blank">ŷղƵ</a>| <a href="http://xhamtube.com" target="_blank">ڲպ</a>| <a href="http://977764.com" target="_blank">һ</a>| <a href="http://5xxm.com" target="_blank">ŷ޳</a>| <a href="http://18mmcg.com" target="_blank">ҹƷ</a>| <a href="http://wwwqm9.com" target="_blank">޵Ӱѹۿ߹ۿ </a>| <a href="http://fangsling.com" target="_blank">Ĺ糱</a>| <a href="http://www44448.com" target="_blank">þþþùƷ</a>| <a href="http://3333328.com" target="_blank">ŮƷþ</a>| <a href="http://tao62bao.com" target="_blank">׾ƷһƵ </a>| <a href="http://xajtyd.com" target="_blank">ŷƵ߹ۿַ</a>| <a href="http://66889h.com" target="_blank">ҹƵۿպ17c</a>| <a href="http://tubcup.com" target="_blank">ŷӰѹۿվ</a>| <a href="http://lutube666.com" target="_blank">Ļ</a>| <a href="http://hhbz518.com" target="_blank">136Ʒ</a>| <a href="http://by2866.com" target="_blank">ŷҹƷþþþþó</a>| <a href="http://ayxchc.com" target="_blank">ŷۺ</a>| <a href="http://vvvv81.com" target="_blank">aɫŷ</a>| <a href="http://777888789.com" target="_blank">ŷƵһ</a>| <a href="http://227c7.com" target="_blank">ŷպۺ</a>| <a href="http://chaoporn97.com" target="_blank">޹Ʒþþþ884 </a>| <a href="http://wwwjuhuase.com" target="_blank">վ</a>| <a href="http://bmcshy.com" target="_blank">91þþƷһ</a>| <a href="http://zhaosaofu.com" target="_blank">Ʒŷ</a>| <a href="http://caosee.com" target="_blank">ŷպ</a>| <a href="http://hdsywang.com" target="_blank">þùƷһ</a>| <a href="http://shght.com" target="_blank"></a>| <a href="http://by21999.com" target="_blank">˳վ߲</a>| <a href="http://0085212.com" target="_blank">þŷƷֲ</a>| <a href="http://xashp.com" target="_blank">һƷ</a>| <a href="http://543422.com" target="_blank">޵һƷþDz</a>| <a href="http://y8e8.com" target="_blank">Ʒۺ</a>| <a href="http://choaoxing.com" target="_blank">ŷպҹ</a>| <a href="http://9486322.com" target="_blank">ŷһ</a>| <a href="http://kk553.com" target="_blank">þһ</a>| <a href="http://www-kkjj88.com" target="_blank">ŷһþþƷ</a>| <a href="http://www5909.com" target="_blank">պ߹ۿ</a>| <a href="http://418ch.com" target="_blank">޹պ</a>| <a href="http://26cs.com" target="_blank">ŷ պ </a>| <a href="http://b1768.com" target="_blank">þþþùƷ</a>| <a href="http://yytaotu.com" target="_blank">þù</a>| <a href="http://miandoctor.com" target="_blank">ŷ߲</a>| <a href="http://cloakok.com" target="_blank">ҹպ</a>| <a href="http://wwwmy77757.com" target="_blank">ŷ999</a>| <a href="http://pgd857.com" target="_blank">2024</a>| <a href="http://www333393.com" target="_blank">߲</a>| <a href="http://78gde.com" target="_blank">ŷƷ</a>| <a href="http://lalandapps.com" target="_blank">ҹ߹ۿƵ</a>| <a href="http://phdy999.com" target="_blank">ҹavӰͬ</a>| <a href="http://yiluee.com" target="_blank">һð׽Ƶ</a>| <a href="http://9238479.com" target="_blank">һɫ</a>| <a href="http://kuaikan97.com" target="_blank">Ļһ</a>| <a href="http://56x6.com" target="_blank">һavӰ</a>| <a href="http://0855dyw.com" target="_blank">һƷƵ</a>| <a href="http://jzsp101.com" target="_blank">һĿ忨</a>| <a href="http://bdkaoyan.com" target="_blank">Ƶ</a>| <a href="http://whaylan.com" target="_blank">ɫavԾþþþþ</a>| <a href="http://qdzhudai.com" target="_blank">ҹӻŷ</a>| <a href="http://2061851.com" target="_blank">þþƷһ</a>| <a href="http://pp88qq.com" target="_blank">þþƷŷˬ</a>| <a href="http://vipaqdx29.com" target="_blank">þӰԺ</a>| <a href="http://m10669.com" target="_blank">þþƷղһ</a>| <a href="http://ziwufuren.com" target="_blank">þþþþ㽶</a>| <a href="http://xiuren2021.com" target="_blank">þþƷһ</a>| <a href="http://833077.com" target="_blank">þþþһ</a>| <a href="http://www-444454.com" target="_blank">ŷƷר</a>| <a href="http://7a6a.com" target="_blank">޾ɫӰ</a>| <a href="http://72nnnn.com" target="_blank">ɫ벥</a>| <a href="http://wy77777.com" target="_blank">պŮƵַ߹ۿ </a>| <a href="http://20074972.com" target="_blank">þ۲ݾƷþþþ</a>| <a href="http://xxxbobba.com" target="_blank">ŷ</a>| <a href="http://928uc.com" target="_blank">޾Ʒɫø</a>| <a href="http://fjccjq.com" target="_blank">һëƬ</a>| <a href="http://05511253.com" target="_blank">þþƷ</a>| <a href="http://www-8438.com" target="_blank">ŷɫһ</a>| <a href="http://70909g.com" target="_blank">Ʒպþþ</a>| <a href="http://www-498787.com" target="_blank">þƷƬwwwapp</a>| <a href="http://114mz.com" target="_blank">޼߹ۿƵ</a>| <a href="http://520844www.com" target="_blank">һ</a>| <a href="http://77777kkk.com" target="_blank">ŷƵۿվ</a>| <a href="http://y1bbs.com" target="_blank">vavaŷva</a>| <a href="http://www66441.com" target="_blank">xxxx137</a>| <a href="http://ehagakii.com" target="_blank">߾Ʒһ˽</a>| <a href="http://951738.com" target="_blank">þþƷvպv </a>| <a href="http://yyy922.com" target="_blank">ҹŷƷ</a>| <a href="http://227c7.com" target="_blank">ŷ߳Ƶ</a>| <a href="http://aa224.com" target="_blank">鶹һƷһavһ</a>| <a href="http://zhijiasd.com" target="_blank">߹ۿպavȷӰӰԺ </a>| <a href="http://6h8c.com" target="_blank">Ʒˬ69</a>| <a href="http://6055365.com" target="_blank">һɫݾƷ㽶վ</a>| <a href="http://www-13413.com" target="_blank">99reƷ</a>| <a href="http://jpqueyou.com" target="_blank">þþþùƷ</a>| <a href="http://pgd857.com" target="_blank">޹Ʒ999</a>| <a href="http://ad377.com" target="_blank">ҹƷƵ</a>| <a href="http://amiee88.com" target="_blank">ŮƷվ</a>| <a href="http://333666333.com" target="_blank">Իѹۿþþ</a>| <a href="http://d77dd.com" target="_blank">99ƵƷ</a>| <a href="http://1zz8903.com" target="_blank">Ѽһ</a>| <a href="http://www50050.com" target="_blank">Ƶպ</a>| <a href="http://www48929.com" target="_blank">պƵ</a>| <a href="http://5588gww.com" target="_blank">һ</a>| <a href="http://444398.com" target="_blank">ŷӰԺƵ</a>| <a href="http://483134.com" target="_blank">99Ʒŷ</a>| <a href="http://9511331.com" target="_blank">ŷպһ</a>| <a href="http://qiansemf.com" target="_blank">һ޾Ʒ</a>| <a href="http://lmjqav.com" target="_blank">ҹӰ</a>| <a href="http://7269003.com" target="_blank">һƵ </a>| <a href="http://hkbsi.com" target="_blank">һѿ</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>