[BACK]Return to parser.c CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / asir2000 / parse

Diff for /OpenXM_contrib2/asir2000/parse/parser.c between version 1.7 and 1.11

version 1.7, 2004/02/27 09:13:04 version 1.11, 2015/08/14 13:51:56
Line 45 
Line 45 
  * 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.6 2003/06/07 16:40:26 saito Exp $   * $OpenXM: OpenXM_contrib2/asir2000/parse/parser.c,v 1.10 2015/08/09 11:46:43 fujimoto 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;
   
Line 68  SNODE *snodep;
Line 67  SNODE *snodep;
         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;
Line 103  FNODE *exprp;
Line 99  FNODE *exprp;
 }  }
   
 /* 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;
Line 131  FNODE *exprp;
Line 125  FNODE *exprp;
         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 147  void read_eval_loop() {
Line 149  void read_eval_loop() {
         double r0,r1;          double r0,r1;
         double get_rtime();          double get_rtime();
         extern Obj LastVal;          extern Obj LastVal;
         extern int asir_texmacs;  
   
         LastVal = 0;          LastVal = 0;
         while ( 1 ) {          while ( 1 ) {
Line 163  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__)
                                         fflush(asir_out);                                          fflush(asir_out);
   #endif
                                 } else                                  } else
                                         printexpr(CO,LastVal);                                          printexpr(CO,LastVal);
                                 if ( asir_texmacs ) printf("\2verbatim:");  
                                 if ( outputstyle == 1 ) {                                  if ( outputstyle == 1 ) {
                                         putc(';',asir_out);                                          putc(';',asir_out);
                                 }                                  }
                                 putc('\n',asir_out);                                  putc('\n',asir_out);
   #if !defined(__MINGW32__)
                                 fflush(asir_out);                                  fflush(asir_out);
                                 if ( asir_texmacs ) { putchar('\5'); fflush(stdout); }  #endif
                         }                          }
                         if ( prtime ) {                          if ( prtime ) {
                                 if ( asir_texmacs ) printf("\2verbatim:");  
                                 printtime(&egt0,&egt1,r1-r0);                                  printtime(&egt0,&egt1,r1-r0);
                                 if ( asir_texmacs ) { putchar('\5'); fflush(stdout); }  
                         }                          }
   #if defined(__MINGW32__)
                           fflush(asir_out);
                           fflush(stderr);
   #endif
                         prompt();                          prompt();
                 }                  }
         }          }

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.11

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>