Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | mjames | 1 | %{ |
2 | /* |
||
3 | * $Header: C:/cvsroot/Vert03/mentor_src/mentor_lex.l,v 1.2 2004/06/22 21:44:12 mjames Exp $ |
||
4 | * |
||
5 | * $Log: mentor_lex.l,v $ |
||
6 | * Revision 1.2 2004/06/22 21:44:12 mjames |
||
7 | * Firrst build most files |
||
8 | * |
||
9 | * Revision 1.3 2002/10/02 19:37:28 MJAMES |
||
10 | * Moved dummy functions to a separate support file. |
||
11 | * |
||
12 | * Used correct number of arguments to define_pin |
||
13 | * |
||
14 | * Revision 1.2 2002/09/18 09:18:37 mjames |
||
15 | * Added dummy function to make code link to create final application |
||
16 | * |
||
17 | * Revision 1.1 2002/08/14 12:13:02 mjames |
||
18 | * Mentor Board Station reader modified to work with latest .nets file format |
||
19 | * |
||
20 | * Revision 1.1 2002/04/04 14:53:06 mjames |
||
21 | * Added mentor board station reader to the portfolio |
||
22 | * |
||
23 | * Revision 1.4 2001/12/13 22:21:36 mjames |
||
24 | * Using #ident with header to identify file |
||
25 | * |
||
26 | * Added dummy function to satisfy linker needs for read command |
||
27 | * |
||
28 | * Revision 1.3 2001/10/31 22:20:08 mjames |
||
29 | * Tidying up problematical comments caused by CVS |
||
30 | * 'intelligent' comment guessing |
||
31 | * |
||
32 | * Revision 1.2 2001/06/06 12:10:20 mjames |
||
33 | * Move from HPUX |
||
34 | * |
||
35 | * Revision 1.1 2001/02/12 10:51:29 mjames |
||
36 | * Inserted new correct version number in vertcl_main.c |
||
37 | * |
||
38 | * Added lex files to the list. |
||
39 | * |
||
40 | * Revision 1.22 2000/10/04 10:37:07 10:37:07 mjames (Mike James) |
||
41 | * Part of Release PSAVAT01 |
||
42 | * |
||
43 | * Revision 1.21 2000/10/02 11:04:16 11:04:16 mjames (Mike James) |
||
44 | * new_vhdl |
||
45 | * |
||
46 | * Revision 1.20 2000/09/27 14:42:16 14:42:16 mjames (Mike James) |
||
47 | * Part of Release Sep_27_ST_2000 |
||
48 | * |
||
49 | * Revision 1.19 2000/09/21 10:15:46 10:15:46 mjames (Mike James) |
||
50 | * Part of Release Sep21Alpha |
||
51 | * |
||
52 | * Revision 1.18 2000/08/25 09:57:13 09:57:13 mjames (Mike James) |
||
53 | * Part of Release Aug25_alpha |
||
54 | * |
||
55 | * Revision 1.17 2000/08/16 08:57:29 08:57:29 mjames (Mike James) |
||
56 | * Part of Release CD01_Aug2000 |
||
57 | * |
||
58 | * Revision 1.16 2000/08/14 14:45:10 14:45:10 mjames (Mike James) |
||
59 | * Part of Release Aug_14_2000 |
||
60 | * |
||
61 | * Revision 1.15 2000/08/11 08:30:31 08:30:31 mjames (Mike James) |
||
62 | * Part of Release Aug_11_2000 |
||
63 | * |
||
64 | * Revision 1.14 2000/08/09 10:31:45 10:31:45 mjames (Mike James) |
||
65 | * Part of Release Aug__9_2000 |
||
66 | * |
||
67 | * Revision 1.13 2000/05/31 11:42:55 11:42:55 mjames (Mike James) |
||
68 | * Part of Release May_31_2000 |
||
69 | * |
||
70 | * Revision 1.12 2000/05/08 17:01:36 17:01:36 mjames (Mike James) |
||
71 | * Part of Release May__8_2000 |
||
72 | * |
||
73 | * Revision 1.11 2000/05/08 16:59:29 16:59:29 mjames (Mike James) |
||
74 | * Part of Release May__8_2000 |
||
75 | * |
||
76 | * Revision 1.10 2000/05/08 16:57:06 16:57:06 mjames (Mike James) |
||
77 | * Part of Release May__8_2000 |
||
78 | * |
||
79 | * Revision 1.9 2000/03/08 16:19:17 16:19:17 mjames (Mike James) |
||
80 | * New version including PC |
||
81 | * |
||
82 | * Revision 1.6 2000/01/20 15:58:46 15:58:46 mjames (Mike James) |
||
83 | * Part of Release R22 |
||
84 | * |
||
85 | * Revision 1.5 99/12/22 11:15:26 11:15:26 mjames (Mike James) |
||
86 | * Part of Release Dec_22_1999 |
||
87 | * |
||
88 | * Revision 1.4 99/06/25 14:35:43 14:35:43 mjames (Mike James) |
||
89 | * Added in reference to expression.h, but no changes made |
||
90 | * to the function of acfread yet. |
||
91 | * |
||
92 | * Revision 1.3 98/02/11 11:26:42 11:26:42 mjames (Mike James) |
||
93 | * Checked in for version 6.2a |
||
94 | * |
||
95 | * Revision 1.2 97/04/23 08:45:04 08:45:04 mjames (Mike James) |
||
96 | * CHecked in for release rel23041997 |
||
97 | * |
||
98 | * Revision 1.1 96/12/13 08:43:24 08:43:24 mjames (Mike James) |
||
99 | * Initial revision |
||
100 | * |
||
101 | * Revision 1.14 96/07/19 14:38:28 14:38:28 mjames (Mike James) |
||
102 | * Update to give to PRL |
||
103 | * |
||
104 | * Revision 1.13 1996/07/12 15:52:12 mjames |
||
105 | * Sorted out things like Alias and Jumpers |
||
106 | * Work Correctly |
||
107 | * Print COrrectly |
||
108 | * |
||
109 | * Revision 1.12 96/06/17 10:52:22 10:52:22 mjames (Mike James) |
||
110 | * Tidying up |
||
111 | * |
||
112 | * Revision 1.11 96/06/04 11:52:43 11:52:43 mjames (Mike James) |
||
113 | * Slight modifications |
||
114 | * |
||
115 | * Revision 1.10 96/04/26 16:03:54 16:03:54 mjames (Mike James) |
||
116 | * Set the limit on token length to be consistent with the rest of the code |
||
117 | * |
||
118 | * Revision 1.9 96/03/29 14:47:24 14:47:24 mjames (Mike James) |
||
119 | * Added VHDL netlist writing to the capabilities of ACFREAD |
||
120 | * |
||
121 | * Revision 1.8 96/03/18 13:51:30 13:51:30 mjames (Mike James) |
||
122 | * Real Revision 2.1 |
||
123 | * |
||
124 | * Revision 1.6 96/02/13 09:13:19 09:13:19 mjames (Mike James) |
||
125 | * Updated to be version 2.0 with net joining |
||
126 | * |
||
127 | * Revision 1.5 96/02/07 16:01:27 16:01:27 mjames (Mike James) |
||
128 | * Added correct RCS header |
||
129 | * |
||
130 | * Revision 1.4 96/02/07 15:50:32 15:50:32 mjames (Mike James) |
||
131 | * Added RCS ident message |
||
132 | * |
||
133 | * Revision 1.3 96/01/10 13:13:24 13:13:24 mjames (Mike James) |
||
134 | * Works in debug mode with EPLD listings and PCB layout |
||
135 | * |
||
136 | * Revision 1.2 96/01/08 15:23:44 15:23:44 mjames (Mike James) |
||
137 | * Managing to make sense of things now |
||
138 | * |
||
139 | * Revision 1.1 96/01/07 12:40:11 Mike_James |
||
140 | * Initial revision |
||
141 | * |
||
142 | * Revision 1.1 96/01/04 17:55:24 17:55:24 mjames (Mike James) |
||
143 | * Initial revision |
||
144 | * |
||
145 | * Revision 1.2 96/01/04 11:37:16 11:37:16 mjames (Mike James) |
||
146 | * Compete parsing of FIT and ACF with ignore of junk . |
||
147 | * |
||
148 | * Revision 1.1 96/01/04 10:18:25 10:18:25 mjames (Mike James) |
||
149 | * Initial revision |
||
150 | * |
||
151 | * */ |
||
152 | #include <stdio.h> |
||
153 | /* see makefile for why */ |
||
154 | #if defined HAS_LEX |
||
155 | #include "tcl_l.h" |
||
156 | #endif |
||
157 | #include "mentor_yacc.h" |
||
158 | #include "lx_support.h" |
||
159 | #include "expression.h" |
||
160 | #include "generic.h" |
||
161 | #include "database.h" |
||
162 | #define YYLMAX MAXIDLEN |
||
163 | |||
164 | #ident "@(#)$Header: C:/cvsroot/Vert03/mentor_src/mentor_lex.l,v 1.2 2004/06/22 21:44:12 mjames Exp $" |
||
165 | |||
166 | extern int yyval; |
||
167 | |||
168 | extern int lineno; |
||
169 | %} |
||
170 | |||
171 | L [A-Za-z0-9_\~] |
||
172 | |||
173 | L2 [A-Za-z0-9_\+\./\~\*\#|\(\)\$\:] |
||
174 | |||
175 | L3 [A-Za-z0-9_\-\+\./\~\*\#|\(\)\$\:] |
||
176 | |||
177 | |||
178 | Ct [ -\~] |
||
179 | |||
180 | Cm [^\n] |
||
181 | |||
182 | D [0-9] |
||
183 | Spc [ \r\t] |
||
184 | |||
185 | S [^\'] |
||
186 | Q [\'] |
||
187 | |||
188 | |||
189 | |||
190 | %x inquote in2quote escquote esc2quote nettype netquote net2quote |
||
191 | |||
192 | %% |
||
193 | ^"#"{Cm}*"\n" { lineno++; return(NL);/* Single line */ }; |
||
194 | |||
195 | "NET_TYPE" { free_strings(&lx_first,&lx_last); BEGIN(nettype); return (NET_TYPE); }; |
||
196 | "NET" { free_strings(&lx_first,&lx_last);return (NET); }; |
||
197 | |||
198 | <net2quote,netquote>"POWERS" { yylval.string = make_string(yytext,&lx_first,&lx_last);return (POWERS); /* all of these are power supply attributes */ }; |
||
199 | <net2quote,netquote>"HI-CURRENT" { yylval.string = make_string(yytext,&lx_first,&lx_last);return (POWERS); /* all of these are power supply attributes */ }; |
||
200 | <net2quote,netquote>"GROUND" { yylval.string = make_string(yytext,&lx_first,&lx_last);return (POWERS); /* all of these are power supply attributes */}; |
||
201 | <net2quote,netquote>"SUPPLY" { yylval.string = make_string(yytext,&lx_first,&lx_last);return (POWERS); /* all of these are power supply attributes */}; |
||
202 | <net2quote,netquote>"POWER" { yylval.string = make_string(yytext,&lx_first,&lx_last);return (POWERS); /* all of these are power supply attributes */}; |
||
203 | |||
204 | <INITIAL>"'/" { BEGIN(escquote);return (QUOTE);}; |
||
205 | <INITIAL>"\"/" { BEGIN(esc2quote);return (QUOTE);}; |
||
206 | |||
207 | |||
208 | <INITIAL>"'" { BEGIN(inquote);return (QUOTE);}; |
||
209 | <nettype>"'" { BEGIN(netquote);return (QUOTE);}; |
||
210 | |||
211 | <netquote,escquote,inquote>"'" { BEGIN(INITIAL) ;return (QUOTE);}; |
||
212 | |||
213 | <INITIAL>"\"" { BEGIN(in2quote);return (QUOTE);}; |
||
214 | <nettype>"\"" { BEGIN(net2quote);return (QUOTE);}; |
||
215 | |||
216 | <net2quote,esc2quote,in2quote>"\"" { BEGIN(INITIAL) ;return (QUOTE);}; |
||
217 | |||
218 | |||
219 | <INITIAL>{L}+ { yylval.string = make_string(yytext,&lx_first,&lx_last) ; /* do it anyway */ |
||
220 | return(ASTRING); }; |
||
221 | |||
222 | <netquote,net2quote,inquote,in2quote>{L2}({L2})* { yylval.string = make_string(yytext,&lx_first,&lx_last) ; /* do it anyway */ |
||
223 | return(ASTRING); }; |
||
224 | |||
225 | <escquote,esc2quote>{L3}* { yylval.string = make_string(yytext,&lx_first,&lx_last) ; /* do it anyway */ |
||
226 | return(ASTRING); }; |
||
227 | |||
228 | |||
229 | {Spc} { break; /* white space */ }; |
||
230 | |||
231 | <INITIAL,inquote,in2quote>"-" { return ('-'); }; |
||
232 | "(" { return ('('); }; |
||
233 | ")" { return (')'); }; |
||
234 | <INITIAL,nettype>"," { return (','); }; |
||
235 | |||
236 | |||
237 | "\n" { lineno++;return(NL); }; |
||
238 | |||
239 | |||
240 | $$ { return (ENDFILE); }; |
||
241 | %% |