module example-5-a {

  yang-version "1.1";

  namespace "http://example.com/example-5-a";

  prefix "ex5a";

  import example-5-b {
    prefix "ex5b";
  }

  typedef my-string {
    type string {
      length "2..4";
      pattern "x*y" {
	error-message "xes and y";
      }
    }
    default "xxy";
  }

  leaf binary-leaf {
    type binary;
  }

  leaf bits-leaf {
    type bits {
      bit un {
        position "1";
      }
      bit dos;
      bit tres;
    }
  }

  leaf boolean-leaf {
    type boolean;
  }

  leaf decimal64-leaf {
    type decimal64 {
      fraction-digits "4";
    }
  }

  leaf empty-leaf {
    type empty;
  }

  leaf enumeration-leaf {
    type enumeration {
      enum Bashful;
      enum Doc;
      enum Dopey;
      enum Grumpy;
      enum Happy;
      enum Sleepy;
      enum Sneezy;
    }
  }

  leaf identityref-leaf {
    type identityref {
      base ex5b:base-identity;
    }
    default "ex5b:derived-identity";
  }

  leaf instance-identifier-leaf {
    type instance-identifier;
  }

  leaf leafref-leaf {
    type leafref {
      path "/string-leaf";
      require-instance "true";
    }
  }

  leaf string-leaf {
    type my-string;
  }

  leaf union-leaf {
    type union {
      type my-string;
      type boolean;
    }
  }
}
