Syntax and Semantics
Syntax and Semantics
And
Semantic
SYNTAX:
A set of strict grammar rules,
symbols, and special words
used to construct a computer
program.
There are syntax rules
(grammar: how valid instructions
are written, what combinations of
symbols can be used)
Cont..
Syntax is the grammar of the
language, that is the rules for
constructing valid statements
in that language.
x * y = c; invalid
y = con; valid
const int x : 10; invalid
int x: a = b % c; invalid
ALGORITHM