version 1.15, 2003/11/11 09:15:36 |
version 1.16, 2003/11/11 19:49:02 |
|
|
fflush(stdout); |
fflush(stdout); |
exit(0); |
exit(0); |
} |
} |
| RETURN |
| RETURN return_expression |
{ |
{ |
if (nesting == 0) { |
if (nesting == 0) { |
warning("return must be in a function"); |
warning("return must be in a function"); |
YYERROR; |
YYERROR; |
} |
} |
$$ = node(cs("0"), epilogue, |
$$ = $2; |
numnode(nesting), cs("Q"), END_NODE); |
|
} |
} |
| RETURN LPAR return_expression RPAR |
|
{ |
|
if (nesting == 0) { |
|
warning("return must be in a function"); |
|
YYERROR; |
|
} |
|
$$ = $3; |
|
} |
|
| FOR LPAR alloc_macro opt_expression SEMICOLON |
| FOR LPAR alloc_macro opt_expression SEMICOLON |
opt_relational_expression SEMICOLON |
opt_relational_expression SEMICOLON |
opt_expression RPAR opt_statement pop_nesting |
opt_expression RPAR opt_statement pop_nesting |
|
|
} |
} |
; |
; |
|
|
function : function_header opt_parameter_list RPAR |
function : function_header opt_parameter_list RPAR opt_newline |
LBRACE NEWLINE opt_auto_define_list |
LBRACE NEWLINE opt_auto_define_list |
statement_list RBRACE |
statement_list RBRACE |
{ |
{ |
int n = node(prologue, $7, epilogue, |
int n = node(prologue, $8, epilogue, |
cs("0"), numnode(nesting), |
cs("0"), numnode(nesting), |
cs("Q"), END_NODE); |
cs("Q"), END_NODE); |
emit_macro($1, n); |
emit_macro($1, n); |
|
|
} |
} |
; |
; |
|
|
|
opt_newline : /* empty */ |
|
| NEWLINE |
|
; |
|
|
opt_parameter_list |
opt_parameter_list |
: /* empty */ |
: /* empty */ |
| parameter_list |
| parameter_list |
|
|
| expression |
| expression |
{ |
{ |
$$ = node($1, epilogue, |
$$ = node($1, epilogue, |
|
numnode(nesting), cs("Q"), END_NODE); |
|
} |
|
| LPAR RPAR |
|
{ |
|
$$ = node(cs("0"), epilogue, |
numnode(nesting), cs("Q"), END_NODE); |
numnode(nesting), cs("Q"), END_NODE); |
} |
} |
; |
; |