Commit 673f1be5 authored by Pierre Brandone's avatar Pierre Brandone
Browse files

source code: add explanations on tasks

* source/source_code/project_layout/1+1.tig: Create,
* source/source_code/project_layout/src_task.rst: Here.
parent bf5c8f49
......@@ -3,5 +3,26 @@
The :code:`src/task` Directory
Namespace :code:`task`. Delivered for TC-1. A generic scheme
to handle the components of our compiler, and their dependencies. It is an implementation of the Command pattern.
Namespace :code:`task`, delivered for TC-1.
Tasks are what handles the execution of components of our compiler. It is a
bridge between command-line arguments passed to `tc` and |project| modules.
In |compiler|, tasks implementation follows the Command pattern.
Tasks can be combined to create a complete execution pipeline. For example
:code:`tc --parse --ast-display --bidings-compute --ast-display 1+1.tig` will
parse the input file (TC-1 :code:`libparse`), then display its AST
(TC-2 :code:`libast`), then compute its bindings (TC-3 :code:`libbind`) and
finally re-display its AST.
However, we can also handle things smarter by allowing tasks to have
**dependencies** over other tasks: when we compute the bindings of our AST, we
expect that the input program has been parsed and put into the form of an AST.
Thus, :code:`bindings-compute` task has a dependency over :code:`parse`. When
processing tasks, the **task-register** will trigger :code:`parse` before
triggering :code:`bindings-compute`. To have more information about the
task pipeline your input is going by, you can use :code:`libtask`'s tasks.
.. command-output:: tc --task-selection --asm-compute 1+1.tig
:cwd: .
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment