Skip to content

Commit 37a2f4d

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
2 parents 51d42da + 092932f commit 37a2f4d

File tree

2 files changed

+33
-19
lines changed

2 files changed

+33
-19
lines changed

cmake/cmake/modules/PHP/Bison.cmake

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
#[=============================================================================[
22
# PHP/Bison
33
4-
Generate parser files with Bison.
4+
Finds the Bison command-line parser generator and provides a command to generate
5+
parser files with Bison:
56
6-
## Functions
7+
```cmake
8+
include(PHP/Bison)
9+
```
10+
11+
## Commands
12+
13+
This module provides the following commands:
714
815
### `php_bison()`
916
10-
Generate parser file from the given template file using the Bison generator.
17+
Generates parser file from the given template file using the Bison generator:
1118
1219
```cmake
1320
php_bison(
@@ -25,8 +32,8 @@ php_bison(
2532
)
2633
```
2734
28-
This creates a target `<name>` and adds a command that generates parser file
29-
`<output>` from the given `<input>` template file using the Bison parser
35+
This command creates a target `<name>` and adds a command that generates parser
36+
file `<output>` from the given `<input>` template file using the Bison parser
3037
generator. Relative source file path `<input>` is interpreted as being relative
3138
to the current source directory. Relative `<output>` file path is interpreted as
3239
being relative to the current binary directory. If generated files are already
@@ -121,7 +128,7 @@ These variables can be set before using this module to configure behavior:
121128
122129
## Examples
123130
124-
### Usage
131+
### Example: Basic usage
125132
126133
```cmake
127134
# CMakeLists.txt
@@ -145,7 +152,7 @@ php_bison(foo foo.y foo.c ADD_DEFAULT_OPTIONS OPTIONS --debug --yacc)
145152
# bison -Wall --no-lines --debug --yacc foo.y --output foo.c
146153
```
147154
148-
### Generator expressions
155+
### Example: Generator expressions
149156
150157
```cmake
151158
include(PHP/Bison)
@@ -157,7 +164,7 @@ php_bison(foo foo.y foo.c OPTIONS $<$<CONFIG:Debug>:--debug> --yacc)
157164
# bison --yacc foo.y --output foo.c
158165
```
159166
160-
### Target usage
167+
### Example: Target usage
161168
162169
Target created by `php_bison()` can be used to specify additional dependencies:
163170
@@ -176,7 +183,7 @@ Running only the `foo_parser` target to generate the parser-related files:
176183
cmake --build <dir> --target foo_parser
177184
```
178185
179-
### Module configuration
186+
### Example: Module configuration
180187
181188
To specify different minimum required Bison version than the module's default,
182189
the `find_package(BISON)` can be called before `php_bison()`:

cmake/cmake/modules/PHP/Re2c.cmake

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
#[=============================================================================[
22
# PHP/Re2c
33
4-
Generate lexer files with re2c.
4+
Finds the re2c command-line lexer generator and provides command to generate
5+
lexer files with re2c:
56
6-
## Functions
7+
```cmake
8+
include(PHP/Re2c)
9+
```
10+
11+
## Commands
12+
13+
This module provides the following commands:
714
815
### `php_re2c()`
916
10-
Generate lexer file from the given template file using the re2c generator.
17+
Generates lexer file from the given template file using the re2c generator:
1118
1219
```cmake
1320
php_re2c(
@@ -25,8 +32,8 @@ php_re2c(
2532
)
2633
```
2734
28-
This creates a target `<name>` and adds a command that generates lexer file
29-
`<output>` from the given `<input>` template file using the re2c lexer
35+
This command creates a target `<name>` and adds a command that generates lexer
36+
file `<output>` from the given `<input>` template file using the re2c lexer
3037
generator. Relative source file path `<input>` is interpreted as being relative
3138
to the current source directory. Relative `<output>` file path is interpreted as
3239
being relative to the current binary directory. If generated files are already
@@ -118,7 +125,7 @@ These variables can be set before using this module to configure behavior:
118125
119126
## Examples
120127
121-
### Usage
128+
### Example: Basic usage
122129
123130
```cmake
124131
# CMakeLists.txt
@@ -130,7 +137,7 @@ php_re2c(foo foo.re foo.c OPTIONS --bit-vectors --conditions)
130137
# re2c --bit-vectors --conditions --output foo.c foo.re
131138
```
132139
133-
### Specifying options
140+
### Example: Specifying options
134141
135142
This module provides some default options when using the `ADD_DEFAULT_OPTIONS`:
136143
@@ -142,7 +149,7 @@ php_re2c(foo foo.re foo.c ADD_DEFAULT_OPTIONS OPTIONS --conditions)
142149
# re2c --no-debug-info --no-generation-date --conditions --output foo.c foo.re
143150
```
144151
145-
### Generator expressions
152+
### Example: Generator expressions
146153
147154
```cmake
148155
include(PHP/Re2c)
@@ -154,7 +161,7 @@ php_re2c(foo foo.re foo.c OPTIONS $<$<CONFIG:Debug>:--debug-output> -F)
154161
# re2c -F --output foo.c foo.re
155162
```
156163
157-
### Target usage
164+
### Example: Target usage
158165
159166
Target created by `php_re2c()` can be used to specify additional dependencies:
160167
@@ -173,7 +180,7 @@ Running only the `foo_lexer` target to generate the lexer-related files:
173180
cmake --build <dir> --target foo_lexer
174181
```
175182
176-
### Module configuration
183+
### Example: Module configuration
177184
178185
To specify different minimum required re2c version than the module's default,
179186
the `find_package(RE2C)` can be called before `php_re2c()`:

0 commit comments

Comments
 (0)