Syntax and Semantics
Syntax and Semantics
Languages in General
• All languages have a set of symbols, rules for constructing compound constructions
out of atomic constructions and meaning assigned to the significant units.
– E.g., the letter ‘A’ is part of English, buy not part of Hindi.
– E.g., English is a Subject-Verb-Object language, where Arabic is Subject-
Object-Verb language.
– E.g., ‘snow’ means snow in English, but ‘schnee’ means snow in German.
• Syntax :The form or structure of the expressions, statements, and program units. It is the
grammar of the language.
• Semantics: The meaning of significant parts(expressions, statements, and program
units.
Comparison Chart
BASIS FOR COMPARISON SYNTAX SEMANTICS
b
a = b + const
Syntax Analysis