version 1.27, 2005/07/27 04:35:11 |
version 1.32, 2005/09/30 01:35:25 |
|
|
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* |
* |
* $OpenXM: OpenXM_contrib2/asir2000/parse/parse.y,v 1.26 2005/04/07 08:33:12 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/parse/parse.y,v 1.31 2005/09/21 23:39:32 noro Exp $ |
*/ |
*/ |
%{ |
%{ |
#define malloc(x) GC_malloc(x) |
#define malloc(x) GC_malloc(x) |
Line 67 extern int gdef,mgdef,ldef; |
|
Line 67 extern int gdef,mgdef,ldef; |
|
extern SNODE parse_snode; |
extern SNODE parse_snode; |
extern int main_parser, allow_create_var; |
extern int main_parser, allow_create_var; |
|
|
int prresult; |
int prresult,saveresult; |
|
|
static int ind; |
static int ind; |
static FNODE t; |
static FNODE t; |
|
|
| WHILE '(' node ')' stat |
| WHILE '(' node ')' stat |
{ $$ = mksnode(5,S_FOR,$1,0,$3,0,$5); $5?$$->ln=$5->ln:0; NOPR; } |
{ $$ = mksnode(5,S_FOR,$1,0,$3,0,$5); $5?$$->ln=$5->ln:0; NOPR; } |
| DO stat WHILE '(' node ')' tail |
| DO stat WHILE '(' node ')' tail |
{ $$ = mksnode(3,S_DO,$1,$2,$5); } |
{ $$ = mksnode(3,S_DO,$1,$2,$5); NOPR; } |
| LCASE '(' node ')' ':' '=' expr tail |
| LCASE '(' node ')' ':' '=' expr tail |
{ $$ = mksnode(3,S_PFDEF,$1,$3,$7); NOPR; } |
{ $$ = mksnode(3,S_PFDEF,$1,$3,$7); NOPR; } |
| PFDEF LCASE '(' node ')' tail |
| PFDEF LCASE '(' node ')' tail |
|
|
{ |
{ |
mkuf($2,asir_infile->name,$6, |
mkuf($2,asir_infile->name,$6, |
mksnode(1,S_CPLX,$11),$1,asir_infile->ln,$9,CUR_MODULE); |
mksnode(1,S_CPLX,$11),$1,asir_infile->ln,$9,CUR_MODULE); |
$$ = 0; NOPR; |
$$ = 0; NOPR; |
} |
} |
| MODDEF LCASE tail |
| MODDEF LCASE tail |
{ |
{ |
|
|
| LCASE '{' node '}' '(' node ')' |
| LCASE '{' node '}' '(' node ')' |
{ |
{ |
searchpf($1,(FUNC *)&val); |
searchpf($1,(FUNC *)&val); |
$$ = mkfnode(2,I_PFDERIV,val,mkfnode(1,I_LIST,$6),mkfnode(1,I_LIST,$3)); |
$$ = mkfnode(3,I_PFDERIV,val,mkfnode(1,I_LIST,$6),mkfnode(1,I_LIST,$3)); |
} |
} |
| GETOPT '(' rawstr ')' |
| GETOPT '(' rawstr ')' |
{ |
{ |
|
|
{ $$ = mkfnode(1,I_NEWCOMP,(int)structtoindex($3)); } |
{ $$ = mkfnode(1,I_NEWCOMP,(int)structtoindex($3)); } |
| QUOTED '(' expr ')' |
| QUOTED '(' expr ')' |
{ MKQUOTE(quote,$3); $$ = mkfnode(1,I_FORMULA,(pointer)quote); } |
{ MKQUOTE(quote,$3); $$ = mkfnode(1,I_FORMULA,(pointer)quote); } |
|
| '[' node '|' expr ']' |
|
{ $$ = mkfnode(2,I_CONS,$2,$4); } |
| '`' expr |
| '`' expr |
{ MKQUOTE(quote,$2); $$ = mkfnode(1,I_FORMULA,(pointer)quote); } |
{ MKQUOTE(quote,$2); $$ = mkfnode(1,I_FORMULA,(pointer)quote); } |
; |
; |