コード例 #1
0
        public override void visit(Generated.ReqRelated obj, bool visitSubNodes)
        {
            ReqRelated init       = obj as ReqRelated;
            ReqRelated reqRelated = obj as ReqRelated;

            if (init != null && init.NeedsRequirement) // the object must be associated to a requirement
            {
                bool noReq = true;                     // no requirement found for this object
                while (noReq && reqRelated != null)
                {
                    for (int i = 0; i < reqRelated.Requirements.Count; i++)
                    {
                        ReqRef reqRef = reqRelated.Requirements[i] as ReqRef;
                        if (reqRef.Paragraph == null)
                        {
                            reqRef.AddError("Cannot find paragraph corresponding to " + reqRef.getId());
                        }
                        else if (reqRef.Paragraph.getType() == Generated.acceptor.Paragraph_type.aREQUIREMENT)
                        {
                            noReq = false;  // found a requirement
                        }
                    }
                    if (noReq)  // if no requirement found, we explore the requirements of the enclosing element
                    {
                        reqRelated = Utils.EnclosingFinder <DataDictionary.ReqRelated> .find(reqRelated);
                    }
                }
                if (noReq)
                {
                    init.AddInfo("No requirement found for element");
                }
            }

            base.visit(obj, visitSubNodes);
        }
コード例 #2
0
        public override void visit(Generated.ReqRef obj, bool visitSubNodes)
        {
            ReqRef reqRef = obj as ReqRef;

            if (reqRef != null)
            {
                if (reqRef.Paragraph == null)
                {
                    reqRef.AddError("Invalid reference to a requirement (" + reqRef.getId() + ")");
                }
            }
        }