gpt4 book ai didi

我们可以使用 GCC 来处理 C 项目的翻译阶段 1..5

转载 作者:太空宇宙 更新时间:2023-11-04 01:47:06 25 4
gpt4 key购买 nike

我正在尝试使用 ANSI C LexYacc解析我的 C 项目的语法。在该语法的描述中,它需要

It is assumed that translation phases 1..5 have already been completed, including preprocessing and _Pragma processing. The Lex rule for string literals will perform concatenation (translation phase 6). Transliteration of universal character names (\uHHHH or \UHHHHHHHH) must have been done by either the preprocessor or a replacement for the input() macro used by Lex (or the YY_INPUT function used by Flex) to read characters.

我如何使用 GCC 处理翻译阶段 1..5?

最佳答案

How can I use GCC to process translation phases 1..5?

最接近的 GCC 提供的是它的 -E 选项,这导致它在“预处理阶段之后”停止并将结果发送到标准输出。

GCC 的预处理阶段至少与 C 的抽象翻译模型中的翻译阶段 4 大致一致,但我无法证明 gcc -E 的输出是否完全匹配什么人们应该期待第 1-4 阶段的结果。如果是这样,那么只有当源字符集与执行字符集不同时,该结果才与您询问的结果不同并且源包含至少一个映射不同的字符那些集合。

关于我们可以使用 GCC 来处理 C 项目的翻译阶段 1..5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51700107/

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