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