Class RuleImpl.RuleModeState

java.lang.Object
org.eclipse.m2m.atl.emftvm.impl.RuleImpl.RuleModeState
Direct Known Subclasses:
RuleImpl.AutomaticRecursiveState, RuleImpl.AutomaticSingleState, RuleImpl.ManualState
Enclosing class:
RuleImpl

protected abstract class RuleImpl.RuleModeState extends Object
Base class for code that depends on the rule's Rule.getMode().
  • Constructor Details

    • RuleModeState

      protected RuleModeState()
  • Method Details

    • matchSingle

      public boolean matchSingle(StackFrame frame)
      Matches #getRule() for the automatic single stage, if applicable.
      Parameters:
      frame - the stack frame in which to execute the matcher
      Returns:
      true iff the rule has any matches
    • matchRecursive

      public boolean[] matchRecursive(StackFrame frame)
      Matches #getRule() for the automatic recursive stage, if applicable.
      Parameters:
      frame - the stack frame in which to execute the matcher
      Returns:
      true iff the rule has any matches
    • matchManual

      public Object matchManual(StackFrame frame, Object[] values)
      Matches #getRule() manually, if applicable.
      Parameters:
      frame - the stack frame in which to execute the matcher
      values - the values to match against
      Returns:
      the rule application result, or null if the rule did not match
      Throws:
      VMException - if this is not a RuleMode.MANUAL rule
    • matchFor

      public abstract boolean matchFor(StackFrame frame, Object[] values)
      Matches this rule against values, and records a match in ExecEnv.getMatches() in case of a match. In case of a unique rule, this method will not match if the rule has already matched against values before.
      Parameters:
      frame - the stack frame context
      values - the source values to match against
      Returns:
      true iff this rule matches against values
    • matchFor

      public abstract boolean matchFor(StackFrame frame, Map<String,Object> valuesMap, Object[] values)
      Matches this rule against values, and records a match in ExecEnv.getMatches() in case of a match. In case of a unique rule, this method will not match if the rule has already matched against values before.
      Parameters:
      frame - the stack frame context
      valuesMap - the map of all values, including super-rule elements
      values - the source values to match against
      Returns:
      true iff this rule matches against values