summaryrefslogtreecommitdiff
path: root/tiger-compiler/src/assert/tasks.hh
blob: 7f062de55f206a03fceb2190cb834c6c28a5dd90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/**
 ** \file assert/tasks.hh
 ** \brief Assert module related tasks.
 */

#pragma once

#include <task/libtask.hh>

// The tasks of the assert module
namespace assert::tasks
{
  TASK_GROUP("Assert");

  // Enable assert extensions.
  BOOLEAN_TASK_DECLARE("assert",
                       "enable assert extensions",
                       enable_assert_extensions_p,
                       "");

  // Parse the input file, allowing assertions.
  TASK_DECLARE("assert-parse",
               "parse a file, allowing assertions",
               parse,
               "assert parse");

  // Bind the parsed file, allowing assertions.
  TASK_DECLARE("assert-bindings-compute",
               "bind the name uses to their definitions, allowing assertions",
               bind,
               "assert-parse");

  // Check for type violation, allowing assertions.
  TASK_DECLARE("assert-types-compute",
               "check for type violations, allowing assertions",
               types_compute,
               "assert-bindings-compute");

  // Perform a renaming, before desugaring assertions.
  TASK_DECLARE("assert-rename",
               "rename identifiers to unique names, allowing assertions",
               rename,
               "assert-bindings-compute");

  // Remove syntactic sugar from the Ast.
  TASK_DECLARE("assert-desugar",
               "remove assertions constructs from the program",
               desugar,
               "assert-rename assert-types-compute");

  // Remove syntactic sugar from the Ast without recomputing
  // bindings nor types.
  TASK_DECLARE("raw-assert-desugar",
               "remove assertions constructs from the program "
               "without recomputing bindings nor types",
               raw_desugar,
               "assert-rename assert-types-compute");

} // namespace assert::tasks