Lua2.4 program analysis parser. c

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.