version 1.5, 1999/10/20 19:57:37
|
version 1.7, 1999/12/07 19:10:47
|
Line 554 pt_list : pt_list ',' point_coo
|
Line 554 pt_list : pt_list ',' point_coo
|
| pt_range { } |
| pt_range { } |
; |
; |
|
|
pt_range : point_coord ':' point_coord '#' IDENTIFIER { PointsList_t *pt; |
pt_range : point_coord ':' point_coord '#' IDENTIFIER |
|
{ |
if( LastPtsList != NULL ) { |
assign_pts($1,$3,$5); |
LastPtsList->pts_next = gen_ptslist( $1, $3, $5 ); |
/*PointsList_t *pt; |
pt = LastPtsList->pts_next; |
if( LastPtsList != NULL ) { |
while( pt->pts_next != NULL ) { |
LastPtsList->pts_next = gen_ptslist( $1, $3, $5 ); |
pt = pt->pts_next; |
pt = LastPtsList->pts_next; |
} |
while( pt->pts_next != NULL ) { |
LastPtsList = pt; |
pt = pt->pts_next; |
} else { |
} |
CurrPtsList = gen_ptslist( $1, $3, $5 ); |
LastPtsList = pt; |
LastPtsList = CurrPtsList; |
} else { |
} |
CurrPtsList = gen_ptslist( $1, $3, $5 ); |
if( $1->s_type == S_CONSTANT ) { |
LastPtsList = CurrPtsList; |
capa_mfree($1->s_str); capa_mfree((char *)$1); |
} |
} |
if( $1->s_type == S_CONSTANT ) { |
if( $3->s_type == S_CONSTANT ) { |
capa_mfree($1->s_str); capa_mfree((char *)$1); |
capa_mfree($3->s_str); capa_mfree((char *)$3); |
} |
} |
if( $3->s_type == S_CONSTANT ) { |
} |
capa_mfree($3->s_str); capa_mfree((char *)$3); |
| point_coord ':' point_coord '#' a_number { PointsList_t *pt; |
} |
|
*/ |
if( LastPtsList != NULL ) { |
} |
LastPtsList->pts_next = gen_ptslist( $1, $3, $5 ); |
| point_coord ':' point_coord '#' ARRAY_ID '[' calc_expr ']' |
pt = LastPtsList->pts_next; |
{ assign_pts($1,$3,get_array_symbol($5,$7,1)); } |
while( pt->pts_next != NULL ) { |
| point_coord ':' point_coord '#' a_number |
pt = pt->pts_next; |
{ |
} |
assign_pts($1,$3,$5); |
LastPtsList = pt; |
/*PointsList_t *pt; |
} else { |
|
CurrPtsList = gen_ptslist( $1, $3, $5 ); |
if( LastPtsList != NULL ) { |
LastPtsList = CurrPtsList; |
LastPtsList->pts_next = gen_ptslist( $1, $3, $5 ); |
} |
pt = LastPtsList->pts_next; |
if( $1->s_type == S_CONSTANT ) { |
while( pt->pts_next != NULL ) { |
capa_mfree($1->s_str); capa_mfree((char *)$1); |
pt = pt->pts_next; |
} |
} |
if( $3->s_type == S_CONSTANT ) { |
LastPtsList = pt; |
capa_mfree($3->s_str); capa_mfree((char *)$3); |
} else { |
} |
CurrPtsList = gen_ptslist( $1, $3, $5 ); |
if( $5->s_type == I_CONSTANT || $5->s_type == R_CONSTANT) { |
LastPtsList = CurrPtsList; |
capa_mfree((char *)$5); |
} |
} |
if( $1->s_type == S_CONSTANT ) { |
} |
capa_mfree($1->s_str); capa_mfree((char *)$1); |
|
} |
|
if( $3->s_type == S_CONSTANT ) { |
|
capa_mfree($3->s_str); capa_mfree((char *)$3); |
|
} |
|
if( $5->s_type == I_CONSTANT || $5->s_type == R_CONSTANT) { |
|
capa_mfree((char *)$5); |
|
} |
|
*/ |
|
} |
; |
; |
|
|
|
|
point_coord : IDENTIFIER { $$ = $1; } |
point_coord : IDENTIFIER { $$ = $1; } |
| S_CONSTANT { $$ = $1; } |
| ARRAY_ID '[' calc_expr ']' { $$ = get_array_symbol($1,$3,1); } |
|
| S_CONSTANT { $$ = $1; } |
; |
; |
|
|
|
|
Line 1078 append_warn(type,str) int type;char *str
|
Line 1088 append_warn(type,str) int type;char *str
|
/*********** if *b is a constant symbol, destroy (free) b ********************/ |
/*********** if *b is a constant symbol, destroy (free) b ********************/ |
/*********** if *a is a var symbol, create a new symbol **********************/ |
/*********** if *a is a var symbol, create a new symbol **********************/ |
/* do not free(*a) */ |
/* do not free(*a) */ |
/* */ |
/* If either a or b is invalid it propagates the error up the parse tree */ |
Symbol * |
Symbol * |
symbols_op(a, b, op) Symbol *a; Symbol *b; int op; |
symbols_op(a, b, op) Symbol *a; Symbol *b; int op; |
{ |
{ |
Line 1093 if( a->s_type == IDENTIFIER || b->s_type
|
Line 1103 if( a->s_type == IDENTIFIER || b->s_type
|
if(a->s_type == IDENTIFIER) { /* a is IDENTIFIER */ |
if(a->s_type == IDENTIFIER) { /* a is IDENTIFIER */ |
sprintf(warn_msg,"var \"%s\" not defined before use.\n", a->s_name); |
sprintf(warn_msg,"var \"%s\" not defined before use.\n", a->s_name); |
capa_msg(MESSAGE_ERROR,warn_msg); |
capa_msg(MESSAGE_ERROR,warn_msg); |
return (b); |
return (a); |
} else { /* b is IDENTIFIER */ |
} else { /* b is IDENTIFIER */ |
sprintf(warn_msg, |
sprintf(warn_msg,"var \"%s\" not defined before use.\n",b->s_name); |
"var \"%s\" not defined before use.\n",b->s_name); |
|
capa_msg(MESSAGE_ERROR,warn_msg); |
capa_msg(MESSAGE_ERROR,warn_msg); |
return (a); |
return (b); |
} |
} |
} else { /* a and b are neither identifiers */ |
} else { /* a and b are neither identifiers */ |
if( (a->s_type == I_VAR) || |
if( (a->s_type == I_VAR) || |
Line 1789 assign_id_list( s ) Symbol *s;
|
Line 1798 assign_id_list( s ) Symbol *s;
|
} |
} |
} |
} |
|
|
|
void assign_pts ( Symbol* coord1, Symbol* coord2, Symbol* num) { |
|
PointsList_t *pt; |
|
if( LastPtsList != NULL ) { |
|
LastPtsList->pts_next = gen_ptslist( coord1, coord2, num ); |
|
pt = LastPtsList->pts_next; |
|
while( pt->pts_next != NULL ) { |
|
pt = pt->pts_next; |
|
} |
|
LastPtsList = pt; |
|
} else { |
|
CurrPtsList = gen_ptslist( coord1, coord2, num ); |
|
LastPtsList = CurrPtsList; |
|
} |
|
if(coord1->s_type == S_CONSTANT) { |
|
capa_mfree(coord1->s_str); capa_mfree((char *)coord1); |
|
} |
|
if(coord2->s_type == S_CONSTANT) { |
|
capa_mfree(coord2->s_str); capa_mfree((char *)coord2); |
|
} |
|
if(num->s_type == I_CONSTANT || num->s_type == R_CONSTANT) { |
|
capa_mfree((char *)num); |
|
} |
|
} |
|
|
/* =========================================================================== */ |
/* =========================================================================== */ |
|
|
|
|