Talk about how to make a compiler?

zhaozj2021-02-08  192

Here, there is no complex compilation principle, I just want to make some instructions on the Basic interpreter I have written, maybe I can inspire you to think about such software.

First step. Less method analysis

Simply put in extracting words from the source file, installing into a container (such as the carray in the Vector, MFC). For example, there is such a program if a> b Then A = B So the extraction word is "IF", " A ","> "," b "," life "," a "," = "," b "put them into a container to prepare for future operation.

Step 2. Run

Let's run it directly, no longer doing a complex analysis work.

It is also very simple to run. First, I will analyze the words in a word, Inti-I = 0; I 转载请注明原文地址:https://www.9cbs.com/read-3191.html


New Post(0)