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_attrs the deduced attributes involved in an access, or None;
10 details of the deductions are given in the following
11 annotations
12 _access_type ("constant", "static", "positioned", "instance",
13 "impossible")
14 defines the kind of access involved for a particular node
15 and determines which of the following annotations will be
16 employed, except for "impossible" which indicates an error
17 condition
18 _value_deduced (_access_type is "constant")
19 defines a specific result associated with an attribute
20 access during deduction and based on inspection results
21 _attr_deduced (_access_type is "static" or "instance")
22 defines an attribute result according to deduction based
23 on inspection results, with the accessor being the parent
24 defined in this object for static attributes
25 _position_deduced (_access_type is "positioned")
26 defines a common position employed by all deduced
27 attributes for an access operation which is relative to
28 the accessor evaluated at run time
29 _set_context (_access_type is "constant" or "static")
30 ("set", "cond", None)
31 indicates the deduced effect on the context in an access
32 operation, whether the context would be replaced
33 unconditionally or conditionally
34
35
36 _attrs_deduced_from_specific_usage
37 _attrs_deduced_from_usage
38 _attrs_deduced
39 provided as additional annotations more suitable for
40 report generation than code generation, since they
41 describe a range of deduced attributes for a given node,
42 but such ranges may not lend themselves to the generation
43 of optimised code
44
45 Evaluation Results
46 ------------------
47
48 _attr (may identify static attributes for classes and modules,
49 is otherwise given as a general instance)
50 notes the result associated with an attribute access
51 operation during inspection; this may be a general
52 instance providing no specific information about the
53 nature of an attribute
54 _expr records the result of evaluating an expression used in an
55 attribute access operation
56
57 Attribute Users
58 ---------------
59
60 _attrtypes defines types deduced from combined attribute usage
61 details (for users), indicating a set of (attribute,
62 value) tuples for each name
63 _values defines a name-to-value mapping for objects that may be
64 used to access attributes
65 _guard_types mapping from names to ("single", "multiple", "impossible")
66 defines the nature of any type check upon assignment of an
67 object to a name/user; an impossible guard occurs when
68 concrete type information conflicts with deduced type
69 information
70 _guards a mapping to a set of actual guard types to which the
71 assigned object must comply
72
73 Attribute Contributors
74 ----------------------
75
76 _attrnames defines a dictionary mapping local names to sets of
77 attribute names found to be used with those names in a
78 branch
79 _attrbranches indicates the immediate contributors to attribute usage
80 known to a node
81 _attrcontributors defines nodes contributing to combined attribute usage known
82 to a node (and is thus the accumulation of all contributors
83 via branches)
84 _attrdefs defines definition-related users which consume usage details
85 from the node (and is thus the accumulation of all
86 definitions affected by the node)
87 _attrcombined defines a dictionary mapping local names to sets of
88 attribute names found to be used with those names for the
89 entire lifetime of a particular attribute user
90 _attrmerged defines a dictionary mapping local names to sets of
91 attribute names merging combined observations with locally
92 applicable observations, indicating usage specific to a
93 region of the code
94 _attrspecifictypes defines specific types from merged attribute usage details
95 (for non-user nodes)
96
97 Attribute Accessors
98 -------------------
99
100 _attrusers defines a dictionary mapping local names to sets of nodes
101 defining those names
102 _username indicates the name of the attribute user involved in an
103 access operation
104
105 Name Accessors
106 --------------
107
108 _scope set as "constant", "local", "global" or "builtins"
109
110 Program Units
111 -------------
112
113 unit refers to a micropython Class, Function or Module instance