Update of /cvsroot/monetdb/pathfinder/modules/pftijah/tjc
In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv32204

Modified Files:
      Tag: Feb2010
        tjc_conf.h tjc_main.c tjc_parse.y tjc_scan.l 
Log Message:
recovery after syntactically wrong NEXI query
(consecutive queries used to fail as well, since the flex buffer was not 
cleaned)



Index: tjc_main.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/modules/pftijah/tjc/tjc_main.c,v
retrieving revision 1.23.2.1
retrieving revision 1.23.2.2
diff -u -d -r1.23.2.1 -r1.23.2.2
--- tjc_main.c  18 Jan 2010 10:40:24 -0000      1.23.2.1
+++ tjc_main.c  27 Jan 2010 13:46:07 -0000      1.23.2.2
@@ -40,7 +40,7 @@
 #include "tjc_phys_optimize.h"
 #include "tjc_milprint.h"
 
-#define DEBUG 0
+#define DEBUG 0 
 
 tjc_config* tjc_c_GLOBAL;
 
@@ -233,7 +233,6 @@
        return NULL;
     }
 
-    if (DEBUG) stream_printf(GDKout,"#!tjc parsing[%s]\n!",query);
     int status = tjc_parser(query,&ptree);
     if (DEBUG) stream_printf(GDKout,"#!tjc parser status = %d\n",status);
     if (use_sn && (ptree->is_rel_path_exp == 0)) {

Index: tjc_parse.y
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/modules/pftijah/tjc/tjc_parse.y,v
retrieving revision 1.13.6.1
retrieving revision 1.13.6.2
diff -u -d -r1.13.6.1 -r1.13.6.2
--- tjc_parse.y 18 Jan 2010 10:41:38 -0000      1.13.6.1
+++ tjc_parse.y 27 Jan 2010 13:46:07 -0000      1.13.6.2
@@ -144,7 +144,7 @@
                            if ($3) { *($3->fixme) = $2->root; $$ = tjcp_wire1 
(tjc_tree, p_nexi, $3->root); 
                            TJCfree($2); TJCfree($3); }
                            else { $$ = tjcp_wire1 (tjc_tree, p_nexi, 
$2->root); TJCfree($2); }
-                         }  
+                         } 
                        ;
 RelativePath_          : "."
                          { $$ = tjcp_leaf (tjc_tree, p_ctx); }
@@ -294,10 +294,15 @@
 
 int tjc_parser (char* input, TJptree_t **res)
 {
+  int result = 0;
   setTJCscanstring(input);
 
   tjc_tree   = tjcp_inittree();
-  int result = tjcparse();
+  if (tjcparse()) {
+     result = 1; // parsing failed
+  }
+  destroyTJCscanBuffer();
+
   *res = tjc_tree;
   tjc_tree = NULL;
 

Index: tjc_conf.h
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/modules/pftijah/tjc/tjc_conf.h,v
retrieving revision 1.10.6.1
retrieving revision 1.10.6.2
diff -u -d -r1.10.6.1 -r1.10.6.2
--- tjc_conf.h  18 Jan 2010 10:40:17 -0000      1.10.6.1
+++ tjc_conf.h  27 Jan 2010 13:46:07 -0000      1.10.6.2
@@ -76,4 +76,5 @@
 
 extern void setTJCscanstring(const char *);
 
+extern void destroyTJCscanBuffer();
 #endif

Index: tjc_scan.l
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/modules/pftijah/tjc/tjc_scan.l,v
retrieving revision 1.11.6.1
retrieving revision 1.11.6.2
diff -u -d -r1.11.6.1 -r1.11.6.2
--- tjc_scan.l  18 Jan 2010 10:42:03 -0000      1.11.6.1
+++ tjc_scan.l  27 Jan 2010 13:46:07 -0000      1.11.6.2
@@ -253,6 +253,7 @@
 
 void setTJCscanstring(const char *s) { tjc_scan_string(s); }
 
+void destroyTJCscanBuffer() { tjclex_destroy(); }
 
 /* vim:set shiftwidth=4 expandtab: */
 


------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to