Ejemplo n.º 1
0
        public static void GenerateObjCMethodSignature(this CCodeGenerator gen,
                                                       Method method)
        {
            gen.Write("{0}", method.IsStatic ? "+" : "-");

            var retType = method.ReturnType.Visit(gen.CTypePrinter);

            gen.Write(" ({0}){1}", retType, method.Name);

            gen.Write(gen.CTypePrinter.VisitParameters(method.Parameters));
        }
Ejemplo n.º 2
0
        public override bool VisitMethodDecl(Method method)
        {
            PushBlock(BlockKind.Method, method);

            var @class = method.Namespace as Class;

            Write($"public {method.ReturnType} {CCodeGenerator.GetMethodIdentifier(method)}(");
            Write(TypePrinter.VisitParameters(method.Parameters, hasNames: true).ToString());
            Write(");");

            PopBlock(NewLineKind.Never);
            return(true);
        }
Ejemplo n.º 3
0
 public static bool GenerateObjCField(this CCodeGenerator gen, Field field)
 {
     gen.WriteLine($"{GetObjCAccessKeyword(field.Access)} {field.Type} {field.Name};");
     return(true);
 }