commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnue/geas/src/classdef Makefile.am parse.y


From: Reinhard Mueller
Subject: gnue/geas/src/classdef Makefile.am parse.y
Date: Sat, 08 Sep 2001 02:11:55 -0700

CVSROOT:        /cvsroot/gnue
Module name:    gnue
Changes by:     Reinhard Mueller <address@hidden>       01/09/08 02:11:55

Modified files:
        geas/src/classdef: Makefile.am parse.y 

Log message:
        continued parser

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/geas/src/classdef/Makefile.am.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/geas/src/classdef/parse.y.diff?tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: gnue/geas/src/classdef/Makefile.am
diff -u gnue/geas/src/classdef/Makefile.am:1.1 
gnue/geas/src/classdef/Makefile.am:1.2
--- gnue/geas/src/classdef/Makefile.am:1.1      Thu Sep  6 11:33:41 2001
+++ gnue/geas/src/classdef/Makefile.am  Sat Sep  8 02:11:55 2001
@@ -1,4 +1,4 @@
-## $Id: Makefile.am,v 1.1 2001/09/06 18:33:41 reinhard Exp $
+## $Id: Makefile.am,v 1.2 2001/09/08 09:11:55 reinhard Exp $
 
 TESTS = test-parse
 
@@ -27,8 +27,8 @@
 
 # This is to work around a bug in automake 1.4. These files should be
 # maintainer-clean'ed by default.
-MAINTAINERCLEANFILES = lparser.c yparser.h yparser.c
+MAINTAINERCLEANFILES = scan.c parse.h parse.c
 # and this file should be in DIST_COMMON
-EXTRA_DIST = yparser.h
+EXTRA_DIST = parse.h
 # In automake 1.5 these bugs are fixed so these lines can be deleted as soon as
 # we use automake 1.5
Index: gnue/geas/src/classdef/parse.y
diff -u gnue/geas/src/classdef/parse.y:1.2 gnue/geas/src/classdef/parse.y:1.3
--- gnue/geas/src/classdef/parse.y:1.2  Thu Sep  6 14:18:16 2001
+++ gnue/geas/src/classdef/parse.y      Sat Sep  8 02:11:55 2001
@@ -19,7 +19,7 @@
    along with GEAS; if not, write to the Free Software Foundation, Inc.,
    59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-   $Id: parse.y,v 1.2 2001/09/06 21:18:16 reinhard Exp $
+   $Id: parse.y,v 1.3 2001/09/08 09:11:55 reinhard Exp $
 */
 
 %{
@@ -30,8 +30,8 @@
 
 #include "config.h"
 
-#include <stdlib.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #define G_LOG_DOMAIN "GEAS .gcd parser"
 #include <glib.h>
@@ -60,7 +60,7 @@
 
 static void     _new_module (const gchar *name, geas_cd_access access);
 static gboolean _new_class  (const gchar *name, geas_cd_access access);
-static gboolean _set_class  (geas_cd_class *clss);
+static void     _set_class  (geas_cd_class *clss);
 static gboolean _new_type   (const gchar *name, geas_cd_access access);
 static     void _new_field  (const gchar *name, gint format,
                              const gchar *fdefault, gint properties);
@@ -168,36 +168,25 @@
                                           gboolean result;
                                           result = _new_class ($3, $1);
                                           g_free ($3);
-                                          if (!result)
-                                            {
-                                              YYERROR;
-                                            }
+                                          if (!result) YYERROR;
                                         }
-            /* continued */ paropt
+            /* continued */ paropt      { /* TODO */ }
 ;
 
-extend:     EXTEND classref             {
-                                          if (!_set_class ($2))
-                                            {
-                                              YYERROR;
-                                            }
-                                        }
+extend:     EXTEND classref             { _set_class ($2) }
 ;
 
 type:       access TYPE SYMBOL          {
                                           gboolean result;
                                           result = _new_type ($3, $1);
                                           g_free ($3);
-                                          if (!result)
-                                            {
-                                              YYERROR;
-                                            }
+                                          if (!result) YYERROR;
                                         }
-            /* continued */ paropt
+            /* continued */ paropt      { /* TODO */ }
 ;
 
 paropt:     /* empty */                 { $$ = NULL; }
-  |         ':' parents                 { $$ = $2;   }
+  |         ':' parents                 { $$ = $2; }
 ;
 
 parents:    classref                    { $$ = g_list_append (NULL, $1); }
@@ -207,26 +196,31 @@
 moduleref:  SYMBOL                      {
                                           $$ = _find_module ($1);
                                           g_free ($1);
+                                          if (!$$) YYERROR;
                                         }
 ;
 
 classref:   SYMBOL                      {
                                           $$ = _find_class (NULL, $1);
                                           g_free ($1);
+                                          if (!$$) YYERROR;
                                         }
   |         moduleref ':' ':' SYMBOL    {
                                           $$ = _find_class ($1, $4);
                                           g_free ($4);
+                                          if (!$$) YYERROR;
                                         }
 ;
 
 typeref:    SYMBOL                      {
                                           $$ = _find_type (NULL, $1);
                                           g_free ($1);
+                                          if (!$$) YYERROR;
                                         }
   |         moduleref ':' ':' SYMBOL    {
                                           $$ = _find_type ($1, $4);
                                           g_free ($4);
+                                          if (!$$) YYERROR;
                                         }
 ;
 
@@ -265,6 +259,9 @@
 
 field:      SYMBOL format fdefault properties
                                         {
+                                          /* TODO: process every part of the
+                                             fielddef as soon as it's read to
+                                             enable better error messages */
                                           _new_field ($1, $2, $3, $4);
                                           g_free ($1);
                                           g_free ($3);
@@ -292,14 +289,14 @@
  * Methods
 \* ------------------------------------------------------------------------- */
 
-method:     SYMBOL '(' arguments ')'    { }
+method:     SYMBOL '(' arguments ')'    { /* TODO */ }
 ;
 
-arguments:  /* */                       { }
-  |         arguments ',' argument      { }
+arguments:  /* */                       { /* TODO */ }
+  |         arguments ',' argument      { /* TODO */ }
 ;
 
-argument:   datatype SYMBOL             { }
+argument:   datatype SYMBOL             { /* TODO */ }
 ;
 
 /* ------------------------------------------------------------------------- *\
@@ -307,19 +304,19 @@
 \* ------------------------------------------------------------------------- */
 
 index:      unique INDEX '(' ixfields ')'
-                                        { ($1) }
+                                        { /* TODO */ }
 ;
 
 unique:     /* */                       { $$ = FALSE; }
   |         UNIQUE                      { $$ = TRUE;  }
 ;
 
-ixfields:   SYMBOL                      { g_free ($1); }
-  |         ixfields ',' SYMBOL         { g_free ($3); }
+ixfields:   SYMBOL                      { g_free ($1); /* TODO */ }
+  |         ixfields ',' SYMBOL         { g_free ($3); /* TODO */ }
 ;
 
 
-orderby:    ORDER BY SYMBOL desc
+orderby:    ORDER BY SYMBOL desc        { /* TODO */ }
 ;
 
 desc:       /* */                       { $$ = FALSE; }
@@ -425,11 +422,10 @@
 /* ------------------------------------------------------------------------- *\
  * Set the current class
 \* ------------------------------------------------------------------------- */
-static gboolean
+static void
 _set_class (geas_cd_class *clss)
 {
   _current_class = clss;
-  return (TRUE);
 }
 
 /* ------------------------------------------------------------------------- *\
@@ -438,6 +434,7 @@
 static gboolean
 _new_type (const gchar *name, geas_cd_access access)
 {
+  /* TODO */
   g_message ("Found new type '%s'", name);
   return (TRUE);
 }
@@ -449,6 +446,7 @@
 _new_field (const gchar *name, gint format, const gchar *fdefault,
             gint properties)
 {
+  /* TODO */
   g_message ("Found new field '%s'", name);
 }
 
@@ -458,6 +456,7 @@
 static geas_cd_module *
 _find_module (const gchar *name)
 {
+  /* TODO */
   g_message ("Needs module '%s'", name);
   return (NULL);
 }
@@ -468,6 +467,7 @@
 static geas_cd_class *
 _find_class (geas_cd_module *module, const gchar *name)
 {
+  /* TODO */
   g_message ("Needs class '%s'", name);
   return (NULL);
 }
@@ -478,6 +478,7 @@
 static geas_cd_type *
 _find_type (geas_cd_module *module, const gchar *name)
 {
+  /* TODO */
   g_message ("Needs type '%s'", name);
   return (NULL);
 }
@@ -488,6 +489,7 @@
 static void
 _set_type_type (geas_cd_type *type)
 {
+/* TODO */
 }
 
 /* ------------------------------------------------------------------------- *\
@@ -496,6 +498,7 @@
 static void
 _set_type_ref  (geas_cd_class *clss)
 {
+/* TODO */
 }
 
 /* ------------------------------------------------------------------------- *\
@@ -504,4 +507,5 @@
 static void
 _set_type_list (geas_cd_class *clss)
 {
+/* TODO */
 }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]