Skip to main content

Introduce Syntax, Semantic and Runtime errors and apply them.

 .

Syntax

Syntax refers to the rules that govern the formation of grammatically correct sentences. Similarly, in computer programming, syntax refers to the rules that govern the structure of the symbols, words and punctuation found in programming language. 

Syntax of a programming language refers to grammatical rules that controls the way in which words, symbols, expression and statements may be formed and combined. The rules that tell us whether a string is a valid program or not, are called the 'syntax' of the language. Let's take an example of English language. The combination of "Subject + Verb + Object" forms a valid English sentence. This rule defines whether a sentence is grammatically correct or not. Different Programming language have some common or different syntax like natural language do.


Semantics

Semantics are the rules that control the meaning. In case of programming language it is defined in terms of what happens when the program is executed. The rules that give meaning to programs are called the 'semantics' of the programming language. The semantics of programming language are much herder to specify than its syntax. No complete satisfactory method for specifying semantics for a programming language has been found.
Semantics is the meaning of a word or phrase. Words have a specific meaning when they are used in a sentence and this meaning can be determined by the context in which they are used. For example, the word "date" can have a specific meaning when used as the subject of a sentence, or it can have a general meaning when used as the object of a sentence.

Runtime Error




Home


Comments

Popular posts from this blog

BCA mathematics -I (Unit I Set)

 .

BCA Mathematics -I (Unit I Complex Number)

 .

BCA Mathematics -I (Unit I Natural Number)

.