COMPILER DESIGN

SEMANTIC ANALYSIS

ATTRIBUTE GRAMMARS

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which is not true about syntax and semantic parts of a computer language?
A
Syntax is generally checked by the programmer.
B
Semantics is the responsibility of the programmer
C
Semantics is checked mechanically by a computer.
D
Both (b) and (c)
Explanation: 

Detailed explanation-1: -1. Which is not true about syntax and semantic parts of a computer language? Explanation: Both in terms of semantics is not true.

Detailed explanation-2: -The syntax of a programming language describes which strings of of characters comprise a valid program. The semantics of a programming language describes what syntactically valid programs mean, what they do. In the larger world of linguistics, syntax is about the form of language, semantics about meaning.

Detailed explanation-3: -Put simply, syntax refers to grammar, while semantics refers to meaning. Syntax is the set of rules needed to ensure a sentence is grammatically correct; semantics is how one’s lexicon, grammatical structure, tone, and other elements of a sentence coalesce to communicate its meaning.

Detailed explanation-4: -A sentence in a programming language is an expression or a program whose form is dictated by the grammar (or rules) of the programming language. Syntax is the term that we commonly use for the grammar. Semantics refers to the meaning that a sentence has.

There is 1 question to complete.