preview

What Is Static Semantics

Decent Essays

2.1.3 Semantics Semantics describe the behaviour that a computer follows when executing a program in the language. We could disclose this behaviour by explaining the relationship between the input and output of a program or a step-by-step explanation of how a program will be implemented or executed on a real or abstract machine. Use of Semantics • For designing, implementation, and for better understanding. • Program correctness • Program equivalence • Compiler correctness • Automatic generation of interpreter Semantics of programming languages is divided into two levels: Static Semantics: In programming languages, static semantic is indirectly linked to the meaning of the program, during the time of execution. Static semantic rules state the type of constraints. It is named because of the analysis, which required to check these specifications and can be fixed at the time of compiling. One method of describing a static semantics is an attribute grammar which it is designed by Knuth in the year 1968a. Attribute grammar is a formal approach of static semantics for checking and describing the correctness of semantic rules in a program. The main objective of the static semantics is to detect programs that are syntactically correct, but it will give errors during the time of execution. Dynamic Semantics: In programming languages, a semantic is used for …show more content…

String of a language is known as Sentences or Statements. Syntax rules of the language specifies the strings of characters from the language alphabet. The example of a natural language has a large and complex collection of rules for specifying the syntax. While comparing with the programming languages are syntactically very simple. The Formal descriptions of the syntax in programming languages are very simple to achieve and it does not include descriptions of lowest-level syntactic units. These small units are known as

Get Access