parser update
[lttv.git] / ltt / branches / poly / ltt / parser.c
index 492f766724f9aaa38c5eb3be12194af3d6bbcb95..785cb652aaf2a47e7771024817649956274c6f28 100644 (file)
@@ -1,25 +1,24 @@
 /*
- * parser.c: Generate helper declarations and functions to trace events
- * from an event description file.
- *
- *    Copyright (C) 2005, Mathieu Desnoyers
- *    Copyright (C) 2002, Xianxiu Yang
- *    Copyright (C) 2002, Michel Dagenais 
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License Version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
+
+parser.c: Generate helper declarations and functions to trace events
+  from an event description file.
+
+           Copyright (C) 2005, Mathieu Desnoyers
+      Copyright (C) 2002, Xianxiu Yang
+      Copyright (C) 2002, Michel Dagenais 
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; version 2 of the License.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+*/
 
 /* This program reads the ".xml" event definitions input files 
    and constructs structure for each event.
@@ -339,22 +338,20 @@ char *getNameAttribute(parse_file_t *in)
   
   while(1) {
     token = getToken(in); 
-    if(strcmp("/",token) == 0 || strcmp(">",token) == 0){
-      ungetToken(in);
-      break;
-    }
-
     if(!strcmp("name",token)) {
       getEqual(in);
       car = seekNextChar(in);
       if(car == EOF) in->error(in,"name was expected");
       else if(car == '\"') name = allocAndCopy(getQuotedString(in));
       else name = allocAndCopy(getName(in));
+    } else {
+      ungetToken(in);
+      break;
     }
+
   }
   if(name == NULL) in->error(in, "Name was expected");
   return name;
-  
 }
 
 
This page took 0.023947 seconds and 4 git commands to generate.