在编译的哪个步骤中删除了注释? [英] In which step of compilation are comments removed?

查看:64
本文介绍了在编译的哪个步骤中删除了注释?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编译程序有几个步骤


  • 行重构

  • 词法分析

  • 预处理。

  • 语法分析

  • 语义分析

  • line reconstruction
  • lexical analysis
  • Preprocessing.
  • syntax analysis
  • semantic analysis

在第一个注释中删除了注释

Is removal of comments in the first step "line reconstruction"?

推荐答案


  • 预处理是其自身阶段,具有自己的扫描和

  • 我是一名编译器作家,而且从未听说过线重构。编译器不处理行:它们处理令牌流。您的引文特别指出,这是几种奇怪语言的特例。

  • 您已经省略了流分析,优化,寄存器分配和代码生成等功能。
  • li>
  • 在词法分析过程中,注释被忽略,而不是被删除,有时在概念上被描述为筛选和扫描,在这种情况下,您可以说评论被筛选了像空白一样。

    • Preprocessing is a phase of its own with its own scanning and parsing, which precede lexical analysis.
    • I'm a compiler writer and I've never heard of 'line reconstruction'. Compilers don't process lines: they process token streams. Your citation specifically says this is a special case for a few odd languages.
    • You've left out flow analysis, optimization, register allocation, and code generation, and a few more.
    • Comments are ignored, not removed, during lexical analysis, which is sometimes conceptually described as 'screening' and 'scanning', in which case you can say comments are screened out, like white space.
    • 这篇关于在编译的哪个步骤中删除了注释?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆