public AttributeField attributeField() throws ParseException {
    try {
      AttributeField attributeField = new AttributeField();

      this.lexer.match('a');

      this.lexer.SPorHT();
      this.lexer.match('=');

      this.lexer.SPorHT();

      NameValue nameValue = new NameValue();

      int ptr = this.lexer.markInputPosition();
      try {
        String name = lexer.getNextToken(':');
        this.lexer.consume(1);
        String value = lexer.getRest();
        nameValue = new NameValue(name.trim(), value.trim());
      } catch (ParseException ex) {
        this.lexer.rewindInputPosition(ptr);
        String rest = this.lexer.getRest();
        if (rest == null) throw new ParseException(this.lexer.getBuffer(), this.lexer.getPtr());
        nameValue = new NameValue(rest.trim(), ""); // jvB: use empty string for flag values
      }
      attributeField.setAttribute(nameValue);

      this.lexer.SPorHT();

      return attributeField;
    } catch (Exception e) {
      e.printStackTrace();
      throw new ParseException(e.getMessage(), 0);
    }
  }