{"id":37049730,"url":"https://github.com/kaby76/trash","last_synced_at":"2026-01-14T05:46:36.194Z","repository":{"id":37447642,"uuid":"353793091","full_name":"kaby76/Trash","owner":"kaby76","description":"Toolkit for grammars","archived":false,"fork":false,"pushed_at":"2025-12-28T12:22:52.000Z","size":34299,"stargazers_count":96,"open_issues_count":128,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-12-30T06:38:27.963Z","etag":null,"topics":["antlr","antlr4","refactoring","transformation","xpath"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kaby76.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-04-01T18:35:10.000Z","updated_at":"2025-12-28T12:22:11.000Z","dependencies_parsed_at":"2024-04-18T23:32:24.863Z","dependency_job_id":"a0786083-63c5-44ba-9bf1-96a6fe31f7e1","html_url":"https://github.com/kaby76/Trash","commit_stats":null,"previous_names":["kaby76/trash"],"tags_count":52,"template":false,"template_full_name":null,"purl":"pkg:github/kaby76/Trash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaby76%2FTrash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaby76%2FTrash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaby76%2FTrash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaby76%2FTrash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaby76","download_url":"https://codeload.github.com/kaby76/Trash/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaby76%2FTrash/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28411386,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["antlr","antlr4","refactoring","transformation","xpath"],"created_at":"2026-01-14T05:46:35.611Z","updated_at":"2026-01-14T05:46:36.177Z","avatar_url":"https://github.com/kaby76.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Trash\n\n[![Build](https://github.com/kaby76/Trash/workflows/CI/badge.svg)](https://github.com/kaby76/Trash/actions?query=workflow%3ACI)\n\n**Status: The toolset is still undergoing a major rewrite. Consider this toolkit as \"pre-alpha\".\nOld tools are being removed, and new ones are being added. Features are being added, while bugs\nare constantly being fixed. The XPath/XQuery engine is still being\nrewritten.**\n\n**The repo [g4-scripts](https://github.com/kaby76/g4-scripts) contains a collections of\nBash which use Trash. The repo also contains XQuery scripts that implement complex\noperations on a parse tree. You can also\nread about Trash details in [my blog](http://codinggorilla.com/).**\n\nTrash is a collection of ~40 command-line tools to analyze and transform\nAntlr parse trees and grammars. The toolkit can: generate a parser\napplication for an Antlr4 grammar for any target and any OS; analyze the\ngrammar for common problems; automate changes applied to a grammar scraped\nfrom a specification; transform parse trees for transpilating\nand proprocessing source code. With the [Antlr toolkit](https://www.antlr.org/)\nand the [collection of Antlr grammars](https://github.com/antlr/grammars-v4),\none can write programming language tools quickly and easily.\n\nThe toolkit is designed around a JSON representation of\nparse trees and command-line tools that read, modify, and write\nthose tree via standard input and output. Complex refactorings can be\nachieved by chaining different commands together.\n\nEach app in `Trash` is implemented as a [Dotnet Tool](https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools) console application, and can be used on Windows, Linux, or Mac.\nNo prerequisites are required other than installing the\n[NET SDK](https://dotnet.microsoft.com/), and the toolchains\nfor any other targets you want to use.\n\nThe toolkit uses [Antlr](https://www.antlr.org/) and\n[XPath2](https://en.wikipedia.org/wiki/XPath).\nThe code is implemented in C#.\n\nAn application of the toolkit was used to scrape and refactor the Dart2\ngrammar from spec. See [this script](https://github.com/kaby76/ScrapeDartSpec/blob/master/refactor.sh).\n\n## Installation\n### Requirements\n[Install Dotnet 8.0.x](https://dotnet.microsoft.com/en-us/download)\n\n### Install Globally\nCopy this script and execute it in a command-line prompt.\n```\ndotnet tool install -g trcaret\ndotnet tool install -g trclonereplace\ndotnet tool install -g trcombine\ndotnet tool install -g trconvert\ndotnet tool install -g trcover\ndotnet tool install -g trfoldlit\ndotnet tool install -g trgen\ndotnet tool install -g trgenvsc\ndotnet tool install -g trglob\ndotnet tool install -g triconv\ndotnet tool install -g tritext\ndotnet tool install -g trjson\ndotnet tool install -g trparse\ndotnet tool install -g trperf\ndotnet tool install -g trquery\ndotnet tool install -g trrename\ndotnet tool install -g trsort\ndotnet tool install -g trsplit\ndotnet tool install -g trsponge\ndotnet tool install -g trtext\ndotnet tool install -g trtokens\ndotnet tool install -g trtree\ndotnet tool install -g trunfold\ndotnet tool install -g trwdog\ndotnet tool install -g trxml\ndotnet tool install -g trxml2\n\n```\n### Uninstall\n```\ndotnet tool uninstall -g trcaret\ndotnet tool uninstall -g trclonereplace\ndotnet tool uninstall -g trcombine\ndotnet tool uninstall -g trconvert\ndotnet tool uninstall -g trcover\ndotnet tool uninstall -g trfoldlit\ndotnet tool uninstall -g trgen\ndotnet tool uninstall -g trgenvsc\ndotnet tool uninstall -g trglob\ndotnet tool uninstall -g triconv\ndotnet tool uninstall -g tritext\ndotnet tool uninstall -g trjson\ndotnet tool uninstall -g trparse\ndotnet tool uninstall -g trperf\ndotnet tool uninstall -g trrename\ndotnet tool uninstall -g trsort\ndotnet tool uninstall -g trsplit\ndotnet tool uninstall -g trsponge\ndotnet tool uninstall -g trtext\ndotnet tool uninstall -g trtokens\ndotnet tool uninstall -g trtree\ndotnet tool uninstall -g trunfold\ndotnet tool uninstall -g trwdog\ndotnet tool uninstall -g trxml\ndotnet tool uninstall -g trxml2\n\n```\n### Install Locally\n```\ndotnet new tool-manifest\ndotnet tool install trcaret\ndotnet tool install trclonereplace\ndotnet tool install trcombine\ndotnet tool install trconvert\ndotnet tool install trcover\ndotnet tool install trfoldlit\ndotnet tool install trgen\ndotnet tool install trgenvsc\ndotnet tool install trglob\ndotnet tool install triconv\ndotnet tool install tritext\ndotnet tool install trjson\ndotnet tool install trparse\ndotnet tool install trperf\ndotnet tool install trquery\ndotnet tool install trrename\ndotnet tool install trsort\ndotnet tool install trsplit\ndotnet tool install trsponge\ndotnet tool install trtext\ndotnet tool install trtokens\ndotnet tool install trtree\ndotnet tool install trunfold\ndotnet tool install trwdog\ndotnet tool install trxgrep\ndotnet tool install trxml\ndotnet tool install trxml2\n\n```\n## List of commands\n__NB: Out of date__\n1) \u003ca href=\"src/tranalyze/readme.md\"\u003etranalyze\u003c/a\u003e -- Analyze a grammar\n1) \u003ca href=\"src/trcombine/readme.md\"\u003etrcombine\u003c/a\u003e -- Combine a split Antlr4 grammar\n1) \u003ca href=\"src/trconvert/readme.md\"\u003etrconvert\u003c/a\u003e -- Convert a grammar from one for to another\n1) \u003ca href=\"src/trdot/readme.md\"\u003etrdot\u003c/a\u003e -- Print a parse tree in Graphvis Dot format\n1) \u003ca href=\"src/trenum/readme.md\"\u003etrenum\u003c/a\u003e -- Not functional, to enumerate strings from grammar.\n1) \u003ca href=\"src/trff/readme.md\"\u003etrff\u003c/a\u003e -- Outputs FIRST and FOLLOW sets of a grammar\n1) \u003ca href=\"src/trfold/readme.md\"\u003etrfold\u003c/a\u003e -- Perform fold transform on a grammar\n1) \u003ca href=\"src/trfoldlit/readme.md\"\u003etrfoldlit\u003c/a\u003e -- Perform fold transform on grammar with literals\n1) \u003ca href=\"src/trformat/readme.md\"\u003etrformat\u003c/a\u003e -- Format a grammar\n1) \u003ca href=\"src/trgen/readme.md\"\u003etrgen\u003c/a\u003e -- Generate an Antlr4 parser for a given target language\n1) \u003ca href=\"src/trgen2/readme.md\"\u003etrgen2\u003c/a\u003e -- Generate files from template and XML doc list.\n1) \u003ca href=\"src/trgroup/readme.md\"\u003etrgroup\u003c/a\u003e -- Perform a group transform on a grammar\n1) \u003ca href=\"src/tritext/readme.md\"\u003etritext\u003c/a\u003e -- Get strings from a PDF file\n1) \u003ca href=\"src/trjson/readme.md\"\u003etrjson\u003c/a\u003e -- Print a parse tree in JSON structured format\n1) \u003ca href=\"src/trkleene/readme.md\"\u003etrkleene\u003c/a\u003e -- Perform a Kleene transform of a grammar\n1) \u003ca href=\"src/trmove/readme.md\"\u003etrmove\u003c/a\u003e -- Move nodes in a parse tree\n1) \u003ca href=\"src/trparse/readme.md\"\u003etrparse\u003c/a\u003e -- Parse a grammar or use generated parse to parse input\n1) \u003ca href=\"src/trperf/readme.md\"\u003etrperf\u003c/a\u003e -- Perform performance analysis of an Antlr grammar parse\n1) \u003ca href=\"src/trpiggy/readme.md\"\u003etrpiggy\u003c/a\u003e -- Perform a parse tree rewrite\n1) \u003ca href=\"src/trprint/readme.md\"\u003etrprint\u003c/a\u003e -- Print a parse tree, including off-token characters\n1) \u003ca href=\"src/trrename/readme.md\"\u003etrrename\u003c/a\u003e -- Rename symbols in a grammar\n1) \u003ca href=\"src/trrr/readme.md\"\u003etrrr\u003c/a\u003e -- (No description.)\n1) \u003ca href=\"src/trrup/readme.md\"\u003etrrup\u003c/a\u003e -- Remove useless parentheses in a grammar\n1) \u003ca href=\"src/trsem/readme.md\"\u003etrsem\u003c/a\u003e -- Read static semantics and generate code\n1) \u003ca href=\"src/trsort/readme.md\"\u003etrsort\u003c/a\u003e -- Sort rules in a grammar\n1) \u003ca href=\"src/trsplit/readme.md\"\u003etrsplit\u003c/a\u003e -- Split a combined Antlr4 grammar\n1) \u003ca href=\"src/trsponge/readme.md\"\u003etrsponge\u003c/a\u003e -- Extract parsing results output of Trash command into files\n1) \u003ca href=\"src/trst/readme.md\"\u003etrst\u003c/a\u003e -- Print a parse tree in Antlr4 ToStringTree()\n1) \u003ca href=\"src/trstrip/readme.md\"\u003etrstrip\u003c/a\u003e -- Strip a grammar of all actions, labels, etc.\n1) \u003ca href=\"src/trtext/readme.md\"\u003etrtext\u003c/a\u003e -- Print a parse tree with a specific interval\n1) \u003ca href=\"src/trthompson/readme.md\"\u003etrthompson\u003c/a\u003e -- (No description.)\n1) \u003ca href=\"src/trtokens/readme.md\"\u003etrtokens\u003c/a\u003e -- Print tokens in a parse tree\n1) \u003ca href=\"src/trtree/readme.md\"\u003etrtree\u003c/a\u003e -- Print a parse tree in a human-readable format\n1) \u003ca href=\"src/trull/readme.md\"\u003etrull\u003c/a\u003e -- Transform a grammar with upper- and lowercase string literals\n1) \u003ca href=\"src/trunfold/readme.md\"\u003etrunfold\u003c/a\u003e -- Perform an unfold transform on a grammar\n1) \u003ca href=\"src/trungroup/readme.md\"\u003etrungroup\u003c/a\u003e -- Perform an ungroup transform on a grammar\n1) \u003ca href=\"src/trwdog/readme.md\"\u003etrwdog\u003c/a\u003e -- Kill a program that runs too long\n1) \u003ca href=\"src/trxml/readme.md\"\u003etrxml\u003c/a\u003e -- Print a parse tree in XML structured format\n1) \u003ca href=\"src/trxml2/readme.md\"\u003etrxml2\u003c/a\u003e -- Print an enumeration of all paths in a parse tree to leaves\n\n## Examples\n\n### Parse a grammar, create a parser for the grammar, build, and test\n```\ngit clone https://github.com/antlr/grammars-v4\ncd grammars-v4/python/python\ntrparse *.g4 | trquery 'grep //grammarDecl' | trtext\n# Output:\n# PythonLexer.g4:lexer grammar PythonLexer;\n# PythonParser.g4:parser grammar PythonParser;\ntrgen\ncd Generated\ndotnet build\ncat - \u003c\u003cEOF | trparse | trquery 'grep //test' | trtext\nx == y\nx == y if z == b else a == u\nlambda: a\nlambda x, y: a\nEOF\n# Output:\n# a\n# lambda x, y: a\n# a\n# lambda: a\n# a == u\n# x == y if z == b else a == u\n# x == y\n```\n### Display parse tree\n```\ntrparse -i \"a == b\" | trtree\n```\n`trtree` is only one of several ways to view parse tree data.\nOther programs for different output are\n[trjson](https://github.com/kaby76/Trash/tree/main/src/trjson) for [JSON output](https://github.com/kaby76/Trash/blob/main/_tests/trconvert/antlr2/ada.g4.json),\n[trxml](https://github.com/kaby76/Trash/tree/main/src/trxml) for [XML output](https://github.com/kaby76/Trash/blob/main/_tests/trconvert/antlr2/ada.g4.xml),\n[trst](https://github.com/kaby76/Trash/tree/main/src/trst) for [Antlr runtime ToStringTree output](https://github.com/kaby76/Trash/blob/main/_tests/trconvert/antlr2/ada.g4.st),\n[trdot](https://github.com/kaby76/Trash/tree/main/src/trdot),\n[trprint](https://github.com/kaby76/Trash/tree/main/src/trprint) for input text for the parse,\nand\n[tragl](https://github.com/kaby76/Trash/tree/main/src/tragl).\n\n### Convert grammars to Antlr4\n```\ntrparse ada.g2 | trconvert | trprint | less\n```\nThis command parses an [old Antlr2 grammar](https://github.com/kaby76/Trash/blob/main/_tests/trconvert/antlr2/ada.g2)\nusing [trparse](https://github.com/kaby76/Trash/tree/main/src/trparse),\nconverts the parse tree data to Antlr4 syntax using\n [trconvert](https://github.com/kaby76/Trash/tree/main/src/trconvert)\n and\nfinally [prints out the converted parse tree data, ada.g4](https://github.com/kaby76/Trash/blob/main/_tests/trconvert/antlr2/ada.g4)\nusing\n[trprint](https://github.com/kaby76/Trash/tree/main/src/trprint). Other\ngrammar that can be converted are Antlr3, Bison, and ISO EBNF. In order to\nuse the grammar to parse data, you will need to convert it to an Antlr4 grammar.\n\n### Generate an Arithmetic parser application\n```\nmkdir foobar; cd foobar; trgen\n```\nThis command creates a parser application for the C# target.\nIf executed in an empty directory, which is done in the example\nshown above, [trgen](https://github.com/kaby76/Trash/tree/main/src/trgen)\ncreates an application using the Arithmetic grammar.\nIf executed in a directory containing\na Antlr Maven plugin (`pom.xml`), `trgen` will create a program according\nto the information specified in the `pom.xml` file. Either way, it creates a directory\n`Generated/`, and places the source code there.\n\n`trgen` has many options to generate a parser from any Antlr4 grammar, for any target.\nBut, if a parser is generated for the C# target, built using the NET SDK, then `trparse`\ncan execute the generated parser, and can be used with all the other tools in Trash. _NB:\nIn order to use the generate parser application, you must first build it:\n\n    dotnet restore Generated/Test.csproj\n    dotnet build Generated/Test.csproj\n\n### Run the generated parser application\n\n    trparse -i \"1+2+3\" | trtree\n\nAfter using `trgen` to generate a parser program in C#, shown previously,\nand after building the program, you can run the parser using `trparse`. This program \nlooks for the generated parser in directory `Generated/`. If it exists,\nit will run the parser application in the directory. You can pass\nas command-line arguments an input string or input file. If no command-line\narguments are supplied, the program will read stdin. The output of `trparse`, as\nwith most tools of Trash, is parse tree data.\n\n### Find nodes in the parse tree using XPath\n\n    mkdir empty; cd empty; trgen; dotnet build Generated/Test.csproj; \\\n        trparse -i \"1+2+3\" | trquery \"grep //SCIENTIFIC_NUMBER\" | trst\n\nWith this command, a directory is created, the Arithmetic grammar generated, build,\nand then run using [trparse](https://github.com/kaby76/Trash/tree/main/src/trparse).\nThe `trparse` tool unifies all parsing, whether it's parsing a grammar or parsing input\nusing a generated parser application. The output from the `trparse` tool is a parse\ntree which you can search. [Trquery](https://github.com/kaby76/Trash/tree/main/src/trquery)\nis the generalized search program for parse trees. `Trquery` uses XPath expressions to\nprecisely identify nodes in the parse tree.\n\nXPath was added to Antlr4, but `Trash` takes the idea\nfurther with the addition of an XPath2 engine ported from the\n[Eclipse Web toolkit](https://git.eclipse.org/r/admin/repos/sourceediting%2Fwebtools.sourceediting).\nXPath is a well-defined language that should be\nused more often in compiler construction.\n\n### Rename a symbol in a grammar, generate a parser for new grammar\n\n    trparse Arithmetic.g4 | trrename \"//parserRuleSpec//labeledAlt//RULE_REF[text() = 'expression']\" \"xxx\" | trtext \u003e new-source.g4\n    trparse Arithmetic.g4 | trrename -r \"expression,expression_;atom,atom_;scientific,scientific_\" | trprint\n\nIn these two examples, the Arithmetic grammar is parsed.\n[trrename](https://github.com/kaby76/Trash/tree/main/src/trrename) reads the parse tree data and\nmodifies it by renaming the `expression` symbol two ways: first by XPath expression identifying the LHS terminal\nsymbol of the `expression` symbol, and the second by assumption that the tree is an Antlr4 parse tree,\nthen renaming a semi-colon-separated list of paired renames. The resulting code is reconstructed and saved.\n`trrename` does not rename symbols in actions, nor does it rename identifiers corresponding to the\ngrammar symbols in any support source code (but it could if the tool is extended).\n\n### Count method declarations in a Java source file\n\n    git clone https://github.com/antlr/grammars-v4.git; \\\n        cd grammars-v4/java/java9; \\\n        trgen; dotnet build Generated/Test.csproj;\\\n        trparse examples/AllInOne8.java | trquery \"greap //methodDeclaration\" | trst | wc\n\nThis command clones the Antlr4 grammars-v4 repo, generates a parser for the Java9 grammar,\nthen runs the parser on [examples/AllInOne8.java](https://github.com/antlr/grammars-v4/blob/master/java/java9/examples/AllInOne8.java).\nThe parse tree is then piped to `trquery` to find all parse tree nodes that are\na `methodDeclaration` type, converts it to a simple string, and counts the result using\n`wc`.\n\n### Strip a grammar of all non-essential CFG\n\n    trparse Java9.g4 | trstrip | trtext \u003e Essential-Java9.g4\n\n### Split a grammar\n\nSince Antlr2, one can written a combined parser/lexer in one file,\nor a split parser/lexer in two files.\nWhile it's not hard to split or combine\na grammar, it's tedious. For automating transformations, it's\nnecessary because Antlr4 requires the grammars to be split\nwhen super classes are needed for different targets.\n\n    trcombine ArithmeticLexer.g4 ArithmeticParser.g4 | trprint \u003e Arithmetic.g4\n\nThis command calls [trcombine](https://github.com/kaby76/Trash/tree/main/src/trcombine)\nwhich parses two split grammar files\n[ArithmeticLexer.g4](https://github.com/kaby76/Trash/blob/main/_tests/combine/ArithmeticLexer.g4)\nand\n[ArithmeticParser.g4](https://github.com/kaby76/Trash/blob/main/_tests/combine/ArithmeticParser.g4),\nand creates a [combined grammar](https://github.com/kaby76/Trash/blob/main/_tests/combine/Arithmetic.g4)\nfor the two.\n\n    trparse Arithmetic.g4 | trsplit | trsponge -o true\n\nThis command calls [trsplit](https://github.com/kaby76/Trash/tree/main/src/trsplit)\nwhich splits the grammar into two parse tree results, one that defines\nArithmeticLexer.g4 and the other that defines ArithmeticParser.g4.\nThe tool [trsponge](https://github.com/kaby76/Trash/tree/main/src/trsponge)\nis similar to the [tee](https://en.wikipedia.org/wiki/Tee_(command)) in\nLinux: the parse tree data is split and placed in files.\n\n## Parsing Result Sets -- the data passed between commands\n\nA *parsing result set* is a JSON serialization of an array of:\n\n* A set of parse tree nodes.\n* Parser information related to the parse tree nodes.\n* Lexer information related to the parse tree nodes.\n* The name of the input corresponding to the parse tree nodes.\n* The input text corresponding to the parse tree nodes.\n\nMost commands in Trash read and/or write parsing result sets.\n\n## Supported grammars\n\n| Grammars | File suffix |\n| ---- | ---- |\n| Antlr4 | .g4 |\n| Antlr3 | .g3 |\n| Antlr2 | .g2 |\n| Bison | .y |\n| LBNF | .cf |\n| W3C EBNF | .ebnf |\n| ISO 14977 | .iso14977, .iso |\n\n## Analysis\n\n### Recursion\n\n* [Has direct/indirect recursion](https://github.com/kaby76/Trash/blob/main/doc/analysis.md#has-directindirect-recursion)\n\n## Refactoring\n\nTrash provides a number of transformations that can help to make grammars cleaner (reformatting),\nmore readable (reducing the length of the RHS of a rule),\nand more efficient (reducing the number of non-terminals) for Antlr.\n\nSome of these refactorings are very specific for Antlr due to the way\nthe parser works, e.g., converting a prioritized chain of productions recognizing\nan arithmetic expression to a recursive alternate form.\nThe refactorings implemented are:\n\n### Raw tree editing\n\n* [Delete parse tree node](https://github.com/kaby76/Trash/blob/main/doc/refactoring.md#delete-parse-tree-node)\n\n### Reordering\n\n* [Move start rule to top](https://github.com/kaby76/Trash/blob/main/doc/refactoring.md#move-start-rule)\n* [Reorder parser rules](https://github.com/kaby76/Trash/blob/main/doc/refactoring.md#reorder-parser-rules)\n* [Sort modes](https://github.com/kaby76/Trash/blob/main/doc/refactoring.md#sort-modes)\n\n### Changing rules\n\n* [Remove useless parentheses](https://github.com/kaby76/Trash/blob/main/doc/refactoring.md#remove-useless-parentheses)\n* [Remove useless parser rules](https://github.com/kaby76/Trash/blob/main/doc/refactoring.md#remove-useless-productions)\n* [Rename lexer or parser symbol](https://github.com/kaby76/Trash/blob/main/doc/refactoring.md#rename)\n* [Unfold](https://github.com/kaby76/Trash/blob/main/doc/refactoring.md#Unfold)\n* [Group alts](https://github.com/kaby76/Trash/blob/main/doc/refactoring.md#group-alts)\n* [Ungroup alts](https://github.com/kaby76/Trash/blob/main/doc/refactoring.md#ungroup-alts)\n* [Upper and lower case string literals](https://github.com/kaby76/Trash/blob/main/doc/refactoring.md#upper-and-lower-case-string-literals)\n* [Fold](https://github.com/kaby76/Trash/blob/main/doc/refactoring.md#Fold)\n* Replace direct left recursion with right recursion\n* [Replace direct left/right recursion with Kleene operator](https://github.com/kaby76/Trash/blob/main/doc/refactoring.md#Kleene)\n* Replace indirect left recursion with right recursion\n* Replace parser rule symbols that conflict with Antlr keywords\n* [Replace string literals in parser with lexer symbols](https://github.com/kaby76/Trash/blob/main/doc/refactoring.md#replace-literals-in-parser-with-lexer-token-symbols)\n* Replace string literals in parser with lexer symbols, with lexer rule create\n* [Delabel removes the annoying and mostly useless labeling in an Antlr grammar](https://github.com/kaby76/Trash/blob/main/doc/refactoring.md#delabel)\n\n### Splitting and combining\n\n* [Split combined grammars](https://github.com/kaby76/Trash/blob/main/doc/refactoring.md#splitting-and-combining-grammars)\n* [Combine splitted grammars](https://github.com/kaby76/Trash/blob/main/doc/refactoring.md#splitting-and-combining-grammars)\n\n## Conversion\n\n* [Antlr3 import](https://github.com/kaby76/Trash/blob/main/doc/Import.md#antlr3)\n* [Antlr2 import](https://github.com/kaby76/Trash/blob/main/doc/Import.md#antlr2)\n* [Bison import](https://github.com/kaby76/Trash/blob/main/doc/Import.md#bison)\n\n---------\n\nThe source code for the extension is open source, free of charge, and free of ads. For the latest developments on the extension,\ncheck out my [blog](http://codinggorilla.com).\n\n# Building\n\n    git clone https://github.com/kaby76/Trash\n    cd Trash\n    make clean; make; make install\n    \nYou must have the NET SDK version 8 installed to build and run.\n\n# Releases\n\nSee https://github.com/kaby76/Trash/releases.\n\nIf you have any questions, email me at ken.domino \u003cat\u003e gmail.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaby76%2Ftrash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaby76%2Ftrash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaby76%2Ftrash/lists"}