Package com.yahoo.prelude.semantics.rule
Class EllipsisCondition
- java.lang.Object
-
- com.yahoo.prelude.semantics.rule.Condition
-
- com.yahoo.prelude.semantics.rule.EllipsisCondition
-
public class EllipsisCondition extends Condition
A condition which greedily matches anything, represented as "..."- Author:
- bratseth
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.yahoo.prelude.semantics.rule.Condition
Condition.Anchor
-
-
Constructor Summary
Constructors Constructor Description EllipsisCondition()
Creates a referable ellipsis condition with no labelEllipsisCondition(boolean referable)
Creates an ellipsis condition with no labelEllipsisCondition(java.lang.String label, boolean referable)
Creates an ellipsis conditionEllipsisCondition(java.lang.String label, java.lang.String context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
doesMatch(RuleEvaluation e)
Returns whether this condition matches the given evaluation at the current location of the evaluation.java.lang.String
getMatchInfo(RuleEvaluation e)
Override this to return a string describing what this condition has matched in this evaluation.protected boolean
hasOpenChoicepoint(RuleEvaluation e)
Returns whether there is an open choice in this or any of its subconditions.protected boolean
isDefaultContextName()
boolean
isReferable()
Returns whether this ellipsis condition can be referred from a productionvoid
setReferable(boolean referable)
Sets whether this ellipsis condition can be referred from a production or notprotected java.lang.String
toInnerString()
All instances of this produces a parseable string output-
Methods inherited from class com.yahoo.prelude.semantics.rule.Condition
getAnchor, getContextName, getLabel, getLabelString, getMatchInfoString, getNameSpace, getParent, labelMatches, labelMatches, makeReferences, matches, matchesEndAnchor, matchesStartAnchor, postMatchHook, preMatchHook, setAnchor, setContextName, setLabel, setNameSpace, toString, traceResult
-
-
-
-
Constructor Detail
-
EllipsisCondition
public EllipsisCondition()
Creates a referable ellipsis condition with no label
-
EllipsisCondition
public EllipsisCondition(boolean referable)
Creates an ellipsis condition with no label
-
EllipsisCondition
public EllipsisCondition(java.lang.String label, boolean referable)
Creates an ellipsis condition
-
EllipsisCondition
public EllipsisCondition(java.lang.String label, java.lang.String context)
-
-
Method Detail
-
doesMatch
public boolean doesMatch(RuleEvaluation e)
Description copied from class:Condition
Returns whether this condition matches the given evaluation at the current location of the evaluation. If there is a match, the evaluation must be advanced to the location beyond the matching item(s) before this method returns.
-
getMatchInfo
public java.lang.String getMatchInfo(RuleEvaluation e)
Description copied from class:Condition
Override this to return a string describing what this condition has matched in this evaluation. Will only be called when this condition is actually matched in this condition- Overrides:
getMatchInfo
in classCondition
- Returns:
- info about what is matched, or null if there is no info to return (default)
-
isReferable
public boolean isReferable()
Returns whether this ellipsis condition can be referred from a production- Overrides:
isReferable
in classCondition
-
setReferable
public void setReferable(boolean referable)
Sets whether this ellipsis condition can be referred from a production or not
-
hasOpenChoicepoint
protected boolean hasOpenChoicepoint(RuleEvaluation e)
Description copied from class:Condition
Returns whether there is an open choice in this or any of its subconditions. Returns false by default, must be overriden by conditions which may generate choices open accross multiple calls to matches, or contain such conditions.- Overrides:
hasOpenChoicepoint
in classCondition
-
isDefaultContextName
protected boolean isDefaultContextName()
- Overrides:
isDefaultContextName
in classCondition
-
toInnerString
protected java.lang.String toInnerString()
Description copied from class:Condition
All instances of this produces a parseable string output- Specified by:
toInnerString
in classCondition
-
-