/[ascend]/trunk/base/generic/compiler/instantiate.c
ViewVC logotype

Diff of /trunk/base/generic/compiler/instantiate.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 910 by johnpye, Thu Oct 26 13:35:25 2006 UTC revision 911 by johnpye, Thu Oct 26 13:44:58 2006 UTC
# Line 5384  int Pass2ExecuteBlackBoxEXTLoop(struct I Line 5384  int Pass2ExecuteBlackBoxEXTLoop(struct I
5384      return 1;      return 1;
5385    }    }
5386    
   CONSOLE_DEBUG("...");  
   
5387    n_input_args = NumberInputArgs(efunc);    n_input_args = NumberInputArgs(efunc);
5388    n_output_args = NumberOutputArgs(efunc);    n_output_args = NumberOutputArgs(efunc);
5389    if ((len =gl_length(arglist)) != (n_input_args + n_output_args)) {    if ((len =gl_length(arglist)) != (n_input_args + n_output_args)) {
# Line 5395  int Pass2ExecuteBlackBoxEXTLoop(struct I Line 5393  int Pass2ExecuteBlackBoxEXTLoop(struct I
5393      return 1;      return 1;
5394    }    }
5395    
   CONSOLE_DEBUG("...");  
   
5396    /* we should have a valid arglist at this stage */    /* we should have a valid arglist at this stage */
5397    if (CheckExtCallArgTypes(arglist)) {    if (CheckExtCallArgTypes(arglist)) {
5398      instantiation_error(ASC_USER_ERROR,statement,"Wrong type of args to external statement");      instantiation_error(ASC_USER_ERROR,statement,"Wrong type of args to external statement");
# Line 5408  int Pass2ExecuteBlackBoxEXTLoop(struct I Line 5404  int Pass2ExecuteBlackBoxEXTLoop(struct I
5404    inputs = LinearizeArgList(arglist,start,end);    inputs = LinearizeArgList(arglist,start,end);
5405    n_inputs_actual = gl_length(inputs);    n_inputs_actual = gl_length(inputs);
5406    
   CONSOLE_DEBUG("...");  
   
5407    /* Now process the outputs */    /* Now process the outputs */
5408    start = n_input_args+1;    start = n_input_args+1;
5409    end = n_input_args + n_output_args;    end = n_input_args + n_output_args;
5410    outputs = LinearizeArgList(arglist,start,end);    outputs = LinearizeArgList(arglist,start,end);
5411    n_outputs_actual = gl_length(outputs);    n_outputs_actual = gl_length(outputs);
5412    
5413    CONSOLE_DEBUG("...");    /* Now create the relations, all with the same common. */
   
   /* Now create the relations, all with the same  
    * common.  
    */  
5414    common = CreateBlackBoxCache(n_inputs_actual,n_outputs_actual, arglist);    common = CreateBlackBoxCache(n_inputs_actual,n_outputs_actual, arglist);
5415    common->interp.task = bb_first_call;    common->interp.task = bb_first_call;
5416    context = WriteInstanceNameString(inst, NULL);    context = WriteInstanceNameString(inst, NULL);
 /* ------------ */ /* ------------ */  
   
   CONSOLE_DEBUG("...");  
5417    
5418    /* now set up the for loop index --------------------------------*/    /* now set up the for loop index --------------------------------*/
5419    name = AddSymbolL(BBOX_RESERVED_INDEX, BBOX_RESERVED_INDEX_LEN);    name = AddSymbolL(BBOX_RESERVED_INDEX, BBOX_RESERVED_INDEX_LEN);
5420    /* using a reserved character not legal in user level modeling. */    /* using a reserved character not legal in user level modeling. */
5421    assert(FindForVar(GetEvaluationForTable(),name) == NULL);    assert(FindForVar(GetEvaluationForTable(),name) == NULL);
5422    /* cannot happen as bbox definitions don't nest as statements and    /* cannot happen as bbox definitions don't nest as statements and
5423      user identifiers cannot contain ?.          user identifiers cannot contain ?. */
  */  
   
   CONSOLE_DEBUG("...");  
5424    
5425    assert(GetEvaluationContext()==NULL);    assert(GetEvaluationContext()==NULL);
5426    SetEvaluationContext(inst);    SetEvaluationContext(inst);
# Line 5484  int Pass2ExecuteBlackBoxEXTLoop(struct I Line 5468  int Pass2ExecuteBlackBoxEXTLoop(struct I
5468      break;      break;
5469    }    }
5470    
   CONSOLE_DEBUG("...");  
   
5471  /* ------------ */ /* ------------ */  /* ------------ */ /* ------------ */
5472    /* and now for cleaning up shared data. */    /* and now for cleaning up shared data. */
5473    init = GetInitFunc(efunc);    init = GetInitFunc(efunc);
# Line 5500  int Pass2ExecuteBlackBoxEXTLoop(struct I Line 5482  int Pass2ExecuteBlackBoxEXTLoop(struct I
5482    DestroySpecialList(arglist);    DestroySpecialList(arglist);
5483  /* ------------ */ /* ------------ */  /* ------------ */ /* ------------ */
5484    
   CONSOLE_DEBUG("...");  
   
5485    /*  currently designed to always succeed or fail permanently.    /*  currently designed to always succeed or fail permanently.
5486     *  We reached this point meaning we've processed everything.     *  We reached this point meaning we've processed everything.
5487     *  Therefore the statment returns 1 and becomes no longer pending.     *  Therefore the statment returns 1 and becomes no longer pending.
# Line 5518  int ExecuteBBOXElement(struct Instance * Line 5498  int ExecuteBBOXElement(struct Instance *
5498    struct relation *reln  = NULL;    struct relation *reln  = NULL;
5499    enum Expr_enum reltype;    enum Expr_enum reltype;
5500    
5501    CONSOLE_DEBUG("ENTERED ExecuteBBOXElement\n");    /* CONSOLE_DEBUG("ENTERED ExecuteBBOXElement\n"); */
5502    
5503    /* make or find the instance */    /* make or find the instance */
5504    name = ExternalStatNameRelation(statement);    name = ExternalStatNameRelation(statement);

Legend:
Removed from v.910  
changed lines
  Added in v.911

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22