home *** CD-ROM | disk | FTP | other *** search
- package com.ms.xml.parser;
-
- import com.ms.xml.util.Name;
- import com.ms.xml.util.XMLOutputStream;
- import java.io.IOException;
- import java.util.BitSet;
-
- class Choice extends Node {
- Node left;
- Node right;
-
- Choice(Node var1, Node var2) {
- this.left = var1;
- this.right = var2;
- }
-
- BitSet firstpos(int var1) {
- if (super.first == null) {
- super.first = (BitSet)this.left.firstpos(var1).clone();
- super.first.or(this.right.firstpos(var1));
- }
-
- return super.first;
- }
-
- BitSet lastpos(int var1) {
- if (super.last == null) {
- super.last = (BitSet)this.left.lastpos(var1).clone();
- super.last.or(this.right.lastpos(var1));
- }
-
- return super.last;
- }
-
- void save(XMLOutputStream var1, int var2, int var3, Name var4) throws IOException {
- ++var3;
- if (var2 == 124) {
- this.left.save(var1, 124, var3, var4);
- var1.write(124);
- this.right.save(var1, 124, var3, var4);
- } else {
- var1.write(40);
- this.left.save(var1, 124, var3, var4);
- var1.write(124);
- this.right.save(var1, 124, var3, var4);
- var1.write(41);
- }
-
- --var3;
- }
-
- Node clone(ContentModel var1) {
- return new Choice(this.left.clone(var1), this.right.clone(var1));
- }
-
- void calcfollowpos(BitSet[] var1) {
- this.left.calcfollowpos(var1);
- this.right.calcfollowpos(var1);
- }
-
- boolean nullable() {
- return this.left.nullable() || this.right.nullable();
- }
- }
-