Semantic Analysis Flashcards

1
Q

What is the difference between syntax and semantics?

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

What is the difference between static semantics and dynamic semantics

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

Semantic analysis is done via

A

Annotations on a parse tree called ATTRIBUTE GRAMMARS

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

What is more precise? A syntax tree or a parse tree?

A

A parse tree

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

Does dynamic checking increase or decrease speed?

A

Decrease

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

What is static analysis?

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

What is attribute grammar

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

Examine the following attrivute grammar:

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

Examine the following annotation of a parse tree:

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

What is a synthesized attribute?

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

What is an S-attributed grammar?

A

all attributes are synthesized

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

What are inherited attributes?

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

Examine the following example for inherited attribute grammar:

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

Examine the following terms:

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

A static scheme is

A

Based on the structure of the grammar. O(n)

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

The simplest static scheme is

A

S-attributed grammar

17
Q

What is an L-attributed grammar?

A
18
Q

_-attribued implies _-attributed, but not vice versa

A

S-attributed implies L-attributed (but not vice versa)

19
Q

S-attribued and L-attributed are paired well with…

A
20
Q

What is a one-pass compiler?

A
21
Q

What is a Multi-pass compiler?

A
22
Q

Examine the following syntax tree construction for S-attributed grammar

A
23
Q

Examine the L-attributed syntax tree construction:

A
24
Q

The automatic tools for the following:

CFG

Attribute grammar

are…

A
25
Q

In LL and LR parsing, can action routines (attributes) be embedded in arbitrary places in the RHS?

A

LL: yes

LR: no