trgroup 0.18.1

dotnet tool install --global trgroup --version 0.18.1
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local trgroup --version 0.18.1
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=trgroup&version=0.18.1
nuke :add-package trgroup --version 0.18.1

Perform a recursive left- and right- factorization of alternatives for rules.
This program is part of the Trash toolkit.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
0.18.1 562 11/11/2022
0.18.0 383 11/7/2022
0.17.0 440 9/11/2022
0.16.5 489 7/29/2022
0.16.4 512 6/13/2022
0.16.3 538 5/7/2022
0.16.2 493 5/6/2022
0.16.1 490 5/5/2022
0.16.0 545 4/13/2022
0.15.1 510 4/4/2022
0.15.0 465 3/20/2022
0.14.3 515 2/27/2022
0.14.2 489 2/18/2022
0.14.1 532 1/26/2022
0.14.0 510 1/26/2022
0.13.8 476 1/14/2022
0.13.7 495 1/13/2022
0.13.6 514 1/13/2022
0.13.5 488 1/12/2022
0.13.4 487 1/11/2022
0.13.3 532 1/10/2022
0.13.2 313 12/24/2021
0.13.1 328 12/24/2021
0.13.0 332 12/23/2021
0.12.0 339 12/6/2021
0.11.5 346 10/17/2021
0.11.4 353 10/17/2021
0.11.3 391 9/28/2021
0.11.2 381 9/26/2021
0.11.1 381 9/25/2021
0.11.0 403 9/24/2021
0.10.0 364 9/9/2021
0.8.9 316 8/13/2021
0.8.8 371 8/5/2021
0.8.7 363 7/20/2021
0.8.6 362 7/13/2021
0.8.5 384 7/6/2021
0.8.4 363 6/24/2021
0.8.3 410 6/13/2021
0.8.2 360 6/8/2021
0.8.1 318 6/2/2021
0.8.0 341 5/27/2021
0.7.0 337 5/10/2021
0.6.0 340 5/3/2021
0.5.5 373 4/22/2021
0.5.0 376 4/14/2021

# trgroup
## Summary
Perform a group transform on a grammar
## Description
Perform a recursive left- and right- factorization of alternatives for rules.
## Usage
trgroup <string>
## Details
The command reads all parse tree data. Then, for each parse tree,
the XPath expression argument specified will be evaluated.
The nodes specified in the XPath arg must be for one or more
ruleAltList, lexerAltList, or altList. These node types contain
a sequence of children alternating with an "|"-operator
(`ruleAltList : labeledAlt ('|' labeledAlt)*`,
`lexerAltList : lexerAlt ('|' lexerAlt)*, and
`altList : alternative ('|' alternative)*`).
A "unification" of all the non-'|' children in the node is performed,
which results in a single sequence of elements with groupings. It is
possible for there to be multiple groups in the set of alternatives.
## Examples
_Input to command (file "temp.g4")_
grammar temp;
a : 'X' 'B' 'Z' | 'X' 'C' 'Z' | 'X' 'D' 'Z' ;
_Command_
trparse temp.g4 | trgroup "//parserRuleSpec[RULE_REF/text()='a']//ruleAltList" | trsponge -c true
# Or, a file-wide group refactoring, over all parser and lexer rules:
trparse temp.g4 | trgroup | trsponge -c true
_Output_
grammar temp;
a : 'X' ( 'B' | 'C' | 'D' ) 'Z' ;
# 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.18.1 Fix trperf, trfirst. Adding Xalan code. Fix #180. Fix crash in trgen https://github.com/antlr/grammars-v4/issues/2818. Fix #134. Add -e option to trrename. Update Antlr4BuildTasks version. Fix #197, #198. Fix trparse exit code. Add --quiet option to trparse to just get exit code. Change trgen templates to remove -file option, make file name parsing the default.