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 indicates the deduced effect on the context in an access
27 operation, whether the context would be replaced
28 unconditionally or conditionally
29
30 _attrs_deduced_from_usage
31 _attrs_deduced
32 provided as additional annotations more suitable for
33 report generation than code generation, since they
34 describe a range of deduced attributes for a given node,
35 but such ranges may not lend themselves to the generation
36 of optimised code
37
38 Evaluation Results
39 ------------------
40
41 _attr (may identify static attributes for classes and modules,
42 is otherwise given as a general instance)
43 notes the result associated with an attribute access
44 operation during inspection; this may be a general
45 instance providing no specific information about the
46 nature of an attribute
47 _expr records the result of evaluating an expression used in an
48 attribute access operation
49
50 Attribute Users
51 ---------------
52
53 _attrtypes defines types deduced either from combined attribute usage
54 details (for users)
55
56 Attribute Contributors
57 ----------------------
58
59 _attrnames defines a dictionary mapping local names to sets of
60 attribute names found to be used with those names in a
61 branch
62 _attrbranches indicates the immediate contributors to attribute usage
63 known to a node
64 _attrcontributors defines nodes contributing to combined attribute usage known
65 to a node
66 _attrcombined defines a dictionary mapping local names to sets of
67 attribute names found to be used with those names for the
68 entire lifetime of a particular attribute user
69 _attrmerged defines a dictionary mapping local names to sets of
70 attribute names merging combined observations with locally
71 applicable observations, indicating usage specific to a
72 region of the code
73 _attrspecifictypes defines specific types from merged attribute usage details
74 (for non-user nodes)
75 _attrdefs defines definition-related users which consume usage details
76 from the node
77
78 Attribute Accessors
79 -------------------
80
81 _attrusers defines a dictionary mapping local names to sets of nodes
82 defining those names
83 _username indicates the name of the attribute user involved in an
84 access operation
85
86 Name Accessors
87 --------------
88
89 _scope set as "constant", "local", "global" or "builtins"
90
91 Program Units
92 -------------
93
94 unit refers to a micropython Class, Function or Module instance