Beispiel #1
0
        /// <summary>
        /// 数式($で囲まれた部分)を解釈して_definedMorphismDictionaryに格納する
        /// </summary>
        /// <param name="text">数式($は含まない)</param>
        private void ReadMathText(string text)
        {
            foreach (var mor in Morphism.Create(text, _line))
            {
                if (mor.Name.ToString().Contains("#") || mor.Source.ToString().Contains("#") || mor.Target.ToString().Contains("#"))
                {
                    _parameterizedMorphisms.Add(mor);
                }
                else
                {
                    if (IsNaturalTransformation(mor))
                    {
                        mor.SetNaturalTransformation();
                    }
                    _definedMorphismDictionary[mor.Name.ToTokenString()] = mor;
                }
            }

            var func = Functor.Create(text);

            if (func != null)
            {
                _functors.Add(func);
                OutputResult(new CheckResult(_line, func.ToString(), false, true));
            }
        }
Beispiel #2
0
 private IEnumerable <Morphism> CreateDefaultMorphisms()
 {
     foreach (var item in Config.Instance.Morphisms)
     {
         foreach (var mor in Morphism.Create(item))
         {
             yield return(mor);
         }
     }
 }