code: private void addSubMatrixVariables(List<TokenList.Token> inputs, List<Variable> variables) {
          for (int i = 0; i < inputs.size(); i++) {
              TokenList.Token t = inputs.get(i);
              if( t.getType() != Type.VARIABLE )
                  throw new ParseError("Expected variables only in sub-matrix input, not "+t.getType());
              Variable v = t.getVariable();
              if( v.getType() == VariableType.INTEGER_SEQUENCE || isVariableInteger(t) ) {
                  variables.add(v);
              } else {
                  throw new ParseError("Expected an integer, integer sequence, or array range to define a submatrix");
              }
          }
      }
docs: Goes through the token lists and adds all the variables which can be used to define a sub-matrix.  If anything
  else is found an excpetion is thrown