Syntactic analysis Flashcards

1
Q

what is the abstract syntax tree

A

it is a parse tree containing where we retain only the set terminals

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

what is a typing system?

A

it ‘is a set of rules that allows you to define the type of an object

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

what is the relation between typing and abstract syntax tree?

A

consists of adding labels to the parse tree, in order to define the type like
int + int => int

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

what are the grammars with sematic actions

A

That consists of inserting semantics into the CFG
such that :

E–> T { print(“+”)} E
this defines that this action should be performed after T has been read and before E to be read

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

Reverse police notation(related to the grammars with semantic actions )

A

it consists of :
in order to count the sum a + b then
what we do is ab+ the operation in the end of the stack

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

attributed grammar

A
  • adding a label to each node of the parse tree
    -and adjusting the grammar to count the values
    the result of the values can be :
    –> inherited: from parent and brother
    –> synthesized: relies on the sons of the node
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

control flow graph

A

is a graph where each node is a block of the statement, and each path is a possible execution

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