Lesson 05 Flashcards

1
Q

What is syntax directed translation ?

A

is done by attaching rules or program fragments to productions in a grammar

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Attribute ?

A

any quantity associated with a programming construct

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

translation scheme ?

A

a notation for attaching program fragments of a grammar

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

program fragments

A

are executed when the production is used during syntax analysis

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Examples of attributes are

A

Data types of expressions , Number of instructions in the generated code,
The location of the first instruction in the generated code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

when we say an attribute is synthesized ?

A

if its value at a parse-tree node N is determined from attribute values at the children of N and at N itself.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Tree traversals

A

are used for describing attribute evaluation and for specifying the execution of code fragments in a translation scheme.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

semantic actions.

A

Program fragments embedded within production bodies

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

translation scheme implementation must ensure

A

Semantic actions are performed in the order they would appear during a postorder traversal of a parse tree.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

preorder traversal action

A

is done when we first visit a node

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

postorder traversal action

A

is done just before we leave a node for the last time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly