🔵 🔵 🔵


Primary

၊၊||၊|။

Static Semantics ○|Definition|1st|20251122201720-00-⌔

Programming language - Wikipedia#Static_semantics

Static semantics

Static semantics defines restrictions on the structure of valid texts that are hard or impossible to express in standard syntactic formalisms.1 For compiled languages, static semantics essentially include those semantic rules that can be checked at compile time. Examples include checking that every identifier is declared before it is used (in languages that require such declarations) or that the labels on the arms of a case statement are distinct.2 Many important restrictions of this type, like checking that identifiers are used in the appropriate context (e.g. not adding an integer to a function name), or that subroutine calls have the appropriate number and type of arguments, can be enforced by defining them as rules in a logic called a type system. Other forms of static analyses like data flow analysis may also be part of static semantics. Programming languages such as Java and C# have definite assignment analysis, a form of data flow analysis, as part of their respective static semantics.3

Printed 2026-06-28.

(echo:: @ )

Footnotes

  1. Aaby, Anthony (2004). Introduction to Programming Languages. Archived from the original on 8 November 2012. Retrieved 29 September 2012.

  2. Michael Lee Scott, Programming language pragmatics, Edition 2, Morgan Kaufmann, 2006, ISBN 0-12-633951-1, p. 18–19

  3. Winskel, Glynn (5 February 1993). The Formal Semantics of Programming Languages: An Introduction. MIT Press. ISBN 978-0-262-73103-4.

Link to original

Secondary

• • •