home *** CD-ROM | disk | FTP | other *** search
/ Online Today 2000 January / Onto0100.iso / pc / JAVA / MSJAVX86.EXE / xmldso.cab / XML4IE3.cab / com / ms / xml / parser / Closure.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-10-10  |  1.3 KB  |  71 lines

  1. package com.ms.xml.parser;
  2.  
  3. import com.ms.xml.util.Name;
  4. import com.ms.xml.util.XMLOutputStream;
  5. import java.io.IOException;
  6. import java.util.BitSet;
  7.  
  8. class Closure extends Node {
  9.    Node node;
  10.  
  11.    Closure(Node var1) {
  12.       this.node = var1;
  13.    }
  14.  
  15.    Closure() {
  16.    }
  17.  
  18.    BitSet firstpos(int var1) {
  19.       if (super.first == null) {
  20.          super.first = this.node.firstpos(var1);
  21.       }
  22.  
  23.       return super.first;
  24.    }
  25.  
  26.    BitSet lastpos(int var1) {
  27.       if (super.last == null) {
  28.          super.last = this.node.lastpos(var1);
  29.       }
  30.  
  31.       return super.last;
  32.    }
  33.  
  34.    void save(XMLOutputStream var1, int var2, int var3, Name var4) throws IOException {
  35.       if (var2 == 63 || var2 == 42) {
  36.          var1.writeChars("(");
  37.       }
  38.  
  39.       ++var3;
  40.       this.node.save(var1, 42, var3, var4);
  41.       --var3;
  42.       var1.write(42);
  43.       if (var2 == 63 || var2 == 42) {
  44.          var1.writeChars(")");
  45.       }
  46.  
  47.    }
  48.  
  49.    Node clone(ContentModel var1) {
  50.       return new Closure(this.node.clone(var1));
  51.    }
  52.  
  53.    void calcfollowpos(BitSet[] var1) {
  54.       this.node.calcfollowpos(var1);
  55.       int var2 = var1.length;
  56.       this.lastpos(var2);
  57.       this.firstpos(var2);
  58.  
  59.       for(int var3 = var1.length - 1; var3 >= 0; --var3) {
  60.          if (super.last.get(var3)) {
  61.             var1[var3].or(super.first);
  62.          }
  63.       }
  64.  
  65.    }
  66.  
  67.    boolean nullable() {
  68.       return true;
  69.    }
  70. }
  71.