Annotation of capa/capa51/pProj/capaParser.h, revision 1.1
1.1 ! albertel 1: /* <==================================================================> */
! 2: /* by Isaac Tsai @ 1994 */
! 3:
! 4: #ifndef _CAPA_PARSER_H_
! 5: #define _CAPA_PARSER_H_
! 6:
! 7: #include <stdio.h> /* for FILE * */
! 8: #ifdef DMALLOC
! 9: #include <dmalloc.h>
! 10: #endif
! 11: #ifdef __STDC__ /* sun ansi cc compiler use this flag */
! 12: #define CAPA_ARG(x) x
! 13: #else
! 14: #define CAPA_ARG(x) ()
! 15: #endif
! 16:
! 17: #define CAPA_ERROR(xx) { }
! 18: #define CAPA_WARNING(xx) { }
! 19: #define MESSAGE_WARN 1
! 20: #define MESSAGE_ERROR 2
! 21:
! 22:
! 23: #ifdef SYMBOL_DBUG
! 24: #define SSDBUG_PR1(xx) { printf(xx); fflush(stdout); }
! 25: #define SSDBUG_PR2(xx,yy) { printf(xx,yy); fflush(stdout); }
! 26: #define SSDBUG_PR3(xx,yy,zz) { printf(xx,yy,zz); fflush(stdout); }
! 27: #else
! 28: #define SSDBUG_PR1(xx) { }
! 29: #define SSDBUG_PR2(xx,yy) { }
! 30: #define SSDBUG_PR3(xx,yy,zz) { }
! 31:
! 32: #endif
! 33:
! 34:
! 35:
! 36: /* Some useful numbers */
! 37:
! 38: #define EIGHT 8
! 39: #define SIXTEEN 16
! 40: /*#define THIRTY_TWO 32*/
! 41: /*#define SIXTY_FOUR 64*/
! 42: #define ONE_TWO_EIGHT 128
! 43: #define QUARTER_K 256
! 44: #define HALF_K 512
! 45: #define ONE_K 1024
! 46: #define TWO_K 2048
! 47: #define FOUR_K 4096
! 48:
! 49:
! 50:
! 51: #define ANSWER_STRING_LENG 81
! 52: #define MAX_OPENED_FILE 4096 /* maximum number of files opened */
! 53: #define MAX_SYMB_COUNT 4096 /* symbol table size */
! 54: #define MAX_FUNC_NAME 256 /* function name length */
! 55: #define MAX_FUNC_NEST 1024 /* sin(cos(tan(...))) */
! 56: /*#define MAX_QTEXT_LEN 4096 overall question text in a set *NO LONGER NEEDED */
! 57: #define WARN_MSG_LENGTH 1024 /* for warning messages */
! 58:
! 59:
! 60: #define ASCII_MODE 1
! 61: #define TeX_MODE 2
! 62: #define HTML_MODE 3
! 63: #define BUBBLE_MODE 4
! 64:
! 65: #define ANSWER_STRING_MODE 5 /* used in answers_string() */
! 66:
! 67:
! 68: /* parameters used in array_sorted_index() */
! 69:
! 70: #define ASCEND_SORT 1
! 71: #define DESCEND_SORT 2
! 72: #define NUMERICAL_SORT 3
! 73:
! 74:
! 75:
! 76: typedef struct _symbol {
! 77: char *s_name; /* IDENTIFIER or FUNCTION_ID or ARRAY_ID name */
! 78: int s_type;
! 79: int s_array_cnt;
! 80: int s_argc;
! 81: struct _argNode *s_argp;
! 82: struct _treeNode *s_treep;
! 83: struct _symbol *s_nextp;
! 84: struct _symbol *s_arrayp;
! 85: struct _pts_list *s_ptslist;
! 86: int s_access_cnt;
! 87: int s_distype;
! 88: char *s_format;
! 89: union { char *s_sval;
! 90: long s_ival;
! 91: double s_rval;
! 92: } s_val;
! 93: } Symbol;
! 94:
! 95: typedef Symbol *Symbol_p;
! 96:
! 97: #define s_int s_val.s_ival
! 98: #define s_real s_val.s_rval
! 99: #define s_str s_val.s_sval
! 100:
! 101: #define E_FORMAT 1
! 102: #define F_FORMAT 3
! 103: #define DEFAULT_FORMAT 9
! 104:
! 105: typedef struct _argNode {
! 106: Symbol *a_sp;
! 107: int a_idx;
! 108: struct _argNode *a_next;
! 109: struct _argNode *a_prev;
! 110: } ArgNode_t;
! 111:
! 112: #define FIRST_SYMBOLP(aaa) (aaa->a_sp)
! 113: #define SECOND_SYMBOLP(aaa) ( (aaa->a_next)->a_sp )
! 114: #define THIRD_SYMBOLP(aaa) ( ((aaa->a_next)->a_next)->a_sp )
! 115: #define FIRST_ARGNAME(aaa) ( FIRST_SYMBOLP(aaa)->s_name )
! 116: #define FIRST_ARGTYPE(aaa) ( FIRST_SYMBOLP(aaa)->s_type )
! 117: #define FIRST_ARGINT(aaa) ( FIRST_SYMBOLP(aaa)->s_int )
! 118: #define FIRST_ARGREAL(aaa) ( FIRST_SYMBOLP(aaa)->s_real )
! 119: #define FIRST_ARGSTR(aaa) ( FIRST_SYMBOLP(aaa)->s_str )
! 120: #define SECOND_ARGNAME(aaa) ( SECOND_SYMBOLP(aaa)->s_name )
! 121: #define SECOND_ARGTYPE(aaa) ( SECOND_SYMBOLP(aaa)->s_type)
! 122: #define SECOND_ARGINT(aaa) ( SECOND_SYMBOLP(aaa)->s_int)
! 123: #define SECOND_ARGREAL(aaa) ( SECOND_SYMBOLP(aaa)->s_real)
! 124: #define SECOND_ARGSTR(aaa) ( SECOND_SYMBOLP(aaa)->s_str)
! 125: #define THIRD_ARGTYPE(aaa) ( THIRD_SYMBOLP(aaa)->s_type)
! 126: #define THIRD_ARGINT(aaa) ( THIRD_SYMBOLP(aaa)->s_int)
! 127: #define THIRD_ARGREAL(aaa) ( THIRD_SYMBOLP(aaa)->s_real)
! 128: #define THIRD_ARGSTR(aaa) ( THIRD_SYMBOLP(aaa)->s_str)
! 129:
! 130:
! 131:
! 132:
! 133:
! 134: typedef struct _treeNode {
! 135: Symbol *t_sp;
! 136: int t_idx;
! 137: struct _treeNode *t_left;
! 138: struct _treeNode *t_right;
! 139: } TreeNode_t;
! 140:
! 141: typedef struct _expNode {
! 142: int e_type;
! 143: struct _expNode *e_parentp;
! 144: struct _expNode *e_lsibp;
! 145: struct _expNode *e_rsibp;
! 146: Symbol *e_sp;
! 147: } ExpNode;
! 148:
! 149: typedef ExpNode *ExpNode_p;
! 150:
! 151: /* ================================================================ */
! 152: /* While loop data structure */
! 153:
! 154: typedef struct _WhileLoop {
! 155: int input_idx; /* stores Input_idx */
! 156: int line_idx; /* stores Current_line[Input_idx] */
! 157: long int pos_idx; /* stores next line position in the input stream */
! 158: } WhileLoop_t;
! 159:
! 160:
! 161: /* ================================================================ */
! 162: /* Warning message data structure */
! 163:
! 164: typedef struct _WarnMsg {
! 165: int warn_type;
! 166: char *warn_str;
! 167: struct _WarnMsg *warn_next;
! 168: } WarnMsg_t;
! 169:
! 170:
! 171:
! 172:
! 173:
! 174:
! 175: /* ================================================================ */
! 176:
! 177: #define SYMBOL_MAXLEN 16 /* unit symbol name length */
! 178: #define NAME_MAXLEN 48 /* unit name length */
! 179: #define BASEUNIT_LIMIT 32 /* maximum number of base units */
! 180: #define ONE_K_SIZE 1024
! 181:
! 182: /* ================================================================ */
! 183:
! 184: typedef struct _unit_elem {
! 185: struct _unit_elem *ue_nextp;
! 186: char ue_symbol[SYMBOL_MAXLEN];
! 187: int ue_index; /* -1 means this is composite */
! 188: #define UE_COMPOSITE -1
! 189: double ue_scale;
! 190: double ue_exp;
! 191: } Unit_E;
! 192:
! 193: typedef struct _unit_t {
! 194: char u_symbol[SYMBOL_MAXLEN];
! 195: char u_name[NAME_MAXLEN];
! 196: char *u_comment;
! 197: int u_index;
! 198: struct _unit_t *u_left;
! 199: struct _unit_t *u_right;
! 200: int u_type;
! 201: #define U_BASE 1
! 202: #define U_DERIVED 2
! 203: #define U_PREFIX 3
! 204: #define U_CONSTANT 4
! 205: #define U_OP_POWER 5
! 206: #define U_OP_TIMES 6
! 207: #define U_OP_PLUS 7
! 208: #define U_OP_MINUS 8
! 209: #define U_OP_DIVIDE 9
! 210: #define U_UNKNOWN 10
! 211: #define U_DEFAULT 11
! 212: double u_scale;
! 213: double u_offset;
! 214: int u_count;
! 215: Unit_E *u_list;
! 216: } Unit_t;
! 217:
! 218: #define U_LEFT(x) ((x)->u_left)
! 219: #define U_RIGHT(x) ((x)->u_right)
! 220: #define U_SYMB(x) ((x)->u_symbol)
! 221: #define U_NAME(x) ((x)->u_name)
! 222: #define U_COUNT(x) ((x)->u_count)
! 223: #define U_TYPE(x) ((x)->u_type)
! 224: #define U_SCALE(x) ((x)->u_scale)
! 225:
! 226: /* ==================================================================== */
! 227: /* Answer tolerance sig string */
! 228: /* int abs/rel */
! 229: /* real abs/rel [l,u] */
! 230: /* string cs/ci */
! 231: /* mc */
! 232:
! 233: typedef struct _problem {
! 234: char *question; /* Question text */
! 235: char *answer; /* Answer string */
! 236: char *hint; /* Hint text */
! 237: char *explain; /* Explain text */
! 238: char *capaidplus; /* Quizzes extra unique identifier
! 239: Only set in the first problem */
! 240: int ans_cnt;
! 241: int weight;
! 242: int tol_type;
! 243: double tolerance;
! 244: int ans_type; /* Type of answer expecting */
! 245: int sig_ubound;
! 246: int sig_lbound;
! 247: int partial_cdt;
! 248:
! 249: int calc; /* calculate correct answers based on
! 250: formated/unformated exact answer */
! 251: int tries; /* Number of tries allowed */
! 252: int show_hint;
! 253: int show_explain;
! 254: int show_br; /* web only, <BR> on is by default */
! 255: int show_ans_box; /* web only, answer box is shown by default */
! 256: int ans_op; /* ANS_AND or ANS_OR */
! 257: char *id_list;
! 258: struct _pts_list *pts_list;
! 259: char ans_fmt[ANSWER_STRING_LENG];
! 260: char unit_str[ANSWER_STRING_LENG];
! 261: Unit_t *ans_unit;
! 262: struct _answer_info *ans_list;
! 263: struct _answer_info *ans_list_last;
! 264: struct _problem *next; /* Pointer to next problem */
! 265: } Problem_t;
! 266:
! 267: #define P_TOLTYPE(p) ((p)->tol_type)
! 268:
! 269:
! 270: typedef struct _pts_list {
! 271: char *pts_str;
! 272: int pts_idx;
! 273: struct _pts_list *pts_next;
! 274: } PointsList_t;
! 275:
! 276:
! 277:
! 278: /* Answer related data structure */
! 279: /*
! 280: char *ans_str
! 281: int ans_type
! 282: int ans_calc
! 283: int ans_tol_type
! 284: double ans_tol
! 285: int ans_sig_ub
! 286: int ans_sig_lb
! 287: char *ans_id_list;
! 288: struct _pts_list *ans_pts_list;
! 289: char ans_fmt
! 290: char ans_unit_str
! 291:
! 292: */
! 293: /*
! 294: some information in the answer specification should be
! 295: problem-wise, such as problem weight, problem tries
! 296:
! 297: */
! 298:
! 299: typedef struct _answer_info {
! 300: char *ans_str; /* correct answer in string form */
! 301: int ans_type; /* answer type */
! 302: int ans_calc;
! 303: int ans_tol_type; /* answer tolerence type */
! 304: double ans_tol; /* the tolerence itself */
! 305: int ans_sig_ub;
! 306: int ans_sig_lb;
! 307: char *ans_id_list;
! 308: struct _pts_list *ans_pts_list;
! 309: char ans_fmt[ANSWER_STRING_LENG];
! 310: char ans_unit_str[ANSWER_STRING_LENG];
! 311: Unit_t *ans_unit;
! 312: struct _answer_info *ans_next;
! 313: } AnswerInfo_t;
! 314:
! 315:
! 316:
! 317: /******************************************************************************/
! 318: /* STRUCTURE FOR A PROBLEM */
! 319: /******************************************************************************/
! 320:
! 321: #define SPEC_TOLERANCE 1
! 322: #define SPEC_SIG 2
! 323: #define SPEC_WEIGHT 4
! 324: #define SPEC_TYPE 8
! 325: #define SPEC_PCREDIT 16
! 326: #define SPEC_TRY 32
! 327: #define SPEC_UNIT 64
! 328:
! 329: /* ---------------------------- tol_type -------------------------- */
! 330: #define TOL_ABSOLUTE 1
! 331: #define TOL_PERCENTAGE 2
! 332:
! 333: /* ------------------------------------------ */
! 334: #define CALC_UNFORMATED 1
! 335: #define CALC_FORMATED 2
! 336:
! 337: #define CALC_DEFAULT CALC_UNFORMATED /* for answer calculation */
! 338:
! 339: /* ---------------------------------------- web option only */
! 340: #define DO_SHOW 1
! 341: #define DONOT_SHOW 0
! 342:
! 343: #define SHOW_BR_DEFAULT DO_SHOW
! 344: #define SHOW_ANSBOX_DEFAULT DO_SHOW
! 345:
! 346: #define SIG_LB_DEFAULT 0 /* ---- sig_lbound ------- */
! 347: #define SIG_UB_DEFAULT 15 /* ---- sig_ubound ------- */
! 348: #define PCREDIT_DEFAULT 0 /* ---- partial_cdt ------ */
! 349: #define TOL_DEFAULT (0.0) /* ---- tolerance ------- */
! 350: #define WEIGHT_DEFAULT 1 /* ---- weight ------- */
! 351: #define NO_LIMIT_TRY (0) /* ---- tries ------- */
! 352: #define MAX_TRIES 99 /* ---- tries ------------ */
! 353: #define SHOW_HINT_DEFAULT 1 /* show hints immediately */
! 354:
! 355: /* --------------------------- ans_type -------------------------- */
! 356: #define ANSWER_IS_INTEGER 1
! 357: #define ANSWER_IS_FLOAT 2
! 358: #define ANSWER_IS_STRING_CI 3
! 359: #define ANSWER_IS_STRING_CS 4
! 360: #define ANSWER_IS_CHOICE 5
! 361: #define ANSWER_IS_ARITH 6
! 362: #define ANSWER_IS_SUBJECTIVE 7
! 363: #define ANSWER_IS_FORMULA 8
! 364: #define ANSWER_IS_EXTERNAL 9
! 365:
! 366: #define YAK 1
! 367: #define NAY 0
! 368:
! 369: /* -------- results given by capa_check_answer() and capa_check_answers() */
! 370:
! 371: #define EXACT_ANS 1
! 372: #define APPROX_ANS 2
! 373: #define SIG_FAIL 3
! 374: #define UNIT_FAIL 4
! 375: #define NO_UNIT 5
! 376: #define UNIT_OK 6
! 377: #define INCORRECT 7
! 378: #define UNIT_NOTNEEDED 8
! 379: #define ANS_CNT_NOT_MATCH 9
! 380: #define SUB_RECORDED 10
! 381: #define BAD_FORMULA 11
! 382:
! 383:
! 384:
! 385: /* =============================================================== */
! 386:
! 387: #define T_SPACE 9
! 388: #define T_PREFIX 8
! 389: #define T_NUMBER 7
! 390: #define T_BASIC_UNIT 6
! 391: #define T_DERIVED_UNIT 5
! 392: #define T_LP 4
! 393: #define T_RP 3
! 394: #define T_MULTIPLY 2
! 395: #define T_POWER 1
! 396: #define T_END 0
! 397:
! 398: /* for IFstatus[] */
! 399:
! 400: #define IF_FALSE 0
! 401: #define IF_TRUE 1
! 402: #define IF_DONT_CARE 2
! 403:
! 404: /* for IFcurrent[] */
! 405: #define RUN_IF_PORTION 1
! 406: #define RUN_ELSE_PORTION 2
! 407:
! 408: /* ================================================================ */
! 409: /********************** for random(), /MAP(), capa_PIN() */
! 410:
! 411: #define RANDOM_G 1L
! 412: #define PERMUTATION_G 2L
! 413: #define PIN_G 3L
! 414:
! 415: #define GET_GENERATOR 0L
! 416: #define SET_GENERATOR 1L
! 417:
! 418: #define FORWARD_MAP 0
! 419: #define REVERSE_MAP 1
! 420:
! 421:
! 422:
! 423: /* ---------------------------------------------- capaLexerDef.flex */
! 424: void begin_if_skip CAPA_ARG(());
! 425: void begin_while_skip CAPA_ARG(());
! 426: void begin_next_line CAPA_ARG(());
! 427: void begin_var CAPA_ARG(());
! 428: void begin_let CAPA_ARG(());
! 429: void begin_def CAPA_ARG(());
! 430: void begin_ans CAPA_ARG(());
! 431: void begin_map CAPA_ARG(());
! 432: void begin_ignore CAPA_ARG(());
! 433: void begin_text CAPA_ARG(());
! 434: void begin_question CAPA_ARG(());
! 435: void end_problemset CAPA_ARG(());
! 436: int match_keyword CAPA_ARG((char *key));
! 437: int match_functionid CAPA_ARG((char *key));
! 438: void init_funcstack CAPA_ARG(());
! 439:
! 440: #ifdef DMALLOC
! 441: #define strsave(s) strcpy(capa_malloc(strlen(s)+1,1),s)
! 442: #define capa_malloc(num,sz) memset(calloc(num,sz),'\0',num*sz)
! 443: #define capa_mfree(p) free(p);
! 444: #else
! 445: char *strsave CAPA_ARG((char *s));
! 446: char *capa_malloc CAPA_ARG((unsigned int num, unsigned int sz));
! 447: void capa_mfree CAPA_ARG((char *p));
! 448: #endif
! 449: void capa_msg CAPA_ARG((int type, char *p));
! 450: void capa_warn_header CAPA_ARG(());
! 451: void parse_filename CAPA_ARG((char *line));
! 452: void parse_import_id CAPA_ARG((char *line));
! 453: char *parse_endinput CAPA_ARG((char *line));
! 454: void append_dynamic_buf CAPA_ARG((char *new_str));
! 455: char* parser_status CAPA_ARG((void));
! 456: /*------------------------------------------------- capaGrammarDef.y */
! 457:
! 458: ExpNode_p mk_node CAPA_ARG((int op, ExpNode_p left, ExpNode_p right));
! 459: ExpNode_p mk_leaf CAPA_ARG((int type, Symbol_p valp));
! 460: void append_text CAPA_ARG((char *str));
! 461: void append_hint CAPA_ARG((char *str));
! 462: void append_explain CAPA_ARG((char *str));
! 463: void append_error CAPA_ARG((char *str));
! 464: void append_warn CAPA_ARG((int type, char *str));
! 465: Symbol *symbols_op CAPA_ARG((Symbol *a, Symbol *b, int op));
! 466: char *format_toTeX CAPA_ARG((char *real));
! 467: char *format_toHTML CAPA_ARG((char *real));
! 468: void init_answerinfo CAPA_ARG(());
! 469: void display_var CAPA_ARG((Symbol *s));
! 470: void assign_answer CAPA_ARG((Symbol *s));
! 471: void assign_tolerance CAPA_ARG((int tol_type, Symbol *s));
! 472: void assign_weight CAPA_ARG((Symbol *s));
! 473: void assign_try_limits CAPA_ARG((Symbol *s));
! 474: void assign_hint CAPA_ARG((Symbol *s));
! 475: void assign_units CAPA_ARG((Symbol *s));
! 476: void assign_sigs CAPA_ARG((int lb, int ub));
! 477: void assign_id_list CAPA_ARG((Symbol *s));
! 478: void init_new_prob CAPA_ARG(());
! 479: void add_answer_cnt CAPA_ARG((int op));
! 480: void finish_answer_info CAPA_ARG(());
! 481: void start_question_over CAPA_ARG(());
! 482:
! 483: Symbol* get_array_symbol CAPA_ARG((Symbol* name,Symbol* index,int free_symbols));
! 484: Symbol* build_array_list CAPA_ARG((Symbol* ar_name,int num_elem));
! 485: /*---------------------------------------------------- capaParserUtils.c */
! 486: void problem_default CAPA_ARG((Problem_t *p));
! 487: int comp_name CAPA_ARG((char *a,char *b));
! 488: int comp_namesymbol CAPA_ARG((char *a, Symbol *b));
! 489: int itis_empty CAPA_ARG((TreeNode_t *root_p));
! 490: void print_symb_stat CAPA_ARG(());
! 491: int preorder_tree CAPA_ARG((TreeNode_t *node_p));
! 492: int inorder_tree CAPA_ARG((TreeNode_t *node_p));
! 493: int postorder_tree CAPA_ARG((TreeNode_t *node_p));
! 494: int destroy_tree CAPA_ARG((TreeNode_t *node_p));
! 495: int free_symtree CAPA_ARG(());
! 496: char *btree_search CAPA_ARG((char *key,TreeNode_t **root_pp,int (*compar)()));
! 497: Symbol *find_identifier CAPA_ARG((register char *name));
! 498:
! 499: ArgNode_t *new_arglist CAPA_ARG((Symbol *sp));
! 500: ArgNode_t *addto_arglist CAPA_ARG((ArgNode_t *argp, Symbol *sp));
! 501: void walk_arglist CAPA_ARG((ArgNode_t *argp));
! 502: void free_arglist CAPA_ARG((ArgNode_t *argp));
! 503: int purge_tree CAPA_ARG((TreeNode_t **root_pp));
! 504: int calc_sig CAPA_ARG((char *a_num ));
! 505: int endian CAPA_ARG(());
! 506: TreeNode_t *new_treenode CAPA_ARG((char *name_p, int type));
! 507: TreeNode_t *new_formulanode CAPA_ARG((char *name_p, double val));
! 508:
! 509: TreeNode_t *t_splay CAPA_ARG((char *name, TreeNode_t *t));
! 510: void print_array_element CAPA_ARG((Symbol *array_p));
! 511: Symbol *find_arrayid CAPA_ARG((char *name_p));
! 512: Symbol *find_array_by_index CAPA_ARG((Symbol *array_p,char *idx_p));
! 513: Symbol *array_min_max CAPA_ARG((char *name_p,int min));
! 514: Symbol *array_moments CAPA_ARG((char *result_p,char *name_p));
! 515:
! 516:
! 517: int setup_formula_id CAPA_ARG((char *v_str, char *pt_str));
! 518: void free_formula_tree CAPA_ARG(());
! 519:
! 520: Symbol *find_formula_id CAPA_ARG((char *name_p));
! 521: int f_eval_formula CAPA_ARG((double *f_val,char *f_str,char *v_str, char *pt_str));
! 522:
! 523: int f_u_parse_formula CAPA_ARG((char *f_str));
! 524: int f_str_to_numbers CAPA_ARG((double **f_ar, char *n_str));
! 525: int f_str_to_ids CAPA_ARG((char ***v_ar, char *n_str));
! 526:
! 527: PointsList_t *f_gen_pts CAPA_ARG((char *ap, char *bp, int n));
! 528: PointsList_t *gen_ptslist_str CAPA_ARG((char *range_str ));
! 529: char *eval_formula_range_str CAPA_ARG((char *f_str,char *var_list,char *range_str));
! 530:
! 531: PointsList_t *gen_ptslist CAPA_ARG((Symbol *ap,Symbol *bp,Symbol *np));
! 532: PointsList_t *new_ptslist CAPA_ARG((Symbol *sp ));
! 533: void free_ptslist CAPA_ARG((PointsList_t *pts_p)) ;
! 534: /* ====================================== capaUnit.c */
! 535:
! 536: void c_ignorewhite CAPA_ARG((FILE *f));
! 537: double c_getdouble CAPA_ARG((FILE *f));
! 538: int c_getint CAPA_ARG((FILE *f));
! 539: int c_getsec_range CAPA_ARG((FILE *f,int *low,int *high));
! 540: char *c_getword CAPA_ARG((FILE *f));
! 541: char *c_getstring CAPA_ARG((FILE *f));
! 542: char *c_getcomment CAPA_ARG((FILE *f));
! 543: int c_gettype CAPA_ARG((FILE *f));
! 544:
! 545: Unit_t *u_find_symb CAPA_ARG((char *name, Unit_t *t, int *result));
! 546: void u_find_name CAPA_ARG((Unit_t *t));
! 547: void print_matches CAPA_ARG((Unit_t *t));
! 548: double u_squared_diff CAPA_ARG((Unit_t *a, Unit_t *b));
! 549: double u_sq_diff CAPA_ARG((Unit_t *b));
! 550:
! 551: void print_unit_tree CAPA_ARG(());
! 552: int alphaorder_utree CAPA_ARG((Unit_t *node_p));
! 553: int inorder_diff CAPA_ARG((Unit_t *node_p));
! 554: int inorder_utree CAPA_ARG((Unit_t *node_p));
! 555: int postorder_utree CAPA_ARG((Unit_t *node_p));
! 556: int postwalk_utree CAPA_ARG((Unit_t *n_p));
! 557: void process_op CAPA_ARG((int op));
! 558: void process_utree CAPA_ARG((Unit_t *t));
! 559: int check_correct_unit CAPA_ARG((char *u_symb,Unit_t *t,double *scale));
! 560: int free_utree CAPA_ARG((Unit_t *t));
! 561: int u_postfree CAPA_ARG((Unit_t *t));
! 562: void print_unit_t CAPA_ARG((Unit_t *t));
! 563: void u_copy_unit CAPA_ARG((Unit_t *a_p,Unit_t *b_p,double exp_scale));
! 564: int u_pm_op CAPA_ARG((Unit_t *a_p, Unit_t *b_p, int op));
! 565:
! 566: int u_parsepower CAPA_ARG((char *unit_str));
! 567: double s_scan_number CAPA_ARG((char *buf, int idx, int *r_idx));
! 568: double s_scan_symbol CAPA_ARG((char *buf,char *symb_p,int idx,int *r_idx));
! 569: int s_process_symb CAPA_ARG((char *symb_str, Unit_t *cu_p,double exp));
! 570: Unit_t *u_parse_unit CAPA_ARG((char *unit_str));
! 571: int comp_unit_symb CAPA_ARG((char *a,char *b));
! 572: Unit_t *u_splay CAPA_ARG((char *name, Unit_t *t));
! 573: int u_insert_baseunit CAPA_ARG((char *n_p,char *s_p,char *c_p));
! 574: int u_insert_derived CAPA_ARG((char *n_p,char *s_p,char *c_p,char *u_p));
! 575: void u_getunit CAPA_ARG((FILE *f));
! 576: void simplify_unit CAPA_ARG((Unit_t *u_p));
! 577: void freelist_unit_e CAPA_ARG((Unit_E *ue_p));
! 578: int is_units_equal CAPA_ARG((Unit_t *u1_p, Unit_t *u2_p));
! 579: double units_ratio CAPA_ARG((Unit_t *u1_p, Unit_t *u2_p));
! 580: Unit_t *p_new_op CAPA_ARG((Unit_t *left_p, int op, Unit_t *right_p));
! 581: Unit_t *p_new_num CAPA_ARG((Unit_t *left_p, double num, Unit_t *right_p));
! 582: Unit_t *p_new_unit CAPA_ARG((Unit_t *left_p, Unit_t *right_p));
! 583: int s_getnext CAPA_ARG(());
! 584: int s_peeknext CAPA_ARG(());
! 585: double scan_FLOAT CAPA_ARG(());
! 586: Unit_t *scan_num_item CAPA_ARG(());
! 587: Unit_t *scan_unit_item CAPA_ARG(());
! 588: Unit_t *scan_basic_term CAPA_ARG(());
! 589: Unit_t *scan_num_term CAPA_ARG(());
! 590: Unit_t *scan_basic_block CAPA_ARG(());
! 591: Unit_t *scan_num_block CAPA_ARG(());
! 592: Unit_t *scan_unit_expr CAPA_ARG(());
! 593: Unit_t *scan_num_expr CAPA_ARG(());
! 594: Unit_t *parse_unit_expr CAPA_ARG((char *symb_str));
! 595: void print_remains CAPA_ARG(());
! 596: /* ================================================= capaMapExpr.c */
! 597:
! 598: int do_map CAPA_ARG((char *seed,ArgNode_t *varp,ArgNode_t *argp,int argc, int dir));
! 599:
! 600: /* =============================================== capaFormulaLexer.c -- */
! 601: double f_get_float CAPA_ARG(());
! 602: char *f_get_id CAPA_ARG(());
! 603: int f_peek_next_token CAPA_ARG(());
! 604: int fml_lex CAPA_ARG(());
! 605:
! 606: /* =============================================== capaFormula.y == */
! 607: int fml_parse CAPA_ARG(());
! 608: Symbol *f_symbol_pow CAPA_ARG((Symbol *ap, Symbol *bp));
! 609: /* ====================================================================== */
! 610:
! 611: #ifdef __sun
! 612: #define index(xx,cc) strchr(xx,cc)
! 613: #define rindex(xx,cc) strrchr(xx,cc)
! 614: #endif
! 615:
! 616: #endif /* _CAPA_PARSER_H_ */
! 617:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>