New node pattern to express alternatives.
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4435 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
parent
f557348885
commit
3f26b1d108
|
@ -0,0 +1,23 @@
|
|||
package com.ibm.wala.cast.tree.pattern;
|
||||
|
||||
import com.ibm.wala.cast.tree.CAstNode;
|
||||
|
||||
/**
|
||||
* Pattern to match one of two alternatives.
|
||||
*
|
||||
* @author mschaefer
|
||||
*
|
||||
*/
|
||||
public class Alt implements NodePattern {
|
||||
private final NodePattern left, right;
|
||||
|
||||
public Alt(NodePattern left, NodePattern right) {
|
||||
this.left = left;
|
||||
this.right = right;
|
||||
}
|
||||
|
||||
public boolean matches(CAstNode node) {
|
||||
return left.matches(node) || right.matches(node);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue