diff options
| author | 2015-03-25 21:51:54 +0100 | |
|---|---|---|
| committer | 2015-03-25 21:51:54 +0100 | |
| commit | 4628051801a5c5297e5bab51d75b28b57b1f5cf5 (patch) | |
| tree | 4853c745a45d22d409ee992efecf4a676fe6de8c /diceparser.h | |
| parent | 7ed106bc79c222586279d4351db1c5f005b0b1f3 (diff) | |
| download | OneRoll-4628051801a5c5297e5bab51d75b28b57b1f5cf5.tar.gz OneRoll-4628051801a5c5297e5bab51d75b28b57b1f5cf5.zip | |
-better comments
-add translation feature for diceCommand.
Diffstat (limited to 'diceparser.h')
| -rw-r--r-- | diceparser.h | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/diceparser.h b/diceparser.h index c4f9f6b..65a8b03 100644 --- a/diceparser.h +++ b/diceparser.h @@ -38,12 +38,16 @@ * * The grammar is something like this: * - * Command =: Expression | ScalarOperator Expression + * Line =: Command | Command;Command + * Command =: Expression | ScalarOperator Expression | ScalarOperator NodeAction Expression * Expression =: number | number Dice | Command - * Dice =: DiceOperator Number(faces) - * DiceOperator =: D + * Dice =: DiceOperator Number(faces) | DiceOperator List + * List =: [Word,Number,',']+ + * NodeAction =: @ + * DiceOperator =: [D,L] * ScalarOperator =: [x,-,*,x,/] * number =: [0-9]+ + * Word =: [A-z]+ * */ @@ -64,14 +68,13 @@ public: * @brief The DiceSymbol enum */ enum NodeAction {JumpBackward}; - - - /** * @brief The OptionOperator enum gathering all options availables for result. */ enum OptionOperator {KeepAndExplose,Keep,Reroll,Explosing,Sort,Count,RerollAndAdd}; + enum CommandOperator {}; + /** * @brief DiceParser default constructor */ @@ -95,9 +98,16 @@ public: * @brief displayResult */ QString displayResult(); - + /** + * @brief readExpression + * @param str + * @param node + * @return + */ bool readExpression(QString& str,ExecutionNode* & node); - + /** + * @brief displayDotTree + */ void displayDotTree(); private: |