diff --git a/README.md b/README.md index 29a317a56..ad130cbb0 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,29 @@ # kotgll -* About -* Usage +* [About](https://github.com/vadyushkins/kotgll#about) +* [Usage](https://github.com/vadyushkins/kotgll#usage) + * [From sources](https://github.com/vadyushkins/kotgll#from-sources) + * [Using JAR](https://github.com/vadyushkins/kotgll#using-jar) ## About GLL implementation in Kotlin ## Usage -### Run from sources +### Command Line Interface + +```text +Usage: kotgll options_list +Options: + --input -> Input format (always required) { Value should be one of [string, graph] } + --grammar -> Grammar format (always required) { Value should be one of [cfg, rsm] } + --sppf [ON] -> Sppf mode { Value should be one of [on, off] } + --inputPath -> Path to input txt file (always required) { String } + --grammarPath -> Path to grammar txt file (always required) { String } + --outputPath -> Path to output txt file (always required) { String } + --help, -h -> Usage info +``` + +### From sources #### Step 1. Clone repository @@ -29,36 +45,24 @@ or `gradle run --args="--help"` -You will see the following message. +You will see the ["Options list"](https://github.com/vadyushkins/kotgll#command-line-interface) message. + +#### Example ```text -Usage: kotgll options_list -Options: - --input -> Input format (always required) { Value should be one of [string, graph] } - --grammar -> Grammar format (always required) { Value should be one of [cfg, rsm] } - --sppf [ON] -> Sppf mode { Value should be one of [on, off] } - --inputPath -> Path to input txt file (always required) { String } - --grammarPath -> Path to grammar txt file (always required) { String } - --outputPath -> Path to output txt file (always required) { String } - --help, -h -> Usage info +gradle run --args="--input graph --grammar rsm --sppf off --inputPath src/test/resources/cli/TestGraphReadWriteCSV/dyck.csv --grammarPath src/test/resources/cli/TestRSMReadWriteTXT/dyck.txt --outputPath ./result.txt" ``` -#### Example +### Using JAR + +#### Step 1. Download the latest JAR ```text -gradle run --args="--input graph --grammar rsm --sppf off --inputPath src/test/resources/cli/TestGraphReadWriteCSV/dyck.csv --grammarPath src/test/resources/cli/TestRSMReadWriteTXT/dyck.txt --outputPath ./result.txt" +curl -L -O https://github.com/vadyushkins/kotgll/releases/download/test/kotgll-1.0.0.jar ``` -In file `result.txt` you will see the following. +#### Step 2. Run JAR with Java ```text -0 0 -0 2 -0 3 -1 1 -1 2 -1 3 -2 2 -2 3 -3 3 -``` \ No newline at end of file +java -jar --input graph --grammar rsm --sppf off --inputPath src/test/resources/cli/TestGraphReadWriteCSV/dyck.csv --grammarPath src/test/resources/cli/TestRSMReadWriteTXT/dyck.txt --outputPath ./result.txt +```