High-level structure of a simple compiler高級結構的簡單編譯器

Posted hoganben

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了High-level structure of a simple compiler高級結構的簡單編譯器相关的知识,希望对你有一定的参考价值。

 

 

 

技术图片

技术图片

 

1.lexical analysis,which analyzes the character string presented to it and divides it up into tokens that are legal members of the vocabulary of the language in which the program is written (and may produce error messages if the character string is not parseable into a string of legal tokens);

2.syntactic analysis or parsing,which processes the sequence of tokens and produces an intermediate-level representation,such as a parse  tree or a sequential intermediate code,and a symbol  table that records the identifiers used in the program  and their attibutes.

3.checking of the program for static-semantic validity(or semantic checking),which takes as input the intermediate code and symbol table and determines whether the program satisfiers  the staic-semantic properties required by the source language.

4.code generation,which transforms the intermediate code into equivalent machine code in the form of a relocatable object module or directly runnable object code.


1.詞法分析,它分析呈現給它的字符串,並將其劃分為令牌,這些令牌是編寫程序的語言詞彙的合法成員(如果字符串不能解析成字符串,則可能產生錯誤消息。一串合法代幣);

2.語法分析或解析,它處理令牌序列並產生中間級表示,例如解析樹或順序中間代碼,以及記錄程序中使用的標識符及其屬性的符號表。

3.檢查程序的靜態語義有效性(或語義檢查),它將中間代碼和符號表作為輸入,並確定程序是否滿足源語言所需的基本語義屬性。

4.代碼生成,它以可重定位目標模塊或直接可運行目標代碼的形式將中間代碼轉換為等效的機器代碼。


以上是关于High-level structure of a simple compiler高級結構的簡單編譯器的主要内容,如果未能解决你的问题,请参考以下文章

[Paper] Structure Of The Paper

Structure of a Task

Structure Of Management Information - SNMP Tutorial

Structure And Representation Of MIB Object Names - SNMP Tutorial

论文阅读|深读RolNE: Improving the Quality of Network Embedding with Structural Role Proximity

L181 The microscopic structure of a cat’s tongue helps keep its fur clean