Beispiel #1
0
 void GenerateMembers(IndentWriter writer)
 {
     foreach (var member in Members)
     {
         writer.WriteDocumentation(member.Doc);
         writer.WriteLine(member.Name.ToCSharp() + " = " + HexFormat(member.Value) + ",");
     }
 }
Beispiel #2
0
        public static void GenerateDocumentation(this IDocumented gen, IndentWriter writer)
        {
            if (gen.Doc is null)
            {
                return;
            }

            writer.WriteDocumentation(gen.Doc, gen is ReturnValue ? "returns" : "summary");
        }
Beispiel #3
0
        public void Generate(GenerationOptions opts, IGeneratable parent, IndentWriter writer)
        {
            writer.WriteDocumentation(Doc);

            // Simple uncorrect gen for now
            var managedType = this.GetSymbol(opts);

            // We need something that will tell us the equivalent C# type
            // including the number of pointers.
            // For now, generate normal info.

            writer.WriteLine($"{managedType.Name} {Name};");
        }
Beispiel #4
0
        public void Generate(GenerationOptions opts, IGeneratable parent, IndentWriter writer)
        {
            writer.WriteDocumentation(Doc);

            string value = Value;

            // Make this smarter, probably pass in some options and key them.
            if (parent is Bitfield)
            {
                value = HexFormat(value);
            }

            writer.WriteLine(Name.ToCSharp() + " = " + value + ",");
        }