blark.transform.Action

class blark.transform.Action(name: Token, body: StatementList | None, meta: Meta | None = None)[source]

Bases: object

A full, named action declaration.

Actions belong to function blocks. Actions may not contain variable blocks, but may contain an implementation. Variable references are assumed to be from the local namespace (i.e., the owner function block) or in the global scope.

Examples:

ACTION ActName
END_ACTION

ACTION ActName
    iValue := iValue + 2;
END_ACTION

Lark grammar

This class is used by the following grammar rules:

action

action: "ACTION"i action_name ":" [ function_block_body ] "END_ACTION"i ";"*

Methods

__init__(name, body[, meta])

from_lark()

Attributes

meta

name

body

name: Token
body: StatementList | None
meta: Meta | None = None
__init__(name: Token, body: StatementList | None, meta: Meta | None = None) None
from_lark() T