trdeltree 0.21.2
See the version list below for details.
dotnet tool install --global trdeltree --version 0.21.2
dotnet new tool-manifest
dotnet tool install --local trdeltree --version 0.21.2
#tool dotnet:?package=trdeltree&version=0.21.2
nuke :add-package trdeltree --version 0.21.2
trdeltree
Summary
Delete an entire subtree of a parse tree
Description
Reads a parse tree from stdin, and given an XPath expression for the nodes in the parse tree, delete the nodes and all children recursively. Writes the modified tree to stdout. The input and output are Parse Tree Data.
Usage
trdeltree <string>
Example
Before:
grammar Expression;
e : e ('*' | '/') e
| e ('+' | '-') e
| '(' e ')'
| ('-' | '+')* a
;
a : INT ;
INT : ('0' .. '9')+ ;
MUL : '*' ;
DIV : '/' ;
ADD : '+' ;
SUB : '-' ;
LP : '(' ;
RP : ')' ;
WS : [ \r\n\t] + -> skip ;
Command:
trparse Expression.g4 | trdelete "//parserRuleSpec[RULE_REF/text() = 'a']" | trprint
After:
grammar Expression;
e : e ('*' | '/') e
| e ('+' | '-') e
| '(' e ')'
| ('-' | '+')* a
;
a : INT ;
INT : ('0' .. '9')+ ;
MUL : '*' ;
DIV : '/' ;
ADD : '+' ;
SUB : '-' ;
LP : '(' ;
RP : ')' ;
WS : [ \r\n\t] + -> 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.21.2 Add trunfold. Various fixes.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net7.0 is compatible. 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. 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.22.0 | 549 | 2/26/2024 |
| 0.21.16 | 387 | 11/16/2023 |
| 0.21.15 | 284 | 11/16/2023 |
| 0.21.14 | 292 | 11/15/2023 |
| 0.21.13 | 271 | 11/14/2023 |
| 0.21.12 | 413 | 10/27/2023 |
| 0.21.11 | 425 | 10/24/2023 |
| 0.21.9 | 410 | 9/27/2023 |
| 0.21.8 | 430 | 9/26/2023 |
| 0.21.7 | 458 | 9/26/2023 |
| 0.21.6 | 345 | 9/20/2023 |
| 0.21.5 | 292 | 9/18/2023 |
| 0.21.4 | 336 | 9/17/2023 |
| 0.21.3 | 409 | 9/14/2023 |
| 0.21.2 | 446 | 9/4/2023 |
| 0.21.1 | 478 | 8/15/2023 |
| 0.21.0 | 385 | 6/25/2023 |
| 0.20.27 | 421 | 6/15/2023 |
| 0.20.26 | 367 | 6/5/2023 |
| 0.20.25 | 350 | 6/3/2023 |
# trdeltree
## Summary
Delete an entire subtree of a parse tree
## Description
Reads a parse tree from stdin, and given an XPath expression
for the nodes in the parse tree, delete the nodes and all children
recursively. Writes the modified tree
to stdout. The input and output are Parse Tree Data.
## Usage
trdeltree <string>
## Example
Before:
grammar Expression;
e : e ('*' | '/') e
| e ('+' | '-') e
| '(' e ')'
| ('-' | '+')* a
;
a : INT ;
INT : ('0' .. '9')+ ;
MUL : '*' ;
DIV : '/' ;
ADD : '+' ;
SUB : '-' ;
LP : '(' ;
RP : ')' ;
WS : [ \r\n\t] + -> skip ;
Command:
trparse Expression.g4 | trdelete "//parserRuleSpec[RULE_REF/text() = 'a']" | trprint
After:
grammar Expression;
e : e ('*' | '/') e
| e ('+' | '-') e
| '(' e ')'
| ('-' | '+')* a
;
a : INT ;
INT : ('0' .. '9')+ ;
MUL : '*' ;
DIV : '/' ;
ADD : '+' ;
SUB : '-' ;
LP : '(' ;
RP : ')' ;
WS : [ \r\n\t] + -> 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.21.2 Add trunfold. Various fixes.