SDT
is a complementary notation to SDD. All applications of SDD can be implemented using
SDT. SDT is a context-free grammar with program fragments called semantic actions
embedded within production bodies.
Any
SDT can be implemented by first building a parse tree and then performing the actions
in a left-to-right depth-first order i.e. during a pre-order traversal.
Typically SDT's are implemented during parsing without building parse tree.
During parsing, an action in a production body is executed as soon as all the
grammar symbols to the left of action have been matched.
SDT's
that can be implemented during parsing can be characterized by introducing distinct
marker nonterminals in place of each
embedded action. Each marker M has only one
production M _ _. If
grammar with marker nonterminals can be parsed by a given method, then the SDT
can be implemented during parsing.
0 comments