コード例 #1
0
ファイル: Call.cs プロジェクト: fakoor/ERTMSFormalSpecs
        /// <summary>
        ///     Builds the explanation of the element
        /// </summary>
        /// <param name="explanation"></param>
        /// <param name="explainSubElements">Precises if we need to explain the sub elements (if any)</param>
        public override void GetExplain(TextualExplanation explanation, bool explainSubElements = true)
        {
            explanation.Write(Called);
            explanation.Write("(");
            explanation.ExplainList(ActualParameters, explainSubElements, ", ",
                                    element => element.GetExplain(explanation));

            if (NamedActualParameters.Count > 0)
            {
                explanation.Indent(2, () =>
                {
                    if (ActualParameters.Count > 0)
                    {
                        explanation.Write(", ");
                    }
                    explanation.ExplainList(NamedActualParameters, explainSubElements, ", ", pair =>
                    {
                        if (AllParameters.Count > 1)
                        {
                            explanation.WriteLine();
                        }
                        explanation.Write(pair.Key);
                        explanation.Write(" => ");
                        explanation.Write(pair.Value);
                    });
                });
            }
            explanation.Write(")");
        }
コード例 #2
0
 /// <summary>
 ///     Builds the explanation of the element
 /// </summary>
 /// <param name="explanation"></param>
 /// <param name="explainSubElements">Precises if we need to explain the sub elements (if any)</param>
 public override void GetExplain(TextualExplanation explanation, bool explainSubElements = true)
 {
     explanation.Write("FUNCTION ");
     explanation.ExplainList(Parameters, explainSubElements, ", ", parameter =>
     {
         explanation.Write(parameter.Name);
         explanation.Write(" : ");
         explanation.Write(parameter.TypeName);
     });
     explanation.Write(" => ");
     explanation.Write(Expression);
 }
コード例 #3
0
 /// <summary>
 ///     Builds the explanation of the element
 /// </summary>
 /// <param name="explanation"></param>
 /// <param name="explainSubElements">Precises if we need to explain the sub elements (if any)</param>
 public override void GetExplain(TextualExplanation explanation, bool explainSubElements = true)
 {
     explanation.Write(Structure);
     explanation.WriteLine();
     explanation.Write("{");
     explanation.Indent(2, () => explanation.ExplainList(Associations, explainSubElements, ", ", element =>
     {
         explanation.WriteLine();
         explanation.Write(element.Key);
         explanation.Write(" => ");
         explanation.Write(element.Value);
     }));
     explanation.WriteLine();
     explanation.Write("}");
 }
コード例 #4
0
 /// <summary>
 ///     Builds the explanation of the element
 /// </summary>
 /// <param name="explanation"></param>
 /// <param name="explainSubElements">Precises if we need to explain the sub elements (if any)</param>
 public override void GetExplain(TextualExplanation explanation, bool explainSubElements = true)
 {
     if (ListElements.Count > 0)
     {
         explanation.Write("[");
         explanation.Indent(2,
                            () => explanation.ExplainList(ListElements, explainSubElements, ", ",
                                                          element => element.GetExplain(explanation, explainSubElements)));
         explanation.Write("]");
     }
     else
     {
         explanation.Write("[]");
     }
 }
コード例 #5
0
 /// <summary>
 ///     Builds the explanation of the element
 /// </summary>
 /// <param name="explanation"></param>
 /// <param name="explainSubElements">Precises if we need to explain the sub elements (if any)</param>
 public override void GetExplain(TextualExplanation explanation, bool explainSubElements = true)
 {
     Structure.GetExplain(explanation);
     explanation.Write("{");
     explanation.Indent(2, () => explanation.ExplainList(Associations, explainSubElements, ", ", element =>
     {
         explanation.WriteLine();
         element.Key.GetExplain(explanation);
         explanation.Write(" => ");
         element.Value.GetExplain(explanation);
     }));
     explanation.WriteLine();
     explanation.Write("}");
 }
コード例 #6
0
 /// <summary>
 ///     Builds the explanation of the element
 /// </summary>
 /// <param name="explanation"></param>
 /// <param name="explainSubElements">Precises if we need to explain the sub elements (if any)</param>
 public override void GetExplain(TextualExplanation explanation, bool explainSubElements = true)
 {
     explanation.ExplainList(Arguments, true, ".", expression => expression.GetExplain(explanation));
 }
コード例 #7
0
 /// <summary>
 ///     Builds the explanation of the element
 /// </summary>
 /// <param name="explanation"></param>
 /// <param name="explainSubElements">Precises if we need to explain the sub elements (if any)</param>
 public override void GetExplain(TextualExplanation explanation, bool explainSubElements = true)
 {
     explanation.Write("FUNCTION ");
     explanation.ExplainList(Parameters, explainSubElements, ", ", parameter =>
     {
         explanation.Write(parameter.Name);
         explanation.Write(" : ");
         explanation.Write(parameter.TypeName);
     });
     explanation.Write(" => ");
     explanation.Write(Expression);
 }
コード例 #8
0
ファイル: Call.cs プロジェクト: JamesOakey/ERTMSFormalSpecs
        /// <summary>
        ///     Builds the explanation of the element
        /// </summary>
        /// <param name="explanation"></param>
        /// <param name="explainSubElements">Precises if we need to explain the sub elements (if any)</param>
        public override void GetExplain(TextualExplanation explanation, bool explainSubElements = true)
        {
            Called.GetExplain(explanation);
            explanation.Write("(");
            explanation.ExplainList(ActualParameters, explainSubElements, ", ",
                element => element.GetExplain(explanation));

            if (NamedActualParameters.Count > 0)
            {
                explanation.Indent(2, () =>
                {
                    if (ActualParameters.Count > 0)
                    {
                        explanation.Write(", ");
                    }
                    explanation.ExplainList(NamedActualParameters, explainSubElements, ", ", pair =>
                    {
                        if (AllParameters.Count > 1)
                        {
                            explanation.WriteLine();
                        }
                        pair.Key.GetExplain(explanation);
                        explanation.Write(" => ");
                        pair.Value.GetExplain(explanation);
                    });
                });
            }
            explanation.Write(")");
        }
コード例 #9
0
 /// <summary>
 ///     Builds the explanation of the element
 /// </summary>
 /// <param name="explanation"></param>
 /// <param name="explainSubElements">Precises if we need to explain the sub elements (if any)</param>
 public override void GetExplain(TextualExplanation explanation, bool explainSubElements = true)
 {
     if (ListElements.Count > 0)
     {
         explanation.Write("[");
         explanation.Indent(2,
             () => explanation.ExplainList(ListElements, explainSubElements, ", ",
                 element => element.GetExplain(explanation, explainSubElements)));
         explanation.Write("]");
     }
     else
     {
         explanation.Write("[]");
     }
 }
コード例 #10
0
 /// <summary>
 ///     Builds the explanation of the element
 /// </summary>
 /// <param name="explanation"></param>
 /// <param name="explainSubElements">Precises if we need to explain the sub elements (if any)</param>
 public override void GetExplain(TextualExplanation explanation, bool explainSubElements = true)
 {
     explanation.ExplainList(Arguments, true, ".", expression => expression.GetExplain(explanation));
 }