trcombine 0.11.1
See the version list below for details.
dotnet tool install --global trcombine --version 0.11.1
dotnet new tool-manifest
dotnet tool install --local trcombine --version 0.11.1
#tool dotnet:?package=trcombine&version=0.11.1
nuke :add-package trcombine --version 0.11.1
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 | 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. |
This package has no dependencies.
Version | Downloads | Last updated |
---|---|---|
0.23.17 | 2,806 | 3/7/2025 |
0.23.16 | 500 | 3/4/2025 |
0.23.15 | 123 | 2/25/2025 |
0.23.14 | 635 | 2/9/2025 |
0.23.13 | 394 | 1/19/2025 |
0.23.12 | 405 | 1/16/2025 |
0.23.11 | 2,616 | 12/18/2024 |
0.23.10 | 111 | 12/12/2024 |
0.23.9 | 112 | 11/29/2024 |
0.23.8 | 151 | 11/1/2024 |
0.23.7 | 4,225 | 10/9/2024 |
0.23.6 | 754 | 9/21/2024 |
0.23.5 | 134 | 9/15/2024 |
0.23.4 | 121 | 9/7/2024 |
0.23.3 | 137 | 8/15/2024 |
0.23.2 | 143 | 6/28/2024 |
0.23.1 | 134 | 6/22/2024 |
0.23.0 | 200 | 4/25/2024 |
0.22.0 | 195 | 2/26/2024 |
0.21.16 | 282 | 11/16/2023 |
0.21.15 | 187 | 11/16/2023 |
0.21.14 | 192 | 11/15/2023 |
0.21.13 | 199 | 11/14/2023 |
0.21.12 | 290 | 10/27/2023 |
0.21.11 | 286 | 10/24/2023 |
0.21.9 | 302 | 9/27/2023 |
0.21.8 | 311 | 9/26/2023 |
0.21.7 | 242 | 9/26/2023 |
0.21.6 | 237 | 9/20/2023 |
0.21.5 | 213 | 9/18/2023 |
0.21.4 | 178 | 9/17/2023 |
0.21.3 | 213 | 9/14/2023 |
0.21.2 | 249 | 9/4/2023 |
0.21.1 | 328 | 8/15/2023 |
0.21.0 | 259 | 6/25/2023 |
0.20.27 | 238 | 6/15/2023 |
0.20.26 | 244 | 6/5/2023 |
0.20.25 | 229 | 6/3/2023 |
0.20.24 | 232 | 6/1/2023 |
0.20.23 | 186 | 5/31/2023 |
0.20.22 | 231 | 5/21/2023 |
0.20.21 | 244 | 5/15/2023 |
0.20.20 | 209 | 5/11/2023 |
0.20.19 | 212 | 5/8/2023 |
0.20.18 | 192 | 5/8/2023 |
0.20.17 | 230 | 5/4/2023 |
0.20.16 | 242 | 5/1/2023 |
0.20.15 | 224 | 4/27/2023 |
0.20.14 | 263 | 4/21/2023 |
0.20.13 | 287 | 4/13/2023 |
0.20.12 | 345 | 3/17/2023 |
0.20.11 | 310 | 3/15/2023 |
0.20.10 | 316 | 3/15/2023 |
0.20.9 | 317 | 3/14/2023 |
0.20.8 | 293 | 3/14/2023 |
0.20.7 | 292 | 3/13/2023 |
0.20.6 | 319 | 3/11/2023 |
0.20.5 | 342 | 3/11/2023 |
0.20.4 | 290 | 3/9/2023 |
0.20.3 | 296 | 3/8/2023 |
0.20.2 | 334 | 3/7/2023 |
0.20.1 | 307 | 3/7/2023 |
0.18.1 | 603 | 11/11/2022 |
0.18.0 | 483 | 11/7/2022 |
0.17.0 | 569 | 9/11/2022 |
0.16.5 | 575 | 7/29/2022 |
0.16.4 | 575 | 6/13/2022 |
0.16.3 | 664 | 5/7/2022 |
0.16.2 | 609 | 5/6/2022 |
0.16.1 | 600 | 5/5/2022 |
0.16.0 | 640 | 4/13/2022 |
0.15.1 | 627 | 4/4/2022 |
0.15.0 | 606 | 3/20/2022 |
0.14.3 | 622 | 2/27/2022 |
0.14.2 | 613 | 2/18/2022 |
0.14.1 | 646 | 1/26/2022 |
0.14.0 | 603 | 1/26/2022 |
0.13.8 | 619 | 1/14/2022 |
0.13.7 | 646 | 1/13/2022 |
0.13.6 | 607 | 1/13/2022 |
0.13.5 | 638 | 1/12/2022 |
0.13.4 | 621 | 1/11/2022 |
0.13.3 | 612 | 1/10/2022 |
0.13.2 | 429 | 12/24/2021 |
0.13.1 | 451 | 12/24/2021 |
0.13.0 | 457 | 12/23/2021 |
0.12.0 | 479 | 12/6/2021 |
0.11.5 | 545 | 10/17/2021 |
0.11.4 | 516 | 10/17/2021 |
0.11.3 | 503 | 9/28/2021 |
0.11.2 | 480 | 9/26/2021 |
0.11.1 | 493 | 9/25/2021 |
0.11.0 | 535 | 9/24/2021 |
0.10.0 | 563 | 9/9/2021 |
0.8.9 | 472 | 8/13/2021 |
0.8.8 | 461 | 8/5/2021 |
0.8.7 | 463 | 7/20/2021 |
0.8.6 | 495 | 7/13/2021 |
0.8.5 | 467 | 7/6/2021 |
0.8.4 | 450 | 6/24/2021 |
0.8.3 | 546 | 6/13/2021 |
0.8.2 | 470 | 6/8/2021 |
0.8.1 | 486 | 6/2/2021 |
# trcombine
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.11.0 -- Updated trkleene. Added trreplace.