Parse Too complex in xxxx.cpp --------source insight
2015-11-24 16:49
501 查看
Source Insight,某些文件出现“parse too complex”,如何解决?
查看网上的解决方案都是SI的一个很有用的功能是可以列出所有的函数名和变量名,然而在Source Insight的工程中,偶尔会遇到那么一两个文件,里面的函数名和变量名无法解析,提示“parse too complex”。难道这段程序真的复杂到SI都不认识了吗?非也。这其中的罪魁祸首就是条件预编译指令。
在一个Source Insight工程中,它里面所有的没有确定数值的宏都被认为是有效的,那么对于类似#ifdef...#else...#endif这样的分支结构,如果在#ifdef和#else这两个分支分别写一个大括号{,而在#endif之后写上大括号的另一半},而这些大括号又都是有效的话,后果显而易见:由于左半边大括号多了一个,括号不配对,导致所有后边的代码被看作是该括号内部的内容,直到文件结束。。
示例代码:
#ifdef COMPLEX
{
#else
{
#endif
}
解决办法:在Options->Preferences->Languages->Conditional Parsing的设置处,在Project Specific Conditions中设置该宏为true、false还是忽略。当设置宏COMPLEX为true或false之后,上面示例的两个左大括号就只有一个有效,代码可以被正确解析了。
但是我试了下,根本没有解决我的问题
后来发现是初始化列表长度的问题,如果初始化类别的行数超过50行,就会出现上述问题,
sdk_buyout_code_strategy::sdk_buyout_code_strategy() : str_pos_id("") , str_combine_id("") , str_<img alt="生气" src="http://static.blog.csdn.net/xheditor/xheditor_emot/default/mad.gif" />("") , str_ad_codetype_id("") , str_code("") , n_win_price("") , str<img alt="微笑" src="http://static.blog.csdn.net/xheditor/xheditor_emot/default/smile.gif" />("") , str_token("") , str_win_price("") , s_exchange_rate("") , str_en_win_price("") , str_tid("") , str_creative_id("") , str_ask_price("") , str_<img alt="害羞" src="http://static.blog.csdn.net/xheditor/xheditor_emot/default/shy.gif" />("") , str_tem_en_extend("") , str_ext_data("") , str_flu_provide_type("") , str_book_id("") , str_click_url("") , str_native_title("") , str_<img alt="吐舌头" src="http://static.blog.csdn.net/xheditor/xheditor_emot/default/tongue.gif" />("") , str_native_mainimage("") , str_native_iconimage("") , str_run_src("") , str_run_width("") , str_run_height("") , str_<img alt="奋斗" src="http://static.blog.csdn.net/xheditor/xheditor_emot/default/struggle.gif" />("") , str_winnotice_url("") , str_imp_url("") , p_materials_new(NULL) , p_material(NULL) , str_<img alt="偷笑" src="http://static.blog.csdn.net/xheditor/xheditor_emot/default/titter.gif" />("") , str_last_impurl_base64("") , str_last_impurl_escape("") , str_last_impurllist_json("") , bk_obj(NULL) , str_monitor_url("") , str_<img alt="大笑" src="http://static.blog.csdn.net/xheditor/xheditor_emot/default/laugh.gif" />("") , str_last_clkurl_base64("") , str_last_clkurllist_json("") , str_last_clkurl_escape("") , str_<img alt="难过" src="http://static.blog.csdn.net/xheditor/xheditor_emot/default/sad.gif" />("") , fea_db(NULL) , b_is_rtb(false) , str_<img alt="委屈" src="http://static.blog.csdn.net/xheditor/xheditor_emot/default/wronged.gif" />("") , n_platform(0) , ad_types_id(0) , str_refresh_time("") <span style="color:#ff0000;">, str_last_reqTrackerurl(""), str_pos_width(""), str_pos_height("")</span> { regist_replace_str(); }
把初始化列表的行数控制在50行以内,这个问题就会解决
这应该是source insight 本身的bug
相关文章推荐
- c++类的定义《一》
- C++指针详解
- C++实现进制转换(十进制转十六进制)
- OC语言的动态性
- c++ 封装socket和epoll编程
- C++ STL算法之accumulate函数
- c++数值算法
- 给VC++6.0加快捷注释和取消注释
- C++关键字
- 纸牌丰收之c++版本
- 回形遍历二维数组
- 顺序折线遍历二维数组
- c/c++ void 指针
- C++primer plus第六版课后编程练习答案3.3
- C++primer plus第六版课后编程练习答案3.2
- 【C++基础学习】类型声明
- 指针与多维数组(C++)
- C语言实现两栈空间共享
- C++primer plus第六版课后编程练习答案3.1
- 使用C++自定义Binder