1 AST Node Annotations
2 ====================
3
4 These annotations are defined in the revised compiler.ast classes.
5
6 Deduction Results
7 -----------------
8
9 _access_type ("constant", "static", "positioned", "instance")
10 defines the kind of access involved for a particular node
11 and determines which of the following annotations will be
12 employed
13 _value_deduced (_access_type is "constant")
14 defines a specific result associated with an attribute
15 access during deduction and based on inspection results
16 _attr_deduced (_access_type is "static" or "instance")
17 defines an attribute result according to deduction based
18 on inspection results, with the accessor being the parent
19 defined in this object for static attributes
20 _position_deduced (_access_type is "positioned")
21 defines a common position employed by all deduced
22 attributes for an access operation which is relative to
23 the accessor evaluated at run time
24 _set_context indicates the deduced effect on the context in an access
25 operation, whether the context would be replaced
26 unconditionally or conditionally
27
28 _attrs_deduced_from_usage
29 _attrs_deduced
30 provided as additional annotations more suitable for
31 report generation than code generation, since they
32 describe a range of deduced attributes for a given node,
33 but such ranges may not lend themselves to the generation
34 of optimised code
35
36 Evaluation Results
37 ------------------
38
39 _attr (may identify static attributes for classes and modules,
40 is otherwise given as a general instance)
41 notes the result associated with an attribute access
42 operation during inspection; this may be a general
43 instance providing no specific information about the
44 nature of an attribute
45 _expr records the result of evaluating an expression used in an
46 attribute access operation
47
48 Attribute Users
49 ---------------
50
51 _attrtypes defines types deduced either from combined attribute usage
52 details (for users)
53
54 Attribute Contributors
55 ----------------------
56
57 _attrnames defines a dictionary mapping local names to sets of
58 attribute names found to be used with those names in a
59 branch
60 _attrbranches indicates the immediate contributors to attribute usage
61 known to a node
62 _attrcontributors defines nodes contributing to combined attribute usage known
63 to a node
64 _attrcombined defines a dictionary mapping local names to sets of
65 attribute names found to be used with those names for the
66 entire lifetime of a particular attribute user
67 _attrmerged defines a dictionary mapping local names to sets of
68 attribute names merging combined observations with locally
69 applicable observations, indicating usage specific to a
70 region of the code
71 _attrspecifictypes defines specific types from merged attribute usage details
72 (for non-user nodes)
73 _attrdefs defines definition-related users which consume usage details
74 from the node
75
76 Attribute Accessors
77 -------------------
78
79 _attrusers defines a dictionary mapping local names to sets of nodes
80 defining those names
81 _username indicates the name of the attribute user involved in an
82 access operation
83
84 Name Accessors
85 --------------
86
87 _scope set as "constant", "local", "global" or "builtins"
88
89 Program Units
90 -------------
91
92 unit refers to a micropython Class, Function or Module instance