Package org.eclipse.epsilon.ecl.dom
Class MatchRule
-
- All Implemented Interfaces:
ModuleElement
public class MatchRule extends ExtensibleNamedRule
-
-
Field Summary
Fields Modifier and Type Field Description protected ExecutableBlock<Boolean>
compareBlock
protected ExecutableBlock<Void>
doBlock
protected ExecutableBlock<Boolean>
guardBlock
protected ExecutableBlock<Collection<?>>
leftDomainBlock
protected Parameter
leftParameter
protected ExecutableBlock<Collection<?>>
rightDomainBlock
protected Parameter
rightParameter
-
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
Constructors Constructor Description MatchRule()
-
Method Summary
-
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 Detail
-
compareBlock
protected ExecutableBlock<Boolean> compareBlock
-
guardBlock
protected ExecutableBlock<Boolean> guardBlock
-
doBlock
protected ExecutableBlock<Void> doBlock
-
leftDomainBlock
protected ExecutableBlock<Collection<?>> leftDomainBlock
-
rightDomainBlock
protected ExecutableBlock<Collection<?>> rightDomainBlock
-
leftParameter
protected Parameter leftParameter
-
rightParameter
protected Parameter rightParameter
-
-
Method Detail
-
getSuperRulesAst
public AST getSuperRulesAst(AST cst)
- Specified by:
getSuperRulesAst
in classExtensibleNamedRule
-
build
public void build(AST cst, IModule module)
- 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 EolRuntimeException
Matches 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
-
isRightDomainDynamic
public boolean isRightDomainDynamic()
-
getCompareBlock
public ExecutableBlock<Boolean> getCompareBlock()
-
getLeftDomainBlock
public ExecutableBlock<Collection<?>> getLeftDomainBlock()
-
getRightDomainBlock
public ExecutableBlock<Collection<?>> getRightDomainBlock()
-
getLeftParameter
public Parameter getLeftParameter()
-
getRightParameter
public Parameter getRightParameter()
-
getGuardBlock
public ExecutableBlock<Boolean> getGuardBlock()
-
getDoBlock
public ExecutableBlock<Void> getDoBlock()
-
accept
public void accept(IEclVisitor visitor)
-
-