Open kaby76 opened 1 week ago
Deleting these unused rules results in another performance gain of about 8%. => Always delete unused rules!
This is the script to delete the unused parser rules.
trparse -t ANTLRv4 ONEParser.g4 2> /dev/null | trquery delete ' //parserRuleSpec
[not(doc("*")//ruleBlock//RULE_REF/text() = ./RULE_REF/text())
and not(./ruleBlock//TOKEN_REF/text() = "EOF")]' | trsponge -c
There are many unused parser rules in the grammar.