Пример #1
0
 protected void standardSteadyProcessing() {
   JStatement steadyBlock = joiner_code.getSteadyBlock();
   // helper has now been used for the last time, so we can write the basic code.
   // write code deemed useful by the helper into the corrrect ComputeCodeStore.
   // write only once if multiple calls for steady state.
   if (!basicCodeWritten.containsKey(inputNode)) {
     codeStore.addFields(joiner_code.getUsefulFields());
     codeStore.addMethods(joiner_code.getUsefulMethods());
     basicCodeWritten.put(inputNode, true);
   }
   codeStore.addSteadyLoopStatement(steadyBlock);
 }
Пример #2
0
 protected void standardPrimePumpProcessing() {
   JMethodDeclaration primePump = joiner_code.getPrimePumpMethod();
   if (primePump != null && !codeStore.hasMethod(primePump)) {
     // Add method -- but only once
     codeStore.addMethod(primePump);
   }
   if (primePump != null) {
     // for each time this method is called, it adds another call
     // to the primePump routine to the initialization.
     codeStore.addInitStatement(
         new JExpressionStatement(
             null,
             new JMethodCallExpression(
                 null, new JThisExpression(null), primePump.getName(), new JExpression[0]),
             null));
   }
 }
Пример #3
0
 protected void standardInitProcessing() {
   //      Have the main function for the CodeStore call our init if any
   codeStore.addInitFunctionCall(joiner_code.getInitMethod());
   JMethodDeclaration workAtInit = joiner_code.getInitStageMethod();
   if (workAtInit != null) {
     // if there are calls to work needed at init time then add
     // method to general pool of methods
     codeStore.addMethod(workAtInit);
     // and add call to list of calls made at init time.
     // Note: these calls must execute in the order of the
     // initialization schedule -- so caller of this routine
     // must follow order of init schedule.
     codeStore.addInitStatement(
         new JExpressionStatement(
             null,
             new JMethodCallExpression(
                 null, new JThisExpression(null), workAtInit.getName(), new JExpression[0]),
             null));
   }
 }