MCPcopy Create free account
hub / github.com/SeaOfNodes/Simple / run

Method run

chapter18/src/main/java/com/seaofnodes/simple/JSViewer.java:31–62  ·  view source on GitHub ↗
( )

Source from the content-addressed store, hash-verified

29 }
30
31 void run( ) throws Exception {
32 SERVER.put("!");
33 while( true ) {
34 String src = SERVER.get();
35 switch( src ) {
36 case null: return;
37 case "null": return;
38 case "+": break; // Client requests more frames, but we send them all anyway
39 default:
40 System.out.println(src);
41 try {
42 N=0;
43 // Use parser scope, xscope when building views
44 CODE = new CodeGen(src);
45 SHOW = true;
46 show();
47 // Parse program, generating views at every parse point
48 CODE.parse();
49 // No longer user parse internal state when building views
50 CODE.opto();
51
52 // Catch and ignore Parser errors
53 } catch(RuntimeException re) {
54 System.err.println(re);
55 } finally {
56 SHOW = false;
57 SERVER.put("#"); // Final frame
58 }
59 break;
60 }
61 }
62 }
63
64 @Override public void close() throws IOException {
65 SERVER.close();

Callers 2

mainMethod · 0.45
webtcp.min.jsFile · 0.45

Calls 5

showMethod · 0.95
putMethod · 0.45
getMethod · 0.45
parseMethod · 0.45
optoMethod · 0.45

Tested by

no test coverage detected