3-Description of Syntax and Semantics
3-Description of Syntax and Semantics
Languages(CS F301)
Prof.R.Gururaj
BITS Pilani CS&IS Dept.
Hyderabad Campus
Description of Syntax and
Semantics (Ch.3 of T1)
BITS Pilani Prof R Gururaj
Hyderabad Campus
Introduction
Language L; Alphabet is ∑
The language Recognizer R is a device which tells a
string/sentence is in L or not.
It is not meant for enumerating strings of that Language.
- Repetitions
- Alternation
Type compatibility
Declaration of variable before it is referenced.
The static semantics of a language are only indirectly
related to the meaning of programs during the
execution, rather they have to do with the legal
format of the program. (syntax rather than semantics)
Static because these checks can be performed at compile
time itself.
Syntax object
Ex.1
Ex.2