public JavaGenerator(BindingContext context) : base(context)
        {
            TypePrinter = new JavaTypePrinter(Context);

            Passes = new PassBuilder <TranslationUnitPass>(Context);
            CGenerator.SetupPasses(Passes);
        }
Esempio n. 2
0
 public JavaSources(BindingContext context, TranslationUnit unit)
     : base(context, new List <TranslationUnit> {
     unit
 })
 {
     TypePrinter = new JavaTypePrinter(context);
 }
Esempio n. 3
0
 public JavaSources(BindingContext context, Declaration decl)
     : base(context, new List <TranslationUnit> {
     decl.TranslationUnit
 })
 {
     Declaration = decl;
     TypePrinter = new JavaTypePrinter(context);
 }
        public override bool VisitClassDecl(Class @class)
        {
            var typePrinter = new JavaTypePrinter(Context.Context);
            var typeName    = @class.Visit(typePrinter);

            if (@class.IsInterface)
            {
                typeName = $"{typeName}Impl";
            }

            Context.Return.Write($"new {typeName}({Context.ReturnVarName})");
            return(true);
        }
Esempio n. 5
0
        public override bool VisitClassDecl(Class @class)
        {
            var typePrinter = new JavaTypePrinter(Context.Context);
            var typeName    = @class.Visit(typePrinter);

            if (@class.IsInterface)
            {
                typeName = $"{typeName}Impl";
            }

            Context.Return.Write("({0} == com.sun.jna.Pointer.NULL ? null : new {1}({0}))",
                                 Context.ReturnVarName, typeName);
            return(true);
        }
 public JavaMarshalPrinter(MarshalContext marshalContext)
     : base(marshalContext)
 {
     TypePrinter = new JavaTypePrinter(Context.Context);
 }