aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/diceparser.h
diff options
context:
space:
mode:
Diffstat (limited to 'diceparser.h')
-rw-r--r--diceparser.h28
1 files changed, 19 insertions, 9 deletions
diff --git a/diceparser.h b/diceparser.h
index 22dead1..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:
@@ -177,7 +187,7 @@ private:
QMap<QString,OptionOperator>* m_OptionOp;
QMap<QString,NodeAction>* m_nodeActionMap;
QMap<QString,QString>* m_aliasMap;
- QList<QString>* m_commandList;
+ QStringList* m_commandList;
ExecutionNode* m_start;