From 7ed106bc79c222586279d4351db1c5f005b0b1f3 Mon Sep 17 00:00:00 2001 From: Renaud G Date: Tue, 24 Mar 2015 21:53:40 +0100 Subject: -Add listaliasnode to list all alias. --- diceparser.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'diceparser.h') diff --git a/diceparser.h b/diceparser.h index 22dead1..c4f9f6b 100644 --- a/diceparser.h +++ b/diceparser.h @@ -177,7 +177,7 @@ private: QMap* m_OptionOp; QMap* m_nodeActionMap; QMap* m_aliasMap; - QList* m_commandList; + QStringList* m_commandList; ExecutionNode* m_start; -- cgit v1.2.3-70-g09d2 From 4628051801a5c5297e5bab51d75b28b57b1f5cf5 Mon Sep 17 00:00:00 2001 From: Renaud G Date: Wed, 25 Mar 2015 21:51:54 +0100 Subject: -better comments -add translation feature for diceCommand. --- diceparser.cpp | 6 +++--- diceparser.h | 26 ++++++++++++++++++-------- 2 files changed, 21 insertions(+), 11 deletions(-) (limited to 'diceparser.h') diff --git a/diceparser.cpp b/diceparser.cpp index 56fa72e..1e23c6b 100644 --- a/diceparser.cpp +++ b/diceparser.cpp @@ -63,7 +63,7 @@ DiceParser::DiceParser() m_aliasMap = new QMap; m_aliasMap->insert("l5r","D10k"); - m_aliasMap->insert("l5R","D10e10k"); + m_aliasMap->insert("l5R","D10K"); m_aliasMap->insert("nwod","D10e10c[>7]"); m_aliasMap->insert("nwod","D10e10c[>7]"); @@ -72,8 +72,8 @@ DiceParser::DiceParser() m_commandList = new QStringList(); - m_commandList->append("help"); - m_commandList->append("la"); + m_commandList->append(tr("help")); + m_commandList->append(tr("la")); } 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: -- cgit v1.2.3-70-g09d2