tranalyze 0.12.0

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global tranalyze --version 0.12.0
                    
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 tranalyze --version 0.12.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=tranalyze&version=0.12.0
                    
nuke :add-package tranalyze --version 0.12.0
                    

Reads an Antlr4 grammar from stdin and identifies problems in the grammar.
This program is part of the Trash toolkit.

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  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.  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. 
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.23.17 210 3/7/2025
0.23.16 210 3/4/2025
0.23.15 91 2/25/2025
0.23.14 102 2/9/2025
0.23.13 98 1/19/2025
0.23.12 92 1/16/2025
0.23.11 122 12/18/2024
0.23.10 112 12/12/2024
0.23.9 108 11/29/2024
0.23.8 120 11/1/2024
0.23.7 143 10/9/2024
0.23.6 157 9/21/2024
0.23.5 126 9/15/2024
0.23.4 120 9/7/2024
0.23.3 126 8/15/2024
0.18.1 693 11/11/2022
0.18.0 528 11/7/2022
0.17.0 515 9/11/2022
0.16.5 595 7/29/2022
0.16.4 627 6/13/2022
0.16.3 583 5/7/2022
0.16.2 579 5/6/2022
0.16.1 544 5/5/2022
0.16.0 589 4/13/2022
0.15.1 583 4/4/2022
0.15.0 563 3/20/2022
0.14.3 583 2/27/2022
0.14.2 581 2/18/2022
0.14.1 634 1/26/2022
0.14.0 606 1/26/2022
0.13.8 577 1/14/2022
0.13.7 564 1/13/2022
0.13.6 585 1/13/2022
0.13.5 544 1/12/2022
0.13.4 598 1/11/2022
0.13.3 565 1/10/2022
0.13.2 443 12/24/2021
0.13.1 417 12/24/2021
0.13.0 430 12/23/2021
0.12.0 408 12/6/2021
0.11.5 452 10/17/2021
0.11.4 472 10/17/2021
0.11.3 438 9/28/2021
0.11.2 442 9/26/2021
0.11.1 460 9/25/2021
0.11.0 505 9/24/2021
0.10.0 421 9/9/2021
0.8.9 396 8/13/2021
0.8.8 431 8/5/2021
0.8.7 431 7/20/2021
0.8.6 426 7/13/2021
0.8.5 423 7/6/2021
0.8.4 456 6/24/2021
0.8.3 506 6/13/2021
0.8.2 477 6/8/2021
0.8.1 416 6/2/2021
0.8.0 441 5/27/2021

# tranalyze
Reads an Antlr4 grammar in the form of parse tree data from stdin,
searches for problems in the grammar, and outputs the results to stdout.
# Usage
tranalyze
# Details
`tranalyze` performs a multi-pass search of a grammar in the
form of a parse result (from `trparse`), looking for problems in the
grammar.
* Classify each node type and output a count for each type.
* Check for unused symbols.
* Check for Unicode literals of the type '\unnnn' with
numbers that are over 32-bits.
* Check for common groupings in alts.
* Check for useless parentheses.
* Identify if a symbol derives the empty string, a non-empty string, or both.
* Check for unhalting nonterminals symbols in a single rule or group of rules.
# Example
Consider the following combined grammar.
_Input to command_
grammar Test;
start : 'a' empty infinite0 infinite1 infinite2 ;
unused : 'b';
infinite0 : (infinite0 'c')* ;  // Not legal in Antlr4 MLR, but okay
infinite1 : (infinite1 'c')+ ;  // Not legal in Antlr4 MLR, infinite
infinite2 : ('c' infinite2)+ ;  // Not flagged by Antlr4, infinite
empty : ;
_Command_
trparse Test.g4 | tranalyze
_Output_
6 occurrences of Antlr - nonterminal def
7 occurrences of Antlr - nonterminal ref
1 occurrences of Antlr - keyword
5 occurrences of Antlr - literal
Rule start is NonEmpty
Rule unused is NonEmpty
Rule infinite0 is NonEmpty
Rule infinite1 is NonEmpty
Rule infinite2 is NonEmpty
Rule empty is Empty
Rule infinite1 is malformed. It does not derive a string with referencing itself.
Rule infinite2 is malformed. It does not derive a string with referencing itself.
# Current version
0.12.0 -- Bug fixes for: parsing result sets reading; update to Antlr 4.9.3; standardize -f, -v options across tools; fix trkleene, trrup, trrename, trparse, trfold, trsponge; remove trmvsr, add trmove, trull.