API reference
python:astx:astx.FunctionDef
class FunctionDef
FunctionDef(prototype: FunctionPrototype, body: Block, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Source: packages/astx/src/astx/callables.py:401
Declared as: python:astx:astx.callables.FunctionDef
AST class for function definition.
Attributes
-
kind — Kind of value or operation.; Type: ASTKind
-
prototype — Prototype.; Type: FunctionPrototype
-
body — Statements forming the body.; Type: Block
-
name — Name identifying this declaration.; Type: str
-
loc — Type: SourceLocation
-
comment — Type: str
-
parent — Type: Optional[ASTNodes]
-
ref — Type: str
Methods
-
__call__ — Initialize the Call instance.
-
__init__ — Initialize the Function instance.
-
__str__ — Return a string that represent the object.
-
get_struct — Get the AST structure that represent the object.
Properties
- name — Return the function prototype name.