public override void visit(Generated.PreCondition obj, bool subNodes) { Rules.PreCondition preCondition = obj as Rules.PreCondition; if (preCondition != null) { try { // Check whether the expression is valid Interpreter.Expression expression = checkExpression(preCondition, preCondition.Condition); if (!preCondition.Dictionary.EFSSystem.BoolType.Match(expression.GetExpressionType())) { preCondition.AddError("Expression type should be Boolean"); } Types.ITypedElement element = OverallTypedElementFinder.INSTANCE.findByName(preCondition, preCondition.findVariable()); if (element != null) { if (element.Type is Types.StateMachine) { if (preCondition.findOperator() != null) { if (preCondition.findOperator().CompareTo("==") == 0) { preCondition.AddWarning("Operator == should not be used for state machines"); } else if (preCondition.findOperator().CompareTo("!=") == 0) { preCondition.AddWarning("Operator != should not be used for state machines"); } } } } } catch (Exception exception) { preCondition.AddException(exception); } } base.visit(obj, subNodes); }