aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/diceparser.h
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2015-04-24 21:35:17 +0200
committerRenaud G <renaud@rolisteam.org>2015-04-24 21:35:17 +0200
commit8beb664172cf2c15abb4e12938b8978506471c02 (patch)
treef033c9df5436abe8848a8b4d69353229028c02bd /diceparser.h
parent67fd3b480f543f2f18bd632ea85d829ba2102a20 (diff)
parentedfcca8d1a630ca7ca79133bd0b03af14fef6363 (diff)
downloadOneRoll-8beb664172cf2c15abb4e12938b8978506471c02.tar.gz
OneRoll-8beb664172cf2c15abb4e12938b8978506471c02.zip
Merge branch 'master' of github.com:obiwankennedy/DiceParser
Conflicts: parsingtoolbox.cpp
Diffstat (limited to 'diceparser.h')
-rw-r--r--diceparser.h48
1 files changed, 38 insertions, 10 deletions
diff --git a/diceparser.h b/diceparser.h
index bec3975..4031bdc 100644
--- a/diceparser.h
+++ b/diceparser.h
@@ -32,6 +32,12 @@
#include "range.h"
#include "booleancondition.h"
#include "parsingtoolbox.h"
+#include "dicealias.h"
+
+
+typedef QPair<QList<quint64>,bool> DiceAndHighlight;
+typedef QList<DiceAndHighlight > ListDiceResult;
+typedef QMap<int,ListDiceResult > ExportedDiceResult;
class ExploseDiceNode;
/**
@@ -82,6 +88,10 @@ public:
* @brief DiceParser default constructor
*/
DiceParser();
+ /**
+ * @brief ~DiceParser
+ */
+ virtual ~DiceParser();
/**
* @brief parseLine, method to call for starting the dice roll. It will parse the command and run the execution tree.
@@ -111,7 +121,7 @@ public:
/**
* @brief displayDotTree
*/
- void displayDotTree();
+ void writeDownDotTree(QString filepath);
/**
* @brief getLastIntegerResult
* @return
@@ -126,7 +136,7 @@ public:
* @brief getLastDiceResult
* @return
*/
- QString getLastDiceResult();
+ void getLastDiceResult(ExportedDiceResult& diceValues);
/**
* @brief hasIntegerResultNotInFirst
* @return
@@ -157,6 +167,21 @@ public:
* @return
*/
QString humanReadableError();
+ /**
+ * @brief getAliases
+ * @return
+ */
+ QList<DiceAlias*>* getAliases();
+ /**
+ * @brief insertAlias
+ */
+ void insertAlias(DiceAlias*, int);
+ /**
+ * @brief DiceParser::convertAlias
+ * @param str
+ * @return
+ */
+ QString convertAlias(QString str);
private:
/**
@@ -218,12 +243,6 @@ private:
* @return
*/
bool readOperand(QString&,ExecutionNode* & node);
- /**
- * @brief DiceParser::convertAlias
- * @param str
- * @return
- */
- QString convertAlias(QString str);
/**
* @brief getErrorList
@@ -244,8 +263,17 @@ private:
*/
bool readNode(QString& str,ExecutionNode* & node);
-
+ /**
+ * @brief getLeafNode
+ * @return
+ */
ExecutionNode* getLeafNode();
+
+ /**
+ * @brief hasResultOfType
+ * @param notthelast
+ * @return
+ */
bool hasResultOfType(Result::RESULT_TYPE,bool notthelast = false);
@@ -253,7 +281,7 @@ private:
QMap<QString,DiceOperator>* m_mapDiceOp;
QMap<QString,OptionOperator>* m_OptionOp;
QMap<QString,NodeAction>* m_nodeActionMap;
- QMap<QString,QString>* m_aliasMap;
+ QList<DiceAlias*>* m_aliasList;
QStringList* m_commandList;
QMap<ExecutionNode::ERROR_CODE,QString> m_errorMap;