public void GenerateDeclarationContext(List <CodeGenerator> generators,
                                               DeclarationContext context)
        {
            foreach (var decl in context.Declarations)
            {
                if (decl is Method || decl is Field || decl is Property ||
                    decl is TypedefDecl)
                {
                    continue;
                }

                if (!decl.IsGenerated)
                {
                    continue;
                }

                if (!(decl is Namespace))
                {
                    var sources = new JavaSources(Context, decl);
                    generators.Add(sources);
                }

                if (decl is DeclarationContext)
                {
                    GenerateDeclarationContext(generators, decl as DeclarationContext);
                }
            }
        }
Пример #2
0
        static string GetName(Declaration decl)
        {
            var names = new List <string>();

            names.AddRange(JavaSources.GetPackageNames(decl));
            names.Add(decl.Name);

            return(string.Join(".", names));
        }