version 1.3, 1999/12/16 22:18:35
|
version 1.4, 2000/02/09 22:10:24
|
Line 14
|
Line 14
|
#include "capaCommon.h" |
#include "capaCommon.h" |
#include "ranlib.h" |
#include "ranlib.h" |
|
|
|
|
char Parse_class[QUARTER_K]; |
char Parse_class[QUARTER_K]; |
int Parse_set; |
int Parse_set; |
int Parse_section; |
int Parse_section; |
Line 38 int
|
Line 37 int
|
match_function(func, argc) char *func; int argc; |
match_function(func, argc) char *func; int argc; |
{ |
{ |
if( !strcmp(func,"random") ) return (((argc==2 || argc==3)? RANDOM_F : MIS_ARG_COUNT)); |
if( !strcmp(func,"random") ) return (((argc==2 || argc==3)? RANDOM_F : MIS_ARG_COUNT)); |
|
if( !strcmp(func,"random_normal") ) return (((argc==2 || argc==3)? RANDOM_NORMAL_F : MIS_ARG_COUNT)); |
|
if( !strcmp(func,"random_exponential") ) return (((argc==2 || argc==3)? RANDOM_EXPONENTIAL_F : MIS_ARG_COUNT)); |
|
if( !strcmp(func,"random_beta") ) return (((argc==2 || argc==3)? RANDOM_BETA_F : MIS_ARG_COUNT)); |
if( !strcmp(func,"choose") ) return (CHOOSE_F); |
if( !strcmp(func,"choose") ) return (CHOOSE_F); |
if( !strcmp(func,"tex") ) return (((argc==2)? TEX_F: MIS_ARG_COUNT)); |
if( !strcmp(func,"tex") ) return (((argc==2)? TEX_F: MIS_ARG_COUNT)); |
if( !strcmp(func,"var_in_tex") ) return (VAR_IN_TEX_F); |
if( !strcmp(func,"var_in_tex") ) return (VAR_IN_TEX_F); |
Line 60 match_function(func, argc) char *func; i
|
Line 62 match_function(func, argc) char *func; i
|
if( !strcmp(func,"strlen") ) return (((argc==1)? STRLEN_F: MIS_ARG_COUNT)); |
if( !strcmp(func,"strlen") ) return (((argc==1)? STRLEN_F: MIS_ARG_COUNT)); |
if( !strcmp(func,"get_seed") ) return (((argc==0)? GET_SEED_F: MIS_ARG_COUNT)); |
if( !strcmp(func,"get_seed") ) return (((argc==0)? GET_SEED_F: MIS_ARG_COUNT)); |
if( !strcmp(func,"set_seed") ) return (((argc==1)? SET_SEED_F: MIS_ARG_COUNT)); |
if( !strcmp(func,"set_seed") ) return (((argc==1)? SET_SEED_F: MIS_ARG_COUNT)); |
|
if( !strcmp(func,"init_array") ) return (((argc==1)? INIT_ARRAY_F: MIS_ARG_COUNT)); |
if( !strcmp(func,"array_index") ) return (((argc==1)? ARRAY_INDEX_F: MIS_ARG_COUNT)); |
if( !strcmp(func,"array_index") ) return (((argc==1)? ARRAY_INDEX_F: MIS_ARG_COUNT)); |
if( !strcmp(func,"array_sorted_index") ) return (((argc==2)? ARRAY_SORTED_INDEX_F: MIS_ARG_COUNT)); |
if( !strcmp(func,"array_sorted_index") ) return (((argc==2)? ARRAY_SORTED_INDEX_F: MIS_ARG_COUNT)); |
if( !strcmp(func,"array_max") ) return (((argc==1)? ARRAY_MAX_F: MIS_ARG_COUNT)); |
if( !strcmp(func,"array_max") ) return (((argc==1)? ARRAY_MAX_F: MIS_ARG_COUNT)); |
Line 819 ArgNode_t *argp;
|
Line 822 ArgNode_t *argp;
|
resultp->s_str = strsave("NOT YET"); |
resultp->s_str = strsave("NOT YET"); |
} break; |
} break; |
|
|
|
case INIT_ARRAY_F: |
|
{ int rr; |
|
|
|
switch( FIRST_ARGTYPE(argp) ) { |
|
case I_VAR: case I_CONSTANT: |
|
case R_VAR: case R_CONSTANT: |
|
resultp->s_type = S_CONSTANT; |
|
resultp->s_str = strsave("<<ARG. OF THIS FUNCTION MUST BE AN ARRAY NAME>>"); |
|
sprintf(tmpS,"init_array()'s arg. must be a name of an array.\n"); |
|
capa_msg(MESSAGE_ERROR,tmpS); |
|
break; |
|
case S_VAR: case S_CONSTANT: /* allows the use of init_array(array[1]) which array[1]="another" */ |
|
rr = free_array(FIRST_ARGSTR(argp)); |
|
resultp->s_type = I_CONSTANT; |
|
resultp->s_int = rr; |
|
break; |
|
case IDENTIFIER: |
|
rr = free_array(FIRST_ARGNAME(argp)); |
|
resultp->s_type = I_CONSTANT; |
|
resultp->s_int = rr; |
|
break; |
|
} |
|
} break; |
case ARRAY_MAX_F: |
case ARRAY_MAX_F: |
case ARRAY_MIN_F: |
case ARRAY_MIN_F: |
{ int min; |
{ int min; |