code: private static Rule parseRule(String description) throws ParseException {
          if (description.length() == 0) {
              return DEFAULT_RULE;
          }
  
          description = description.toLowerCase(Locale.ENGLISH);
  
          int x = description.indexOf(':');
          if (x == -1) {
              throw new ParseException("missing ':' in rule description '" +
                      description + "'", 0);
          }
  
          String keyword = description.substring(0, x).trim();
          if (!isValidKeyword(keyword)) {
              throw new ParseException("keyword '" + keyword +
                      " is not valid", 0);
          }
  
          description = description.substring(x+1).trim();
          String[] constraintOrSamples = AT_SEPARATED.split(description);
          boolean sampleFailure = false;
          FixedDecimalSamples integerSamples = null, decimalSamples = null;
          switch (constraintOrSamples.length) {
          case 1: break;
          case 2:
              integerSamples = FixedDecimalSamples.parse(constraintOrSamples[1]);
              if (integerSamples.sampleType == SampleType.DECIMAL) {
                  decimalSamples = integerSamples;
                  integerSamples = null;
              }
              break;
          case 3:
              integerSamples = FixedDecimalSamples.parse(constraintOrSamples[1]);
              decimalSamples = FixedDecimalSamples.parse(constraintOrSamples[2]);
              if (integerSamples.sampleType != SampleType.INTEGER || decimalSamples.sampleType != SampleType.DECIMAL) {
                  throw new IllegalArgumentException("Must have @integer then @decimal in " + description);
              }
              break;
          default:
              throw new IllegalArgumentException("Too many samples in " + description);
          }
          if (sampleFailure) {
              throw new IllegalArgumentException("Ill-formed samples—'@' characters.");
          }
  
          // 'other' is special, and must have no rules; all other keywords must have rules.
          boolean isOther = keyword.equals("other");
          if (isOther != (constraintOrSamples[0].length() == 0)) {
              throw new IllegalArgumentException("The keyword 'other' must have no constraints, just samples.");
          }
  
          Constraint constraint;
          if (isOther) {
              constraint = NO_CONSTRAINT;
          } else {
              constraint = parseConstraint(constraintOrSamples[0]);
          }
          return new Rule(keyword, constraint, integerSamples, decimalSamples);
      }
docs: /*
  Syntax:
  rule : keyword ':' condition
  keyword: <identifier>