Homemade Calculators (0)

Source: Internet
Author: User
Recently interested in the compiler, intends to write a Python interpreter in accordance with the idea of the book, but too much detail and the compilation process is not aware of the slow progress.     Just now think of the SICP in the past to see the implementation of the calculator, think about whether you can use a simple arithmetic to get started, so with this calculator. Due to the author's level problem, there are many loopholes in the implementation method and code design.      Write the text is also to be able to organize ideas, check gaps, at the same time or to meet the same problem of children's shoes to provide a thought bar.     Progress: This calculator is now implemented into the syntax tree stage, error handling has not been understood. Code schema:
    • Scanner: Using the state machine, refer to the Blue Big article http://frozengene.github.io/unfortunately did not finish
    • Parser: Using recursive descent
      • Reference to the Vczh of the http://www.cnblogs.com/geniusvczh/specific article unexpectedly can not find.
      • and assembling the head of the http://www.cnblogs.com/Ninputer/archive/2011/06/21/2085527.html wish to recover soon
    • Experssion: Simply traverse the tree to get the calculation results
    • GitHub Address: Https://github.com/ninovt9/NINO_CALCULATOR.git
Next article first write scanner

Homemade Calculators (0)

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.