Package com.mackenziehigh.sexpr
Interface Schema.Match
- Enclosing class:
- Schema
public static interface Schema.Match
Result of a
match(Sexpr) invocation.-
Method Summary
Modifier and TypeMethodDescriptionexecute()Execute the defined passes and related actions.Sexpr<?>input()Get the symbolic-expression that was the input tomatch().booleanDetermine whether this object represents a unsuccessful match.booleanDetermine whether this object represents a successful match.Get the last node of the input that was successfully matched, if any, which is useful for locating and reporting errors in the input.
-
Method Details
-
isSuccess
boolean isSuccess()Determine whether this object represents a successful match.- Returns:
- true, if the match attempt succeeded.
-
isFailure
boolean isFailure()Determine whether this object represents a unsuccessful match.- Returns:
- true, if the match attempt failed.
-
input
Sexpr<?> input()Get the symbolic-expression that was the input tomatch().- Returns:
- the input.
-
lastSuccess
Get the last node of the input that was successfully matched, if any, which is useful for locating and reporting errors in the input.- Returns:
- the last successfully matched node, if any.
-
execute
Schema.Match execute()Execute the defined passes and related actions.If the match is successful, then the match-tree will be traversed once for each translation-pass that was defined previously. Upon encountering the successful match of a rule (R) during a translation-pass, the before-actions of (R) will be executed, then the subordinate matches will be visited and their actions will be executed, and then the after-actions of (R) will be executed.
- Returns:
- this.
-