trsort 0.23.10
See the version list below for details.
dotnet tool install --global trsort --version 0.23.10
dotnet new tool-manifest
dotnet tool install --local trsort --version 0.23.10
#tool dotnet:?package=trsort&version=0.23.10
nuke :add-package trsort --version 0.23.10
trsort
Summary
Sort rules in a grammar
Description
Reads a parse tree from stdin, move rules according to the named operation, and writes the modified tree to stdout. The input and output are Parse Tree Data.
Usage
trsort bfs <string>
trsort dfs <string>
Details
Reorder the parser rules according to the specified type and start rule. For BFS and DFS, an XPath expression must be supplied to specify all the start rule symbols. For alphabetic reordering, all parser rules are retained, and simply reordered alphabetically. For BFS and DFS, if the rule is unreachable from a start node set that is specified via <string>, then the rule is dropped from the grammar.
Example
trparse Java.g4 | trsort alpha | trtext
trparse Java.g4 | trsort dfs ""//parserRuleSpec/RULE_REF[text()='libraryDefinition']"" | trtext
Notes
If you are running MSYS2 on Windows, you may notice that XPaths are not being processed by this command correctly. To avoid the Bash shell from altering XPaths, type export MSYS2_ARG_CONV_EXCL="*", then execute your command.
Current version
0.23.10 Added block tree output to trtree.
License
The MIT License
Copyright (c) 2024 Ken Domino
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.
Version | Downloads | Last Updated |
---|---|---|
0.23.26 | 2,721 | 8/17/2025 |
0.23.25 | 244 | 8/9/2025 |
0.23.24 | 2,617 | 7/15/2025 |
0.23.23 | 1,020 | 7/6/2025 |
0.23.22 | 600 | 6/27/2025 |
0.23.21 | 1,776 | 6/6/2025 |
0.23.20 | 358 | 6/4/2025 |
0.23.19 | 349 | 6/4/2025 |
0.23.18 | 1,282 | 5/13/2025 |
0.23.17 | 4,253 | 3/7/2025 |
0.23.16 | 559 | 3/4/2025 |
0.23.15 | 184 | 2/25/2025 |
0.23.14 | 685 | 2/9/2025 |
0.23.13 | 447 | 1/19/2025 |
0.23.12 | 473 | 1/16/2025 |
0.23.11 | 2,672 | 12/18/2024 |
0.23.10 | 177 | 12/12/2024 |
0.23.9 | 177 | 11/29/2024 |
0.23.8 | 193 | 11/1/2024 |
0.23.7 | 4,302 | 10/9/2024 |
0.23.6 | 795 | 9/21/2024 |
0.23.5 | 185 | 9/15/2024 |
0.23.4 | 190 | 9/7/2024 |
0.23.3 | 185 | 8/15/2024 |
0.18.1 | 618 | 11/11/2022 |
0.18.0 | 551 | 11/7/2022 |
0.17.0 | 594 | 9/11/2022 |
0.16.5 | 595 | 7/29/2022 |
0.16.4 | 598 | 6/13/2022 |
# trsort
## Summary
Sort rules in a grammar
## Description
Reads a parse tree from stdin, move rules according to the named
operation, and writes the modified tree
to stdout. The input and output are Parse Tree Data.
## Usage
trsort bfs <string>
trsort dfs <string>
## Details
Reorder the parser rules according to the specified type and start rule.
For BFS and DFS, an XPath expression must be supplied to specify all the start
rule symbols. For alphabetic reordering, all parser rules are retained, and
simply reordered alphabetically. For BFS and DFS, if the rule is unreachable
from a start node set that is specified via <string>, then the rule is dropped
from the grammar.
## Example
trparse Java.g4 | trsort alpha | trtext
trparse Java.g4 | trsort dfs ""//parserRuleSpec/RULE_REF[text()='libraryDefinition']"" | trtext
## Notes
If you are running MSYS2 on Windows, you may notice that XPaths are not being
processed by this command correctly. To avoid the Bash shell from altering
XPaths, type _export MSYS2_ARG_CONV_EXCL="*"_, then execute your command.
## Current version
0.23.10 Added block tree output to trtree.
## License
The MIT License
Copyright (c) 2024 Ken Domino
Permission is hereby granted, free of charge,
to any person obtaining a copy of this software and
associated documentation files (the "Software"), to
deal in the Software without restriction, including
without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom
the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice
shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.