Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 102 lines (88 sloc) 3.192 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;
c7366e6 @steveicarus Rework port input and inout to use data_type_or_implicit rule for types.
authored
38 std::string get_fileline() const;
3fb7a05 Introduce verilog to CVS.
steve authored
39 };
1507dcd More C-like use of vlltype.
steve authored
40 # define YYLTYPE struct vlltype
7ad66b0 Support old/new bison yylloc.
steve authored
41
5b27317 @steveicarus Parse disciplines and contribution statements
authored
42 class LineInfo;
43 inline void FILE_NAME(LineInfo*tmp, const struct vlltype&where)
44 {
45 tmp->set_lineno(where.first_line);
46 tmp->set_file(filename_strings.make(where.text));
47 }
48
7ad66b0 Support old/new bison yylloc.
steve authored
49 /* This for compatibility with new and older bison versions. */
50 #ifndef yylloc
51 # define yylloc VLlloc
52 #endif
3fb7a05 Introduce verilog to CVS.
steve authored
53 extern YYLTYPE yylloc;
54
55 /*
56 * Interface into the lexical analyzer. ...
57 */
58 extern int VLlex();
59 extern void VLerror(const char*msg);
8456252 @steveicarus More class syntax
authored
60 extern void VLerror(const YYLTYPE&loc, const char*msg, ...) __attribute__((format(printf,2,3)));
3fb7a05 Introduce verilog to CVS.
steve authored
61 #define yywarn VLwarn
62 extern void VLwarn(const YYLTYPE&loc, const char*msg);
63
d98c925 @caryr Some compiler cleanup and minor memory leak fixes.
caryr authored
64 extern void destroy_lexor();
65
ce9fd01 @steveicarus Detect and warn about anachronistic use of begin/end in generate.
authored
66 extern ostream& operator << (ostream&, const YYLTYPE&loc);
67
b118634 Handle procedural conditional, and some
steve authored
68 extern unsigned error_count, warn_count;
676695c @caryr Check for extra digits in sized binary, octal and hex constants.
caryr authored
69 extern unsigned long based_size;
3fb7a05 Introduce verilog to CVS.
steve authored
70
636758f @caryr Add support for `celldefine, vpiCellInstance
caryr authored
71 extern bool in_celldefine;
d06f6df @caryr Add support for unconnected_drive.
caryr authored
72 enum UCDriveType { UCD_NONE, UCD_PULL0, UCD_PULL1 };
73 extern UCDriveType uc_drive;
9dce649 @caryr Fix up original SV timeunit/timeprecision patch.
caryr authored
74 /*
75 * Flags to control if we are declaring or checking a timeunit or
76 * timeprecision statement.
77 */
78 extern bool have_timeunit_decl;
79 extern bool have_timeprec_decl;
636758f @caryr Add support for `celldefine, vpiCellInstance
caryr authored
80
7b102b1 @steveicarus Add function to define parameter from command line
authored
81 /*
42b3e6f @steveicarus Implement simple typedefs, and parse type identifiers.
authored
82 * Test if this identifier is a type identifier in the current
83 * context. The pform code needs to help the lexor here because the
84 * parser detects typedefs and marks the typedef'ed identifiers as
85 * type names.
86 */
764b38b @steveicarus Use user defined types in the syntax.
authored
87 extern data_type_t* pform_test_type_identifier(const char*txt);
42b3e6f @steveicarus Implement simple typedefs, and parse type identifiers.
authored
88
89 /*
ec49f10 @steveicarus Revert bad merge from vhdl branch
authored
90 * Export these functions because we have to generate PENumber class
7b102b1 @steveicarus Add function to define parameter from command line
authored
91 * in pform.cc for user defparam definition from command file.
92 */
93 extern verinum*make_unsized_dec(const char*txt);
94 extern verinum*make_undef_highz_dec(const char*txt);
95 extern verinum*make_unsized_binary(const char*txt);
96 extern verinum*make_unsized_octal(const char*txt);
97 extern verinum*make_unsized_hex(const char*txt);
98
31d4aa9 @steveicarus Handle complexities of class name pre-declarations
authored
99 extern char* strdupnew(char const *str);
100
3fb7a05 Introduce verilog to CVS.
steve authored
101 #endif
Something went wrong with that request. Please try again.