简体   繁体   English

解析和编译的区别

[英]the difference between parsing and compiling

I am new to the world of the assembly and would like to know what parsing means in this context and the difference between parsing and compiling.我是汇编世界的新手,想知道在这种情况下解析意味着什么以及解析和编译之间的区别。 Thank you.谢谢你。

A recognizer does verify that a sequence of symbols belongs or not to a given language.识别器确实验证符号序列是否属于给定语言。 With the assumption that it terminates, it will terminate with a Boolean value: true (belongs) or false (does not belong).假设它终止,它将以 Boolean 值终止:true(属于)或 false(不属于)。

A parser is a recognizer that also outputs the derivation steps that one can use to build a syntax tree .解析器是一种识别器,它还输出可用于构建语法树推导步骤

Parsing is the process that the parser performs.解析是解析器执行的过程。

A translator does translate from one language to another.翻译人员确实一种语言翻译成另一种语言。

A compiler is a translator that translates from a high-level language to a low-level language.编译器是将高级语言翻译成低级语言的翻译器。

Compiling is the process that the compiler performs.编译是编译器执行的过程。

A decompiler is a translator that translates from a low-level language to a high-level language.反编译器是将低级语言翻译高级语言的翻译器。

An assembly language is low-level language that uses mnemonics that are very close to a given machine language .汇编语言是使用非常接近给定机器语言的助记符的低级语言 It is the "human friendly" version of the machine language, often with some extras like comments.它是机器语言的“人性化”版本,通常带有一些附加功能,例如注释。

A machine language is the language that is used to write machine code and that will be executed by the hardware.机器语言是用于编写机器代码并将由硬件执行的语言。 For example, the Central Processor Unit (CPU).例如,中央处理器单元 (CPU)。

It seems to me that its more correct to say that the assembly language is compiled by an assembler to produce a machine code written in a machine language.在我看来,说汇编语言由汇编程序编译以产生用机器语言编写的机器代码更正确。 The term assembled is also used in this case.在这种情况下也使用术语组装 I write compiled , because, the assembly languages express not exactly the machine language, but have extras, that I think is somehow "higher" level compared to the machine language.我写编译,因为汇编语言不完全表达机器语言,但有额外的东西,我认为与机器语言相比,它在某种程度上是“更高”的水平。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM