code: private final DiceOperand getDiceOperand(final DiceContext ctx) {
          final Dice dice;                     // Parsed dice
          final Integer quantity;              // Number of dice
          final Integer sides;                 // Number of sides
          final Iterator<TerminalNode> digits; // Parsed digits
  
          // Parses the dice data
          digits = ctx.DIGIT().iterator();
  
          if (Iterables.size(ctx.DIGIT()) > 1) {
              if ((ctx.ADDOPERATOR() != null) && (SUBTRACTION_OPERATOR
                      .equals(ctx.ADDOPERATOR().getText()))) {
                  LOGGER.debug("This is part of a subtraction. Reversing sign.");
                  quantity = 0 - Integer.parseInt(digits.next().getText());
              } else {
                  quantity = Integer.parseInt(digits.next().getText());
              }
          } else {
              // No quantity of dice defined
              // Defaults to 1
              quantity = 1;
          }
          sides = Integer.parseInt(digits.next().getText());
  
          // Creates the dice
          dice = new DefaultDice(quantity, sides);
  
          return new DefaultDiceOperand(dice);
      }
docs: Creates a dice operand from the parsed context data.
  <p>
  If the dice is being subtracted then the sign of the dice set is
  reversed.
  
  @param ctx
  parsed context
  @return a dice operand