Index: tmp/org.txm.ocaml.core/lib/ocamlrun-scripting.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.ocaml.core/lib/ocamlrun-scripting.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.ocaml.core/lib/README
===================================================================
--- tmp/org.txm.ocaml.core/lib/README	(revision 0)
+++ tmp/org.txm.ocaml.core/lib/README	(revision 2123)
@@ -0,0 +1 @@
+add ocaml-lib-files.jar file -> ~50mo
\ No newline at end of file

Property changes on: tmp/org.txm.ocaml.core/lib
___________________________________________________________________
Added: svn:ignore
   + ocaml-lib-files.jar


Index: tmp/org.txm.ocaml.core/src/org/txm/ocaml/core/OcamlScriptEngine.java
===================================================================
--- tmp/org.txm.ocaml.core/src/org/txm/ocaml/core/OcamlScriptEngine.java	(revision 0)
+++ tmp/org.txm.ocaml.core/src/org/txm/ocaml/core/OcamlScriptEngine.java	(revision 2123)
@@ -0,0 +1,82 @@
+package org.txm.ocaml.core;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import javax.script.ScriptContext;
+import javax.script.ScriptEngineManager;
+import javax.script.ScriptException;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.ocamljava.runtime.support.scripting.OCamlContext;
+import org.txm.core.engines.ScriptEngine;
+import org.txm.utils.io.IOUtils;
+
+public class OcamlScriptEngine extends ScriptEngine {
+
+	public OcamlScriptEngine() {
+		super("ml");
+	}
+
+	@Override
+	public boolean isRunning() {
+		return true;
+	}
+
+	@Override
+	public boolean initialize() throws Exception {
+		return true;
+	}
+
+	@Override
+	public boolean start(IProgressMonitor monitor) throws Exception {
+		return true;
+	}
+
+	@Override
+	public boolean stop() throws Exception {
+		return true;
+	}
+
+	@Override
+	public IStatus executeScript(File script, HashMap<String, Object> env) {
+		String cmd;
+		try {
+			cmd = IOUtils.getText(script, "UTF-8");
+			return executeText(cmd, env);
+		} catch (IOException e) {
+			e.printStackTrace();
+			return Status.CANCEL_STATUS;
+		}
+	}
+
+	@Override
+	public IStatus executeText(String cmd, HashMap<String, Object> env) {
+
+		final ScriptEngineManager manager = new ScriptEngineManager();
+		final javax.script.ScriptEngine engine = manager.getEngineByName("OCaml");
+		final ScriptContext ctxt = new OCamlContext();
+		ctxt.getBindings(ScriptContext.ENGINE_SCOPE).put("env", env);
+		try {
+			engine.eval(cmd, ctxt);
+			return Status.OK_STATUS;
+		} catch (ScriptException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+			return Status.CANCEL_STATUS;
+		}
+	}
+
+	private static IStatus run(ArrayList<String> cmd, HashMap<String, Object> env) {
+		return Status.OK_STATUS;
+	}
+
+	public static void main(String args[]) {
+		ArrayList<String> cmd = new ArrayList<String>();
+		run(cmd, null);
+	}
+}

Property changes on: tmp/org.txm.ocaml.core/src/org/txm/ocaml/core/OcamlScriptEngine.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ocaml.core/src/org/txm/ocaml/core/SimpleInterpreted.java
===================================================================
--- tmp/org.txm.ocaml.core/src/org/txm/ocaml/core/SimpleInterpreted.java	(revision 0)
+++ tmp/org.txm.ocaml.core/src/org/txm/ocaml/core/SimpleInterpreted.java	(revision 2123)
@@ -0,0 +1,23 @@
+package org.txm.ocaml.core;
+import javax.script.*;
+import org.ocamljava.runtime.support.scripting.OCamlContext;
+import org.ocamljava.runtime.support.scripting.OCamlScriptEngine;
+import org.ocamljava.runtime.support.scripting.OCamlScriptEngineFactory;
+
+public final class SimpleInterpreted {
+
+    private static final String SCRIPT =
+        "external get_binding : string -> 'a = \"script_get_binding\";;\n" +
+        "let n = Int32.to_int (get_binding \"repetitions\");;\n" +
+        "let s : string = get_binding \"message\";;\n" +
+        "for i = 1 to n do print_endline s done;;\n";
+
+    public static void main(final String[] args) throws Throwable {
+    	final ScriptEngineManager manager = new ScriptEngineManager();
+        final ScriptEngine engine = manager.getEngineByName("OCaml");
+        final ScriptContext ctxt = new OCamlContext();
+        ctxt.getBindings(ScriptContext.ENGINE_SCOPE).put("repetitions", 3);
+        ctxt.getBindings(ScriptContext.ENGINE_SCOPE).put("message", "hello!!!");
+        engine.eval(SCRIPT, ctxt);
+    }
+}
\ No newline at end of file

Property changes on: tmp/org.txm.ocaml.core/src/org/txm/ocaml/core/SimpleInterpreted.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ocaml.core/build.properties
===================================================================
--- tmp/org.txm.ocaml.core/build.properties	(revision 0)
+++ tmp/org.txm.ocaml.core/build.properties	(revision 2123)
@@ -0,0 +1,8 @@
+output.. = bin/
+bin.includes = META-INF/,\
+               plugin.xml,\
+               .,\
+               lib/ocamlrun-scripting.jar,\
+               lib/ocaml-lib-files.jar
+jars.compile.order = 
+source.. = src/

Property changes on: tmp/org.txm.ocaml.core/build.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ocaml.core/plugin.xml
===================================================================
--- tmp/org.txm.ocaml.core/plugin.xml	(revision 0)
+++ tmp/org.txm.ocaml.core/plugin.xml	(revision 2123)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+   <extension
+         point="org.txm.core.engines.ScriptEngine">
+      <ScriptEngine
+            class="org.txm.ocaml.core.OcamlScriptEngine"
+            name="ml">
+      </ScriptEngine>
+   </extension>
+
+</plugin>

Property changes on: tmp/org.txm.ocaml.core/plugin.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ocaml.core/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- tmp/org.txm.ocaml.core/.settings/org.eclipse.jdt.core.prefs	(revision 0)
+++ tmp/org.txm.ocaml.core/.settings/org.eclipse.jdt.core.prefs	(revision 2123)
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.7

Property changes on: tmp/org.txm.ocaml.core/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ocaml.core/.classpath
===================================================================
--- tmp/org.txm.ocaml.core/.classpath	(revision 0)
+++ tmp/org.txm.ocaml.core/.classpath	(revision 2123)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry exported="true" kind="lib" path="lib/ocaml-lib-files.jar"/>
+	<classpathentry exported="true" kind="lib" path="lib/ocamlrun-scripting.jar"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**"/>
+		</accessrules>
+	</classpathentry>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Property changes on: tmp/org.txm.ocaml.core/.classpath
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ocaml.core/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.ocaml.core/META-INF/MANIFEST.MF	(revision 0)
+++ tmp/org.txm.ocaml.core/META-INF/MANIFEST.MF	(revision 2123)
@@ -0,0 +1,40 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Ocaml
+Bundle-SymbolicName: org.txm.ocaml.core;singleton:=true
+Bundle-Version: 2.0
+Automatic-Module-Name: org.txm.libs.ocaml
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Export-Package: .,
+ org.ocamljava.runtime,
+ org.ocamljava.runtime.annotations.markers,
+ org.ocamljava.runtime.annotations.parameters,
+ org.ocamljava.runtime.annotations.primitives,
+ org.ocamljava.runtime.context,
+ org.ocamljava.runtime.gui,
+ org.ocamljava.runtime.kernel,
+ org.ocamljava.runtime.parameters,
+ org.ocamljava.runtime.primitives.externallibs.zip,
+ org.ocamljava.runtime.primitives.javalibs.concurrent,
+ org.ocamljava.runtime.primitives.javalibs.javabase,
+ org.ocamljava.runtime.primitives.otherlibs.bigarray,
+ org.ocamljava.runtime.primitives.otherlibs.graph,
+ org.ocamljava.runtime.primitives.otherlibs.num,
+ org.ocamljava.runtime.primitives.otherlibs.str,
+ org.ocamljava.runtime.primitives.otherlibs.systhreads,
+ org.ocamljava.runtime.primitives.otherlibs.threads,
+ org.ocamljava.runtime.primitives.otherlibs.unix,
+ org.ocamljava.runtime.primitives.stdlib,
+ org.ocamljava.runtime.support.applet,
+ org.ocamljava.runtime.support.scripting,
+ org.ocamljava.runtime.support.servlet,
+ org.ocamljava.runtime.support.toplevel,
+ org.ocamljava.runtime.util,
+ org.ocamljava.runtime.values,
+ org.ocamljava.runtime.wrappers,
+ org.txm.ocaml.core
+Require-Bundle: org.txm.core,
+ org.eclipse.core.runtime
+Bundle-ClassPath: .,
+ lib/ocamlrun-scripting.jar,
+ lib/ocaml-lib-files.jar

Property changes on: tmp/org.txm.ocaml.core/META-INF/MANIFEST.MF
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ocaml.core/.project
===================================================================
--- tmp/org.txm.ocaml.core/.project	(revision 0)
+++ tmp/org.txm.ocaml.core/.project	(revision 2123)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.txm.ocaml.core</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Property changes on: tmp/org.txm.ocaml.core/.project
___________________________________________________________________
Added: svn:mime-type
   + text/plain

