Update of /cvsroot/monetdb/pathfinder/modules/pftijah/tjc
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv29550/tjc

Modified Files:
        tjc_abssyn.c tjc_abssyn.h tjc_conf.h tjc_main.c tjc_milprint.c 
        tjc_parse.y 
Log Message:
check whether NEXI query represents an 'absolute' or 'relative'
path expression, to give better error messages, when the tijah
query is started from a context set coming from pathfinder.



U tjc_main.c
Index: tjc_main.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/modules/pftijah/tjc/tjc_main.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- tjc_main.c  9 Feb 2009 10:39:28 -0000       1.14
+++ tjc_main.c  21 Feb 2009 09:57:47 -0000      1.15
@@ -274,7 +274,7 @@
        return 1;
 }
 
-char* tjc_new_parse(char* query, BAT* optbat, BAT* rtagbat, char* 
startNodes_name, char** errBUFF)
+char* tjc_new_parse(char* query, BAT* optbat, BAT* rtagbat, int use_sn, char** 
errBUFF)
 {
     tjc_config *tjc_c = (tjc_config*)TJCmalloc(sizeof(struct tjc_config));
 
@@ -286,11 +286,6 @@
     TJpnode_t *root;
     TJatree_t *atree;
   
-    if (startNodes_name)
-       tjc_c->startNodes = startNodes_name;
-    else
-       tjc_c->startNodes = NULL;
-
     if (DEBUG) stream_printf(GDKout,"#!tjc interpreting options\n");
     if ( !interpret_options(tjc_c,optbat) ) {
        *errBUFF = GDKstrdup("option handling error");
@@ -299,6 +294,16 @@
     if (DEBUG) stream_printf(GDKout,"#!tjc parsing[%s]\n!",query);
     int status = tjc_parser(query,&ptree);
     if (DEBUG) stream_printf(GDKout,"#!tjc status = %d\n",status);
+    if (use_sn && (ptree->is_rel_path_exp == 0)) {
+       *errBUFF = GDKstrdup("Error (new NEXI syntax): A query with startnodes 
should start with a relative path expression");
+        if (DEBUG) stream_printf(GDKout,"#!tjc error <%s>\n",errBUFF);
+       return NULL;
+    }
+    if ((use_sn == 0) && ptree->is_rel_path_exp) {
+       *errBUFF = GDKstrdup("Error (new NEXI syntax): A query without 
startnodes should start with an absolute path expression");
+        if (DEBUG) stream_printf(GDKout,"#!tjc error <%s>\n",errBUFF);
+       return NULL;
+    }
     if (!status && ptree) {
        root = &ptree->node[ptree->length - 1];
         if (DEBUG) stream_printf(GDKout,"#!tjc start normalize\n");

U tjc_conf.h
Index: tjc_conf.h
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/modules/pftijah/tjc/tjc_conf.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- tjc_conf.h  9 Feb 2009 10:39:28 -0000       1.6
+++ tjc_conf.h  21 Feb 2009 09:57:47 -0000      1.7
@@ -50,7 +50,6 @@
        char* upprop;
        char* downprop;
        char* prior;
-       char* startNodes;
        double scorebase;
        double lambda;
        double okapik1;

U tjc_milprint.c
Index: tjc_milprint.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/modules/pftijah/tjc/tjc_milprint.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- tjc_milprint.c      19 Feb 2009 16:22:42 -0000      1.16
+++ tjc_milprint.c      21 Feb 2009 09:57:47 -0000      1.17
@@ -89,9 +89,6 @@
     if (tjc_c->returnall) {
         TJCPRINTF(MILOUT,"returnAllElements := TRUE;\n");
     }
-    if (tjc_c->startNodes) {
-        TJCPRINTF(MILOUT,"var startNodes := bat(\"%s\");\n", 
tjc_c->startNodes);
-    }
     TJCPRINTF(MILOUT,"\n");
 }
 
@@ -321,7 +318,7 @@
     switch (node->kind) { 
        case a_select_element :
            if (strcmp (node->op, "select_startnodes") == 0)
-               TJCPRINTF(MILOUT,"var R%d := tj_%s(\"%s\");\n", nid, node->op, 
tjc_c->startNodes);
+               TJCPRINTF(MILOUT,"var R%d := tj_%s();\n", nid, node->op);
            else if (strcmp (node->op, "select_star") == 0)
                TJCPRINTF(MILOUT,"var R%d := tj_%s();\n", nid, node->op);
            else

U tjc_parse.y
Index: tjc_parse.y
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/modules/pftijah/tjc/tjc_parse.y,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- tjc_parse.y 6 Feb 2009 13:02:44 -0000       1.7
+++ tjc_parse.y 21 Feb 2009 09:57:47 -0000      1.8
@@ -128,9 +128,9 @@
                            else { $$ = tjcp_wire1 (tjc_tree, p_nexi, 
$1->root); TJCfree($1); }
                          }  
                        | RelativePath_
-                         { $$ = tjcp_wire1 (tjc_tree, p_nexi, $1); }
+                         { tjc_tree->is_rel_path_exp = 1; $$ = tjcp_wire1 
(tjc_tree, p_nexi, $1); }
                        | RelativePath_ Path OptPathNoPred
-                         { *($2->fixme) = $1; 
+                         { tjc_tree->is_rel_path_exp = 1; *($2->fixme) = $1; 
                            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); }

U tjc_abssyn.c
Index: tjc_abssyn.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/modules/pftijah/tjc/tjc_abssyn.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- tjc_abssyn.c        29 Jan 2009 22:33:16 -0000      1.5
+++ tjc_abssyn.c        21 Feb 2009 09:57:47 -0000      1.6
@@ -165,6 +165,7 @@
 
     ptree->capacity = TJPTREE_MAXSIZE;
     ptree->length = 0;
+    ptree->is_rel_path_exp = 0;
 
     return ptree;
 }

U tjc_abssyn.h
Index: tjc_abssyn.h
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/modules/pftijah/tjc/tjc_abssyn.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- tjc_abssyn.h        29 Jan 2009 22:33:16 -0000      1.7
+++ tjc_abssyn.h        21 Feb 2009 09:57:47 -0000      1.8
@@ -131,6 +131,7 @@
     TJpnode_t  node[TJPTREE_MAXSIZE];
     int        capacity;
     int                length;
+    char       is_rel_path_exp;
 };
 
 


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to