Skip to content

Commit 1939131

Browse files
authored
Merge pull request #302 from lf-lang/reactor-names
Added reactor name functions
2 parents c8b9794 + bd13594 commit 1939131

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

docs/reference/target-language-details.mdx

+5
Original file line numberDiff line numberDiff line change
@@ -2854,6 +2854,11 @@ Reactions in C can use a number of pre-defined functions, macros, and constants
28542854

28552855
- Schedule future events, such as `lf_schedule` and `lf_schedule_value` ([api.h](https://www.lf-lang.org/reactor-c/dc/d65/api_8h.html))
28562856

2857+
- **Reactor Names**
2858+
2859+
- `lf_reactor_name(self)`: Returns the name of the reactor that contains the current reaction. The name is that assigned upon instantiation. If the reactor is in a bank, then the name has a suffix of the form `[bank_index]`.
2860+
- `lf_reactor_full_name(self)`: Returns the full name of the reactor that contains the current reaction. This is the name of the reactor and all its parent reactors, separated by periods.
2861+
28572862
- **File Access**
28582863

28592864
- LF_SOURCE_DIRECTORY: A C string giving the full path to the directory containing the `.lf` file of the program.

0 commit comments

Comments
 (0)