trcombine 0.20.17
See the version list below for details.
dotnet tool install --global trcombine --version 0.20.17
dotnet new tool-manifest
dotnet tool install --local trcombine --version 0.20.17
#tool dotnet:?package=trcombine&version=0.20.17
nuke :add-package trcombine --version 0.20.17
Reads an Antlr4 grammar from stdin and identifies problems in the grammar.
This program is part of the Trash toolkit.
| 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.23.43 | 2,546 | 3/28/2026 |
| 0.23.42 | 2,174 | 2/21/2026 |
| 0.23.41 | 4,577 | 1/25/2026 |
| 0.23.40 | 127 | 1/25/2026 |
| 0.23.39 | 353 | 1/22/2026 |
| 0.23.38 | 127 | 1/21/2026 |
| 0.23.37 | 133 | 1/20/2026 |
| 0.23.36 | 147 | 1/18/2026 |
| 0.23.35 | 117 | 1/16/2026 |
| 0.23.34 | 196 | 1/6/2026 |
| 0.23.33 | 244 | 12/28/2025 |
| 0.23.32 | 260 | 12/22/2025 |
| 0.23.31 | 410 | 12/19/2025 |
| 0.23.30 | 349 | 12/17/2025 |
| 0.23.29 | 334 | 12/17/2025 |
| 0.23.28 | 2,199 | 12/4/2025 |
| 0.23.27 | 2,887 | 10/30/2025 |
| 0.23.26 | 4,095 | 8/17/2025 |
| 0.23.25 | 377 | 8/9/2025 |
| 0.20.17 | 369 | 5/4/2023 |
# trcombine
## Summary
Combine a split Antlr4 grammar
## Description
Combine two grammars into one.
One grammar must be a lexer grammar, the other a parser grammar,
order is irrelevant. The output is parse tree data.
## Usage
trcombine <grammar1> <grammar2>
## Details
`trcombine` combines grammars that are known as "split grammars"
(separate Antlr4 lexer and parser grammars)
into one grammar, known as a "combined grammar". This refactoring is
useful if a simplified grammar grammar is wanted, and if possible if
the split grammar does not use the "superClass" option in one or the other
grammars. The opposite refactoring is implemented by
[trsplit](https://github.com/kaby76/Domemtech.Trash/tree/main/trsplit).
The split refactoring performs several operations:
* Combine the two files together, parser grammar first, then lexer grammar.
* Remove the `grammarDecl` for the lexer rules, and change the `grammarDecl`
for the parser rules to be a combined grammar declaration. Rename the name
of the parser grammar to not have "Parser" at the tail of the name.
* Remove the `optionsSpec` for the lexer section.
* Remove any occurrence of "tokenVocab" from the `optionsSpec` of the parser section.
* If the `optionsSpec` is empty, it is removed.
The order of the two grammars is ignored: the parser rules always will appear
before the lexer rules.
Lexer modes will require manual fix-up.
## Example
Consider the following grammar that is split.
_Input to command_
Lexer grammar in ExpressionLexer.g4:
lexer grammar ExpressionLexer;
VARIABLE : VALID_ID_START VALID_ID_CHAR* ;
fragment VALID_ID_START : ('a' .. 'z') | ('A' .. 'Z') | '_' ;
fragment VALID_ID_CHAR : VALID_ID_START | ('0' .. '9') ;
INT : ('0' .. '9')+ ;
MUL : '*' ;
DIV : '/' ;
ADD : '+' ;
SUB : '-' ;
LP : '(' ;
RP : ')' ;
WS : [ \r\n\t] + -> skip ;
Parser grammar in ExpressionParser.g4:
parser grammar ExpressionParser;
e : e ('*' | '/') e
| e ('+' | '-') e
| '(' e ')'
| ('-' | '+')* a
;
a : number | variable ;
number : INT ;
variable : VARIABLE ;
_Command_
trcombine ExpressionLexer.g4 ExpressionParser.g4 | trprint > Expression.g4
Combined grammar in Expression.g4:
grammar Expression;
e : e ('*' | '/') e
| e ('+' | '-') e
| '(' e ')'
| ('-' | '+')* a
;
a : number | variable ;
number : INT ;
variable : VARIABLE ;
VARIABLE : VALID_ID_START VALID_ID_CHAR* ;
fragment VALID_ID_START : ('a' .. 'z') | ('A' .. 'Z') | '_' ;
fragment VALID_ID_CHAR : VALID_ID_START | ('0' .. '9') ;
INT : ('0' .. '9')+ ;
MUL : '*' ;
DIV : '/' ;
ADD : '+' ;
SUB : '-' ;
LP : '(' ;
RP : ')' ;
WS : [ \r\n\t] + -> skip ;
The original grammars are left unchanged.
## Current version
0.20.17 Updates to trfoldlit, trconvert (rex, pegjs, kocmanllk but incomplete, trparse, trstrip. Add trcover. NB: not all Trash tools supported yet.