Isp Lesson 3 Share
Isp Lesson 3 Share
NKANNAN
SYNTAX AND SEMANTICS
• Programming Language Syntax and Semantics
• Programming languages are the foundation of software
development, enabling developers to write instructions that
computers can execute. Two fundamental aspects of any
programming language are its syntax and semantics.
Understanding these concepts is crucial for writing correct and
efficient code.
SYNTAX AND SEMANTICS
• SYNTAX:
• Syntax refers to the set of rules that define the structure of a
programming language. It dictates how programs are written,
including the arrangement of symbols, keywords, and
punctuation. Syntax is like the grammar of a programming
language—it ensures that code is written in a way that the
compiler or interpreter can understand.
SYNTAX AND SEMANTICS
• Key Characteristics of Syntax:
• Rules for writing code: Syntax defines how statements,
expressions, and declarations are formed.
• Symbols and punctuation: Syntax includes the use of
braces {}, parentheses (), semicolons ;, and other
symbols.
• Keywords: Reserved words like if, else, for, and while
are part of the syntax.
SYNTAX AND SEMANTICS
• Example of Syntax: