Пример #1
0
        public KAOSModel Parse(string input, string filename)
        {
            KAOSModel       model   = new KAOSModel();
            GoalModelParser _parser = new GoalModelParser();

            Uri RelativePath = null;

            if (!string.IsNullOrEmpty(filename))
            {
                RelativePath = new Uri(Path.GetFullPath(Path.GetDirectoryName(filename) + "/"));
            }

            FirstStageBuilder  FSB = new FirstStageBuilder(model, RelativePath);
            FormulaBuilder     FB  = new FormulaBuilder(model, RelativePath);
            SecondStageBuilder SSB = new SecondStageBuilder(model, RelativePath);
            ThirdStageBuilder  TSB = new ThirdStageBuilder(model, FB, RelativePath);

            var elements = _parser.Parse(input, filename) as ParsedElements;

            FSB.BuildElementWithKeys(elements);
            SSB.BuildElement(elements);
            TSB.BuildElement(elements);

            return(model);
        }
Пример #2
0
        public ThirdStageBuilder(KAOSModel model,
                                 FormulaBuilder fb,
                                 Uri relativePath)
            : base(model, relativePath)
        {
            declareBuilders.Add(new AgentDeclareBuilder());
            declareBuilders.Add(new AssociationDeclareBuilder());
            declareBuilders.Add(new CalibrationDeclareBuilder());
            declareBuilders.Add(new DomainHypothesisDeclareBuilder());
            declareBuilders.Add(new DomainPropertyDeclareBuilder());
            declareBuilders.Add(new EntityDeclareBuilder());
            declareBuilders.Add(new ExpertDeclareBuilder());
            declareBuilders.Add(new GoalDeclareBuilder());
            declareBuilders.Add(new SoftGoalDeclareBuilder());
            declareBuilders.Add(new TypeDeclareBuilder());
            declareBuilders.Add(new ObstacleDeclareBuilder());
            declareBuilders.Add(new PredicateDeclareBuilder());
            declareBuilders.Add(new ContextDeclareBuilder());

            attributeBuilders.Add(new ArgumentAttributeBuilder());
            attributeBuilders.Add(new FormalSpecAttributeBuilder(fb));

            attributeBuilders.Add(new ProvidedNotAttributeBuilder(fb));
            attributeBuilders.Add(new ProvidedAttributeBuilder(fb));
            attributeBuilders.Add(new RelaxedToAttributeBuilder(fb));
        }