{"id":13,"date":"2014-10-05T15:44:40","date_gmt":"2014-10-05T15:44:40","guid":{"rendered":"http:\/\/emacslisp.com\/?p=13"},"modified":"2014-10-05T15:44:40","modified_gmt":"2014-10-05T15:44:40","slug":"preprocess_new-at-tccpp-c3199-tcc%e7%9a%84%e9%a2%84%e5%a4%84%e7%90%86","status":"publish","type":"post","link":"http:\/\/emacslisp.com\/?p=13","title":{"rendered":"preprocess_new () at tccpp.c:3199 tcc\u7684\u9884\u5904\u7406"},"content":{"rendered":"<p>\/\/ \u8fd9\u4e9b\u51fd\u6570\u7b97\u662f\u6bd4\u8f83\u57fa\u672c\u7684\u4e86\uff0c\u770b\u770b\u5c31\u660e\u767d<\/p>\n<p>static inline int is_space(int ch)<br \/>\n{<br \/>\nreturn ch == &#8216; &#8216; || ch == &#8216;\\t&#8217; || ch == &#8216;\\v&#8217; || ch == &#8216;\\f&#8217; || ch == &#8216;\\r&#8217;;<br \/>\n}<br \/>\nstatic inline int isid(int c)<br \/>\n{<br \/>\nreturn (c &gt;= &#8216;a&#8217; &amp;&amp; c &lt;= &#8216;z&#8217;) || (c &gt;= &#8216;A&#8217; &amp;&amp; c &lt;= &#8216;Z&#8217;) || c == &#8216;_&#8217;;<br \/>\n}<br \/>\nstatic inline int isnum(int c)<br \/>\n{<br \/>\nreturn c &gt;= &#8216;0&#8217; &amp;&amp; c &lt;= &#8216;9&#8217;;<br \/>\n}<br \/>\nstatic inline int isoct(int c)<br \/>\n{<br \/>\nreturn c &gt;= &#8216;0&#8217; &amp;&amp; c &lt;= &#8216;7&#8217;;<br \/>\n}<br \/>\nstatic inline int toup(int c)<br \/>\n{<br \/>\nreturn (c &gt;= &#8216;a&#8217; &amp;&amp; c &lt;= &#8216;z&#8217;) ? c &#8211; &#8216;a&#8217; + &#8216;A&#8217; : c;<br \/>\n}<\/p>\n<p>preprocess_new () at tccpp.c:3199<\/p>\n<p>\u521d\u59cb\u5316isidnum\u8868<\/p>\n<p>\/* init isid table *\/<br \/>\nfor(i=CH_EOF;i&lt;256;i++)<br \/>\nisidnum_table[i-CH_EOF] = isid(i) || isnum(i);<\/p>\n<p>\/\/ \u8be5\u51fd\u6570\u5269\u4e0b\u51e0\u884c\u628atcc\u7684\u5173\u952e\u5b57\u63d2\u5165 ptable (\u4ee3\u7801\u5982\u4e0b\uff09<\/p>\n<p>[code]<\/p>\n<p>static TokenSym *tok_alloc_new(TokenSym **pts, const char *str, int len)<br \/>\n{<br \/>\nTokenSym *ts, **ptable;<br \/>\n[\/code]<\/p>\n<p>[code]<\/p>\n<p>\/\/\u5728\u5934\u6587\u4ef6tcctok.h\u5b9a\u4e49\u4e86tcc\u7684\u5173\u952e\u5b57<\/p>\n<p>static const char tcc_keywords[] =<br \/>\n#define DEF(id, str) str &#8220;\\0&#8221;<br \/>\n#include &#8220;tcctok.h&#8221;<br \/>\n#undef DEF<br \/>\n;<br \/>\n[\/code]<\/p>\n<p>ST_FUNC TokenSym *tok_alloc(const char *str, int len)<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\/\/ \u8fd9\u4e9b\u51fd\u6570\u7b97\u662f\u6bd4\u8f83\u57fa\u672c\u7684\u4e86\uff0c\u770b\u770b\u5c31\u660e\u767d static inline int is_space(int ch) { return ch == &#8216; &#8216; || ch == &#8216;\\t&#8217; || ch == &#8216;\\v&#8217; || ch == &#8216;\\f&#8217; || ch == &#8216;\\r&#8217;; } static inline int isid(int c) { return (c &gt;= &#8216;a&#8217; &amp;&amp; c &lt;= &#8216;z&#8217;) || (c &gt;= &#8216;A&#8217; &amp;&amp; c &lt;= &#8216;Z&#8217;) || c == [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-13","post","type-post","status-publish","format-standard","hentry","category-tcc-"],"_links":{"self":[{"href":"http:\/\/emacslisp.com\/index.php?rest_route=\/wp\/v2\/posts\/13","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/emacslisp.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/emacslisp.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/emacslisp.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/emacslisp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=13"}],"version-history":[{"count":1,"href":"http:\/\/emacslisp.com\/index.php?rest_route=\/wp\/v2\/posts\/13\/revisions"}],"predecessor-version":[{"id":14,"href":"http:\/\/emacslisp.com\/index.php?rest_route=\/wp\/v2\/posts\/13\/revisions\/14"}],"wp:attachment":[{"href":"http:\/\/emacslisp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=13"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/emacslisp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=13"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/emacslisp.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=13"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}