Add -D to iverilog-vpi and update documentation.
[iverilog.git] / LineInfo.h
blobdb0bd62b5a762e6d3aeea4ceaba2092df0fcaafb
1 #ifndef __LineInfo_H
2 #define __LineInfo_H
3 /*
4 * Copyright (c) 1999 Stephen Williams (steve@icarus.com)
6 * This source code is free software; you can redistribute it
7 * and/or modify it in source code form under the terms of the GNU
8 * General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
10 * any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 #ifdef HAVE_CVS_IDENT
22 #ident "$Id: LineInfo.h,v 1.8 2005/06/14 19:13:43 steve Exp $"
23 #endif
25 # include <string>
27 using namespace std;
30 * This class holds line information for an internal object.
32 * Note that the file names are C-style strings that are allocated by
33 * the lexor (which parses the line directives) and are never
34 * deallocated. We can therefore safely store the pointer and never
35 * delete the string, even if LineInfo objects are destroyed.
38 class LineInfo {
39 public:
40 LineInfo();
41 ~LineInfo();
43 string get_line() const;
45 void set_line(const LineInfo&that);
47 void set_file(const char*f);
48 void set_lineno(unsigned n);
50 private:
51 const char* file_;
52 unsigned lineno_;
56 * $Log: LineInfo.h,v $
57 * Revision 1.8 2005/06/14 19:13:43 steve
58 * gcc3/4 compile errors.
60 * Revision 1.7 2003/01/17 05:49:03 steve
61 * Use stringstream in place of sprintf.
63 * Revision 1.6 2002/08/12 01:34:58 steve
64 * conditional ident string using autoconfig.
66 * Revision 1.5 2000/11/30 17:31:42 steve
67 * Change LineInfo to store const C strings.
69 * Revision 1.4 2000/02/23 02:56:53 steve
70 * Macintosh compilers do not support ident.
72 * Revision 1.3 1999/02/15 02:06:15 steve
73 * Elaborate gate ranges.
75 #endif