Parse Too complex in xxxx.cpp --------source insight
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之后,上面示例的兩個左大括號就只有一個有效,代碼可以被正確解析了。
但是我試了下,根本沒有解決我的問題
后來發(fā)現是初始化列表長度的問題,如果初始化類別的行數超過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
總結
以上是生活随笔為你收集整理的Parse Too complex in xxxx.cpp --------source insight的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Unable to create '/m
- 下一篇: git删除本地仓库