From reddituser, 1 Year ago, written in Plain Text.
Embed
  1. / Step 2: If you see an operand, push operand object onto the exprStack
  2.             if (currentExprScanner.hasNextInt())
  3.             {
  4.                 // This force scanner to grab all of the digits
  5.                 // Otherwise, it will just get one char
  6.                 String dataString = currentExprScanner.findInLine("\\d+");
  7.                 exprStack.push(dataString);
  8.             }
  9.             else
  10.             {
  11.                 // Get next token, only one char in string token
  12.                 String aToken = currentExprScanner.next();
  13.                 char item = aToken.charAt(0);