gpt4 book ai didi

c - C 语言翻译的 8 个阶段海报

转载 作者:太空狗 更新时间:2023-10-29 16:30:09 24 4
gpt4 key购买 nike

有没有人引用海报/一页 pdf 或类似的 C 语言翻译八个阶段的列表(第一个是三字母翻译)?我想在我的电脑旁边的墙上挂一张打印品。

更新:很抱歉忘记指定。我对 C90 很感兴趣(尽管 C99 可能非常接近,pmg 的回答中提到的 _Pragma 是特定于 C99 的,我想避免这种情况)。

最佳答案

获胜的 ASCII 艺术:

                       ANSI C translation phases
=========================

+-------------------------------------------------+
| map physical characters to source character set |
| replace line terminators with newlines |
| decode trigraph sequences |
+-------------------------------------------------+
|
V
+---------------------------------------+
| join lines along trailing backslashes |
+---------------------------------------+
|
V
+-------------------------------------------------------------+
| decompose into preprocessing tokens and whitespace/comments |
| strip comments |
| retain newlines |
+-------------------------------------------------------------+
|
V
+------------------------------------------------+
| execute preprocessing directives/invoke macros |
| process included files |
+------------------------------------------------+
|
V
+----------------------------------------------------------------+
| decode escape sequences in character constants/string literals |
+----------------------------------------------------------------+
|
V
+--------------------------------------+
| concatenate adjacent string literals |
+--------------------------------------+
|
V
+------------------------------------------+
| convert preprocessing tokens to C tokens |
| analyze and translate tokens |
+------------------------------------------+
|
V
+-----------------------------+
| resolve external references |
| link libraries |
| build program image |
+-----------------------------+

关于c - C 语言翻译的 8 个阶段海报,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1476892/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com