Esempio n. 1
0
        private static void WriteExplicitConverterCSharp(StringBuilder SB, Specification S, FloatType FT, G25.fgs fgs, SMV srcSmv, SMV dstSmv)
        {
            string  srcTypeName  = FT.GetMangledName(S, srcSmv.GetName());
            string  dstTypeName  = FT.GetMangledName(S, dstSmv.GetName());
            string  argName      = "x";
            string  extraComment = null;
            Comment comment      = GetComment(S, srcTypeName, dstTypeName, argName, extraComment);

            comment.Write(SB, S, 1);
            SB.AppendLine("\tpublic static explicit operator " + dstTypeName + " (" + srcTypeName + " " + argName + ") {");
            SB.AppendLine("\t\treturn " + S.m_namespace + "." + FT.GetMangledName(S, fgs.m_outputName) + /*dstTypeName*/ "(" + argName + ");");
            SB.AppendLine("\t}");
        }
Esempio n. 2
0
        private static void WriteConvertingConstructor(StringBuilder SB, Specification S, G25.CG.Shared.CGdata cgd, FloatType FT, G25.fgs fgs, SMV srcSmv, SMV dstSmv)
        {
            string  srcTypeName = FT.GetMangledName(S, srcSmv.GetName());
            string  dstTypeName = FT.GetMangledName(S, dstSmv.GetName());
            string  argName     = "x";
            Comment comment     = new Comment("Converting constructor, from " + srcTypeName + " to " + dstTypeName);

            comment.Write(SB, S, 1);

            SB.AppendLine("\tpublic " + dstTypeName + "(" + srcTypeName + " " + argName + ") {");

            int  nbTabs          = 2;
            bool declareVariable = false;
            bool cast            = false;
            bool srcPtr          = false;
            bool dstPtr          = false;

            RefGA.Multivector value = Symbolic.SMVtoSymbolicMultivector(S, srcSmv, argName, srcPtr);
            AssignInstruction AI    = new AssignInstruction(nbTabs, dstSmv, FT, cast, value, SmvUtil.THIS, dstPtr, declareVariable);

            AI.Write(SB, S, cgd);

            SB.AppendLine("\t}");
        }
Esempio n. 3
0
 private static void WriteExplicitConverterCSharp(StringBuilder SB, Specification S, FloatType FT, G25.fgs fgs, SMV srcSmv, SMV dstSmv)
 {
     string srcTypeName = FT.GetMangledName(S, srcSmv.GetName());
     string dstTypeName = FT.GetMangledName(S, dstSmv.GetName());
     string argName = "x";
     string extraComment = null;
     Comment comment = GetComment(S, srcTypeName, dstTypeName, argName, extraComment);
     comment.Write(SB, S, 1);
     SB.AppendLine("\tpublic static explicit operator " + dstTypeName + " (" + srcTypeName + " " + argName + ") {");
     SB.AppendLine("\t\treturn " + S.m_namespace + "." + FT.GetMangledName(S, fgs.m_outputName) + /*dstTypeName*/ "(" + argName + ");");
     SB.AppendLine("\t}");
 }
Esempio n. 4
0
        private static void WriteConvertingConstructor(StringBuilder SB, Specification S, G25.CG.Shared.CGdata cgd, FloatType FT, G25.fgs fgs, SMV srcSmv, SMV dstSmv)
        {
            string srcTypeName = FT.GetMangledName(S, srcSmv.GetName());
            string dstTypeName = FT.GetMangledName(S, dstSmv.GetName());
            string argName = "x";
            Comment comment = new Comment("Converting constructor, from " + srcTypeName + " to " + dstTypeName);
            comment.Write(SB, S, 1);

            SB.AppendLine("\tpublic " + dstTypeName + "(" + srcTypeName + " " + argName + ") {");

            int nbTabs = 2;
            bool declareVariable = false;
            bool cast = false;
            bool srcPtr = false;
            bool dstPtr = false;
            RefGA.Multivector value = Symbolic.SMVtoSymbolicMultivector(S, srcSmv, argName, srcPtr);
            AssignInstruction AI = new AssignInstruction(nbTabs, dstSmv, FT, cast, value, SmvUtil.THIS, dstPtr, declareVariable);
            AI.Write(SB, S, cgd);

            SB.AppendLine("\t}");
        }