public class UnaryTransition extends Object implements Transition
Modifier and Type | Field and Description |
---|---|
boolean |
isRoot
root transitions are illegal in the middle of the tree, naturally
|
String |
label |
Constructor and Description |
---|
UnaryTransition(String label,
boolean isRoot) |
Modifier and Type | Method and Description |
---|---|
State |
apply(State state)
Add a unary node to the existing node on top of the stack
|
State |
apply(State state,
double scoreDelta)
Add a unary node to the existing node on top of the stack
|
boolean |
equals(Object o) |
int |
hashCode() |
boolean |
isLegal(State state,
List<ParserConstraint> constraints)
Legal as long as there is at least one item on the state's stack.
|
String |
toString() |
public final String label
public final boolean isRoot
public UnaryTransition(String label, boolean isRoot)
public boolean isLegal(State state, List<ParserConstraint> constraints)
isLegal
in interface Transition
public State apply(State state)
apply
in interface Transition
public State apply(State state, double scoreDelta)
apply
in interface Transition