aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2016-12-04 12:58:58 +0100
committerRenaud G <renaud@rolisteam.org>2016-12-04 12:58:58 +0100
commit1bd34a24eaa8717ae61f2f46339001f7b830808e (patch)
treedd5f059ef5f41ea0b3b229707ec2ae5924f5f43d
parentef54c6c64691d5b766f02edb87c296611dd7f65d (diff)
parent43ab25390377f3a312dc7245d83fe6abe9d0728a (diff)
downloadOneRoll-1bd34a24eaa8717ae61f2f46339001f7b830808e.tar.gz
OneRoll-1bd34a24eaa8717ae61f2f46339001f7b830808e.zip
Merge branch 'master' of github.com:Rolisteam/DiceParser
-rw-r--r--HelpMe.md18
-rw-r--r--README.md35
2 files changed, 32 insertions, 21 deletions
diff --git a/HelpMe.md b/HelpMe.md
index d2a12a0..b7a7db8 100644
--- a/HelpMe.md
+++ b/HelpMe.md
@@ -170,20 +170,20 @@ There is also 2 optional parameters
> i*[]{}{}
-\* : the compare method
-[] : the validator
-{} : the true instruction
-{} : the false instruction
+* \* : the compare method
+* [] : the validator
+* {} : the true instruction
+* {} : the false instruction
## Compare method
There are 3 different methods.
-* On Each : the condition is tested on each die from the previous part of the command. \[Default method\]
-* All Of Them : All dice must fit the condition to trigger the true instruction. If all dice do not fit the condition the false instruction is run.
-* One Of Them : at least one die must fit the condition to trigger the true instruction. If no dices fit the condition the false instruction is run.
+* **On Each** : the condition is tested on each die from the previous part of the command. \[Default method\]
+* **All Of Them** : All dice must fit the condition to trigger the true instruction. If all dice do not fit the condition the false instruction is run.
+* **One Of Them** : at least one die must fit the condition to trigger the true instruction. If no dices fit the condition the false instruction is run.
-To switch the operator to act in '''All Of Them''' method you must add '*' character as compare method position.
-To switch the operator to act in '''One Of Them''' method you must add '.' character as compare method position.
+To switch the operator to act in **All Of Them** method you must add **\*** character as compare method position.
+To switch the operator to act in **One Of Them** method you must add **.** character as compare method position.
## example:
diff --git a/README.md b/README.md
index a0031a6..0746586 100644
--- a/README.md
+++ b/README.md
@@ -3,26 +3,37 @@
# DiceParser
-
-
Rolisteam Dice Parser
## Grammar
The grammar is something like this:
+```
Command =: Expression
-
-Expression =: number | number Dice | ScalarOperator Expression
-
-Dice =: DiceOperator Number(faces)
-
-DiceOperator =: D
-
+Expression =: number | number Dice DiceOperation | ScalarOperator Expression | string
+Dice =: DiceOperator Number(faces) | DiceOperator ListOfValues
+DiceOperator =: D | L
+DiceOperation =: Keep | KeepAndExplose | sort | if | explose | jumpbackward | merge | filter | parenthese | count
ScalarOperator =: [x,-,*,x,/]
-
number =: [0-9]+
-
-Validator =: number | [operator number] | [ number - number ]
+Validator =: BooleanValidator | RangeValidator | CompositeValidator
+CompositeValidator =: Validator LogicOpetator Validator
+LogicOpetator =: = | > | => | < | =<
+RangeValidator =: [ number - number ]
+BooleanValidator =: number | [operator number] |
+ListOfValue=: String[Range],ListOfValue | String[Range]
+String =: [A-z0-9]+
+Keep =: k Number
+KeepAndExplose =: K number
+sort =: s
+if =: i compareMethod [Validator] {Expression}
+explose =: e Validator
+jumpbackward =: @DiceOperation
+merge =: m | m Expression
+filter =: f Validator
+parenthese =: (expression)
+count =: c Validator
+```
## Example: