Beispiel #1
0
 public final void append(Token t) {
   if (fFirst == null) {
     fFirst = t;
     fLast = t;
   } else {
     fLast.setNext(t);
     fLast = t;
   }
   t.setNext(null);
 }
Beispiel #2
0
 void cutAfter(Token l) {
   if (l == null) {
     fFirst = null;
     fLast = null;
   } else {
     l.setNext(null);
     fLast = l;
   }
 }
Beispiel #3
0
 public final void prepend(TokenList prepend) {
   final Token first = prepend.fFirst;
   if (first != null) {
     final Token last = prepend.fLast;
     last.setNext(fFirst);
     fFirst = first;
     if (fLast == null) {
       fLast = last;
     }
   }
 }
Beispiel #4
0
 public final void appendAll(TokenList tl) {
   final Token t = tl.first();
   if (t != null) {
     if (fFirst == null) {
       fFirst = tl.fFirst;
     } else {
       fLast.setNext(tl.fFirst);
     }
     fLast = tl.fLast;
   }
   tl.fFirst = null;
   tl.fLast = null;
 }
Beispiel #5
0
 final void removeBehind(Token l) {
   if (l == null) {
     Token t = fFirst;
     if (t != null) {
       t = (Token) t.getNext();
       fFirst = t;
       if (t == null) {
         fLast = null;
       }
     }
   } else {
     final Token r = (Token) l.getNext();
     if (r != null) {
       l.setNext(r.getNext());
       if (r == fLast) {
         fLast = l;
       }
     }
   }
 }