Package org.eclipse.epsilon.ecl.dom
Class MatchRule
- java.lang.Object
-
- All Implemented Interfaces:
ModuleElement
public class MatchRule extends ExtensibleNamedRule
-
-
Field Summary
Fields Modifier and Type Field Description protected ExecutableBlock<java.lang.Boolean>
compareBlock
protected ExecutableBlock<java.lang.Void>
doBlock
protected ExecutableBlock<java.lang.Boolean>
guardBlock
protected Parameter
leftParameter
protected Parameter
rightParameter
-
Fields inherited from class org.eclipse.epsilon.erl.dom.ExtensibleNamedRule
allSuperRules, isAbstract, isGreedy, isLazy, 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 boolean
appliesTo(java.lang.Object left, java.lang.Object right, IEclContext context, boolean ofTypeOnly)
void
build(AST cst, IModule module)
java.util.Collection<?>
getLeftInstances(IEclContext context, boolean ofTypeOnly)
java.util.Collection<?>
getRightInstances(IEclContext context, boolean ofTypeOnly)
AST
getSuperRulesAst(AST cst)
Match
match(java.lang.Object left, java.lang.Object right, IEclContext context, EolMap<?,?> matchInfo, boolean forcedMatch)
Matches left against rightMatch
matchPair(IEclContext context, boolean ofTypeOnly, java.lang.Object leftInstance, java.lang.Object rightInstance)
java.lang.String
toString()
-
Methods inherited from class org.eclipse.epsilon.erl.dom.ExtensibleNamedRule
calculateSuperRules, calculateSuperRules, getAllInstances, getAllOfKind, getAllOfType, getAllSuperRules, getRuleByName, getSuperRules, isAbstract, isGreedy, isLazy
-
Methods inherited from class org.eclipse.epsilon.erl.dom.NamedRule
equals, getName, getNameAst, getNameExpression, hashCode, setNameExpression
-
Methods inherited from class org.eclipse.epsilon.eol.dom.AnnotatableModuleElement
getAnnotation, getAnnotationBlock, getAnnotations, getAnnotationsValues, getBooleanAnnotationValue, getBooleanAnnotationValue, getBooleanAnnotationValue, getBooleanAnnotationValue, hasAnnotation, setAnnotationBlock
-
Methods inherited from class org.eclipse.epsilon.common.module.AbstractModuleElement
getChildren, getComments, getDebugInfo, getFile, getModule, getParent, getRegion, getUri, setModule, setParent, setRegion, setUri
-
-
-
-
Field Detail
-
compareBlock
protected ExecutableBlock<java.lang.Boolean> compareBlock
-
guardBlock
protected ExecutableBlock<java.lang.Boolean> guardBlock
-
doBlock
protected ExecutableBlock<java.lang.Void> doBlock
-
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(java.lang.Object left, java.lang.Object right, IEclContext context, boolean ofTypeOnly) throws EolRuntimeException
- Throws:
EolRuntimeException
-
getLeftInstances
public java.util.Collection<?> getLeftInstances(IEclContext context, boolean ofTypeOnly) throws EolRuntimeException
- Throws:
EolRuntimeException
-
getRightInstances
public java.util.Collection<?> getRightInstances(IEclContext context, boolean ofTypeOnly) throws EolRuntimeException
- Throws:
EolRuntimeException
-
matchPair
public Match matchPair(IEclContext context, boolean ofTypeOnly, java.lang.Object leftInstance, java.lang.Object rightInstance) throws EolRuntimeException
- Throws:
EolRuntimeException
-
match
public Match match(java.lang.Object left, java.lang.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
-
-