From 095e1e5016369680dd320036cb1456df54b40a1a Mon Sep 17 00:00:00 2001 From: Renaud G Date: Mon, 18 Dec 2017 14:31:18 +0100 Subject: Update README.md update grammar --- README.md | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 0e32f80..79561c9 100644 --- a/README.md +++ b/README.md @@ -9,13 +9,18 @@ Rolisteam Dice Parser The grammar is something like this: ``` -Command =: Expression -Expression =: number | number Dice DiceOperation | ScalarOperator Expression | string +Command =: Instruction [';',Instruction]* +Instruction =: Expression +Expression =: number | number Dice DiceOperation | ScalarOperator Expression | string | variable Expression Dice =: DiceOperator Number(faces) | DiceOperator ListOfValues DiceOperator =: D | L -DiceOperation =: Keep | KeepAndExplose | sort | if | explose | jumpbackward | merge | filter | parenthese | count +DiceOperation =: Keep | KeepAndExplose | sort | if | explose | jumpbackward | merge | filter | parenthese | count | paint | group ScalarOperator =: [x,-,*,x,/] -number =: [0-9]+ +number =: [0-9]+ | constantValue +constantValue =: ${id | label} +id=[_,a-z][_,A-z,0-9]* +label=[_,a-z][_,A-z,0-9,é,è,ç,û,ê,â]* +variable = ${[0-9]+} Validator =: BooleanValidator | RangeValidator | CompositeValidator CompositeValidator =: Validator LogicOpetator Validator LogicOpetator =: = | > | => | < | =< @@ -26,7 +31,9 @@ String =: [A-z0-9]+ Keep =: k Number KeepAndExplose =: K number sort =: s -if =: i compareMethod [Validator] {Expression} +if =: i compareMethod [Validator] {Expression}[{Expression}] +paint =: p [ count : color ] +group =: number explose =: e Validator jumpbackward =: @DiceOperation merge =: m | m Expression -- cgit v1.2.3-70-g09d2