Exemple #1
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");
        }
Exemple #2
0
        /// <summary>
        /// Loads all templates for the 'C' 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)
        {
            // also load shared templates:
            G25.CG.Shared.Util.LoadTemplates(cog);
            G25.CG.Shared.Util.LoadCTemplates(cog);

            //cog.LoadTemplates(g25_cg_shared.Properties.Resources.cg_shared_templates, "cg_shared_templates.txt");

            cog.LoadTemplates(g25_cg_c.Properties.Resources.cg_c_templates, "cg_c_templates.txt");
            if (S.m_generateTestSuite) // only load when testing code is required
                cog.LoadTemplates(g25_cg_c.Properties.Resources.cg_c_test_templates, "cg_c_test_templates.txt");
        }
Exemple #3
0
 public CGdata(List<CodeGeneratorPlugin> plugins, CoGsharp.CoG cog)
 {
     m_plugins = plugins;
     m_cog = cog;
 }
Exemple #4
0
 /// <summary>
 /// Loads globally shared templates for into 'cog'. 
 /// Specifically, loads 'cg_shared_templates.txt'
 /// which is a project resource of g25_cg_shared.
 /// </summary>
 /// <param name="cog">Templates are loaded into cog.</param>
 public static void LoadTemplates(CoGsharp.CoG cog)
 {
     cog.LoadTemplates(g25_cg_shared.Properties.Resources.cg_shared_templates, "cg_shared_templates.txt");
 }
Exemple #5
0
 /// <summary>
 /// Should load all templates for the language into 'cog'.
 /// 
 /// Default implementation does nothing.
 /// 
 /// </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 virtual void LoadTemplates(Specification S, CoGsharp.CoG cog)
 {
 }