version 1.8, 2004/12/17 03:09:08 |
version 1.10, 2015/08/09 11:46:43 |
|
|
* 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.7 2004/02/27 09:13:04 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/parse/parser.c,v 1.9 2008/09/04 01:42:26 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 162 void read_eval_loop() { |
|
Line 164 void read_eval_loop() { |
|
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)); |
|
#if !defined(__MINGW32__) && !defined(__MINGW64__) |
fflush(asir_out); |
fflush(asir_out); |
|
#endif |
} else |
} else |
printexpr(CO,LastVal); |
printexpr(CO,LastVal); |
if ( outputstyle == 1 ) { |
if ( outputstyle == 1 ) { |
putc(';',asir_out); |
putc(';',asir_out); |
} |
} |
putc('\n',asir_out); |
putc('\n',asir_out); |
|
#if !defined(__MINGW32__) && !defined(__MINGW64__) |
fflush(asir_out); |
fflush(asir_out); |
|
#endif |
} |
} |
if ( prtime ) { |
if ( prtime ) { |
printtime(&egt0,&egt1,r1-r0); |
printtime(&egt0,&egt1,r1-r0); |
} |
} |
|
#if defined(__MINGW32__) || defined(__MINGW64__) |
|
fflush(asir_out); |
|
fflush(stderr); |
|
#endif |
prompt(); |
prompt(); |
} |
} |
} |
} |