comparison graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/SLMain.java @ 16675:0fc43b066eee

SL/SourceAttribution: correct some omissions, and in particular add new node SLParenExpressionNode to represent a parenthesized expression; this is semantically neutral of course, but needed to account correctly for the text of such an expression (as opposed to its contents).
author Michael Van De Vanter <michael.van.de.vanter@oracle.com>
date Fri, 01 Aug 2014 16:30:22 -0700
parents 618d92152d3c
children 7c8ddb4233cd
comparison
equal deleted inserted replaced
16674:70f47dbbcabd 16675:0fc43b066eee
151 /* Parse the SL source file. */ 151 /* Parse the SL source file. */
152 if (sourceCallback != null) { 152 if (sourceCallback != null) {
153 sourceCallback.startLoading(source); 153 sourceCallback.startLoading(source);
154 } 154 }
155 Parser.parseSL(context, source, null); 155 Parser.parseSL(context, source, null);
156 System.out.println(source.getName() + "========================");
157 System.out.println(source.getCode());
158 System.out.println(source.getName() + "========================");
156 if (sourceCallback != null) { 159 if (sourceCallback != null) {
157 sourceCallback.endLoading(source); 160 sourceCallback.endLoading(source);
158 } 161 }
159 /* Lookup our main entry point, which is per definition always named "main". */ 162 /* Lookup our main entry point, which is per definition always named "main". */
160 SLFunction main = context.getFunctionRegistry().lookup("main"); 163 SLFunction main = context.getFunctionRegistry().lookup("main");
163 } 166 }
164 167
165 /* Change to true if you want to see the AST on the console. */ 168 /* Change to true if you want to see the AST on the console. */
166 boolean printASTToLog = false; 169 boolean printASTToLog = false;
167 /* Change to true if you want to see source attribution for the AST to the console */ 170 /* Change to true if you want to see source attribution for the AST to the console */
168 boolean printSourceAttributionToLog = false; 171 boolean printSourceAttributionToLog = true;
169 /* Change to dump the AST to IGV over the network. */ 172 /* Change to dump the AST to IGV over the network. */
170 boolean dumpASTToIGV = false; 173 boolean dumpASTToIGV = false;
171 174
172 printScript("before execution", context, logOutput, printASTToLog, printSourceAttributionToLog, dumpASTToIGV); 175 printScript("before execution", context, logOutput, printASTToLog, printSourceAttributionToLog, dumpASTToIGV);
173 try { 176 try {
190 } 193 }
191 194
192 } finally { 195 } finally {
193 printScript("after execution", context, logOutput, printASTToLog, printSourceAttributionToLog, dumpASTToIGV); 196 printScript("after execution", context, logOutput, printASTToLog, printSourceAttributionToLog, dumpASTToIGV);
194 } 197 }
198 return;
195 } 199 }
196 200
197 /** 201 /**
198 * When dumpASTToIGV is true: dumps the AST of all functions to the IGV visualizer, via a socket 202 * When dumpASTToIGV is true: dumps the AST of all functions to the IGV visualizer, via a socket
199 * connection. IGV can be started with the mx command "mx igv". 203 * connection. IGV can be started with the mx command "mx igv".