public boolean matches(int atom) { if ( label==atom ) { return true; // handle the single atom case efficiently } if ( isSet() ) { return labelSet.member(atom); } return false; }
public boolean matches(int atom) { if ( label==atom ) { return true; // handle the single atom case efficiently } if ( isSet() ) { return labelSet.member(atom); } return false; }
public boolean matches(int atom) { if ( label==atom ) { return true; // handle the single atom case efficiently } if ( isSet() ) { return labelSet.member(atom); } return false; }
public boolean matches(int atom) { if ( label==atom ) { return true; // handle the single atom case efficiently } if ( isSet() ) { return labelSet.member(atom); } return false; }
protected static Integer getTokenType(Label label) { if ( label.isSet() ) { // pick random element of set IntervalSet typeSet = (IntervalSet)label.getSet(); int randomIndex = random.nextInt(typeSet.size()); return typeSet.get(randomIndex); } else { return Utils.integer(label.getAtom()); } //System.out.println(t0.label.toString(g)); }
protected static Integer getTokenType(Label label) { if ( label.isSet() ) { // pick random element of set IntervalSet typeSet = (IntervalSet)label.getSet(); int randomIndex = random.nextInt(typeSet.size()); return typeSet.get(randomIndex); } else { return Utils.integer(label.getAtom()); } //System.out.println(t0.label.toString(g)); }
protected static Integer getTokenType(Label label) { if ( label.isSet() ) { // pick random element of set IntervalSet typeSet = (IntervalSet)label.getSet(); int randomIndex = random.nextInt(typeSet.size()); return typeSet.get(randomIndex); } else { return Utils.integer(label.getAtom()); } //System.out.println(t0.label.toString(g)); }
protected static Integer getTokenType(Label label) { if ( label.isSet() ) { // pick random element of set IntervalSet typeSet = (IntervalSet)label.getSet(); int randomIndex = random.nextInt(typeSet.size()); return typeSet.get(randomIndex); } else { return Utils.integer(label.getAtom()); } //System.out.println(t0.label.toString(g)); }
public boolean matches(Label other) { if ( other.isSet() ) { return matches(other.getSet()); } if ( other.isAtom() ) { return matches(other.getAtom()); } return false; }
public boolean matches(Label other) { if ( other.isSet() ) { return matches(other.getSet()); } if ( other.isAtom() ) { return matches(other.getAtom()); } return false; }
public boolean matches(Label other) { if ( other.isSet() ) { return matches(other.getSet()); } if ( other.isAtom() ) { return matches(other.getAtom()); } return false; }
public boolean matches(Label other) { if ( other.isSet() ) { return matches(other.getSet()); } if ( other.isAtom() ) { return matches(other.getAtom()); } return false; }
public boolean matches(IntSet set) { if ( isAtom() ) { return set.member(getAtom()); } if ( isSet() ) { // matches if intersection non-nil return !getSet().and(set).isNil(); } return false; }
public boolean matches(IntSet set) { if ( isAtom() ) { return set.member(getAtom()); } if ( isSet() ) { // matches if intersection non-nil return !getSet().and(set).isNil(); } return false; }
/** Given a collapsed block of alts (a set of atoms), pull out * the set and return it. */ protected IntSet getCollapsedBlockAsSet(State blk) { State s0 = blk; if ( s0!=null && s0.transition(0)!=null ) { State s1 = s0.transition(0).target; if ( s1!=null && s1.transition(0)!=null ) { Label label = s1.transition(0).label; if ( label.isSet() ) { return label.getSet(); } } } return null; }
/** Given a collapsed block of alts (a set of atoms), pull out * the set and return it. */ protected IntSet getCollapsedBlockAsSet(State blk) { State s0 = blk; if ( s0!=null && s0.transition(0)!=null ) { State s1 = s0.transition(0).target; if ( s1!=null && s1.transition(0)!=null ) { Label label = s1.transition(0).label; if ( label.isSet() ) { return label.getSet(); } } } return null; }
/** Given a collapsed block of alts (a set of atoms), pull out * the set and return it. */ protected IntSet getCollapsedBlockAsSet(State blk) { State s0 = blk; if ( s0!=null && s0.transition(0)!=null ) { State s1 = s0.transition(0).target; if ( s1!=null && s1.transition(0)!=null ) { Label label = s1.transition(0).label; if ( label.isSet() ) { return label.getSet(); } } } return null; }
/** Given a collapsed block of alts (a set of atoms), pull out * the set and return it. */ protected IntSet getCollapsedBlockAsSet(State blk) { State s0 = blk; if ( s0!=null && s0.transition(0)!=null ) { State s1 = s0.transition(0).target; if ( s1!=null && s1.transition(0)!=null ) { Label label = s1.transition(0).label; if ( label.isSet() ) { return label.getSet(); } } } return null; }
public boolean matches(IntSet set) { if ( isAtom() ) { return set.member(getAtom()); } if ( isSet() ) { // matches if intersection non-nil return !getSet().and(set).isNil(); } return false; }
public boolean matches(IntSet set) { if ( isAtom() ) { return set.member(getAtom()); } if ( isSet() ) { // matches if intersection non-nil return !getSet().and(set).isNil(); } return false; }