version 1.1, 2000/04/12 20:06:16
|
version 1.3, 2001/11/18 09:41:33
|
Line 15
|
Line 15
|
#include "capaParser.h" /* _symbol structure def */ |
#include "capaParser.h" /* _symbol structure def */ |
#include "capaCommon.h" |
#include "capaCommon.h" |
#include "capaFunction.h" |
#include "capaFunction.h" |
#include "capaRQO.h" |
|
#ifdef __hpux |
#ifdef __hpux |
#include <stdlib.h> |
#include <stdlib.h> |
#include <alloca.h> |
#include <alloca.h> |
Line 60 extern int Input_idx;
|
Line 59 extern int Input_idx;
|
int Current_line[MAX_OPENED_FILE]; |
int Current_line[MAX_OPENED_FILE]; |
extern int Func_idx; |
extern int Func_idx; |
extern Symbol FuncStack[MAX_FUNC_NEST]; |
extern Symbol FuncStack[MAX_FUNC_NEST]; |
extern int IFstatus[MAX_FUNC_NEST]; |
/*extern int IFstatus[MAX_FUNC_NEST];*/ |
extern int IFcount; |
extern int IFcount; |
/*extern int gUnitError;*/ |
/*extern int gUnitError;*/ |
|
|
Line 79 int Answer_infospec;
|
Line 78 int Answer_infospec;
|
void (*Status_Func)(); |
void (*Status_Func)(); |
AnswerInfo_t CurrAnsInfo; |
AnswerInfo_t CurrAnsInfo; |
|
|
RandQO_t *QuestionOrder; |
|
PointsList_t *CurrPtsList; |
PointsList_t *CurrPtsList; |
PointsList_t *LastPtsList; |
PointsList_t *LastPtsList; |
|
|
Line 297 if_expr : CAPA_IF '(' calc_expr '
|
Line 295 if_expr : CAPA_IF '(' calc_expr '
|
YYDBUG_PR2("(IF expr <IFcount=%d>)\n",IFcount); |
YYDBUG_PR2("(IF expr <IFcount=%d>)\n",IFcount); |
switch($3->s_type) { |
switch($3->s_type) { |
case IDENTIFIER: |
case IDENTIFIER: |
IFstatus[IFcount] = IF_FALSE; |
/*IFstatus[IFcount] = IF_FALSE;*/ |
begin_next_line(); |
begin_next_line(); |
break; |
break; |
case I_CONSTANT: case I_VAR: |
case I_CONSTANT: case I_VAR: |
if(!$3->s_int) { |
if(!$3->s_int) { |
IFstatus[IFcount] = IF_FALSE; |
/*IFstatus[IFcount] = IF_FALSE; |
begin_if_skip(); |
begin_if_skip();*/ |
} else { |
} else { |
IFstatus[IFcount] = IF_TRUE; |
/*IFstatus[IFcount] = IF_TRUE;*/ |
begin_next_line(); |
begin_next_line(); |
} |
} |
break; |
break; |
case R_CONSTANT: case R_VAR: |
case R_CONSTANT: case R_VAR: |
if($3->s_real == 0.0) { |
if($3->s_real == 0.0) { |
IFstatus[IFcount] = IF_FALSE; |
/*IFstatus[IFcount] = IF_FALSE; |
begin_if_skip(); |
begin_if_skip();*/ |
}else{ |
}else{ |
IFstatus[IFcount] = IF_TRUE; |
/*IFstatus[IFcount] = IF_TRUE;*/ |
begin_next_line(); |
begin_next_line(); |
} |
} |
break; |
break; |
Line 324 if_expr : CAPA_IF '(' calc_expr '
|
Line 322 if_expr : CAPA_IF '(' calc_expr '
|
capa_mfree($3->s_str); |
capa_mfree($3->s_str); |
} |
} |
if(leng == 0) { |
if(leng == 0) { |
IFstatus[IFcount] = IF_FALSE; |
/*IFstatus[IFcount] = IF_FALSE; |
begin_if_skip(); |
begin_if_skip();*/ |
}else{ |
}else{ |
IFstatus[IFcount] = IF_TRUE; |
/*IFstatus[IFcount] = IF_TRUE;*/ |
begin_next_line(); |
begin_next_line(); |
} |
} |
break; |
break; |
Line 337 if_expr : CAPA_IF '(' calc_expr '
|
Line 335 if_expr : CAPA_IF '(' calc_expr '
|
capa_mfree($3->s_str); |
capa_mfree($3->s_str); |
} |
} |
if(leng == 0) { |
if(leng == 0) { |
IFstatus[IFcount] = IF_FALSE; |
/*IFstatus[IFcount] = IF_FALSE;*/ |
begin_if_skip(); |
/*begin_if_skip();*/ |
}else{ |
}else{ |
IFstatus[IFcount] = IF_TRUE; |
/*IFstatus[IFcount] = IF_TRUE;*/ |
begin_next_line(); |
begin_next_line(); |
} |
} |
break; |
break; |
Line 710 term : term '*' basic_constr {
|
Line 708 term : term '*' basic_constr {
|
YYDBUG_PR1(" term <= basic_constr "); YYDBUG_SYM($1); } |
YYDBUG_PR1(" term <= basic_constr "); YYDBUG_SYM($1); } |
; |
; |
|
|
basic_constr : FUNCTION_ID '(' ')' { int tmp; |
basic_constr : FUNCTION_ID '(' ')' { /*int tmp;*/ |
|
|
Func_idx--; |
Func_idx--; |
if(Func_idx >= 0 ) { |
if(Func_idx >= 0 ) { |
Line 721 basic_constr : FUNCTION_ID '(' ')' {
|
Line 719 basic_constr : FUNCTION_ID '(' ')' {
|
|
|
} |
} |
| FUNCTION_ID '(' arg_list ')' |
| FUNCTION_ID '(' arg_list ')' |
{ int tmp; |
{ /*int tmp; */ |
|
|
Func_idx--; |
Func_idx--; |
YYDBUG_PR4(" basic_constr <= FUNCTION<%s><argc=%d> YYSTATE(%d) ", |
YYDBUG_PR4(" basic_constr <= FUNCTION<%s><argc=%d> YYSTATE(%d) ", |
Line 869 void free_calc_expr(Symbol *expr)
|
Line 867 void free_calc_expr(Symbol *expr)
|
Symbol* get_array_symbol ( name,index,free_symbols ) |
Symbol* get_array_symbol ( name,index,free_symbols ) |
Symbol *name,*index;int free_symbols; |
Symbol *name,*index;int free_symbols; |
{ |
{ |
Symbol *s_p, *a_p; |
Symbol *s_p/*, *a_p*/; |
char *key, *tmp; |
char *key, *tmp; |
int leng, idx_len; |
int leng, idx_len; |
leng = strlen(name->s_name)+8; /* [ ] */ |
leng = strlen(name->s_name)+8; /* [ ] */ |
Line 914 Symbol * build_array_list(ar_name,num_el
|
Line 912 Symbol * build_array_list(ar_name,num_el
|
Symbol *ar_name;int num_elem; |
Symbol *ar_name;int num_elem; |
{ |
{ |
int i; |
int i; |
Symbol *arg_list,*a_p; |
Symbol *arg_list/*,*a_p*/; |
char idx_str[MAX_BUFFER_SIZE]; |
char idx_str[MAX_BUFFER_SIZE]; |
|
|
/*a_p = find_arrayid(ar_name->s_name);*/ |
/*a_p = find_arrayid(ar_name->s_name);*/ |