trunfoldlit 0.23.45
dotnet tool install --global trunfoldlit --version 0.23.45
dotnet new tool-manifest
dotnet tool install --local trunfoldlit --version 0.23.45
#tool dotnet:?package=trunfoldlit&version=0.23.45
nuke :add-package trunfoldlit --version 0.23.45
trunfoldlit
Summary
Perform an unfold transform for all string literal lexer rules on a grammar
Description
The unfoldlit command applies the unfold transform to a collection of terminal nodes for string literal lexer rules in a grammar. An unfold operation substitutes the right-hand side of a parser or lexer rule into a reference of the rule name that occurs at the specified node. In this app, all lexer rules that have a string literal on the right-hand side of the rule are identified as the symbols to unfold in parser rules.
Usage
trunfoldlit
Examples
Before:
grammar Expression;
s : ( e '*' e | INT ) ;
e : e '*' e # Mult
| INT # primary
;
INT : [0-9]+ ;
WS : [ \t\n]+ -> skip ;
Command:
trparse Expression.g4 | trunfoldlit | trsponge -c
After:
grammar Expresion;
s : e ;
e : e '*' e # Mult
| INT # primary
;
INT : [0-9]+ ;
WS : [ \t\n]+ -> skip ;
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.45 Parameterized ANTLR version via a new --antlr-version CLI option.
License
The MIT License
Copyright (c) 2025 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 | net10.0 is compatible. 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.45 | 566 | 5/24/2026 |
| 0.23.44 | 1,209 | 5/8/2026 |
| 0.23.43 | 6,189 | 3/28/2026 |
| 0.23.42 | 2,179 | 2/21/2026 |
| 0.23.41 | 4,558 | 1/25/2026 |
| 0.23.40 | 135 | 1/25/2026 |
| 0.23.39 | 348 | 1/22/2026 |
| 0.23.38 | 128 | 1/21/2026 |
| 0.23.37 | 126 | 1/20/2026 |
| 0.23.36 | 141 | 1/18/2026 |
| 0.23.35 | 119 | 1/16/2026 |
| 0.23.34 | 194 | 1/6/2026 |
| 0.23.33 | 226 | 12/28/2025 |
| 0.23.32 | 255 | 12/22/2025 |
| 0.23.31 | 413 | 12/19/2025 |
| 0.23.30 | 325 | 12/17/2025 |
| 0.23.29 | 301 | 12/17/2025 |
| 0.23.28 | 2,157 | 12/4/2025 |
| 0.23.27 | 2,854 | 10/30/2025 |
| 0.23.26 | 3,912 | 8/17/2025 |
# trunfoldlit
## Summary
Perform an unfold transform for all string literal lexer rules on a grammar
## Description
The unfoldlit command applies the unfold transform to a collection of terminal nodes
for string literal lexer rules in a grammar. An unfold operation substitutes
the right-hand side of a parser or lexer rule into a reference of the rule name that
occurs at the specified node. In this app, all lexer rules that have a string literal
on the right-hand side of the rule are identified as the symbols to unfold in parser
rules.
## Usage
trunfoldlit
## Examples
Before:
grammar Expression;
s : ( e '*' e | INT ) ;
e : e '*' e # Mult
| INT # primary
;
INT : [0-9]+ ;
WS : [ \t\n]+ -> skip ;
Command:
trparse Expression.g4 | trunfoldlit | trsponge -c
After:
grammar Expresion;
s : e ;
e : e '*' e # Mult
| INT # primary
;
INT : [0-9]+ ;
WS : [ \t\n]+ -> skip ;
## 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.45 Parameterized ANTLR version via a new --antlr-version CLI option.
## License
The MIT License
Copyright (c) 2025 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.