2017-07-24 17:42:25 -07:00
|
|
|
package org.nwapw.abacus.lexing.pattern;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
2017-07-24 20:45:56 -07:00
|
|
|
import java.util.Collection;
|
2017-07-24 17:42:25 -07:00
|
|
|
|
2017-07-25 22:47:48 -07:00
|
|
|
/**
|
|
|
|
* A node that is used as structural glue in pattern compilation.
|
|
|
|
* @param <T> the type that's used to tell which pattern this node belongs to.
|
|
|
|
*/
|
2017-07-24 17:42:25 -07:00
|
|
|
public class LinkNode<T> extends PatternNode<T> {
|
|
|
|
|
|
|
|
@Override
|
2017-07-24 20:45:56 -07:00
|
|
|
public void addInto(Collection<PatternNode<T>> into) {
|
2017-07-28 09:51:59 -07:00
|
|
|
if(!into.contains(this)) {
|
|
|
|
into.add(this);
|
|
|
|
addOutputsInto(into);
|
|
|
|
}
|
2017-07-24 17:42:25 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|