Diff for /capa/capa51/pProj/capaParser.h between versions 1.1.1.1 and 1.13

version 1.1.1.1, 1999/09/28 21:26:21 version 1.13, 2005/02/15 22:15:05
Line 1 Line 1
   /* definitions of all parser constants/structs
      Copyright (C) 1992-2000 Michigan State University
   
      The CAPA system is free software; you can redistribute it and/or
      modify it under the terms of the GNU General Public License as
      published by the Free Software Foundation; either version 2 of the
      License, or (at your option) any later version.
   
      The CAPA system is distributed in the hope that it will be useful,
      but WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      General Public License for more details.
   
      You should have received a copy of the GNU General Public
      License along with the CAPA system; see the file COPYING.  If not,
      write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
      Boston, MA 02111-1307, USA.
   
      As a special exception, you have permission to link this program
      with the TtH/TtM library and distribute executables, as long as you
      follow the requirements of the GNU GPL in regard to all of the
      software in the executable aside from TtH/TtM.
   */
   
 /* <==================================================================> */  /* <==================================================================> */
 /*  by Isaac Tsai @ 1994                                                */  /*  by Isaac Tsai @ 1994                                                */
   
Line 35 Line 59
   
 /* Some useful numbers */  /* Some useful numbers */
   
 #define  EIGHT                8  /*#define  EIGHT                8*/
 #define  SIXTEEN             16  /*#define  SIXTEEN             16*/
 /*#define  THIRTY_TWO          32*/  /*#define  THIRTY_TWO          32*/
 /*#define  SIXTY_FOUR          64*/  /*#define  SIXTY_FOUR          64*/
 #define  ONE_TWO_EIGHT      128  #define  ONE_TWO_EIGHT      128
Line 81  typedef struct _symbol { Line 105  typedef struct _symbol {
   struct _argNode   *s_argp;    struct _argNode   *s_argp;
   struct _treeNode  *s_treep;    struct _treeNode  *s_treep;
   struct _symbol    *s_nextp;    struct _symbol    *s_nextp;
     struct _symbol    *s_prevp;
   struct _symbol    *s_arrayp;    struct _symbol    *s_arrayp;
   struct _pts_list  *s_ptslist;    struct _pts_list  *s_ptslist;
   int                s_access_cnt;    int                s_access_cnt;
Line 109  typedef struct _argNode { Line 134  typedef struct _argNode {
     struct _argNode *a_prev;      struct _argNode *a_prev;
  } ArgNode_t;   } ArgNode_t;
     
 #define   FIRST_SYMBOLP(aaa)     (aaa->a_sp)  #define   FIRST_SYMBOLP(aaa)      (aaa->a_sp)
 #define   SECOND_SYMBOLP(aaa)   ( (aaa->a_next)->a_sp )  #define   SECOND_SYMBOLP(aaa)   ( (aaa->a_next)->a_sp )
 #define   THIRD_SYMBOLP(aaa)    ( ((aaa->a_next)->a_next)->a_sp )  #define   THIRD_SYMBOLP(aaa)    ( ((aaa->a_next)->a_next)->a_sp )
   #define   FOURTH_SYMBOLP(aaa)   ( (((aaa->a_next)->a_next)->a_next)->a_sp )
   #define   FIFTH_SYMBOLP(aaa)    ( ((((aaa->a_next)->a_next)->a_next)->a_next)->a_sp )
   #define   SIXTH_SYMBOLP(aaa)    ( (((((aaa->a_next)->a_next)->a_next)->a_next)->a_next)->a_sp )
 #define   FIRST_ARGNAME(aaa)    ( FIRST_SYMBOLP(aaa)->s_name )  #define   FIRST_ARGNAME(aaa)    ( FIRST_SYMBOLP(aaa)->s_name )
 #define   FIRST_ARGTYPE(aaa)    ( FIRST_SYMBOLP(aaa)->s_type )  #define   FIRST_ARGTYPE(aaa)    ( FIRST_SYMBOLP(aaa)->s_type )
 #define   FIRST_ARGINT(aaa)     ( FIRST_SYMBOLP(aaa)->s_int )  #define   FIRST_ARGINT(aaa)     ( FIRST_SYMBOLP(aaa)->s_int )
Line 122  typedef struct _argNode { Line 150  typedef struct _argNode {
 #define   SECOND_ARGINT(aaa)    ( SECOND_SYMBOLP(aaa)->s_int)  #define   SECOND_ARGINT(aaa)    ( SECOND_SYMBOLP(aaa)->s_int)
 #define   SECOND_ARGREAL(aaa)   ( SECOND_SYMBOLP(aaa)->s_real)  #define   SECOND_ARGREAL(aaa)   ( SECOND_SYMBOLP(aaa)->s_real)
 #define   SECOND_ARGSTR(aaa)    ( SECOND_SYMBOLP(aaa)->s_str)  #define   SECOND_ARGSTR(aaa)    ( SECOND_SYMBOLP(aaa)->s_str)
   #define   THIRD_ARGNAME(aaa)    ( THIRD_SYMBOLP(aaa)->s_name )
 #define   THIRD_ARGTYPE(aaa)    ( THIRD_SYMBOLP(aaa)->s_type)  #define   THIRD_ARGTYPE(aaa)    ( THIRD_SYMBOLP(aaa)->s_type)
 #define   THIRD_ARGINT(aaa)     ( THIRD_SYMBOLP(aaa)->s_int)  #define   THIRD_ARGINT(aaa)     ( THIRD_SYMBOLP(aaa)->s_int)
 #define   THIRD_ARGREAL(aaa)    ( THIRD_SYMBOLP(aaa)->s_real)  #define   THIRD_ARGREAL(aaa)    ( THIRD_SYMBOLP(aaa)->s_real)
 #define   THIRD_ARGSTR(aaa)     ( THIRD_SYMBOLP(aaa)->s_str)  #define   THIRD_ARGSTR(aaa)     ( THIRD_SYMBOLP(aaa)->s_str)
   #define   FOURTH_ARGTYPE(aaa)   ( FOURTH_SYMBOLP(aaa)->s_type)
   #define   FOURTH_ARGNAME(aaa)   ( FOURTH_SYMBOLP(aaa)->s_name )
   #define   FOURTH_ARGINT(aaa)    ( FOURTH_SYMBOLP(aaa)->s_int)
   #define   FOURTH_ARGREAL(aaa)   ( FOURTH_SYMBOLP(aaa)->s_real)
   #define   FOURTH_ARGSTR(aaa)    ( FOURTH_SYMBOLP(aaa)->s_str)
   #define   FIFTH_ARGTYPE(aaa)    ( FIFTH_SYMBOLP(aaa)->s_type)
   #define   FIFTH_ARGNAME(aaa)    ( FIFTH_SYMBOLP(aaa)->s_name )
   #define   FIFTH_ARGINT(aaa)     ( FIFTH_SYMBOLP(aaa)->s_int)
   #define   FIFTH_ARGREAL(aaa)    ( FIFTH_SYMBOLP(aaa)->s_real)
   #define   FIFTH_ARGSTR(aaa)     ( FIFTH_SYMBOLP(aaa)->s_str)
   #define   SIXTH_ARGTYPE(aaa)    ( SIXTH_SYMBOLP(aaa)->s_type)
   #define   SIXTH_ARGNAME(aaa)    ( SIXTH_SYMBOLP(aaa)->s_name )
   #define   SIXTH_ARGINT(aaa)     ( SIXTH_SYMBOLP(aaa)->s_int)
   #define   SIXTH_ARGREAL(aaa)    ( SIXTH_SYMBOLP(aaa)->s_real)
   #define   SIXTH_ARGSTR(aaa)     ( SIXTH_SYMBOLP(aaa)->s_str)
   
   
   
Line 253  typedef struct _problem { Line 296  typedef struct _problem {
    int                 show_explain;     int                 show_explain;
    int                 show_br;      /* web only, <BR> on is by default */     int                 show_br;      /* web only, <BR> on is by default */
    int                 show_ans_box; /* web only, answer box is shown by default */     int                 show_ans_box; /* web only, answer box is shown by default */
      int                 verbatim; /* do verbatim protection around answers */
    int                 ans_op;   /* ANS_AND or ANS_OR */     int                 ans_op;   /* ANS_AND or ANS_OR */
    char               *id_list;     char               *id_list;
    struct   _pts_list *pts_list;     struct   _pts_list *pts_list;
Line 340  typedef struct _answer_info { Line 384  typedef struct _answer_info {
 #define    DO_SHOW              1  #define    DO_SHOW              1
 #define    DONOT_SHOW           0  #define    DONOT_SHOW           0
   
   #define    DO_VERBATIM          1
   #define    DONOT_VERBATIM       0
   
 #define    SHOW_BR_DEFAULT      DO_SHOW  #define    SHOW_BR_DEFAULT      DO_SHOW
   #define    VERBATIM_DEFAULT     DO_VERBATIM
 #define    SHOW_ANSBOX_DEFAULT  DO_SHOW  #define    SHOW_ANSBOX_DEFAULT  DO_SHOW
   
 #define    SIG_LB_DEFAULT       0        /* ---- sig_lbound ------- */  #define    SIG_LB_DEFAULT       0        /* ---- sig_lbound ------- */
Line 379  typedef struct _answer_info { Line 427  typedef struct _answer_info {
 #define    ANS_CNT_NOT_MATCH   9  #define    ANS_CNT_NOT_MATCH   9
 #define    SUB_RECORDED        10  #define    SUB_RECORDED        10
 #define    BAD_FORMULA         11  #define    BAD_FORMULA         11
   #define    WANTED_NUMERIC      12
   #define    UNIT_INVALID_INSTRUCTOR  13
   #define    UNIT_INVALID_STUDENT1    141
   #define    UNIT_INVALID_STUDENT2    142
   #define    UNIT_INVALID_STUDENT3    143
   #define    UNIT_IRRECONCIBLE        15
   
 /* =============================================================== */  /* =============================================================== */
   
Line 407  typedef struct _answer_info { Line 459  typedef struct _answer_info {
   
 /* ================================================================ */  /* ================================================================ */
 /********************** for random(), /MAP(), capa_PIN() */  /********************** for random(), /MAP(), capa_PIN() */
   /* BETA_DIS is used for genbet() */
   /* CHI_DIS  is for genchi() */
   /* EXPONENTIAL_DIS    genexp() */
   /* GAMMA_DIS    gengam() */
   /* MULTI_NORM_DIS    genmn() */
   /* NONCEN_CHI_DIS    gennch() */
   /* NORMAL_DIS        gennor() */
   /* POISSON_DIS       long ignpoi(float mu) */
   
   #define    RANDOM_G            1L
   #define    PERMUTATION_G       2L
   #define    PIN_G               3L
   
   #define    NORMAL_DIS          10 
   #define    POISSON_DIS         11
   #define    EXPONENTIAL_DIS     12 
   #define    BETA_DIS            13
   #define    GAMMA_DIS           14
   #define    CHI_DIS             15
   #define    NONCENTRAL_CHI_DIS  16
   #define    FORMULA_PICK_POINTS 17
   #define    MULTIVARIATE_NORMAL_DIS  18
   
 #define    RANDOM_G          1L  #define    GET_GENERATOR        0L
 #define    PERMUTATION_G     2L  #define    SET_GENERATOR        1L
 #define    PIN_G             3L  
   
 #define    GET_GENERATOR     0L  
 #define    SET_GENERATOR     1L  
   
 #define    FORWARD_MAP        0  #define    FORWARD_MAP           0
 #define    REVERSE_MAP        1  #define    REVERSE_MAP           1
   
   
   
Line 483  void        start_question_over CAPA_ARG Line 553  void        start_question_over CAPA_ARG
 Symbol*     get_array_symbol    CAPA_ARG((Symbol* name,Symbol* index,int free_symbols));  Symbol*     get_array_symbol    CAPA_ARG((Symbol* name,Symbol* index,int free_symbols));
 Symbol*     build_array_list    CAPA_ARG((Symbol* ar_name,int num_elem));   Symbol*     build_array_list    CAPA_ARG((Symbol* ar_name,int num_elem)); 
 /*---------------------------------------------------- capaParserUtils.c */   /*---------------------------------------------------- capaParserUtils.c */ 
   Symbol*     negate              CAPA_ARG((Symbol* symb));
 void        problem_default     CAPA_ARG((Problem_t  *p));  void        problem_default     CAPA_ARG((Problem_t  *p));
 int         comp_name           CAPA_ARG((char *a,char *b));  int         comp_name           CAPA_ARG((char *a,char *b));
 int         comp_namesymbol     CAPA_ARG((char *a, Symbol *b));  int         comp_namesymbol     CAPA_ARG((char *a, Symbol *b));
Line 510  TreeNode_t *t_splay             CAPA_ARG Line 581  TreeNode_t *t_splay             CAPA_ARG
 void        print_array_element CAPA_ARG((Symbol *array_p));  void        print_array_element CAPA_ARG((Symbol *array_p));
 Symbol     *find_arrayid        CAPA_ARG((char *name_p));  Symbol     *find_arrayid        CAPA_ARG((char *name_p));
 Symbol     *find_array_by_index CAPA_ARG((Symbol *array_p,char *idx_p));  Symbol     *find_array_by_index CAPA_ARG((Symbol *array_p,char *idx_p));
   int         free_array          CAPA_ARG((char *name_p));
 Symbol     *array_min_max       CAPA_ARG((char *name_p,int min));  Symbol     *array_min_max       CAPA_ARG((char *name_p,int min));
 Symbol     *array_moments       CAPA_ARG((char *result_p,char *name_p));  Symbol     *array_moments       CAPA_ARG((char *result_p,char *name_p));
   Symbol     *gen_multivariate_normal  CAPA_ARG((char *output_p,char *seed,int
   item_cnt,int dimen,char *m_vec_str,char *c_vec_str));
   Symbol     *gen_random_by_selector  CAPA_ARG((char *output_p,int sel,char *seed,int item_cnt,float p1,float p2));
 int         setup_formula_id    CAPA_ARG((char *v_str, char *pt_str));  int         setup_formula_id    CAPA_ARG((char *v_str, char *pt_str));
 void        free_formula_tree   CAPA_ARG(());  void        free_formula_tree   CAPA_ARG(());
   
Line 555  int         inorder_utree       CAPA_ARG Line 628  int         inorder_utree       CAPA_ARG
 int         postorder_utree     CAPA_ARG((Unit_t *node_p));  int         postorder_utree     CAPA_ARG((Unit_t *node_p));
 int         postwalk_utree      CAPA_ARG((Unit_t *n_p));  int         postwalk_utree      CAPA_ARG((Unit_t *n_p));
 void        process_op          CAPA_ARG((int op));  void        process_op          CAPA_ARG((int op));
 void        process_utree       CAPA_ARG((Unit_t *t));  Unit_t*     process_utree       CAPA_ARG((Unit_t *t));
 int         check_correct_unit  CAPA_ARG((char *u_symb,Unit_t *t,double *scale));  int         check_correct_unit  CAPA_ARG((char *u_symb,Unit_t *t,double *scale));
 int         free_utree          CAPA_ARG((Unit_t *t));  int         free_utree          CAPA_ARG((Unit_t *t));
 int         u_postfree          CAPA_ARG((Unit_t *t));  int         u_postfree          CAPA_ARG((Unit_t *t));

Removed from v.1.1.1.1  
changed lines
  Added in v.1.13


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>