version 1.35, 2012/12/17 07:20:45 |
version 1.38, 2018/03/28 05:27:22 |
|
|
* 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.34 2011/06/16 08:17:15 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/parse/parse.y,v 1.37 2017/08/31 02:36:21 noro Exp $ |
*/ |
*/ |
%{ |
%{ |
#define malloc(x) Risa_GC_malloc(x) |
#define malloc(x) Risa_GC_malloc(x) |
|
|
if ( f ) |
if ( f ) |
$$ = mkfnode(2,I_FUNC,f,mkfnode(1,I_LIST,NULLP)); |
$$ = mkfnode(2,I_FUNC,f,mkfnode(1,I_LIST,NULLP)); |
else { |
else { |
gen_searchf_searchonly($1,(FUNC *)&f); |
gen_searchf_searchonly($1,(FUNC *)&f,1); |
if ( f ) |
if ( f ) |
makesrvar(f,(P *)&val); |
makesrvar(f,(P *)&val); |
else |
else |
|
|
print_crossref(val); |
print_crossref(val); |
$$ = mkfnode(2,I_FUNC,val,mkfnode(1,I_LIST,$3)); |
$$ = mkfnode(2,I_FUNC,val,mkfnode(1,I_LIST,$3)); |
} |
} |
|
|
| LCASE '(' node '|' optlist ')' |
| LCASE '(' node '|' optlist ')' |
{ |
{ |
gen_searchf($1,(FUNC *)&val); |
gen_searchf($1,(FUNC *)&val); |
|
|
{ $$ = mkfnode(3,I_COP,$2,$1,$3); } |
{ $$ = mkfnode(3,I_COP,$2,$1,$3); } |
| '!' expr |
| '!' expr |
{ $$ = mkfnode(1,I_NOT,$2); } |
{ $$ = mkfnode(1,I_NOT,$2); } |
|
| expr '!' |
|
{ |
|
gen_searchf("factorial",(FUNC *)&val); |
|
print_crossref(val); |
|
MKNODE(a,$1,0); |
|
$$ = mkfnode(2,I_FUNC,val,mkfnode(1,I_LIST,a)); |
|
} |
| expr OR expr |
| expr OR expr |
{ $$ = mkfnode(2,I_OR,$1,$3); } |
{ $$ = mkfnode(2,I_OR,$1,$3); } |
| expr AND expr |
| expr AND expr |
|
|
{ $$ = mkfnode(3,I_CE,$1,$3,$5); } |
{ $$ = mkfnode(3,I_CE,$1,$3,$5); } |
| '<' node '>' |
| '<' node '>' |
{ $$ = mkfnode(1,I_EV,$2); } |
{ $$ = mkfnode(1,I_EV,$2); } |
|
| '<' node ':' expr '>' |
|
{ |
|
$$ = mkfnode(2,I_EVM,$2,$4); |
|
} |
| NEWSTRUCT '(' rawstr ')' |
| NEWSTRUCT '(' rawstr ')' |
{ $$ = mkfnode(1,I_NEWCOMP,(int)structtoindex($3)); } |
{ $$ = mkfnode(1,I_NEWCOMP,(int)structtoindex($3)); } |
| QUOTED '(' expr ')' |
| QUOTED '(' expr ')' |