public static GeneralizedSymbol lookupRigidSymbolWrtModule(String name, Module module, int kindofsym) {
    { int offset = Stella.lookupRigidSymbolOffsetWrtModule(name, module, kindofsym);

      if (offset != Stella.NULL_INTEGER) {
        switch (kindofsym) {
          case 0: 
            return (Symbol.getSymFromOffset(offset));
          case 1: 
            return (Surrogate.getSgtFromOffset(offset));
          case 2: 
            return (Keyword.getKwdFromOffset(offset));
          default:
            { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

              stream000.nativeStream.print("`" + kindofsym + "' is not a valid case option");
              throw ((StellaException)(StellaException.newStellaException(stream000.theStringReader()).fillInStackTrace()));
            }
        }
      }
      else {
        return (null);
      }
    }
  }