Skip to content

Commit

Permalink
Merge pull request #37 from gbenroscience/gbenroscience-patch-1
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
gbenroscience authored Aug 17, 2024
2 parents c5d1377 + 0e6fb9a commit 7ca27af
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ If you need to access this library via Maven Central, do:
<dependency>
<groupId>com.github.gbenroscience</groupId>
<artifactId>parser-ng</artifactId>
<version>0.1.9</version>
<version>0.1.10</version>
</dependency>

Expand Down Expand Up @@ -82,20 +82,20 @@ ParserNG is written completely in (pure) Java and so is as cross-platform as Jav
## Using ParserNG as commandline tool
You can use jar directly as commandline calculus. Unless the tool is packed to your distribution:
```
java -jar parser-ng-0.1.8.jar 1+1
java -jar parser-ng-0.1.10.jar 1+1
2.0
```
Or as logical parser
```
java -jar parser-ng-0.1.8.jar -l true and true
java -jar parser-ng-0.1.10.jar -l true and true
true
java -jar parser-ng-0.1.8.jar -l "2 == (4-2)"
java -jar parser-ng-0.1.10.jar -l "2 == (4-2)"
true
```
You can get help by
```
java -jar parser-ng-0.1.8.jar -h
ParserNG 0.1.8 math.Main
java -jar parser-ng-0.1.10.jar -h
ParserNG 0.1.10 math.Main
-h/-H/--help this text; do not change for help (witout dashes), which lists functions
-v/-V/--verbose output is reprinted to stderr with some inter-steps
-l/-L/--logic will add logical expression wrapper around the expression
Expand All @@ -117,11 +117,11 @@ java -jar parser-ng-0.1.8.jar -h
```
You can get examples by verbose help:
```
java -jar parser-ng-0.1.8.jar -h -v
java -jar parser-ng-0.1.10.jar -h -v
```
you can list functions:
```
java -jar parser-ng-0.1.8.jar help
java -jar parser-ng-0.1.10.jar help
List of currently known methods:
acos - help not yet written. See https://github.com/gbenroscience/ParserNG
...
Expand All @@ -130,7 +130,7 @@ List of functions is just tip of iceberg, see: https://github.com/gbenroscience/
```
you can list logical operators:
```
java -jar parser-ng-0.1.8.jar -l help
java -jar parser-ng-0.1.10.jar -l help
Comparing operators: !=, ==, >=, <=, le, ge, lt, gt, <, >
Logical operators: impl, xor, imp, eq, or, and, |, &
As Mathematical parts are using () as brackets, Logical parts must be grouped by [] eg.
Expand All @@ -145,40 +145,40 @@ Program can work with stdin, out and err properly. Can work with multiline input
### cmdline examples
Following lines describes, how stdin/arguments are processed, and how different is input/output with `-t` on/off
```
java -jar parser-ng-0.1.8.jar -h
java -jar parser-ng-0.1.10.jar -h
this help
java -jar parser-ng-0.1.8.jar 1+1
java -jar parser-ng-0.1.10.jar 1+1
2.0
java -jar parser-ng-0.1.8.jar "1+1
java -jar parser-ng-0.1.10.jar "1+1
+2+2"
2.0
4.0
java -jar parser-ng-0.1.8.jar -t "1+1
java -jar parser-ng-0.1.10.jar -t "1+1
+2+2"
6.0
java -jar parser-ng-0.1.8.jar -i 1+1
java -jar parser-ng-0.1.10.jar -i 1+1
nothing, will expect manual output, and calculate line by line
java -jar parser-ng-0.1.8.jar -i -t 1+1
java -jar parser-ng-0.1.10.jar -i -t 1+1
nothing, will expect manual output and calcualte it all as one expression
echo 2+2 | java -jar parser-ng-0.1.8.jar 1+1
echo 2+2 | java -jar parser-ng-0.1.10.jar 1+1
2.0
echo "1+1
+2+2 | java -jar parser-ng-0.1.8.jar -i
+2+2 | java -jar parser-ng-0.1.10.jar -i
2.0
4.0
echo "1+1
+2+2 | java -jar parser-ng-0.1.8.jar -i -t
+2+2 | java -jar parser-ng-0.1.10.jar -i -t
6.0
java -cp parser-ng-0.1.8.jar parser.cmd.ParserCmd "1+1
java -cp parser-ng-0.1.10.jar parser.cmd.ParserCmd "1+1
will ask for manual imput en evaluate per line
echo "1+1
+2+2 | java -cp parser-ng-0.1.8.jar parser.cmd.ParserCmd 2>/dev/null
+2+2 | java -cp parser-ng-0.1.10.jar parser.cmd.ParserCmd 2>/dev/null
2.0
4.0
java -cp parser-ng-0.1.8.jar parser.MathExpression "1+1
java -cp parser-ng-0.1.10.jar parser.MathExpression "1+1
+2+2"
6.0
java -cp parser-ng-0.1.8.jar parser.LogicalExpression "true or false"
java -cp parser-ng-0.1.10.jar parser.LogicalExpression "true or false"
true
```
Expand Down

0 comments on commit 7ca27af

Please sign in to comment.