Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 99 lines (86 sloc) 3.061 kB
3fb7a05 Introduce verilog to CVS.
steve authored
1 #ifndef __parse_misc_H
2 #define __parse_misc_H
3 /*
636758f @caryr Add support for `celldefine, vpiCellInstance
caryr authored
4 * Copyright (c) 1998-2009 Stephen Williams (steve@icarus.com)
3fb7a05 Introduce verilog to CVS.
steve authored
5 *
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.
11 *
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.
16 *
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
20 */
21
22 # include <list>
ce9fd01 @steveicarus Detect and warn about anachronistic use of begin/end in generate.
authored
23 # include <ostream>
5b27317 @steveicarus Parse disciplines and contribution statements
authored
24 # include "compiler.h"
3fb7a05 Introduce verilog to CVS.
steve authored
25 # include "pform.h"
26
27 /*
28 * The vlltype supports the passing of detailed source file location
29 * information between the lexical analyzer and the parser. Defining
30 * YYLTYPE compels the lexor to use this type and not something other.
31 */
32 struct vlltype {
33 unsigned first_line;
34 unsigned first_column;
35 unsigned last_line;
36 unsigned last_column;
37 const char*text;
38 };
1507dcd More C-like use of vlltype.
steve authored
39 # define YYLTYPE struct vlltype
7ad66b0 Support old/new bison yylloc.
steve authored
40
5b27317 @steveicarus Parse disciplines and contribution statements
authored
41 class LineInfo;
42 inline void FILE_NAME(LineInfo*tmp, const struct vlltype&where)
43 {
44 tmp->set_lineno(where.first_line);
45 tmp->set_file(filename_strings.make(where.text));
46 }
47
7ad66b0 Support old/new bison yylloc.
steve authored
48 /* This for compatibility with new and older bison versions. */
49 #ifndef yylloc
50 # define yylloc VLlloc
51 #endif
3fb7a05 Introduce verilog to CVS.
steve authored
52 extern YYLTYPE yylloc;
53
54 /*
55 * Interface into the lexical analyzer. ...
56 */
57 extern int VLlex();
58 extern void VLerror(const char*msg);
59 extern void VLerror(const YYLTYPE&loc, const char*msg);
60 #define yywarn VLwarn
61 extern void VLwarn(const YYLTYPE&loc, const char*msg);
62
d98c925 @caryr Some compiler cleanup and minor memory leak fixes.
caryr authored
63 extern void destroy_lexor();
64
ce9fd01 @steveicarus Detect and warn about anachronistic use of begin/end in generate.
authored
65 extern ostream& operator << (ostream&, const YYLTYPE&loc);
66
b118634 Handle procedural conditional, and some
steve authored
67 extern unsigned error_count, warn_count;
676695c @caryr Check for extra digits in sized binary, octal and hex constants.
caryr authored
68 extern unsigned long based_size;
3fb7a05 Introduce verilog to CVS.
steve authored
69
636758f @caryr Add support for `celldefine, vpiCellInstance
caryr authored
70 extern bool in_celldefine;
d06f6df @caryr Add support for unconnected_drive.
caryr authored
71 enum UCDriveType { UCD_NONE, UCD_PULL0, UCD_PULL1 };
72 extern UCDriveType uc_drive;
9dce649 @caryr Fix up original SV timeunit/timeprecision patch.
caryr authored
73 /*
74 * Flags to control if we are declaring or checking a timeunit or
75 * timeprecision statement.
76 */
77 extern bool have_timeunit_decl;
78 extern bool have_timeprec_decl;
636758f @caryr Add support for `celldefine, vpiCellInstance
caryr authored
79
7b102b1 @steveicarus Add function to define parameter from command line
authored
80 /*
42b3e6f @steveicarus Implement simple typedefs, and parse type identifiers.
authored
81 * Test if this identifier is a type identifier in the current
82 * context. The pform code needs to help the lexor here because the
83 * parser detects typedefs and marks the typedef'ed identifiers as
84 * type names.
85 */
86 extern bool pform_test_type_identifier(const char*txt);
87
88 /*
ec49f10 @steveicarus Revert bad merge from vhdl branch
authored
89 * Export these functions because we have to generate PENumber class
7b102b1 @steveicarus Add function to define parameter from command line
authored
90 * in pform.cc for user defparam definition from command file.
91 */
92 extern verinum*make_unsized_dec(const char*txt);
93 extern verinum*make_undef_highz_dec(const char*txt);
94 extern verinum*make_unsized_binary(const char*txt);
95 extern verinum*make_unsized_octal(const char*txt);
96 extern verinum*make_unsized_hex(const char*txt);
97
3fb7a05 Introduce verilog to CVS.
steve authored
98 #endif
Something went wrong with that request. Please try again.