
Using data pack to make a compiler or interpreter: taking the C language subset C-Minus as an example'
This article introduces the concept of a compiler and the basic characteristics of mcfunction as a computer language, and demonstrates how to use data pack to create a compiler (interpreter) from a high-level language to mcfunction by implementing a complete compiler of C language subset C-Minus. At the same time, this article also provides a method for data pack to identify strings (as a lexical analyzer), a way to build an automaton (as a syntax analyzer), an intermediate language representation that can be translated into command execution, a code editor based on dialog, and an intermediate language display with highlighting, etc.





