Mathematical modeling software of semester summary--compiling principle

Source: Internet
Author: User

This semester we also learned the principles of compiling knowledge, summed up, a total of several steps:
1. Lexical Analysis: The task is to convert the source program into an internal format;
2. Grammar Analysis: The task is to determine whether the source program structure conforms to the language syntax;
3. Semantic Analysis: The task is to ensure the semantic correctness of the source program;
4. Intermediate code Generation: Converts the source program into an equivalent intermediate language code;
5. Code optimization: Optimized processing of intermediate code
6. Target code generation: translates intermediate code into machine or assembly language. The methods and algorithms used in lexical analysis are: state transition diagram and finite automaton.

Among them, we mainly study lexical analysis and grammatical analysis part.

Lexical analysis:

The characters are read in turn, the identifiers are identified according to the poor automatic state machine, and their addresses are mapped.

The picture is a poor state machine.

Syntax Analysis:

Grammar analysis is divided into top-down and bottom-up analysis methods.

The method of top-down analysis using derivation is the key to the construction of the predictive analysis table, and its weak analysis ability.

The key of using the method of the bottom-up analysis method is to establish the SLR (1) Analysis table, which is superior to the top-down analysis method.

Mathematical modeling software of semester summary--compiling principle

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.