public static void main(String[] argsArray) { // argsArray = "-library foo -dependencies bar,baz /Users/ochafik/test.h -mode Directory -o /Users/ochafik/tmp".split(" "); // argsArray = new String[] { "/Users/ochafik/github/nativelibs4java/libraries/tmp/glib/config.jnaerator", "-mode", "Directory", "-f", "-o", "/Users/ochafik/github/nativelibs4java/libraries/tmp/glib" }; // argsArray = new String[] { "/Users/ochafik/tmp/test.h", "-T__be16=short", "-mode", "Directory", "-f", "-o", "/Users/ochafik/github/nativelibs4java/libraries/jnaerator/test", "-v" }; // argsArray = new String[] { "/Users/ochafik/tmp/test.h", "-T__be16=short", "-mode", "Directory", "-f", "-o", "/Users/ochafik/github/nativelibs4java/libraries/jnaerator/test", "-v", "-Dfoo" }; // argsArray = new String[] { "-mode", "Jar", "-f", "-o", "/Users/ochafik/github/nativelibs4java/libraries/tmp", "/Users/ochafik/github/nativelibs4java/libraries/OpenCL/OpenCL4Java/src/main/jnaerator/config.jnaerator" }; main(new JNAerator(new JNAeratorConfig()), argsArray); }
public static void main(String[] argsArray) { // argsArray = "-library foo -dependencies bar,baz /Users/ochafik/test.h -mode Directory -o /Users/ochafik/tmp".split(" "); // argsArray = new String[] { "/Users/ochafik/github/nativelibs4java/libraries/tmp/glib/config.jnaerator", "-mode", "Directory", "-f", "-o", "/Users/ochafik/github/nativelibs4java/libraries/tmp/glib" }; // argsArray = new String[] { "/Users/ochafik/tmp/test.h", "-T__be16=short", "-mode", "Directory", "-f", "-o", "/Users/ochafik/github/nativelibs4java/libraries/jnaerator/test", "-v" }; // argsArray = new String[] { "/Users/ochafik/tmp/test.h", "-T__be16=short", "-mode", "Directory", "-f", "-o", "/Users/ochafik/github/nativelibs4java/libraries/jnaerator/test", "-v", "-Dfoo" }; // argsArray = new String[] { "-mode", "Jar", "-f", "-o", "/Users/ochafik/github/nativelibs4java/libraries/tmp", "/Users/ochafik/github/nativelibs4java/libraries/OpenCL/OpenCL4Java/src/main/jnaerator/config.jnaerator" }; main(new JNAerator(new JNAeratorConfig()), argsArray); }
public static void main(String[] args) { JNAerator.main(new JavaCLGenerator(new JNAeratorConfig()), new String[] { "-o", "target/generated-sources/test", //"-o", "/Users/ochafik/Prog/Java/versionedSources/nativelibs4java/trunk/libraries/OpenCL/Demos/target/generated-sources/main/java", "-noJar", "-noComp", "-v", "-addRootDir", "src/test/opencl", "src/test/opencl/com/nativelibs4java/opencl/generator/Structs.c", //"-addRootDir", "/Users/ochafik/Prog/Java/versionedSources/nativelibs4java/trunk/libraries/OpenCL/Blas/target/../src/main/opencl", //"/Users/ochafik/Prog/Java/versionedSources/nativelibs4java/trunk/libraries/OpenCL/Blas/src/main/opencl/com/nativelibs4java/opencl/blas/LinearAlgebraKernels.c" //"-addRootDir", "/Users/ochafik/Prog/Java/versionedSources/nativelibs4java/trunk/libraries/OpenCL/Demos/target/../src/main/opencl", //"/Users/ochafik/Prog/Java/versionedSources/nativelibs4java/trunk/libraries/OpenCL/Demos/target/../src/main/opencl/com/nativelibs4java/opencl/demos/sobelfilter/SimpleSobel.cl" } ); } }
public static ObjCppParser newParser(String s) throws IOException { Result result = new Result(new JNAeratorConfig(), null, null); ObjCppParser parser = new ObjCppParser(new CommonTokenStream(new ObjCppLexer( new ANTLRReaderStream(new StringReader(s)))) // , new DummyDebugEventListener() ); parser.objCParserHelper = result.typeConverter; return parser; }
public static ObjCppParser newParser(String s) throws IOException { Result result = new Result(new JNAeratorConfig(), null, null); ObjCppParser parser = new ObjCppParser(new CommonTokenStream(new ObjCppLexer( new ANTLRReaderStream(new StringReader(s)))) // , new DummyDebugEventListener() ); parser.objCParserHelper = result.typeConverter; return parser; }
static String preprocess(File source) throws IOException, LexerException { JNAeratorConfig config = new JNAeratorConfig(); JNAeratorConfigUtils.autoConfigure(config); config.preprocessorConfig.implicitIncludes.add("C:\\program files\\Microsoft SDKs\\Windows\\v7.0A\\Include"); config.preprocessorConfig.implicitIncludes.add("C:\\program files\\Microsoft Visual Studio 10.0\\VC\\include"); //config.preprocessorConfig.includeStrings.add(source); config.addSourceFile(source, null, false, true, true); Result result = new Result(config, null, null); String pre = PreprocessorUtils.preprocessSources(config, Collections.EMPTY_LIST, false, result.typeConverter, null); return pre; }
public static void main(String[] args) { try { JNAeratorConfig config = new JNAeratorConfig(); config.verbose = true; Result result = new Result(config, null, null); SourceFiles sourceFiles = new SourceFiles(); File file = new File("/System/Library/Frameworks/Foundation.framework/Resources/BridgeSupport/FoundationFull.bridgesupport"); new BridgeSupportParser(result, sourceFiles).parseBridgeSupportFile(file); } catch (Exception ex) { ex.printStackTrace(); } }
public static void main(String[] args) { try { JNAeratorConfig config = new JNAeratorConfig(); config.verbose = true; Result result = new Result(config, null, null); SourceFiles sourceFiles = new SourceFiles(); File file = new File("/System/Library/Frameworks/Foundation.framework/Resources/BridgeSupport/FoundationFull.bridgesupport"); new BridgeSupportParser(result, sourceFiles).parseBridgeSupportFile(file); } catch (Exception ex) { ex.printStackTrace(); } }
static String preprocess(File source) throws IOException, LexerException { JNAeratorConfig config = new JNAeratorConfig(); JNAeratorConfigUtils.autoConfigure(config); config.preprocessorConfig.implicitIncludes.add("C:\\program files\\Microsoft SDKs\\Windows\\v7.0A\\Include"); config.preprocessorConfig.implicitIncludes.add("C:\\program files\\Microsoft Visual Studio 10.0\\VC\\include"); //config.preprocessorConfig.includeStrings.add(source); config.addSourceFile(source, null, false, true, true); Result result = new Result(config, null, null); String pre = PreprocessorUtils.preprocessSources(config, Collections.EMPTY_LIST, false, result.typeConverter, null); return pre; }
static List<Declaration> parseDeclarations(String source) throws IOException, LexerException, InterruptedException { JNAeratorConfig config = new JNAeratorConfig(); JNAeratorConfigUtils.autoConfigure(config); //config.noCPlusPlus = true; config.preprocessorConfig.includeStrings.add(source); Result result = new Result(config, null, null); SourceFiles parse = new JNAeratorParser().parse(config, result.typeConverter, null); List<Declaration> ret = new ArrayList<Declaration>(); flatten(parse, ret); return ret; }
static List<Declaration> parseDeclarations(String source) throws IOException, LexerException, InterruptedException { JNAeratorConfig config = new JNAeratorConfig(); JNAeratorConfigUtils.autoConfigure(config); //config.noCPlusPlus = true; config.preprocessorConfig.includeStrings.add(source); Result result = new Result(config, null, null); SourceFiles parse = new JNAeratorParser().parse(config, result.typeConverter, null); List<Declaration> ret = new ArrayList<Declaration>(); flatten(parse, ret); return ret; }
String javaOutPath = javaOutDir.getCanonicalPath(); for (File file : sources) { final JNAeratorConfig config = new JNAeratorConfig(); config.autoConf = true; config.forceOverwrite = true;
public void run() { JNAeratorConfig config = new JNAeratorConfig(); config.outputJar = getOutputJarFile(); config.outputDir = getOutputDir();
public void run() { JNAeratorConfig config = new JNAeratorConfig(); config.outputJar = getOutputJarFile(); config.outputDir = getOutputDir();
public static ObjCppParser newParser(String s) throws IOException { Result result = new Result(new JNAeratorConfig(), null, null); ObjCppParser parser = new ObjCppParser(new CommonTokenStream(new ObjCppLexer( new ANTLRReaderStream(new StringReader(s)))) // , new DummyDebugEventListener() ); parser.objCParserHelper = result.typeConverter; return parser; } }
@Test public void test() throws SyntaxException, IOException, LexerException, RecognitionException { JNAeratorConfig config = new JNAeratorConfig(); config.defaultLibrary = header.replaceAll("[^\\w]+", "_"); config.outputMode = null;
@Test public void test() throws SyntaxException, IOException, LexerException, RecognitionException { JNAeratorConfig config = new JNAeratorConfig(); config.defaultLibrary = test.libraryName; config.outputMode = OutputMode.StandaloneJar;