COMPUTER PROGRAMMING FUNDAMENTALS
PROGRAMMING LANGUAGES
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Syntax
|
|
Lexical
|
|
Semantic
|
|
None of the above
|
Detailed explanation-1: -Syntactic Rules The rules of how to order words help the language parts make sense. Sentences often start with a subject, followed by a predicate (or just a verb in the simplest sentences) and contain an object or a complement (or both), which shows, for example, what’s being acted upon.
Detailed explanation-2: -Syntactic structure is defined by: An alphabet (what are legal characters) Lexical structure: formation of strings of legal characters into lexical units (legal tokens) Parse structure: formation of sequences of legal tokens into grammatical units (legal constructs)
Detailed explanation-3: -Syntax is the order or arrangement of words and phrases to form proper sentences. The most basic syntax follows a subject + verb + direct object formula. That is, “Jillian hit the ball.” Syntax allows us to understand that we wouldn’t write, “Hit Jillian the ball."
Detailed explanation-4: -Computer language syntax is generally distinguished into three levels: Words – the lexical level, determining how characters form tokens; Phrases – the grammar level, narrowly speaking, determining how tokens form phrases; Context – determining what objects or variables names refer to, if types are valid, etc.