chapter 3. concepts of programming languages 10th ed. preview question

13 Mar

1. Define syntax and semantics.
-syntax : the set of rules that define the combinations of symbols
that are considered to be correctly structured programs in that language.
-semantic : the meaning of languages, as opposed to their form (syntax).

3. Describe the operation of a general language generator.
A general language generator is a device that can be used to
generate the sentences of the language.

4. Describe the operation of a general language recognizer.
A general language recognizer is a recognition device
capable of reading strings of characters from the alphabet.

5. What is the difference between a sentence and a sentential form?
A sentence is a sentential form that has only terminal symbols.
A sentential form is every string of symbols in the derivation.

8. Distinguish between static and dynamic semantics.
Static semantics is more syntax rather semantics
and is only indirectly related to the meaning of the programs during execution.
Dynamic semantics is describing the meaning of the programs.

23. On what branch of mathematics is axiomatic semantics based?
mathematics logic.

24. On what branch of mathematics is denotational semantics based?
mathematical objects (called denotations).

7. What three extensions are common to most EBNFs?
-The first of these denotes an optional part of an RHS, which is delimited by
-The second extension is the use of braces in an RHS to indicate that the
enclosed part can be repeated indefinitely or left out altogether.
-The third common extension deals with multiple-choice options.

10. What is the difference between a synthesized and an inherited attribute?
The synthesized attributes are the result of the attribute evaluation rules,
and may also use the values of the inherited attributes.
The inherited attributes are passed down from parent nodes.

6. Define a left-recursive grammar rule.
A grammar is left-recursive if we can find some non-terminal A which will eventually derive a sentential form with itself as the left-symbol.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: