TC-3 Code to Write
See The src/ast Directory, The src/bind Directory and Scoped Map.
- lib/misc/scoped-map.hxx
Complete the class template
misc::scoped_map
inlib/misc/scoped-map.hh
andlib/misc/scoped-map.hxx
. See scoped_map for more details.- src/bind/tasks.*
- What’s a Task:
A task is the name of tc’s options. Macros used in tasks.hh define options than can be used with tc. tasks.cc is the file containing all functions needed in macros. More information about how they are used and their implementation can be found here: The src/task Directory. They would call the function of the libbind.
- What should be added?
Tasks macros for bindings-compute, bindings-display and bound should be added in tasks.hh. Look at how the tasks are implemented for escaping.
- src/bind/libbind.cc
Create the function that will call the binder. Write the tasks,
libbind.*
etc.- src/ast
Some constructs “using” an identifier, such as
CallExp
, have been augmented withdef_
. Implementdef_get
, anddef_set
to be able to set a reference to their definition, here aFunctionDec
.- src/ast/pretty-printer.*
Implement
--bindings-display
support in thePrettyPrinter
. You must strictly follow the format specified at TC-3 Samples when displaying binding addresses.In the ast you have to add definition sites for the binding, and you have to display them in the PrettyPrinter.
- src/bind/binder.*
In the Binder, you have to implement the
Binder
visitor. The binding pass applies to variables, functions and types. Most of the assignment is here…- src/object/binder.* (Optional)
…and here.
object::Binder
inherits frombind::Binder
so as to factor common parts.- src/bind/renamer.*
Implement renaming to unique identifiers. TC-R is a core assignment. Once TC-3 is completed, implementing TC-R is straightforward, see TC-R, Unique Identifiers. Note that
--rename
is helpful to write a test suite for TC-3.