aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/diceparser.h
diff options
context:
space:
mode:
Diffstat (limited to 'diceparser.h')
-rw-r--r--diceparser.h73
1 files changed, 70 insertions, 3 deletions
diff --git a/diceparser.h b/diceparser.h
index 65a8b03..e4ea0e3 100644
--- a/diceparser.h
+++ b/diceparser.h
@@ -33,6 +33,7 @@
#include "booleancondition.h"
#include "parsingtoolbox.h"
+class ExploseDiceNode;
/**
* @mainpage DiceParser
*
@@ -109,6 +110,51 @@ public:
* @brief displayDotTree
*/
void displayDotTree();
+ /**
+ * @brief getLastIntegerResult
+ * @return
+ */
+ qreal getLastIntegerResult();
+ /**
+ * @brief getSumOfDiceResult
+ * @return
+ */
+ qreal getSumOfDiceResult();
+ /**
+ * @brief getLastDiceResult
+ * @return
+ */
+ QString getLastDiceResult();
+ /**
+ * @brief hasIntegerResultNotInFirst
+ * @return
+ */
+ bool hasIntegerResultNotInFirst();
+ /**
+ * @brief hasDiceResult
+ * @return
+ */
+ bool hasDiceResult();
+ /**
+ * @brief getDiceCommand
+ * @return
+ */
+ QString getDiceCommand();
+ /**
+ * @brief hasStringResult
+ * @return
+ */
+ bool hasStringResult();
+ /**
+ * @brief getStringResult
+ * @return
+ */
+ QString getStringResult();
+ /**
+ * @brief humanReadableError
+ * @return
+ */
+ QString humanReadableError();
private:
/**
@@ -157,7 +203,13 @@ private:
* @return
*/
DiceRollerNode* addRollDiceNode(qint64 faces,ExecutionNode*);
-
+ /**
+ * @brief addExploseDiceNode
+ * @param faces
+ * @param previous
+ * @return
+ */
+ ExploseDiceNode* addExploseDiceNode(qint64 faces,ExecutionNode* previous);
/**
* @brief readOperand
* @param node
@@ -176,12 +228,25 @@ private:
* @return
*/
QList<ExecutionNode::ERROR_CODE> getErrorList();
-
+ /**
+ * @brief readInstructionOperator
+ * @param c
+ * @return
+ */
bool readInstructionOperator(QChar c);
-
+ /**
+ * @brief readNode
+ * @param str
+ * @param node
+ * @return
+ */
bool readNode(QString& str,ExecutionNode* & node);
+ ExecutionNode* getLeafNode();
+ bool hasResultOfType(Result::RESULT_TYPE,bool notthelast = false);
+
+
private:
QMap<QString,DiceOperator>* m_mapDiceOp;
QMap<QString,OptionOperator>* m_OptionOp;
@@ -189,6 +254,8 @@ private:
QMap<QString,QString>* m_aliasMap;
QStringList* m_commandList;
+ QMap<ExecutionNode::ERROR_CODE,QString> m_errorMap;
+
ExecutionNode* m_start;
ExecutionNode* m_current;