Runs getvar on the inStack. The parameter is popped off the inStack, and the variable's value is pushed back to the top of inStack. @param inStack the jep stack @throws ParseException
(final Stack inStack)
| 53 | * @throws ParseException |
| 54 | */ |
| 55 | @SuppressWarnings("unchecked") //Uses JEP, which doesn't use generics |
| 56 | @Override |
| 57 | public void run(final Stack inStack) throws ParseException |
| 58 | { |
| 59 | // check the stack |
| 60 | checkStack(inStack); |
| 61 | |
| 62 | // get the parameter from the stack |
| 63 | |
| 64 | // |
| 65 | // have to do this in reverse order...this is a stack afterall |
| 66 | // |
| 67 | final Object param1 = inStack.pop(); |
| 68 | |
| 69 | if (param1 instanceof String) |
| 70 | { |
| 71 | final Object result = pcgen.core.RollingMethods.roll((String) param1); |
| 72 | inStack.push(result); |
| 73 | } |
| 74 | else |
| 75 | { |
| 76 | throw new ParseException("Invalid parameter type"); |
| 77 | } |
| 78 | } |
| 79 | } |