Beispiel #1
0
        public CoGsharp.CoG InitCog(Specification S)
        {
            // get cog, add references, load templates
            CoGsharp.CoG cog = new CoGsharp.CoG();
            cog.AddReference(S.GetType().Assembly.Location);                          // add reference for libg25
            cog.AddReference(RefGA.BasisBlade.ZERO.GetType().Assembly.Location);      // add reference for RefGA
            cog.AddReference(this.GetType().Assembly.Location);                       // add reference for this assembly
            cog.AddReference((new G25.CG.Shared.Util()).GetType().Assembly.Location); // add reference for g25_cg_shared

            LoadTemplates(S, cog);
            return(cog);
        }
Beispiel #2
0
        public CoGsharp.CoG InitCog(Specification S)
        {
            // get cog, add references, load templates
            CoGsharp.CoG cog = new CoGsharp.CoG();
            cog.AddReference(S.GetType().Assembly.Location); // add reference for libg25
            cog.AddReference(RefGA.BasisBlade.ZERO.GetType().Assembly.Location); // add reference for RefGA
            cog.AddReference(this.GetType().Assembly.Location); // add reference for this assembly
            cog.AddReference((new G25.CG.Shared.Util()).GetType().Assembly.Location); // add reference for g25_cg_shared

            LoadTemplates(S, cog);
            return cog;
        }
Beispiel #3
0
        /// <summary>
        /// Loads all templates for the 'Java' language into 'cog'. Also loads
        /// shared templates by calling G25.CG.Shared.Util.LoadTemplates(cog);
        /// </summary>
        /// <param name="cog">Templates are loaded into this variable.</param>
        /// <param name="S">Specification. Used to know whether testing code will be generated.</param>
        public override void LoadTemplates(Specification S, CoGsharp.CoG cog)
        {
            cog.AddReference((new G25.CG.CSJ.GMV()).GetType().Assembly.Location); // add reference for g25_cg_csj

            // also load shared templates:
            G25.CG.Shared.Util.LoadTemplates(cog);

            cog.LoadTemplates(g25_cg_csj_shared.Properties.Resources.cg_csj_shared_templates , "cg_csj_shared_templates.txt");
            cog.LoadTemplates(g25_cg_csj_shared.Properties.Resources.cg_csj_shared_test_templates, "cg_csj_shared_test_templates.txt");

            cog.LoadTemplates(g25_cg_java.Properties.Resources.cg_java_templates, "cg_java_templates.txt");
            if (S.m_generateTestSuite) // only load when testing code is required
                cog.LoadTemplates(g25_cg_java.Properties.Resources.cg_java_test_templates, "cg_java_test_templates.txt");
        }