final public ParsedPattern DataExpr(boolean topLevel, Scope scope, Annotations a, Token[] except) throws ParseException {
  Token datatypeToken;
  Location loc;
  String datatype;
  String datatypeUri = null;
  String s = null;
  ParsedPattern e = null;
  DataPatternBuilder dpb;
    datatypeToken = DatatypeName();
    datatype = datatypeToken.image;
    loc = makeLocation(datatypeToken);
    int colon = datatype.indexOf(':');
    if (colon < 0)
      datatypeUri = "";
    else {
      String prefix = datatype.substring(0, colon);
      datatypeUri = lookupDatatype(prefix, datatypeToken);
      datatype = datatype.substring(colon + 1);
    }
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case LITERAL:
      s = Literal();
      if (topLevel && annotationsIncludeElements) {
        error("top_level_follow_annotation", datatypeToken);
        a = null;
      }
      {if (true) return sb.makeValue(datatypeUri, datatype, s, getContext(), defaultNamespace, loc, a);}
      break;
    default:
      jj_la1[48] = jj_gen;
        dpb = sb.makeDataPatternBuilder(datatypeUri, datatype, loc);
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case 11:
        Params(dpb);
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case 30:
          e = Except(scope, except);
          break;
        default:
          jj_la1[45] = jj_gen;
          ;
        }
        break;
      default:
        jj_la1[47] = jj_gen;
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case 30:
          e = Except(scope, except);
          break;
        default:
          jj_la1[46] = jj_gen;
          ;
        }
      }
        {if (true) return e == null ? dpb.makePattern(loc, a) : dpb.makePattern(e, loc, a);}
    }
    throw new Error("Missing return statement in function");
  }