Software Engineering Learning Elementary School four mixed operation the design idea and thoughts of Version 1.00

Source: Internet
Author: User

For the primary four mixed operation of the software design, through the analysis of design requirements, I think for this software in the future to facilitate the expansion of functionality, you can use the last semester of the "compilation Principle" in the lesson of the LL1 grammar analysis and guidance translation algorithm to achieve. The benefits of doing this include the following points:

1. Because LL1 guidance translation is a mature and reliable technology, and its recursive descent algorithm is easy to adapt to the calculation algorithm;

2. We have a systematic approach to obtain more complex expressions of the LL1 grammar, it is easy to generate a rich form of formulas;

3. Due to the problem of operation priority in four mixed operation, it is very convenient to implement the function of computation expression by using LL1 Analyzer.

4. When the user needs to give a problem solving process rather than just an answer, the LL1 Analyzer can provide a correct process of solving the problem (can be LL1-guided translation of the generation of four to rewrite the calculation process).

Of course, there are some problems that need to be solved in the implementation, such as controlling the length of the calculation, avoiding redundant parentheses in the calculation, avoiding the calculation of the non-operator, avoiding meaningless formulas and so on.

At the moment, my Version 1.00 has implemented the ability to use the rewritten LL1 parser to generate a formula and get the answer at the same time, but it also has some of these problems. After all, the 1.00 version of the program is very rough, then I will analyze and resolve one by one, and then release Version 1.01.

Mixed operation Generator 1.00 debug based on LL1 grammar:

Software Engineering Learning Elementary School four mixed operation the design idea and thoughts of Version 1.00

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.