The syntax analyzer of this version is generated by the tool YACC and its source file is Lua. Stx. This is not my focus. I skipped it.
The end of this section is a bit cool, just a few words.
The history of YACC is not mentioned. The emergence of YACC tools reduces the complexity of programming language analysis. This is why many small languages appeared in the Unix world.
Before the syntax is finalized, tools such as YACC can quickly verify their ideas and create a program prototype. When the syntax is stable, you can write the syntax analysis part to improve the customization of the program and the efficiency of running the program. For example, Lua does this. This does not rule out that Lua's syntax is more refined. Due to its small syntax design and orthogonal design, it reduces the difficulty of handwriting analyzer in a certain program. The main reason for handwriting analyzer is to improve efficiency. Otherwise, it is not difficult for people who have received compilation principles to write a analyzer. In the case that efficiency and robustness are not particularly required, this is basically equivalent to a large job in the Compilation Principle Course.
In other words, the syntax is only for display. The reason why the script appears is to lower the programming threshold. If the syntax of a language is like lisp, it is directly the pattern of the abstract syntax tree, which saves the parsing step. It saves a lot of trouble to execute it. However, it is clear that a program like this abstract syntax tree style is not enjoyed and can be easily accepted by everyone.
I will not talk more about it.
----------------------------------------
So far:
> What are the methods called in the do_dump method?
----------------------------------------
Lua2.4 program analysis parser. c