ast::PrintVisitor
escapes::EscapesVisitor
escapes::EscapesVisitor
in
src/escapes/escapes-visitor.hh.
You are suggested to implement three additional classes:
Definition
symbol::Table
into Table <Definition>
.
Sets the escape to true.
Depth at which this object has been created.
Returns the depth associated to this
Definition
object.
VariableDefinition
Definition
. It has one additional attribute, a
VarDec &
. The method escape_set
is implemented, and when
invoked, set the escapes
flags of the corresponding
VarDec
.
FormalDefinition
Definition
. To be designed by yourself. Do not
forget that the ast
class used to register formals is used
elsewhere, and it would be a pity that your implementation makes no
difference... Be sure to write a test that verifies that your
implementation is not abused. I have one such test...
ast
escape_get
and escape_set
methods. Most
probably the code was already given, and is using const_casts;
try to use mutable
instead.
Modify the code so that each definition of an escaping variable/formal
is preceded by the comment /* escaping */ if the flag
display_escapes_p
is true. See the item “Driver” for an
example.