Class MatchRule

  • All Implemented Interfaces:
    org.eclipse.epsilon.common.module.ModuleElement

    public class MatchRule
    extends ExtensibleNamedRule
    • Field Detail

      • compareBlock

        protected org.eclipse.epsilon.eol.dom.ExecutableBlock<Boolean> compareBlock
      • guardBlock

        protected org.eclipse.epsilon.eol.dom.ExecutableBlock<Boolean> guardBlock
      • doBlock

        protected org.eclipse.epsilon.eol.dom.ExecutableBlock<Void> doBlock
      • leftParameter

        protected org.eclipse.epsilon.eol.dom.Parameter leftParameter
      • rightParameter

        protected org.eclipse.epsilon.eol.dom.Parameter rightParameter
    • Constructor Detail

      • MatchRule

        public MatchRule()
    • Method Detail

      • getSuperRulesAst

        public org.eclipse.epsilon.common.parse.AST getSuperRulesAst​(org.eclipse.epsilon.common.parse.AST cst)
        Specified by:
        getSuperRulesAst in class ExtensibleNamedRule
      • build

        public void build​(org.eclipse.epsilon.common.parse.AST cst,
                          org.eclipse.epsilon.common.module.IModule module)
        Specified by:
        build in interface org.eclipse.epsilon.common.module.ModuleElement
        Overrides:
        build in class ExtensibleNamedRule
      • appliesTo

        public boolean appliesTo​(Object left,
                                 Object right,
                                 IEclContext context,
                                 boolean ofTypeOnly)
                          throws org.eclipse.epsilon.eol.exceptions.EolRuntimeException
        Throws:
        org.eclipse.epsilon.eol.exceptions.EolRuntimeException
      • getLeftInstances

        public Collection<?> getLeftInstances​(IEclContext context,
                                              boolean ofTypeOnly)
                                       throws org.eclipse.epsilon.eol.exceptions.EolRuntimeException
        Throws:
        org.eclipse.epsilon.eol.exceptions.EolRuntimeException
      • getRightInstances

        public Collection<?> getRightInstances​(IEclContext context,
                                               boolean ofTypeOnly)
                                        throws org.eclipse.epsilon.eol.exceptions.EolRuntimeException
        Throws:
        org.eclipse.epsilon.eol.exceptions.EolRuntimeException
      • matchPair

        public Match matchPair​(IEclContext context,
                               boolean ofTypeOnly,
                               Object leftInstance,
                               Object rightInstance)
                        throws org.eclipse.epsilon.eol.exceptions.EolRuntimeException
        Throws:
        org.eclipse.epsilon.eol.exceptions.EolRuntimeException
      • match

        public Match match​(Object left,
                           Object right,
                           IEclContext context,
                           org.eclipse.epsilon.eol.types.EolMap<?,​?> matchInfo,
                           boolean forcedMatch)
                    throws org.eclipse.epsilon.eol.exceptions.EolRuntimeException
        Matches left against right
        Parameters:
        left - The left object
        right - The right object
        context - The context in which the ECL program is running
        asSuperRule - Shows if the rule is executed as a super-rule of another rule
        forcedMatch - Whether to add the match to the trace (?)
        Returns:
        Throws:
        org.eclipse.epsilon.eol.exceptions.EolRuntimeException