1 package org.apache.oro.text.awk; 2 3 59 60 import java.util.*; 61 62 66 class OrNode extends SyntaxNode { 67 SyntaxNode _left, _right; 68 69 OrNode(SyntaxNode left, SyntaxNode right) { 70 _left = left; 71 _right = right; 72 } 73 74 boolean _nullable() { 75 return (_left._nullable() || _right._nullable()); 76 } 77 78 BitSet _firstPosition() { 79 BitSet ls, rs, bs; 80 81 ls = _left._firstPosition(); 82 rs = _right._firstPosition(); 83 bs = new BitSet(Math.max(ls.size(), rs.size())); 84 bs.or(rs); 85 bs.or(ls); 86 87 return bs; 88 } 89 90 BitSet _lastPosition() { 91 BitSet ls, rs, bs; 92 93 ls = _left._lastPosition(); 94 rs = _right._lastPosition(); 95 bs = new BitSet(Math.max(ls.size(), rs.size())); 96 bs.or(rs); 97 bs.or(ls); 98 99 return bs; 100 } 101 102 void _followPosition(BitSet[] follow, SyntaxNode[] nodes) { 103 _left._followPosition(follow, nodes); 104 _right._followPosition(follow, nodes); 105 } 106 107 SyntaxNode _clone(int pos[]) { 108 return new OrNode(_left._clone(pos), _right._clone(pos)); 109 } 110 } 111 | Popular Tags |