正在加载图片...
Semantic analysis Parsing only verifies that the program consists of tokens arranged in a syntactically-valid combination, we now move on to semantic analysis, where we delve deeper to check whether they form a sensible set of instructions in the programming language For a program to be semantically correct, all variables functions, classes, etc are properly defined expressions and variables are used in ways that respect the type system, access control isnt violated, and so on Semantic analysis is the next-to-last phase of the front end and the compilers last chance to weed out incorrect programs We need to ensure the program is well-formed enough to continue on to the next phase where we generate codeSemantic analysis Parsing only verifies that the program consists of tokens arranged in a syntactically-valid combination, we now move on to semantic analysis, where we delve deeper to check whether they form a sensible set of instructions in the programming language. For a program to be semantically correct, all variables, functions, classes, etc. are properly defined, expressions and variables are used in ways that respect the type system, access control isn’t violated, and so on. Semantic analysis is the next-to-last phase of the front end and the compiler’s last chance to weed out incorrect programs. We need to ensure the program is well-formed enough to continue on to the next phase where we generate code
向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有