code: public BProgramSyncSnapshot setup() {
          if (started) {
              throw new IllegalStateException("Program already set up.");
          }
          Set<BThreadSyncSnapshot> bthreads = drainRecentlyRegisteredBthreads();
  
          if (eventSelectionStrategy == null) {
              eventSelectionStrategy = new SimpleEventSelectionStrategy();
          }
          FailedAssertion failedAssertion = null;
          try {
              Context cx = ContextFactory.getGlobal().enterContext();
              cx.setOptimizationLevel(-1); // must use interpreter mode
              initProgramScope(cx);
  
              // evaluate code in order
              if (prependedCode != null) {
                  prependedCode.forEach(s -> evaluate(s, "prependedCode"));
                  prependedCode = null;
              }
              setupProgramScope(programScope);
              if (appendedCode != null) {
                  appendedCode.forEach(s -> evaluate(s, "appendedCode"));
                  appendedCode = null;
              }
  
          } catch (FailedAssertionException fae) {
              failedAssertion = new FailedAssertion(fae.getMessage(), "---init_code");
  
          } finally {
              Context.exit();
          }
  
          started = true;
          return new BProgramSyncSnapshot(this, bthreads, Collections.emptyList(), failedAssertion);
      }
docs: Sets up the program scope and evaluates the program source.
  
  <em>This method can only be called once per instance.</em>
  
  @return a snapshot of the program, after source code was executed, and
  before any registered b-threads have run.
  @throws IllegalStateException for repeated calls.