Exemplo n.º 1
0
        public void Render_Ast_SubClasses()
        {
            var allTerms = MetaDb.JavaTermInfo.ToObject <Dictionary <string, JObject> >();
            var mutator  = new CSharpTermInfoMutator(allTerms);

            mutator.EnsureLanguageSafeTerms();

            RenderAstSubclass(null, "ReqlExpr", "ReqlAst", allTerms, null);

            foreach (var kvp in allTerms)
            {
                var termName = kvp.Key;
                var termMeta = kvp.Value;

                if (!kvp.Value["deprecated"]?.ToObject <bool?>() ?? true)
                {
                    var className  = termMeta["classname"].ToString();
                    var superclass = termMeta["superclass"].ToString();

                    RenderAstSubclass(termName, className, superclass, allTerms, termMeta);
                }
                else
                {
                    Console.WriteLine("Deprcated:" + kvp.Key);
                }
            }
        }
Exemplo n.º 2
0
        public void Render_TopLevel()
        {
            var allTerms = MetaDb.JavaTermInfo.ToObject <Dictionary <string, JObject> >();
            var mutator  = new CSharpTermInfoMutator(allTerms);

            mutator.EnsureLanguageSafeTerms();

            var tmpl = new TopLevelTemplate()
            {
                AllTerms = allTerms
            };

            File.WriteAllText(Path.Combine(ModelDir, "TopLevel.cs"), tmpl.TransformText());
        }