Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/edje

Dir     : e17/libs/edje/src/bin


Modified Files:
        edje_cc_handlers.c edje_cc_parse.c 


Log Message:


EVEN better parsing! :) lots of NULL handlers need filling in. i need to unify
common type parameter parsing to use smaller common functions to save space.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/bin/edje_cc_handlers.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- edje_cc_handlers.c  11 Jun 2003 13:20:48 -0000      1.1
+++ edje_cc_handlers.c  11 Jun 2003 14:14:21 -0000      1.2
@@ -4,17 +4,47 @@
 static void ob_images_image(void);
 static void st_images_image(void);
 
+static void ob_collections(void);
+
 /*****/
 
 New_Object_Handler object_handlers[] =
 {
      {"images", ob_images},
-     {"images.image", ob_images_image}
+     {"images.image", ob_images_image},
+     {"collections", ob_collections},
+     {"collections.group", NULL},
+     {"collections.group.name", NULL},
+     {"collections.group.parts", NULL},
+     {"collections.group.parts.part", NULL},
+     {"collections.group.parts.part.name", NULL},
+     {"collections.group.parts.part.type", NULL},
+     {"collections.group.parts.part.mouse_events", NULL},
+     {"collections.group.parts.part.color_class", NULL},
+     {"collections.group.parts.part.description", NULL},
+     {"collections.group.parts.part.description.state", NULL},
+     {"collections.group.parts.part.description.visible", NULL},
+     {"collections.group.parts.part.description.dragable", NULL},
+     {"collections.group.parts.part.description.dragable.x", NULL},
+     {"collections.group.parts.part.description.dragable.y", NULL},
+     {"collections.group.parts.part.description.dragable.confine", NULL},
+     {"collections.group.programs", NULL},
+     {"collections.group.programs.program", NULL}
 };
 
 New_Statement_Handler statement_handlers[] =
 {
-     {"images.image", st_images_image}
+     {"images.image", st_images_image},
+     {"collections.group.name", NULL},
+     {"collections.group.parts.part.name", NULL},
+     {"collections.group.parts.part.type", NULL},
+     {"collections.group.parts.part.mouse_events", NULL},
+     {"collections.group.parts.part.color_class", NULL},
+     {"collections.group.parts.part.description.state", NULL},
+     {"collections.group.parts.part.description.visible", NULL},
+     {"collections.group.parts.part.description.dragable.x", NULL},
+     {"collections.group.parts.part.description.dragable.y", NULL},
+     {"collections.group.parts.part.description.dragable.confine", NULL}
 };
 
 /*****/
@@ -127,4 +157,9 @@
                progname, file_in, line);
        exit(-1);
      }
+}
+
+static void
+ob_collections(void)
+{
 }
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/bin/edje_cc_parse.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- edje_cc_parse.c     11 Jun 2003 13:20:48 -0000      1.1
+++ edje_cc_parse.c     11 Jun 2003 14:14:23 -0000      1.2
@@ -17,16 +17,27 @@
 {
    char *id;
    int i;
+   int handled = 0;
    
    id = stack_id();
-//   printf("+++: %s\n", id);
    for (i = 0; i < object_handler_num(); i++)
      {
        if (!strcmp(object_handlers[i].type, id))
          {
-            if (object_handlers[i].func) object_handlers[i].func();
+            handled = 1;
+            if (object_handlers[i].func)
+              {
+                 object_handlers[i].func();
+              }
+            break;
          }
      }
+   if (!handled)
+     {
+       fprintf(stderr, "%s: Error. %s:%i unhandled keyword %s\n",
+               progname, file_in, line, evas_list_data(evas_list_last(stack)));
+       exit(-1);
+     }
    free(id);
 }
 
@@ -35,21 +46,27 @@
 {
    char *id;
    int i;
+   int handled = 0;
    
    id = stack_id();
-// {   
-//   Evas_List *l;
-//   printf("===: %s", id);
-//   for (l = params; l; l = l->next) printf(" [%s]", l->data);
-//   printf("\n");
-// }
    for (i = 0; i < statement_handler_num(); i++)
      {
        if (!strcmp(statement_handlers[i].type, id))
          {
-            if (statement_handlers[i].func) statement_handlers[i].func();
+            handled = 1;
+            if (statement_handlers[i].func)
+              {
+                 statement_handlers[i].func();
+              }
+            break;
          }
-     }   
+     }
+   if (!handled)
+     {
+       fprintf(stderr, "%s: Error. %s:%i unhandled keyword %s\n",
+               progname, file_in, line, evas_list_data(evas_list_last(stack)));
+       exit(-1);
+     }
    free(id);
 }
 
@@ -141,6 +158,7 @@
                         {
                            in_tok = 0;
                            tok_end = p - 1;
+                           if (*p == '\n') line--;
                            goto done;
                         }
                    }




-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to