home *** CD-ROM | disk | FTP | other *** search
- package com.ibm.xml.internal;
-
- class CMBinOp extends CMNode {
- private CMNode fLeftChild;
- private CMNode fRightChild;
-
- CMBinOp(int var1, CMNode var2, CMNode var3) throws CMException {
- super(var1);
- if (((CMNode)this).type() != 4 && ((CMNode)this).type() != 5) {
- throw new CMException(154);
- } else {
- this.fLeftChild = var2;
- this.fRightChild = var3;
- }
- }
-
- final CMNode getLeft() {
- return this.fLeftChild;
- }
-
- final CMNode getRight() {
- return this.fRightChild;
- }
-
- boolean isNullable() throws CMException {
- if (((CMNode)this).type() == 4) {
- return this.fLeftChild.isNullable() || this.fRightChild.isNullable();
- } else if (((CMNode)this).type() == 5) {
- return this.fLeftChild.isNullable() && this.fRightChild.isNullable();
- } else {
- throw new CMException(154);
- }
- }
-
- protected void calcFirstPos(CMStateSet var1) throws CMException {
- if (((CMNode)this).type() == 4) {
- var1.setTo(this.fLeftChild.firstPos());
- var1.union(this.fRightChild.firstPos());
- } else if (((CMNode)this).type() == 5) {
- var1.setTo(this.fLeftChild.firstPos());
- if (this.fLeftChild.isNullable()) {
- var1.union(this.fRightChild.firstPos());
- }
- } else {
- throw new CMException(154);
- }
- }
-
- protected void calcLastPos(CMStateSet var1) throws CMException {
- if (((CMNode)this).type() == 4) {
- var1.setTo(this.fLeftChild.lastPos());
- var1.union(this.fRightChild.lastPos());
- } else if (((CMNode)this).type() == 5) {
- var1.setTo(this.fRightChild.lastPos());
- if (this.fRightChild.isNullable()) {
- var1.union(this.fLeftChild.lastPos());
- }
- } else {
- throw new CMException(154);
- }
- }
- }
-