.. # This page is generated by doc/ASTReference.py when Sphinx starts. Do not edit it. Subprogram Body ############### The diagrams below draw one box per node kind, with one port per field. The edge colours say how a link is held; they are listed in full on the :ref:`INT:AST:Fields` page. .. graphviz:: digraph { rankdir="LR" nodesep=0.1 node [shape=point width=0.06 color="#888a85"] edge [fontname="monospace" fontsize=10 minlen=3] l0a -> l0b [label="owned" color="#000000"] l1a -> l1b [label="ref" color="#3465a4" style=dashed] l2a -> l2b [label="maybe ref" color="#3465a4" style=dotted] l3a -> l3b [label="of ref" color="#3465a4" style=dashed] l4a -> l4b [label="of maybe ref" color="#3465a4" style=dotted] l5a -> l5b [label="forward ref" color="#f57900" style=dashed] l6a -> l6b [label="maybe forward ref" color="#f57900" style=dotted] l7a -> l7b [label="chain" color="#4e9a06"] l8a -> l8b [label="chain next" color="#4e9a06" style=bold] } .. _INT:AST:Function_Body: Iir_Kind_Function_Body ====================== LRM08 4.3 Subprogram bodies :: subprogram_body ::= subprogram_specification IS subprogram_declarative_part BEGIN subprogram_statement_part END [ subprogram_kind ] [ designator ] ; :: subprogram_kind ::= PROCEDURE | FUNCTION Format: ``Medium`` .. list-table:: :header-rows: 1 :widths: 30 12 18 12 28 * - Accessor - Field - Type - Access - Description * - :ref:`Parent ` - ``Field0`` - ``Iir`` - ref - Get/Set the statement in which TARGET appears. This is used to check if next/exit is in a loop. * - :ref:`Declaration_Chain ` - ``Field1`` - ``Iir`` - chain - The parse stage always puts a declaration before a body. Sem will remove the declaration if there is a forward declaration. * - :ref:`Chain ` - ``Field2`` - ``Iir`` - chain next - — * - :ref:`Impure_Depth ` - ``Field3`` - ``Iir_Int32`` - owned - Depth of the deepest impure object. * - :ref:`Attribute_Value_Chain ` - ``Field5`` - ``Iir`` - ref - Chain of attribute values for declared items. To be used with Get/Set_Value_Chain. There is no order, therefore, a new attribute value may be always prepended. * - :ref:`Sequential_Statement_Chain ` - ``Field4`` - ``Iir`` - chain - — * - :ref:`Subprogram_Specification ` - ``Field6`` - ``Iir`` - ref - — * - :ref:`Callees_List ` - ``Field7`` - ``Iir_List`` - of ref - Returns the list of subprogram called in this subprogram or process. Note: implicit function (such as implicit operators) are omitted from this list, since the purpose of this list is to correctly set flags for side effects (purity_state, wait_state). Can return null_iir if there is no subprogram called. * - :ref:`End_Has_Reserved_Id ` - ``Flag8`` - ``Boolean`` - owned - Layout flag: true if 'end' is followed by the reserved identifier. * - :ref:`End_Has_Identifier ` - ``Flag9`` - ``Boolean`` - owned - Layout flag: true if 'end' is followed by the identifier. .. graphviz:: digraph { rankdir="LR" node [shape=record fontname="monospace" fontsize=10] edge [fontname="monospace" fontsize=9] "Function_Body" [style=filled fillcolor="#eeeeec" label="{Function_Body|{ Parent| Declaration_Chain| Chain| Impure_Depth| Attribute_Value_Chain| Sequential_Statement_Chain| Subprogram_Specification| Callees_List| End_Has_Reserved_Id| End_Has_Identifier}}"] "Function_Body__Parent" [shape=box label="Iir"] "Function_Body":Parent -> "Function_Body__Parent" [color="#3465a4" style=dashed] "Function_Body__Declaration_Chain" [shape=box label="Iir"] "Function_Body":Declaration_Chain -> "Function_Body__Declaration_Chain" [color="#4e9a06"] "Function_Body__Chain" [shape=box label="Iir"] "Function_Body":Chain -> "Function_Body__Chain" [color="#4e9a06" style=bold] "Function_Body__Attribute_Value_Chain" [shape=box label="Iir"] "Function_Body":Attribute_Value_Chain -> "Function_Body__Attribute_Value_Chain" [color="#3465a4" style=dashed] "Function_Body__Sequential_Statement_Chain" [shape=box label="Iir"] "Function_Body":Sequential_Statement_Chain -> "Function_Body__Sequential_Statement_Chain" [color="#4e9a06"] "Function_Body__Subprogram_Specification" [shape=box label="Iir"] "Function_Body":Subprogram_Specification -> "Function_Body__Subprogram_Specification" [color="#3465a4" style=dashed] "Function_Body__Callees_List" [shape=box3d label="Iir_List"] "Function_Body":Callees_List -> "Function_Body__Callees_List" [color="#3465a4" style=dashed] } .. _INT:AST:Procedure_Body: Iir_Kind_Procedure_Body ======================= LRM08 4.3 Subprogram bodies :: subprogram_body ::= subprogram_specification IS subprogram_declarative_part BEGIN subprogram_statement_part END [ subprogram_kind ] [ designator ] ; :: subprogram_kind ::= PROCEDURE | FUNCTION Format: ``Medium`` .. list-table:: :header-rows: 1 :widths: 30 12 18 12 28 * - Accessor - Field - Type - Access - Description * - :ref:`Parent ` - ``Field0`` - ``Iir`` - ref - Get/Set the statement in which TARGET appears. This is used to check if next/exit is in a loop. * - :ref:`Declaration_Chain ` - ``Field1`` - ``Iir`` - chain - The parse stage always puts a declaration before a body. Sem will remove the declaration if there is a forward declaration. * - :ref:`Chain ` - ``Field2`` - ``Iir`` - chain next - — * - :ref:`Impure_Depth ` - ``Field3`` - ``Iir_Int32`` - owned - Depth of the deepest impure object. * - :ref:`Attribute_Value_Chain ` - ``Field5`` - ``Iir`` - ref - Chain of attribute values for declared items. To be used with Get/Set_Value_Chain. There is no order, therefore, a new attribute value may be always prepended. * - :ref:`Sequential_Statement_Chain ` - ``Field4`` - ``Iir`` - chain - — * - :ref:`Subprogram_Specification ` - ``Field6`` - ``Iir`` - ref - — * - :ref:`Callees_List ` - ``Field7`` - ``Iir_List`` - of ref - Returns the list of subprogram called in this subprogram or process. Note: implicit function (such as implicit operators) are omitted from this list, since the purpose of this list is to correctly set flags for side effects (purity_state, wait_state). Can return null_iir if there is no subprogram called. * - :ref:`End_Has_Reserved_Id ` - ``Flag8`` - ``Boolean`` - owned - Layout flag: true if 'end' is followed by the reserved identifier. * - :ref:`End_Has_Identifier ` - ``Flag9`` - ``Boolean`` - owned - Layout flag: true if 'end' is followed by the identifier. * - :ref:`Suspend_Flag ` - ``Flag11`` - ``Boolean`` - owned - Set on wait, procedure call and composite statements when there is a sub-statement that can suspend a procedure or a process. Also set on procedure declaration. Note that the flag is conservative: it must be true if the node contains directly or indirectly a wait statement, but need not to be false otherwise. .. graphviz:: digraph { rankdir="LR" node [shape=record fontname="monospace" fontsize=10] edge [fontname="monospace" fontsize=9] "Procedure_Body" [style=filled fillcolor="#eeeeec" label="{Procedure_Body|{ Parent| Declaration_Chain| Chain| Impure_Depth| Attribute_Value_Chain| Sequential_Statement_Chain| Subprogram_Specification| Callees_List| End_Has_Reserved_Id| End_Has_Identifier| Suspend_Flag}}"] "Procedure_Body__Parent" [shape=box label="Iir"] "Procedure_Body":Parent -> "Procedure_Body__Parent" [color="#3465a4" style=dashed] "Procedure_Body__Declaration_Chain" [shape=box label="Iir"] "Procedure_Body":Declaration_Chain -> "Procedure_Body__Declaration_Chain" [color="#4e9a06"] "Procedure_Body__Chain" [shape=box label="Iir"] "Procedure_Body":Chain -> "Procedure_Body__Chain" [color="#4e9a06" style=bold] "Procedure_Body__Attribute_Value_Chain" [shape=box label="Iir"] "Procedure_Body":Attribute_Value_Chain -> "Procedure_Body__Attribute_Value_Chain" [color="#3465a4" style=dashed] "Procedure_Body__Sequential_Statement_Chain" [shape=box label="Iir"] "Procedure_Body":Sequential_Statement_Chain -> "Procedure_Body__Sequential_Statement_Chain" [color="#4e9a06"] "Procedure_Body__Subprogram_Specification" [shape=box label="Iir"] "Procedure_Body":Subprogram_Specification -> "Procedure_Body__Subprogram_Specification" [color="#3465a4" style=dashed] "Procedure_Body__Callees_List" [shape=box3d label="Iir_List"] "Procedure_Body":Callees_List -> "Procedure_Body__Callees_List" [color="#3465a4" style=dashed] }