Tslang development syntax parser-a function stack processing design process

Source: Internet
Author: User
Stack processing design process for a function {int A = 50; if (a> 3) {int B = A;} else {} 1. first find the first {. at this time, the initialization stack is 0. if there is a new {, it indicates that the new stack needs to be added with the stack ++. the stack is 02. determines whether the int type is of the base type. if so, declare the variable. it can be a class or a basic type. after the judgment is passed. A new tsobject. then, take the value 50 after the equal sign. write the value in. then we can see that the; number is over. then insert it into the system's Stack Array .. defined as tslist <tsmap <name, tsobject> 3. then we find that if. then, the bool statement is used to judge the result. then calculate the number. a. in this case, you need to look up the stack. If the declared type of the string cannot be found, an error is returned. is it possible to pass. if. the next stack {. at this time, the stack ++ becomes 1. if it fails, check whether there is any else. if it's okay, everything will be done .. if yes. the stack of the else. if it is else if, the process will repeat 3. till finished. 4. then an int is found. repeat 1. stack after discovery} --; 5. if return. you need to exit the stack directly. if there is a value after return. assign a value to the return value of tsfunction. the value will be received from other places that call the function. 6. break is required only. and continue. continue continues. the break exits from the layer.

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.