Package org.eclipse.epsilon.ecl.dom
Class MatchRule
- java.lang.Object
-
- org.eclipse.epsilon.common.module.AbstractModuleElement
-
- org.eclipse.epsilon.eol.dom.AnnotatableModuleElement
-
- org.eclipse.epsilon.erl.dom.NamedRule
-
- org.eclipse.epsilon.erl.dom.ExtensibleNamedRule
-
- org.eclipse.epsilon.ecl.dom.MatchRule
-
- All Implemented Interfaces:
org.eclipse.epsilon.common.module.ModuleElement
public class MatchRule extends ExtensibleNamedRule
-
-
Field Summary
Fields Modifier and Type Field Description protected ExecutableBlock<Boolean>compareBlockprotected ExecutableBlock<Void>doBlockprotected ExecutableBlock<Boolean>guardBlockprotected ParameterleftParameterprotected ParameterrightParameter-
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanappliesTo(Object left, Object right, IEclContext context, boolean ofTypeOnly)voidbuild(org.eclipse.epsilon.common.parse.AST cst, org.eclipse.epsilon.common.module.IModule module)Collection<?>getLeftInstances(IEclContext context, boolean ofTypeOnly)Collection<?>getRightInstances(IEclContext context, boolean ofTypeOnly)org.eclipse.epsilon.common.parse.ASTgetSuperRulesAst(org.eclipse.epsilon.common.parse.AST cst)Matchmatch(Object left, Object right, IEclContext context, EolMap<?,?> matchInfo, boolean forcedMatch)Matches left against rightMatchmatchPair(IEclContext context, boolean ofTypeOnly, Object leftInstance, Object rightInstance)StringtoString()-
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
-
-
-
-
Field Detail
-
compareBlock
protected ExecutableBlock<Boolean> compareBlock
-
guardBlock
protected ExecutableBlock<Boolean> guardBlock
-
doBlock
protected ExecutableBlock<Void> doBlock
-
leftParameter
protected Parameter leftParameter
-
rightParameter
protected Parameter rightParameter
-
-
Method Detail
-
getSuperRulesAst
public org.eclipse.epsilon.common.parse.AST getSuperRulesAst(org.eclipse.epsilon.common.parse.AST cst)
- Specified by:
getSuperRulesAstin classExtensibleNamedRule
-
build
public void build(org.eclipse.epsilon.common.parse.AST cst, org.eclipse.epsilon.common.module.IModule module)- Specified by:
buildin interfaceorg.eclipse.epsilon.common.module.ModuleElement- Overrides:
buildin 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
-
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
-
-