version 1.6, 2003/06/07 16:40:26 |
version 1.9, 2008/09/04 01:42:26 |
|
|
* 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/parser.c,v 1.5 2002/12/09 00:42:15 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/parse/parser.c,v 1.8 2004/12/17 03:09:08 noro Exp $ |
*/ |
*/ |
#include <ctype.h> |
#include <ctype.h> |
#include "ca.h" |
#include "ca.h" |
Line 57 extern SNODE parse_snode; |
|
Line 57 extern SNODE parse_snode; |
|
extern FUNC parse_targetf; |
extern FUNC parse_targetf; |
extern int outputstyle; |
extern int outputstyle; |
|
|
int mainparse(snodep) |
int mainparse(SNODE *snodep) |
SNODE *snodep; |
|
{ |
{ |
int ret; |
int ret; |
|
|
|
|
return ret; |
return ret; |
} |
} |
|
|
int exprparse(f,str,exprp) |
int exprparse(FUNC f,char *str,FNODE *exprp) |
FUNC f; |
|
char *str; |
|
FNODE *exprp; |
|
{ |
{ |
char buf0[BUFSIZ]; |
char buf0[BUFSIZ]; |
char *buf; |
char *buf; |
|
|
} |
} |
|
|
/* allows to create a new variable */ |
/* allows to create a new variable */ |
|
/* returns SNODE */ |
|
|
int exprparse_create_var(f,str,exprp) |
int exprparse_create_var(FUNC f,char *str,SNODE *statp) |
FUNC f; |
|
char *str; |
|
FNODE *exprp; |
|
{ |
{ |
char buf0[BUFSIZ]; |
char buf0[BUFSIZ]; |
char *buf; |
char *buf; |
|
|
parse_targetf = f; |
parse_targetf = f; |
main_parser = 0; |
main_parser = 0; |
allow_create_var = 1; |
allow_create_var = 1; |
|
#if 0 |
if ( yyparse() || !parse_snode || parse_snode->id != S_SINGLE ) { |
if ( yyparse() || !parse_snode || parse_snode->id != S_SINGLE ) { |
*exprp = 0; return 0; |
*exprp = 0; return 0; |
} else { |
} else { |
*exprp = (FNODE)FA0(parse_snode); return 1; |
*exprp = (FNODE)FA0(parse_snode); return 1; |
} |
} |
|
#else |
|
if ( yyparse() || !parse_snode ) { |
|
*statp = 0; return 0; |
|
} else { |
|
*statp = parse_snode; return 1; |
|
} |
|
#endif |
} |
} |
|
|
extern FUNC user_print_function; |
extern FUNC user_print_function; |
Line 160 void read_eval_loop() { |
|
Line 162 void read_eval_loop() { |
|
r1 = get_rtime(); |
r1 = get_rtime(); |
if ( !ox_do_copy ) { |
if ( !ox_do_copy ) { |
if ( prresult ) { |
if ( prresult ) { |
if ( user_print_function ) |
if ( user_print_function ) { |
bevalf(user_print_function,mknode(1,LastVal)); |
bevalf(user_print_function,mknode(1,LastVal)); |
else |
fflush(asir_out); |
|
} else |
printexpr(CO,LastVal); |
printexpr(CO,LastVal); |
if ( outputstyle == 1 ) { |
if ( outputstyle == 1 ) { |
putc(';',asir_out); |
putc(';',asir_out); |