Skip to content

Commit 47810a0

Browse files
committed
Document LF_SOURCE_GEN_DIRECTORY and fix one link
1 parent 1939131 commit 47810a0

File tree

9 files changed

+2301
-2316
lines changed

9 files changed

+2301
-2316
lines changed

docs/reference/target-declaration.mdx

+2-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ A command to execute after code generation instead of the default compile comman
161161
- `LF_CURRENT_WORKING_DIRECTORY`: The directory in which the command is invoked.
162162
- `LF_SOURCE_DIRECTORY`: The directory containing the .lf file being compiled.
163163
- `LF_PACKAGE_DIRECTORY`: The directory for the root of the project or package (normally the directory above the `src` directory).
164-
- `LF_SOURCE_GEN_DIRECTORY`: The directory in which generated files are placed.
164+
- `LF_SOURCE_GEN_DIRECTORY`: The directory in which generated files and any files in the [files](#files) target directive are placed.
165165
- `LF_BIN_DIRECTORY`: The directory into which to put binaries.
166166

167167
The command will be executed in the same directory as the `.lf` file being compiled. For example, if you specify
@@ -400,6 +400,7 @@ This target does not support the `files` option.
400400
</ShowIf>
401401
<ShowIf c py>
402402
The `files` target parameter specifies array of files or directories to be copied to the directory that contains the generated sources.
403+
The full path to that directory is available in C code via the `LF_SOURCE_GEN_DIRECTORY` macro.
403404

404405
<ShowOnly c>
405406
```lf-c

docs/reference/target-language-details.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -2443,8 +2443,7 @@ is equivalent to
24432443
In the `Delay` reactor, the reaction to the input `_in` declares as its effect
24442444
the action `a`. This declaration makes it possible for the reaction to schedule
24452445
a future triggering of `a` using the
2446-
[`a.schedule()`](<../reference/target-language-details.mdx#schedule-functions>)
2447-
method.
2446+
`a.schedule()` method available on [actions](#actions)
24482447

24492448
The first reaction declares that it is triggered by `a` and has effect `out`. To
24502449
read the value, it uses the `a.value` syntax. Because this reaction is first,
@@ -2863,6 +2862,7 @@ Reactions in C can use a number of pre-defined functions, macros, and constants
28632862

28642863
- LF_SOURCE_DIRECTORY: A C string giving the full path to the directory containing the `.lf` file of the program.
28652864
- LF_PACKAGE_DIRECTORY: A C string giving the full path to the directory that is the root of the project or package (normally, the directory above the `src` directory).
2865+
- LF_SOURCE_GEN_DIRECTORY: The directory in which generated files and any files in the [files](target-declaration#files) target directive are placed.
28662866
- LF_FILE_SEPARATOR: A C string giving the file separator for the platform containing the `.lf` file ("/" for Unix-like systems, "\\" for Windows).
28672867

28682868
These are useful when your application needs to open and read additional files. For example, the following C code can be used to open a file in a subdirectory called `dir` of the directory that contains the `.lf` file:

versioned_docs/version-0.5.0/reference/target-language-details.mdx

+1-2
Original file line numberDiff line numberDiff line change
@@ -2411,8 +2411,7 @@ is equivalent to
24112411
In the `Delay` reactor, the reaction to the input `_in` declares as its effect
24122412
the action `a`. This declaration makes it possible for the reaction to schedule
24132413
a future triggering of `a` using the
2414-
[`a.schedule()`](<../reference/target-language-details.mdx#schedule-functions>)
2415-
method.
2414+
`a.schedule()` method available on [actions](#actions)
24162415

24172416
The first reaction declares that it is triggered by `a` and has effect `out`. To
24182417
read the value, it uses the `a.value` syntax. Because this reaction is first,

versioned_docs/version-0.6.0/reference/target-language-details.mdx

+1-2
Original file line numberDiff line numberDiff line change
@@ -2411,8 +2411,7 @@ is equivalent to
24112411
In the `Delay` reactor, the reaction to the input `_in` declares as its effect
24122412
the action `a`. This declaration makes it possible for the reaction to schedule
24132413
a future triggering of `a` using the
2414-
[`a.schedule()`](<../reference/target-language-details.mdx#schedule-functions>)
2415-
method.
2414+
`a.schedule()` method available on [actions](#actions)
24162415

24172416
The first reaction declares that it is triggered by `a` and has effect `out`. To
24182417
read the value, it uses the `a.value` syntax. Because this reaction is first,

versioned_docs/version-0.7.0/reference/target-language-details.mdx

+1-2
Original file line numberDiff line numberDiff line change
@@ -2441,8 +2441,7 @@ is equivalent to
24412441
In the `Delay` reactor, the reaction to the input `_in` declares as its effect
24422442
the action `a`. This declaration makes it possible for the reaction to schedule
24432443
a future triggering of `a` using the
2444-
[`a.schedule()`](<../reference/target-language-details.mdx#schedule-functions>)
2445-
method.
2444+
`a.schedule()` method available on [actions](#actions)
24462445

24472446
The first reaction declares that it is triggered by `a` and has effect `out`. To
24482447
read the value, it uses the `a.value` syntax. Because this reaction is first,

versioned_docs/version-0.8.0/reference/target-language-details.mdx

+1-2
Original file line numberDiff line numberDiff line change
@@ -2441,8 +2441,7 @@ is equivalent to
24412441
In the `Delay` reactor, the reaction to the input `_in` declares as its effect
24422442
the action `a`. This declaration makes it possible for the reaction to schedule
24432443
a future triggering of `a` using the
2444-
[`a.schedule()`](<../reference/target-language-details.mdx#schedule-functions>)
2445-
method.
2444+
`a.schedule()` method available on [actions](#actions)
24462445

24472446
The first reaction declares that it is triggered by `a` and has effect `out`. To
24482447
read the value, it uses the `a.value` syntax. Because this reaction is first,

versioned_docs/version-0.9.0/reference/target-declaration.mdx

+2-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ A command to execute after code generation instead of the default compile comman
160160
- `LF_CURRENT_WORKING_DIRECTORY`: The directory in which the command is invoked.
161161
- `LF_SOURCE_DIRECTORY`: The directory containing the .lf file being compiled.
162162
- `LF_PACKAGE_DIRECTORY`: The directory for the root of the project or package (normally the directory above the `src` directory).
163-
- `LF_SOURCE_GEN_DIRECTORY`: The directory in which generated files are placed.
163+
- `LF_SOURCE_GEN_DIRECTORY`: The directory in which generated files and any files in the [files](#files) target directive are placed.
164164
- `LF_BIN_DIRECTORY`: The directory into which to put binaries.
165165

166166
The command will be executed in the same directory as the `.lf` file being compiled. For example, if you specify
@@ -399,6 +399,7 @@ This target does not support the `files` option.
399399
</ShowIf>
400400
<ShowIf c py>
401401
The `files` target parameter specifies array of files or directories to be copied to the directory that contains the generated sources.
402+
The full path to that directory is available in C code via the `LF_SOURCE_GEN_DIRECTORY` macro.
402403

403404
<ShowOnly c>
404405
```lf-c

versioned_docs/version-0.9.0/reference/target-language-details.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -2441,8 +2441,7 @@ is equivalent to
24412441
In the `Delay` reactor, the reaction to the input `_in` declares as its effect
24422442
the action `a`. This declaration makes it possible for the reaction to schedule
24432443
a future triggering of `a` using the
2444-
[`a.schedule()`](<../reference/target-language-details.mdx#schedule-functions>)
2445-
method.
2444+
`a.schedule()` method available on [actions](#actions)
24462445

24472446
The first reaction declares that it is triggered by `a` and has effect `out`. To
24482447
read the value, it uses the `a.value` syntax. Because this reaction is first,
@@ -2856,6 +2855,7 @@ Reactions in C can use a number of pre-defined functions, macros, and constants
28562855

28572856
- LF_SOURCE_DIRECTORY: A C string giving the full path to the directory containing the `.lf` file of the program.
28582857
- LF_PACKAGE_DIRECTORY: A C string giving the full path to the directory that is the root of the project or package (normally, the directory above the `src` directory).
2858+
- LF_SOURCE_GEN_DIRECTORY: The directory in which generated files and any files in the [files](target-declaration#files) target directive are placed.
28592859
- LF_FILE_SEPARATOR: A C string giving the file separator for the platform containing the `.lf` file ("/" for Unix-like systems, "\\" for Windows).
28602860

28612861
These are useful when your application needs to open and read additional files. For example, the following C code can be used to open a file in a subdirectory called `dir` of the directory that contains the `.lf` file:

0 commit comments

Comments
 (0)