TC-3 Code to Write
See The src/ast Directory, The src/bind Directory and Scoped Map.
- lib/misc/scoped-map.*
Complete the class template
misc::scoped_mapinlib/misc/scoped-map.hhandlib/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.hhdefine options than can be used with tc.tasks.ccis 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 thelibbind.- What should be added?
Tasks macros for
bindings-compute,bindings-displayandboundshould 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_setto be able to set a reference to their definition, here aFunctionDec.- src/ast/pretty-printer.*
Implement
--bindings-displaysupport 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
Bindervisitor. The binding pass applies to variables, functions and types. Most of the assignment is here…- 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
--renameis helpful to write a test suite for TC-3.
- src/object/binder.* (Optional)
…and here.
object::Binderinherits frombind::Binderso as to factor common parts.- src/ast/escapable.* src/escapes/* (Optional)
escapes::EscapesVisitormust mark the escaped variables (nested & used).bind::Binderpass is required to use the definition sites. See TC-E, Computing the Escaping Variables.