Skip to content
Open

Dev #618

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"trash": {
"version": "1.0.0",
"version": "1.1.0",
"commands": [
"trash"
],
Expand Down
8 changes: 4 additions & 4 deletions _scripts/set-version.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/bash
#set -e
#set -x
version="1.0.0"
version="1.1.0"
cd src
directories=`find . -maxdepth 1 -type d -name "tr*"`
cwd=`pwd`
Expand Down Expand Up @@ -42,10 +42,10 @@ do
do
sed -i -e "s%[<][Vv]ersion[>].*[<][/][Vv]ersion[>]%<Version\>$version</Version>%" $csproj
done
sed -i -e 's%^0[.][0-9]*[.][0-9]*.*$'"%$version"' Unified dispatcher for the Trash toolkit.%' readme.md
sed -i -e 's%^[0-9]*[.][0-9]*[.][0-9]*.*$'"%$version"' Unified dispatcher for the Trash toolkit. Fix broken Cpp target on Github.%' readme.md
for cs in *.cs
do
sed -i -e "s%public string Version { get; set; } = \"0[.][0-9]*[.][0-9]*\";%public string Version { get; set; } = \"$version\";%" $cs
sed -i -e "s%public string Version { get; set; } = \"[0-9][.][0-9]*[.][0-9]*\";%public string Version { get; set; } = \"$version\";%" $cs
done
cd ..
done
Expand Down Expand Up @@ -80,7 +80,7 @@ do
rm -f asdfasdf
cat *.csproj | sed -e "s%[<][Vv]ersion[>].*[<][/][Vv]ersion[>]%<Version\>$version</Version>%" > asdfasdf
mv asdfasdf *.csproj
sed -i -e 's%^0[.][0-9]*[.][0-9]*.*$'"%$version"' Unified dispatcher for the Trash toolkit.%' readme.md
sed -i -e 's%^[0-9]*[.][0-9]*[.][0-9]*.*$'"%$version"' Unified dispatcher for the Trash toolkit. Fix broken Cpp target on Github.%' readme.md
cd ..
done

Expand Down
26 changes: 13 additions & 13 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ In order to use the generate parser application, you must first build it:

### Run the generated parser application

dotnet trash parse -i "1+2+3" | dotnet trash tree
trash parse -i "1+2+3" | trash tree

After using `trgen` to generate a parser program in C#, shown previously,
and after building the program, you can run the parser using `trparse`. This program
Expand All @@ -183,14 +183,14 @@ with most tools of Trash, is parse tree data.

### Find nodes in the parse tree using XPath

mkdir empty; cd empty; dotnet trash gen; dotnet build Generated/Test.csproj; \
dotnet trash parse -i "1+2+3" | dotnet trash query "grep //SCIENTIFIC_NUMBER" | trst
mkdir empty; cd empty; trash gen; dotnet build Generated/Test.csproj; \
trash parse -i "1+2+3" | trash query "grep //SCIENTIFIC_NUMBER"

With this command, a directory is created, the Arithmetic grammar generated, build,
and then run using [trparse](https://github.com/kaby76/Trash/tree/main/src/trparse).
The `trparse` tool unifies all parsing, whether it's parsing a grammar or parsing input
and then run using [parse](https://github.com/kaby76/Trash/tree/main/src/trparse).
The `trash parse` tool unifies all parsing, whether it's parsing a grammar or parsing input
using a generated parser application. The output from the `trparse` tool is a parse
tree which you can search. [Trquery](https://github.com/kaby76/Trash/tree/main/src/trquery)
tree which you can search. [query](https://github.com/kaby76/Trash/tree/main/src/trquery)
is the generalized search program for parse trees. `Trquery` uses XPath expressions to
precisely identify nodes in the parse tree.

Expand All @@ -202,8 +202,8 @@ used more often in compiler construction.

### Rename a symbol in a grammar, generate a parser for new grammar

dotnet trash parse Arithmetic.g4 | dotnet trash rename "//parserRuleSpec//labeledAlt//RULE_REF[text() = 'expression']" "xxx" | dotnet trash text > new-source.g4
dotnet trash parse Arithmetic.g4 | dotnet trash rename -r "expression,expression_;atom,atom_;scientific,scientific_" | trprint
trash parse Arithmetic.g4 | trash rename "//parserRuleSpec//labeledAlt//RULE_REF[text() = 'expression']" "xxx" | dotnet trash text > new-source.g4
trash parse Arithmetic.g4 | trash rename -r "expression,expression_;atom,atom_;scientific,scientific_" | trprint

In these two examples, the Arithmetic grammar is parsed.
[trrename](https://github.com/kaby76/Trash/tree/main/src/trrename) reads the parse tree data and
Expand All @@ -217,8 +217,8 @@ grammar symbols in any support source code (but it could if the tool is extended

git clone https://github.com/antlr/grammars-v4.git; \
cd grammars-v4/java/java9; \
dotnet trash gen; dotnet build Generated/Test.csproj;\
dotnet trash parse examples/AllInOne8.java | dotnet trash query "greap //methodDeclaration" | trst | wc
trash gen; dotnet build Generated/Test.csproj;\
trash parse examples/AllInOne8.java | trash query "greap //methodDeclaration" | trst | wc

This command clones the Antlr4 grammars-v4 repo, generates a parser for the Java9 grammar,
then runs the parser on [examples/AllInOne8.java](https://github.com/antlr/grammars-v4/blob/master/java/java9/examples/AllInOne8.java).
Expand All @@ -228,7 +228,7 @@ a `methodDeclaration` type, converts it to a simple string, and counts the resul

### Strip a grammar of all non-essential CFG

dotnet trash parse Java9.g4 | trstrip | dotnet trash text > Essential-Java9.g4
trash parse Java9.g4 | trash strip | trash text > Essential-Java9.g4

### Split a grammar

Expand All @@ -239,7 +239,7 @@ a grammar, it's tedious. For automating transformations, it's
necessary because Antlr4 requires the grammars to be split
when super classes are needed for different targets.

dotnet trash combine ArithmeticLexer.g4 ArithmeticParser.g4 | trprint > Arithmetic.g4
trash combine ArithmeticLexer.g4 ArithmeticParser.g4 | trash text > Arithmetic.g4

This command calls [trcombine](https://github.com/kaby76/Trash/tree/main/src/trcombine)
which parses two split grammar files
Expand All @@ -249,7 +249,7 @@ and
and creates a [combined grammar](https://github.com/kaby76/Trash/blob/main/_tests/combine/Arithmetic.g4)
for the two.

dotnet trash parse Arithmetic.g4 | dotnet trash split | dotnet trash sponge -o true
trash parse Arithmetic.g4 | trash split | trash sponge -o true

This command calls [trsplit](https://github.com/kaby76/Trash/tree/main/src/trsplit)
which splits the grammar into two parse tree results, one that defines
Expand Down
2 changes: 1 addition & 1 deletion src/tragl/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This tool is part of Trash, Transformations for Antlr Shell.

## Current version

1.0.0 Unified dispatcher for the Trash toolkit.
1.1.0 Unified dispatcher for the Trash toolkit. Fix broken Cpp target on Github.

## License

Expand Down
2 changes: 1 addition & 1 deletion src/tragl/tragl.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This program is part of the Trash toolkit.]]>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
<Version>1.0.0</Version>
<Version>1.1.0</Version>
<RepositoryUrl>https://github.com/kaby76/Trash/tree/main/src/tragl</RepositoryUrl>
<RepositoryType>git</RepositoryType>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/tranalyze/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ public class Config
public bool Verbose { get; set; }

[Option("version", Required = false)]
public string Version { get; set; } = "1.0.0";
public string Version { get; set; } = "1.1.0";
}
}
2 changes: 1 addition & 1 deletion src/tranalyze/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ _Output_

## Current version

1.0.0 Unified dispatcher for the Trash toolkit.
1.1.0 Unified dispatcher for the Trash toolkit. Fix broken Cpp target on Github.

## License

Expand Down
2 changes: 1 addition & 1 deletion src/tranalyze/tranalyze.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This program is part of the Trash toolkit.]]>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
<Version>1.0.0</Version>
<Version>1.1.0</Version>
<RepositoryUrl>https://github.com/kaby76/Trash/tree/main/src/tranalyze</RepositoryUrl>
<RepositoryType>git</RepositoryType>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/trash/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Trash;

public class Program
{
private const string Version = "0.23.45";
private const string Version = "1.1.0";

// Maps both full names (e.g. "trgen") and short aliases (e.g. "gen") to the
// sub-tool directory name that lives next to trash.dll in the package.
Expand Down
2 changes: 1 addition & 1 deletion src/trash/readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
1.0.0 Unified dispatcher for the Trash toolkit.
1.1.0 Unified dispatcher for the Trash toolkit. Fix broken Cpp target on Github.

# trash

Expand Down
2 changes: 1 addition & 1 deletion src/trash/trash.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Usage: trash <command> [options] (e.g. trash trgen, trash gen, trash trparse)]]
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
<Version>1.0.0</Version>
<Version>1.1.0</Version>
<RepositoryUrl>https://github.com/kaby76/Trash/tree/main/src/trash</RepositoryUrl>
<RepositoryType>git</RepositoryType>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/trcaret/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ public class Config
public bool Verbose { get; set; }

[Option("version", Required = false)]
public string Version { get; set; } = "1.0.0";
public string Version { get; set; } = "1.1.0";
}
}
2 changes: 1 addition & 1 deletion src/trcaret/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Reads a tree from stdin and prints lines and caret marks.

## Current version

1.0.0 Unified dispatcher for the Trash toolkit.
1.1.0 Unified dispatcher for the Trash toolkit. Fix broken Cpp target on Github.

## License

Expand Down
2 changes: 1 addition & 1 deletion src/trcaret/trcaret.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This program is part of the Trash toolkit.
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
<Version>1.0.0</Version>
<Version>1.1.0</Version>
<RepositoryUrl>https://github.com/kaby76/Trash/tree/main/src/trcaret</RepositoryUrl>
<RepositoryType>git</RepositoryType>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/trclonereplace/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ public class Config
public string Suffix { get; set; }

[Option("version", Required = false)]
public string Version { get; set; } = "1.0.0";
public string Version { get; set; } = "1.1.0";
}
2 changes: 1 addition & 1 deletion src/trclonereplace/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Clone, rename, and replace symbols in a grammar to optimize full stack fallbacks

## Current version

1.0.0 Unified dispatcher for the Trash toolkit.
1.1.0 Unified dispatcher for the Trash toolkit. Fix broken Cpp target on Github.

## License

Expand Down
2 changes: 1 addition & 1 deletion src/trclonereplace/trclonereplace.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This program is part of the Trash toolkit.]]>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
<Version>1.0.0</Version>
<Version>1.1.0</Version>
<RepositoryUrl>https://github.com/kaby76/Trash/tree/main/src/trclonereplace</RepositoryUrl>
<RepositoryType>git</RepositoryType>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/trcombine/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ public class Config
public bool Verbose { get; set; }

[Option("version", Required = false)]
public string Version { get; set; } = "1.0.0";
public string Version { get; set; } = "1.1.0";
}
}
2 changes: 1 addition & 1 deletion src/trcombine/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ The original grammars are left unchanged.

## Current version

1.0.0 Unified dispatcher for the Trash toolkit.
1.1.0 Unified dispatcher for the Trash toolkit. Fix broken Cpp target on Github.

## License

Expand Down
2 changes: 1 addition & 1 deletion src/trcombine/trcombine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This program is part of the Trash toolkit.]]>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
<Version>1.0.0</Version>
<Version>1.1.0</Version>
<RepositoryUrl>https://github.com/kaby76/Trash/tree/main/src/trcombine</RepositoryUrl>
<RepositoryType>git</RepositoryType>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/trconvert/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ public class Config
public bool Verbose { get; set; }

[Option("version", Required = false)]
public string Version { get; set; } = "1.0.0";
public string Version { get; set; } = "1.1.0";
}
}
2 changes: 1 addition & 1 deletion src/trconvert/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ _Output_

## Current version

1.0.0 Unified dispatcher for the Trash toolkit.
1.1.0 Unified dispatcher for the Trash toolkit. Fix broken Cpp target on Github.

## License

Expand Down
2 changes: 1 addition & 1 deletion src/trconvert/trconvert.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ syntax. This program is part of the Trash toolkit.]]>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
<Version>1.0.0</Version>
<Version>1.1.0</Version>
<RepositoryUrl>https://github.com/kaby76/Trash/tree/main/src/trconvert</RepositoryUrl>
<RepositoryType>git</RepositoryType>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/trcover/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ public class Config
public bool ReadFileNameStdin { get; set; }

[Option("version", Required = false)]
public string Version { get; set; } = "1.0.0";
public string Version { get; set; } = "1.1.0";
}
}
2 changes: 1 addition & 1 deletion src/trcover/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ a grammar.

## Current version

1.0.0 Unified dispatcher for the Trash toolkit.
1.1.0 Unified dispatcher for the Trash toolkit. Fix broken Cpp target on Github.

## License

Expand Down
2 changes: 1 addition & 1 deletion src/trcover/trcover.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ for the entire grammar. This program is part of the Trash toolkit.]]>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
<Version>1.0.0</Version>
<Version>1.1.0</Version>
<RepositoryUrl>https://github.com/kaby76/Trash/tree/main/src/trcover</RepositoryUrl>
<RepositoryType>git</RepositoryType>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/trdistill/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ public class Config
public bool Verbose { get; set; }

[Option("version", Required = false)]
public string Version { get; set; } = "1.0.0";
public string Version { get; set; } = "1.1.0";
}
}
2 changes: 1 addition & 1 deletion src/trdistill/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ _Output_

## Current version

1.0.0 Unified dispatcher for the Trash toolkit.
1.1.0 Unified dispatcher for the Trash toolkit. Fix broken Cpp target on Github.

## License

Expand Down
2 changes: 1 addition & 1 deletion src/trdistill/trdistill.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ syntax. This program is part of the Trash toolkit.]]>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
<Version>1.0.0</Version>
<Version>1.1.0</Version>
<RepositoryUrl>https://github.com/kaby76/Trash/tree/main/src/trdistill</RepositoryUrl>
<RepositoryType>git</RepositoryType>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/trdot/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ public class Config
public bool Verbose { get; set; }

[Option("version", Required = false)]
public string Version { get; set; } = "1.0.0";
public string Version { get; set; } = "1.1.0";
}

2 changes: 1 addition & 1 deletion src/trdot/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ The output will be:

## Current version

1.0.0 Unified dispatcher for the Trash toolkit.
1.1.0 Unified dispatcher for the Trash toolkit. Fix broken Cpp target on Github.

## License

Expand Down
2 changes: 1 addition & 1 deletion src/trdot/trdot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This program is part of the Trash toolkit.
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
<Version>1.0.0</Version>
<Version>1.1.0</Version>
<RepositoryUrl>https://github.com/kaby76/Trash/tree/main/src/trdot</RepositoryUrl>
<RepositoryType>git</RepositoryType>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/trenum/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ public class Config
public bool Verbose { get; set; }

[Option("version", Required = false)]
public string Version { get; set; } = "1.0.0";
public string Version { get; set; } = "1.1.0";
}
}
2 changes: 1 addition & 1 deletion src/trenum/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

## Current version

1.0.0 Unified dispatcher for the Trash toolkit.
1.1.0 Unified dispatcher for the Trash toolkit. Fix broken Cpp target on Github.

## License

Expand Down
2 changes: 1 addition & 1 deletion src/trenum/trenum.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This program is part of the Trash toolkit.
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
<Version>1.0.0</Version>
<Version>1.1.0</Version>
<RepositoryUrl>https://github.com/kaby76/Trash/tree/main/src/trull</RepositoryUrl>
<RepositoryType>git</RepositoryType>
</PropertyGroup>
Expand Down
Loading
Loading