Lecture No. 31
Dated: 09-04-2025
The grammatical rules
which involve meanings of the words
are called semantics
meanwhile which don't are called syntactics
.
In general, the rules of a computer language
are all syntactical
and not semantical
.
A law of grammar
is just a suggestion for possible substitutions
.
Terminologies
Terminals
The symbols which cannot be replaced by other symbols.
Non Terminals
The symbols that must be replaced by other things are called non terminals
.
Productions
The grammatical rules
are often called productions
.
Context Free Grammar
It is a collection of the following
- An
alphabet
1 \(\Sigma\) ofletters
called terminals from which thestrings
1 (words
1 of thelanguage
1) are formed. - A
set
2 of symbols callednon terminals
, one of which is \(S\) which stands for "Start Here". - A finite
set
2 of productions of the form non terminal → finitestring
1 of terminals and/or non terminals.
Non Terminals are capitalized meanwhile terminals are not.
Context Free Language
A language generated by context free grammar is called context free language
.
Example
Productions
Language Defined
\(\Lambda\) has special purpose.
It is not considered a terminal. It just means that if there's a production for a non terminal such that \(N \to \Lambda\) then \(N\) can be deleted from the string
.1