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