diff graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/SLMain.java @ 18485:e3c95cbbb50c

Truffle Instrumentation: major API revision, based around the Probe and Instrument classes; add Instrumentable API for language implementors, with most details automated; reimplemented to handle AST splitting automatically; more JUnit tests.
author Michael Van De Vanter <michael.van.de.vanter@oracle.com>
date Sun, 23 Nov 2014 16:07:23 -0800
parents 7661cc464239
children 0ef23ff7d5a1
line wrap: on
line diff
--- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/SLMain.java	Fri Nov 21 13:16:02 2014 +0100
+++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/SLMain.java	Sun Nov 23 16:07:23 2014 -0800
@@ -27,10 +27,10 @@
 
 import com.oracle.truffle.api.*;
 import com.oracle.truffle.api.dsl.*;
-import com.oracle.truffle.api.instrument.*;
 import com.oracle.truffle.api.nodes.*;
 import com.oracle.truffle.api.source.*;
 import com.oracle.truffle.sl.builtins.*;
+import com.oracle.truffle.sl.factory.*;
 import com.oracle.truffle.sl.nodes.*;
 import com.oracle.truffle.sl.nodes.call.*;
 import com.oracle.truffle.sl.nodes.controlflow.*;
@@ -119,7 +119,7 @@
      */
     public static void main(String[] args) throws IOException {
 
-        SLContext context = new SLContext(new BufferedReader(new InputStreamReader(System.in)), System.out);
+        SLContext context = SLContextFactory.create(new BufferedReader(new InputStreamReader(System.in)), System.out);
 
         Source source;
         if (args.length == 0) {
@@ -146,16 +146,9 @@
             // logOutput.println("Source = " + source.getCode());
         }
 
-        final SourceCallback sourceCallback = context.getSourceCallback();
+        /* Parse the SL source file. */
+        Parser.parseSL(context, source);
 
-        /* Parse the SL source file. */
-        if (sourceCallback != null) {
-            sourceCallback.startLoading(source);
-        }
-        Parser.parseSL(context, source);
-        if (sourceCallback != null) {
-            sourceCallback.endLoading(source);
-        }
         /* Lookup our main entry point, which is per definition always named "main". */
         SLFunction main = context.getFunctionRegistry().lookup("main");
         if (main.getCallTarget() == null) {