Fix for pr1833776.
[iverilog.git] / parse_misc.cc
blob60bd8b02e2a4175a979a511eb0234ea95a56d48f
1 /*
2 * Copyright (c) 1998-1999 Stephen Williams (steve@icarus.com)
4 * This source code is free software; you can redistribute it
5 * and/or modify it in source code form under the terms of the GNU
6 * General Public License as published by the Free Software
7 * Foundation; either version 2 of the License, or (at your option)
8 * any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 #ifdef HAVE_CVS_IDENT
20 #ident "$Id: parse_misc.cc,v 1.7 2002/08/12 01:35:00 steve Exp $"
21 #endif
23 # include "config.h"
25 # include "parse_misc.h"
26 # include <iostream>
28 extern const char*vl_file;
29 unsigned error_count = 0;
30 unsigned warn_count = 0;
31 unsigned long based_size = 0;
33 void VLerror(const char*msg)
35 error_count += 1;
36 cerr << yylloc.text << ":" << yylloc.first_line << ": " << msg << endl;
39 void VLerror(const YYLTYPE&loc, const char*msg)
41 error_count += 1;
42 if (loc.text)
43 cerr << loc.text << ":";
45 cerr << loc.first_line << ": " << msg << endl;
46 based_size = 0; /* Clear the base information if we have an error. */
49 void yywarn(const YYLTYPE&loc, const char*msg)
51 warn_count += 1;
52 if (loc.text)
53 cerr << loc.text << ":";
55 cerr << loc.first_line << ": warning: " << msg << endl;
58 int VLwrap()
60 return -1;