C%2b%2b To Java Converter For Mac



Chalmers University of Technology and University of Gothenburg

What is the BNF Converter?

Converter

Jar2app is a Python 2/3 script that can easily convert any jar file into a Mac OS X app file. It seeks simplicity, and in fact can be run just like. Jar2app input.jar creating input.App in the process. No third-party libraries. Though simple and easy to use, there are loads of configurable options, such as setting icons, bundle names or bundling your own JRE/JDK. Running the command: $ gcc -S geeks.c This will cause gcc to run the compiler, generating an assembly file geeks.s, and go no further.(Normally it would then invoke the assembler to generate an object- code file.).

The BNF Converter is a compiler construction tool generating a compiler front-end from a Labelled BNF grammar. It is currently generating code for the target languages Haskell, Agda, C, C++, C#, Java, and OCaml, as well as XML representations and Pygment syntax highlighters.

The C2J converter provides automatic translation of C code source files into separate Java classes with appropriate names. Standard ANSI C runtime and K&R C libraries are fully supported, and the.

Given a Labelled BNF grammar the tool produces:

  • an abstract syntax implementation in the target language,
  • a case skeleton for the abstract syntax in the target language,
  • a pretty-printer in the target language,
  • an Alex, JLex, or Flexlexer generator file ,
  • a Happy, CUP, or Bisonparser generator file, and
  • a LaTeX file containing a readable specification of the language.

Download

C 2b 2b To Java Converter For Mac 64-bit

Install by Cabal from Hackage:

C 2b 2b To Java Converter For Mac Os

Current development version (source repository on GitHub)

News

Find the latest releases at https://github.com/BNFC/bnfc/releases.

BNFC release 2.8.42020-10-10

BNFC release 2.8.32019-08-27

BNFC release 2.8.22018-11-04

BNFC release 2.8.12016-10-04

BNFC release 2.82015-05-24

BNFC release 2.7.12014-10-09

BNFC release 2.7.0.12014-09-26

C 2b 2b To Java Converter For Mac Download

BNFC release 2.7.0.02014-09-26

BNFC release 2.5.02013-03-18

Implementing Programming Languages, a compiler book using BNFC2012-07-13

Resources

C 2b 2b To Java Converter For Macs

Documentation

  • User Manual on Read the Docs (HTML)
  • Tutorial (a bit dated) (Files)
  • LBNF Reference Manual (also as PDF from 2005)

Mailing list

Send questions, bug reports, usage news, etc, to our Google group.

Book

Implementing Programming Languages, a compiler book using BNFC.

A small example

Content of file Calc.cf:
-- Calc.cf: A grammar for arithmetical expressions
EAdd.Exp::=Exp'+'Exp1;
ESub.Exp::=Exp'-'Exp1;
EMul.Exp1::=Exp1'*'Exp2;
EDiv.Exp1::=Exp1'/'Exp2;
EInt.Exp2::=Integer;
coercionsExp2;
Run the test parser, generated e.g. with `--haskell`:

Large examples

A grammar of C with an example C file.

A grammar of Alfa with an example Alfa file. (For more details, see the Alfa home page.)

A grammar of LBNF. It is at the same time an example LBNF file. The development version of this grammar is used in the implementation of the BNF Converter.

A grammar of Java 1.1 developed by Mike Rainey.

Authors

© Andreas Abel, Jonas Almström Duregård, Krasimir Angelov,Jean-Philippe Bernardy, Björn Bringert, Johan Broberg, Kyle Butt,Paul Callaghan,Grégoire Détrez,Markus Forsberg, Ola Frid,Peter Gammie,Thomas Hallgren, Pascal Hof, Simon Huber,Patrik Jansson, Kristofer Johannisson,Antti-Juhani Kaijanaho,Andreas Lööw,Justin Meiners, Kent Mein,Ulf Norell,Gabriele Paganelli, Michael Pellauer,Fabian Ruch, andAarne Ranta 2002 - 2020.

License

Free software under theBSD 3-clauselicense.

Versions until 2.8.4 released under theGNU General Public License(GPL).

C 2b 2b to java converter for mac download xml:lang='en-US'>

These documentation pages are no longer current. They remain available for archival purposes. Please visit https://docs.oracle.com/javase for the most up-to-date documentation.

This page shows you, step by step, how to convert a simple Java application to a version you can distribute on a Mac. To follow along, download the ButtonDemo (.zip) example from the Java Tutorial. This example was created using NetBeans which uses the Ant utility. You can run all necessary tools and make all necessary edits from the command line, without launching NetBeans. The Ant tool is required.

You have created a Java application and want to bundle it for deployment. This requires the following steps:

Create a JAR File

This step creates the ButtonDemo.jar file.

Execute ant jar in the high-level project directory to create the dist/ButtonDemo.jar file. This jar file is used to create the .app package.

Bundle the JAR File into an App Package

To create the ButtonDemo.app package, use the appbundler tool. The appbundler is not shipped with the 7u6 version of the Oracle JDK for the Mac. You can download it from the Java Application Bundler project on java.net. There is also AppBundler Documentation available.

As of this writing, the most recent version is appbundler-1.0.jar, which is used by this document. Download the latest version available and substitute the file name accordingly.

  1. Install the appbundler-1.0.jar file. In this case, create a lib directory in the high-level project directory and add the appbundler-1.0.jar file.
  2. Modify the build.xml file in the high-level project directory as follows. (The added code is shown in bold.)
  3. Invoke the appbundler by typing ant bundle-buttonDemo from the high-level project directory. This creates the ButtonDemo.app package in the dist directory.
  4. You should now be able to launch the application by double clicking ButtonDemo.app in the Finder, or by typing open ButtonDemo.app at the command line.

Bundle the JRE with the App Package

In order to distribute a Java application, you want to avoid dependencies on third party software. Your app package should include the Java Runtime Environment, or JRE. In fact, the Apple Store requires the use of an embedded JRE as a prerequisite for Mac App Store distribution. The runtime sub-element of the <bundleapp> task specifies the root of the JRE that will be included in the app package.

In this example, the location of the JRE is defined using the JAVA_HOME environment variable. However, you might choose to bundle a JRE that is not the same as the one you are using for development. For example you might be developing on 7u6, but you need to bundle the app with 7u4. You will define runtime accordingly.

Since this example defines the runtime sub-element using JAVA_HOME, make sure it is configured correctly for your environment. For example, in your .bashrc file, define JAVA_HOME as follows:

Use the following steps to modify the build.xml file at the top of the project directory:

  1. Specify an environment property, named env:
  2. In the target that creates the bundle, specify the location of the JRE on your system, using the env property:

The resulting build.xml file should look like the following. (The new lines are shown in bold.)

Create a fresh version of ButtonDemo.app, using the ant bundle-buttonDemo command. The resulting version includes the JRE in the app package. You can confirm this by examining the Contents/PlugIns directory inside of the app package.

Sign the App

The Gatekeeper feature, introduced in Mountain Lion (OS X 10.8), allows users to set the level of security for downloaded applications. By default, Gatekeeper is set to allow only OS X App Store and Developer ID signed applications. Unless your app is signed with a Developer ID certificate provided by Apple, your application will not launch on a system with Gatekeeper's default settings.

For information on the signing certificates available, see Code Signing Tasks on developer.apple.com.

The signing certificate contains a field called Common Name. Use the string from the Common Name field to sign your application.

Sign your app using the codesign(1) tool, as shown in the following example:

To verify that the app is signed, the following command provides information about the signing status of the app:

To check whether an application can be launched when Gatekeeper is enabled, use the spctl command:

If you leave off the --verbose tag, and it does not print any output, indicates 'success'.

For more information, see Distributing Outside the Mac App Store on developer.apple.com.

Submitting an App to the Mac App Store

Packaging an app for the Mac App Store is similar to packaging for regular distribution up until the step of signing the app. Signing the app for the Mac App Store requires a few more steps, and a different kind of certificate.

You will need to create an application ID and then obtain a distribution certificate for that application ID. Submit your app using Application Loader. For more information, see the following links (on developer.apple.com):

Copyright © 1993, 2020, Oracle and/or its affiliates. All rights reserved.