Beruflich Dokumente
Kultur Dokumente
Answers:
2. The four criteria for evaluating the syntax of programming languages are:
readability, writability, ease of translation and lack of ambiguity.
In terms of readability, C is of course much less readable compared to
Pascal. The use of braces enclose group of statements instead of begin and end in
Pascal contributed to its being less readable compared to Pascal.
In terms of writability, however, C is better compared to Pascal and
COBOL. The short keywords being used in the language and the use of braces to
enclose group of statements contribute to this.
The syntax of C is quite small. Hence, it is very easy to write a compiler
for it. At least it is easier to write a compiler compared to Pascal or COBOL and
much easier compared to Algol-68.
The language C is one of the languages whose syntax is unambiguous.
You cannot find any ambiguity in the syntax of C.
3. Syntactic Elements of C.
4. An ambiguous grammar is the one that produces mare than one parse tree (or
derivation) for at least one string in the language.
It is important for he language to be unambiguous so that there is only one
interpretation for each program in the language.