Search in sources :

Example 11 with RuleOperation

use of de.be4.classicalb.core.parser.rules.RuleOperation in project probparsers by bendisposto.

the class RulesMachineChecker method caseARuleOperation.

@Override
public void caseARuleOperation(ARuleOperation node) {
    currentOperation = new RuleOperation(node.getRuleName(), this.fileName, this.machineName, machineReferences);
    if (containsRule(currentOperation.getName())) {
        errorList.add(new CheckException("Duplicate operation name '" + currentOperation.getName() + "'.", node.getRuleName()));
    }
    RuleOperation ruleOp = (RuleOperation) currentOperation;
    rulesMap.put(node, ruleOp);
    visitOperationAttributes(node.getAttributes());
    node.getRuleBody().apply(this);
    checkAllErrorTypesImplemented(ruleOp);
    currentOperation = null;
}
Also used : ARuleOperation(de.be4.classicalb.core.parser.node.ARuleOperation) CheckException(de.be4.classicalb.core.parser.exceptions.CheckException)

Aggregations

CheckException (de.be4.classicalb.core.parser.exceptions.CheckException)8 ARuleOperation (de.be4.classicalb.core.parser.node.ARuleOperation)4 AIdentifierExpression (de.be4.classicalb.core.parser.node.AIdentifierExpression)3 RuleOperation (de.be4.classicalb.core.parser.rules.RuleOperation)3 BException (de.be4.classicalb.core.parser.exceptions.BException)2 AbstractOperation (de.be4.classicalb.core.parser.rules.AbstractOperation)2 RuleResult (de.prob.model.brules.RuleResult)2 RuleResults (de.prob.model.brules.RuleResults)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 AFunctionOperation (de.be4.classicalb.core.parser.node.AFunctionOperation)1 AIntegerExpression (de.be4.classicalb.core.parser.node.AIntegerExpression)1 APredicateAttributeOperationAttribute (de.be4.classicalb.core.parser.node.APredicateAttributeOperationAttribute)1 PPredicate (de.be4.classicalb.core.parser.node.PPredicate)1 ComputationOperation (de.be4.classicalb.core.parser.rules.ComputationOperation)1 RulesProject (de.be4.classicalb.core.parser.rules.RulesProject)1 AbstractEvalResult (de.prob.animator.domainobjects.AbstractEvalResult)1 IEvalElement (de.prob.animator.domainobjects.IEvalElement)1 ResultSummary (de.prob.model.brules.RuleResults.ResultSummary)1 RulesMachineRun (de.prob.model.brules.RulesMachineRun)1