@SuppressWarnings("fallthrough") private void dtdatt(Pair elm) throws Exception {
  char attqn[]=null;
  Pair att=null;
  char ch;
  for (short st=0; st >= 0; ) {
    ch=getch();
switch (st) {
case 0:
switch (chtyp(ch)) {
case 'a':
case 'A':
case '_':
case 'X':
case ':':
        bkch();
      attqn=qname(mIsNSAware);
    att=find(elm.list,attqn);
  if (att == null) {
    att=pair(elm.list);
    att.chars=attqn;
    elm.list=att;
  }
 else {
    att=pair(null);
    att.chars=attqn;
    att.id='c';
  }
wsskip();
st=1;
break;
case '%':
pent(' ');
break;
case ' ':
break;
default :
panic(FAULT);
break;
}
break;
case 1:
switch (chtyp(ch)) {
case '(':
att.id='u';
st=2;
break;
case '%':
pent(' ');
break;
case ' ':
break;
default :
bkch();
bntok();
att.id=bkeyword();
switch (att.id) {
case 'o':
if (wsskip() != '(') {
panic(FAULT);
}
ch=getch();
st=2;
break;
case 'i':
case 'r':
case 'R':
case 'n':
case 'N':
case 't':
case 'T':
case 'c':
wsskip();
st=4;
break;
default :
panic(FAULT);
break;
}
break;
}
break;
case 2:
switch (chtyp(ch)) {
case 'a':
case 'A':
case 'd':
case '.':
case ':':
case '-':
case '_':
case 'X':
bkch();
switch (att.id) {
case 'u':
bntok();
break;
case 'o':
mBuffIdx=-1;
bname(false);
break;
default :
panic(FAULT);
break;
}
wsskip();
st=3;
break;
case '%':
pent(' ');
break;
case ' ':
break;
default :
panic(FAULT);
break;
}
break;
case 3:
switch (ch) {
case ')':
wsskip();
st=4;
break;
case '|':
wsskip();
switch (att.id) {
case 'u':
bntok();
break;
case 'o':
mBuffIdx=-1;
bname(false);
break;
default :
panic(FAULT);
break;
}
wsskip();
break;
case '%':
pent(' ');
break;
default :
panic(FAULT);
break;
}
break;
case 4:
switch (ch) {
case '#':
bntok();
switch (bkeyword()) {
case 'F':
switch (wsskip()) {
case '\"':
case '\'':
st=5;
break;
case EOS:
panic(FAULT);
default :
st=-1;
break;
}
break;
case 'Q':
case 'I':
st=-1;
break;
default :
panic(FAULT);
break;
}
break;
case '\"':
case '\'':
bkch();
st=5;
break;
case ' ':
case '\n':
case '\r':
case '\t':
break;
case '%':
pent(' ');
break;
default :
bkch();
st=-1;
break;
}
break;
case 5:
switch (ch) {
case '\"':
case '\'':
bkch();
bqstr('d');
att.list=pair(null);
att.list.chars=new char[att.chars.length + mBuffIdx + 3];
System.arraycopy(att.chars,1,att.list.chars,0,att.chars.length - 1);
att.list.chars[att.chars.length - 1]='=';
att.list.chars[att.chars.length]=ch;
System.arraycopy(mBuff,1,att.list.chars,att.chars.length + 1,mBuffIdx);
att.list.chars[att.chars.length + mBuffIdx + 1]=ch;
att.list.chars[att.chars.length + mBuffIdx + 2]=' ';
st=-1;
break;
default :
panic(FAULT);
break;
}
break;
default :
panic(FAULT);
break;
}
}
}

@ SuppressWarnings ( "fallthrough" ) private void dtdatt ( Pair elm ) throws Exception { char attqn [ ] = null ; Pair att = null ; char ch ; for ( short st = 0 ; st >= 0 ; ) { ch = getch ( ) ; switch ( st ) { case 0 : switch ( chtyp ( ch ) ) { case 'a' : case 'A' : case '_' : case 'X' : case ':' : bkch ( ) ; attqn = qname ( mIsNSAware ) ; att = find ( elm . list , attqn ) ; if ( att == null ) { att = pair ( elm . list ) ; att . chars = attqn ; elm . list = att ; } else { att = pair ( null ) ; att . chars = attqn ; att . id = 'c' ; } wsskip ( ) ; st = 1 ; break ; case '%' : pent ( ' ' ) ; break ; case ' ' : break ; default : panic ( FAULT ) ; break ; } break ; case 1 : switch ( chtyp ( ch ) ) { case '(' : att . id = 'u' ; st = 2 ; break ; case '%' : pent ( ' ' ) ; break ; case ' ' : break ; default : bkch ( ) ; bntok ( ) ; att . id = bkeyword ( ) ; switch ( att . id ) { case 'o' : if ( wsskip ( ) != '(' ) { panic ( FAULT ) ; } ch = getch ( ) ; st = 2 ; break ; case 'i' : case 'r' : case 'R' : case 'n' : case 'N' : case 't' : case 'T' : case 'c' : wsskip ( ) ; st = 4 ; break ; default : panic ( FAULT ) ; break ; } break ; } break ; case 2 : switch ( chtyp ( ch ) ) { case 'a' : case 'A' : case 'd' : case '.' : case ':' : case '-' : case '_' : case 'X' : bkch ( ) ; switch ( att . id ) { case 'u' : bntok ( ) ; break ; case 'o' : mBuffIdx = - 1 ; bname ( false ) ; break ; default : panic ( FAULT ) ; break ; } wsskip ( ) ; st = 3 ; break ; case '%' : pent ( ' ' ) ; break ; case ' ' : break ; default : panic ( FAULT ) ; break ; } break ; case 3 : switch ( ch ) { case ')' : wsskip ( ) ; st = 4 ; break ; case '|' : wsskip ( ) ; switch ( att . id ) { case 'u' : bntok ( ) ; break ; case 'o' : mBuffIdx = - 1 ; bname ( false ) ; break ; default : panic ( FAULT ) ; break ; } wsskip ( ) ; break ; case '%' : pent ( ' ' ) ; break ; default : panic ( FAULT ) ; break ; } break ; case 4 : switch ( ch ) { case '#' : bntok ( ) ; switch ( bkeyword ( ) ) { case 'F' : switch ( wsskip ( ) ) { case '\"' : case '\'' : st = 5 ; break ; case EOS : panic ( FAULT ) ; default : st = - 1 ; break ; } break ; case 'Q' : case 'I' : st = - 1 ; break ; default : panic ( FAULT ) ; break ; } break ; case '\"' : case '\'' : bkch ( ) ; st = 5 ; break ; case ' ' : case '\n' : case '\r' : case '\t' : break ; case '%' : pent ( ' ' ) ; break ; default : bkch ( ) ; st = - 1 ; break ; } break ; case 5 : switch ( ch ) { case '\"' : case '\'' : bkch ( ) ; bqstr ( 'd' ) ; att . list = pair ( null ) ; att . list . chars = new char [ att . chars . length + mBuffIdx + 3 ] ; System . arraycopy ( att . chars , 1 , att . list . chars , 0 , att . chars . length - 1 ) ; att . list . chars [ att . chars . length - 1 ] = '=' ; att . list . chars [ att . chars . length ] = ch ; System . arraycopy ( mBuff , 1 , att . list . chars , att . chars . length + 1 , mBuffIdx ) ; att . list . chars [ att . chars . length + mBuffIdx + 1 ] = ch ; att . list . chars [ att . chars . length + mBuffIdx + 2 ] = ' ' ; st = - 1 ; break ; default : panic ( FAULT ) ; break ; } break ; default : panic ( FAULT ) ; break ; } } }
parses an attribute declaration . the attribute uses the following fields of pair object : chars - characters of qualified name id - the type identifier of the attribute list - a pair which holds the default value ( chars field )
