/// <summary> /// Performs the semantic analysis of the statement /// </summary> /// <param name="instance">the reference instance on which this element should analysed</param> /// <returns>True if semantic analysis should be continued</returns> public override bool SemanticAnalysis(INamable instance = null) { bool retVal = base.SemanticAnalysis(instance); if (retVal) { // ListExpression if (ListExpression != null) { ListExpression.SemanticAnalysis(instance, IsRightSide.INSTANCE); StaticUsage.AddUsages(ListExpression.StaticUsage, Usage.ModeEnum.ReadAndWrite); Collection collectionType = ListExpression.GetExpressionType() as Collection; if (collectionType != null) { IteratorVariable.Type = collectionType.Type; } } else { AddError("List expression not provided", RuleChecksEnum.SemanticAnalysisError); } // ConditionExpression if (ConditionExpression != null) { ConditionExpression.SemanticAnalysis(instance); StaticUsage.AddUsages(ConditionExpression.StaticUsage, Usage.ModeEnum.Read); } if (AppliedStatement != null) { AppliedStatement.SemanticAnalysis(instance); StaticUsage.AddUsages(AppliedStatement.StaticUsage, Usage.ModeEnum.Call); } else { AddError("Applied statement not provided", RuleChecksEnum.SemanticAnalysisError); } } return(retVal); }
/// <summary> /// Performs the semantic analysis of the statement /// </summary> /// <param name="instance">the reference instance on which this element should analysed</param> /// <returns>True if semantic analysis should be continued</returns> public override bool SemanticAnalysis(Utils.INamable instance) { bool retVal = base.SemanticAnalysis(instance); if (retVal) { ListExpression.SemanticAnalysis(instance, Filter.IsRightSide); Types.Collection collectionType = ListExpression.GetExpressionType() as Types.Collection; if (collectionType != null) { IteratorVariable.Type = collectionType.Type; } if (ConditionExpression != null) { ConditionExpression.SemanticAnalysis(instance); } Call.SemanticAnalysis(instance); } return(retVal); }