Daily Archives: September 23, 2019

Keywords (annotated)

The above tokens (case sensitive) are reserved (in translation phases 7 and 8) for use as keywords, and shall not be used otherwise. keywords出現在phase7開始,在之前是屬於preprocessor token的identifier 上面的紅框是C99新增的keyword,_Bool定義成_Bool而不是bool,主要的原因是在C89的標準中,對於reserved identifier是用 底線+大寫字母開頭 或是 雙底線。提供了後續標準新增的關鍵字避免使用上與使用者衝突。另外在標準中提到 Implementation-defined keywords shall have the form of an identifier reserved … Continue reading

Posted in C Language | Leave a comment

Identifier (annotated)

參考: https://en.cppreference.com/w/c/language/identifier 有關C99 identifier的定義 6.4.2.1 An identifier is a sequence of nondigit characters (including the underscore _, the lowercase and uppercase Latin letters, and other characters) and digits. C99也支援universal-character-name \u or \U開頭的UCN來作為identifier的字元(可以在identifier開頭) \u接4個hex \U接8個hex 當然也考慮了上面提到的不能digit開頭的限制 Each universal character name in … Continue reading

Posted in C Language | Leave a comment