/*
- * 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.
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;
-
}
-/*
- * parser.h: 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.
- */
-
#ifndef PARSER_H
#define PARSER_H