Syntactic analysis Flashcards
what is the abstract syntax tree
it is a parse tree containing where we retain only the set terminals
what is a typing system?
it ‘is a set of rules that allows you to define the type of an object
what is the relation between typing and abstract syntax tree?
consists of adding labels to the parse tree, in order to define the type like
int + int => int
what are the grammars with sematic actions
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
Reverse police notation(related to the grammars with semantic actions )
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
attributed grammar
- 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
control flow graph
is a graph where each node is a block of the statement, and each path is a possible execution