Package org.eclipse.epsilon.ecl.dom
Class MatchRule
- All Implemented Interfaces:
ModuleElement
-
Field Summary
Modifier and TypeFieldDescriptionprotected ExecutableBlock<Boolean>
protected ExecutableBlock<Void>
protected ExecutableBlock<Boolean>
protected ExecutableBlock<Collection<?>>
protected Parameter
protected ExecutableBlock<Collection<?>>
protected Parameter
Fields inherited from class org.eclipse.epsilon.erl.dom.ExtensibleNamedRule
allSuperRules, isAbstract, isGreedy, isLazy, isParallel, ofKindCache, ofTypeCache, superRules, superRulesIdentifiers
Fields inherited from class org.eclipse.epsilon.erl.dom.NamedRule
nameExpression
Fields inherited from class org.eclipse.epsilon.eol.dom.AnnotatableModuleElement
annotationBlock
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(IEclVisitor visitor) boolean
appliesTo
(Object left, Object right, IEclContext context, boolean ofTypeOnly) void
Collection<?>
getLeftInstances
(IEclContext context, boolean ofTypeOnly) Collection<?>
getRightInstances
(IEclContext context, boolean ofTypeOnly) Collection<?>
getRightInstances
(IEclContext context, boolean ofTypeOnly, Object left) getSuperRulesAst
(AST cst) boolean
match
(Object left, Object right, IEclContext context, EolMap<?, ?> matchInfo, boolean forcedMatch) Matches left against rightmatchPair
(IEclContext context, boolean ofTypeOnly, Object leftInstance, Object rightInstance) toString()
Methods inherited from class org.eclipse.epsilon.erl.dom.ExtensibleNamedRule
calculateSuperRules, calculateSuperRules, getAllInstances, getAllOfKind, getAllOfType, getAllSuperRules, getRuleByName, getSuperRules, isAbstract, isGreedy, isLazy, isParallel
Methods inherited from class org.eclipse.epsilon.erl.dom.NamedRule
equals, getName, getNameAst, getNameExpression, hashCode
Methods inherited from class org.eclipse.epsilon.eol.dom.AnnotatableModuleElement
accept, getAnnotation, getAnnotationBlock, getAnnotations, getAnnotationsValues, getBooleanAnnotationValue, getBooleanAnnotationValue, getBooleanAnnotationValue, getBooleanAnnotationValue, hasAnnotation, setAnnotationBlock
Methods inherited from class org.eclipse.epsilon.common.module.AbstractModuleElement
getChildren, getComments, getData, getDebugInfo, getFile, getModule, getParent, getRegion, getUri, setModule, setParent, setRegion, setUri
-
Field Details
-
compareBlock
-
guardBlock
-
doBlock
-
leftDomainBlock
-
rightDomainBlock
-
leftParameter
-
rightParameter
-
-
Constructor Details
-
MatchRule
public MatchRule()
-
-
Method Details
-
getSuperRulesAst
- Specified by:
getSuperRulesAst
in classExtensibleNamedRule
-
build
- Specified by:
build
in interfaceModuleElement
- Overrides:
build
in classExtensibleNamedRule
-
appliesTo
public boolean appliesTo(Object left, Object right, IEclContext context, boolean ofTypeOnly) throws EolRuntimeException - Throws:
EolRuntimeException
-
getLeftInstances
public Collection<?> getLeftInstances(IEclContext context, boolean ofTypeOnly) throws EolRuntimeException - Throws:
EolRuntimeException
-
getRightInstances
public Collection<?> getRightInstances(IEclContext context, boolean ofTypeOnly) throws EolRuntimeException - Throws:
EolRuntimeException
-
getRightInstances
public Collection<?> getRightInstances(IEclContext context, boolean ofTypeOnly, Object left) throws EolRuntimeException - Throws:
EolRuntimeException
-
matchPair
public Match matchPair(IEclContext context, boolean ofTypeOnly, Object leftInstance, Object rightInstance) throws EolRuntimeException - Throws:
EolRuntimeException
-
match
public Match match(Object left, Object right, IEclContext context, EolMap<?, ?> matchInfo, boolean forcedMatch) throws EolRuntimeExceptionMatches left against right- Parameters:
left
- The left objectright
- The right objectcontext
- The context in which the ECL program is runningasSuperRule
- Shows if the rule is executed as a super-rule of another ruleforcedMatch
- Whether to add the match to the trace (?)- Returns:
- Throws:
EolRuntimeException
-
toString
-
isRightDomainDynamic
public boolean isRightDomainDynamic() -
getCompareBlock
-
getLeftDomainBlock
-
getRightDomainBlock
-
getLeftParameter
-
getRightParameter
-
getGuardBlock
-
getDoBlock
-
accept
-