On 7/21/12, Andrei Alexandrescu <[email protected]> wrote: > class ModuleInfo { > @property: > string name(); > ImportInfo[] imports(); > DataInfo[] data(); > FunctionInfo[] functions(); > ClassInfo[] classes(); > StructInfo[] structs(); // includes unions > TemplateInfo[] templates(); > EnumInfo[] enums(); > bool hasStaticCtor(), hasStaticDtor(), > hasSharedCtor(), hasSharedDtor(); > }
Are class/struct/function/etc templates going to be stored in the templates field? Then you'd have to tag each template with a type, e.g. "class template" vs "function template" to be able to filter them out. Otherwise classes/functions/etc could have an optional "TemplateTypeInfo[] typeParams" field so you could filter out templated from non-templated types by checking their typeParams field, e.g.: auto tempClasses = filter!(a => !empty(a.typeParams) )(modinfo.classes); I use a similar structure to what you've defined for my code generator and it worked out nicely for me.
