-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Best to use local tools so repos can have different set of tool versions. https://github.com/kaby76/Trash?tab=readme-ov-file#install-locally
- Loading branch information
Showing
7 changed files
with
59 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,10 @@ | ||
#!/usr/bin/bash | ||
# "Setting MSYS2_ARG_CONV_EXCL so that Trash XPaths do not get mutulated." | ||
export MSYS2_ARG_CONV_EXCL="*" | ||
for i in `find . -name pom.xml | grep -v Generated | grep -v target` | ||
do | ||
base=`dirname $i` | ||
echo $i | ||
grep -qs . $base/*.g4 | ||
if [ "$?" = "0" ] | ||
then | ||
for j in "$base"/*.g4 | ||
do | ||
echo $j | grep Parser.g4 | ||
if [ "$?" = "0" ] | ||
then | ||
continue | ||
fi | ||
echo $j >> xxx-all | ||
fgrep "> skip" $j | ||
if [ "$?" = "0" ] | ||
then | ||
echo $j >> xxx-with | ||
fi | ||
fgrep "> channel" $j | ||
if [ "$?" = "0" ] | ||
then | ||
echo $j >> xxx-with | ||
fi | ||
# trparse -t antlr4 $j \ | ||
# | trxgrep -e ' | ||
# for $i in ( | ||
# //lexerRuleSpec | ||
# [./lexerRuleBlock/lexerAltList/lexerAlt/lexerCommands/lexerCommand/lexerCommandName/identifier/RULE_REF/text()="skip"] | ||
# /TOKEN_REF/text()]) | ||
# return concat("line ", $i/@Line, " col ", $i/@Column, " """, $i/@Text,"""")' | ||
# | ||
done | ||
fi | ||
done | ||
dotnet trparse -t ANTLRv4 *.g4 \ | ||
| dotnet trxgrep ' | ||
//lexerRuleSpec | ||
[./lexerRuleBlock/lexerAltList/lexerAlt/lexerCommands/lexerCommand/lexerCommandName/identifier/RULE_REF/text()="skip"] | ||
/TOKEN_REF/text()' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# | ||
if [[ $# -gt 0 ]] | ||
then | ||
echo Finding actions in grammars... >&2 | ||
dotnet trparse -l -t ANTLRv4 $@ | \ | ||
dotnet trquery grep ' //actionBlock[following-sibling::QUESTION and not ./self[1] ]' | \ | ||
dotnet trcaret | ||
else | ||
echo Finding actions in grammars... >&2 | ||
for i in `find . -name desc.xml | grep -v Generated\*` | ||
do | ||
echo $i | ||
d=`dirname $i` | ||
pushd $d > /dev/null 2>&1 | ||
if [ ! -z $(find . -maxdepth 1 -name '*.g4' -printf 1 -quit) ] | ||
then | ||
# Parse all grammar files so that any imports can also be checked. | ||
dotnet trparse -l -t ANTLRv4 *.g4 2> /dev/null | \ | ||
dotnet trxgrep ' //actionBlock[following-sibling::QUESTION]' | \ | ||
dotnet trcaret | ||
fi | ||
popd > /dev/null 2>&1 | ||
done | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters