Qucs-core  0.0.18
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
scan_spice.l
Go to the documentation of this file.
1 /* -*-c-*- */
2 
3 %{
4 /*
5  * scan_spice.l - scanner for a Spice netlist
6  *
7  * Copyright (C) 2004-2009 Stefan Jahn <stefan@lkcc.org>
8  *
9  * This is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2, or (at your option)
12  * any later version.
13  *
14  * This software is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this package; see the file COPYING. If not, write to
21  * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
22  * Boston, MA 02110-1301, USA.
23  *
24  * $Id$
25  *
26  */
27 
28 #if HAVE_CONFIG_H
29 # include <config.h>
30 #endif
31 
32 #include <stdio.h>
33 #include <stdlib.h>
34 #include <string.h>
35 #include <ctype.h>
36 
37 #ifdef __MINGW32__
38 #include <io.h>
39 #endif
40 
41 #ifdef HAVE_UNISTD_H
42 #include <unistd.h>
43 #endif
44 
45 #include "check_spice.h"
46 #include "tokens_spice.h"
47 
48 #if !HAVE_STRCHR
49 # define strchr index
50 # define strrchr rindex
51 #endif
52 
53 /* fixing invalid identifiers */
54 static void spice_fix_identifier (char * ident) {
55  char * p;
56  for (p = ident; *p != '\0'; p++)
57  switch (*p) {
58  case '+': *p = 'P'; break;
59  case '-': *p = 'N'; break;
60  case '/': *p = '_'; break;
61  }
62 }
63 
64 %}
65 
66 WS [ \t\n\r]
67 TITLE [* \t0-9A-Za-z][A-Za-z0-9\- \t;#:=()/\.,*\\]*\r*\n
68 SPACE [ \t]
69 NAME [A-Z][A-Z0-9]*
70 IDENT [A-Za-z_][A-Za-z0-9_\-/]*
71 IDENT2 [A-Za-z0-9_][A-Za-z0-9_\-/]*
72 FILE [/A-Za-z0-9_][/\\:A-Za-z0-9_\.]*
73 DIGIT [0-9]
74 EXPONENT [Ee][+-]?{DIGIT}+
75 INT [+-]?{DIGIT}+
76 FLOAT1 [+-]?{DIGIT}+{EXPONENT}
77 FLOAT2 [+-]?{DIGIT}*"."{DIGIT}+({EXPONENT})?
78 FLOAT3 [+-]?{DIGIT}+"."
79 NUMBER ({INT}|{FLOAT1}|{FLOAT2}|{FLOAT3}){SFX}?{UNIT}?
80 SFX ([tT]|[gG]|[mM]|[kK]|[uU]|[nN]|[pP]|[fF]|[mM][iI][lL]|[mM][eE][gG])
81 UNIT ([sS]|[vV]|[aA]|[oO][hH][mM]|[mM][hH][oO]|[fF]|[hH])
82 NODE ([A-Za-z0-9_#\+-]+|[\+]|[-])
83 EOL \r*\n
84 CSFX [A-Za-z0-9_]*
85 
86  /* Source functions */
87 FUN1 ([dD][eE][cC]|[lL][iI][nN]|[oO][cC][tT]|[dD][cC]|[aA][cC])
88 FUN2 ([sS][iI][nN]|[pP][uU][lL][sS][eE]|[pP][wW][lL]|[eE][xX][pP])
89 FUN3 ([dD][iI][sS][tT][oO][fF][12])
90 FUNCTION ({FUN1}|{FUN2}|{FUN3})
91 
92  /* Device Models */
93 MODEL1 ([rR]|[cC]|[sS][wW]|[cC][sS][wW]|[uU][rR][cC]|[lL][tT][rR][aA])
94 MODEL2 ([dD]|[nN][pP][nN]|[pP][nN][pP]|[nN][jJ][fF]|[pP][jJ][fF])
95 MODEL3 ([nN][mM][oO][sS]|[pP][mM][oO][sS]|[nN][mM][fF]|[pP][mM][fF])
96 MODEL4 ([rR][eE][sS]|[vV][sS][wW][iI][tT][cC][hH])
97 MODEL ({MODEL1}|{MODEL2}|{MODEL3}|{MODEL4})
98 
99  /* Voltage derivatives */
100 VFUN ([vV]|[vV][rR]|[vV][iI]|[vV][mM]|[vV][pP]|[vV][dD][bB])
101 
102  /* Options specials */
103 OPT1 ([aA][cC][cC][tT]|[lL][iI][sS][tT]|[nN][oO][mM][oO][dD])
104 OPT2 ([nN][oO][pP][aA][gG][eE]|[nN][oO][dD][eE]|[oO][pP][tT][sS])
105 OPT3 ([tT][rR][yY][tT][oO][cC][oO][mM][pP][aA][cC][tT])
106 OPT4 ([kK][eE][eE][pP][oO][pP][iI][nN][fF][oO]|[bB][aA][dD][mM][oO][sS]3)
107 OPT5 ([pP][oO][sS][tT]|[tT][rR][aA][nN][sS])
108 OPTS ({OPT1}|{OPT2}|{OPT3}|{OPT4}|{OPT5})
109 
110  /* Model specific properties */
111 MOD1 ([nN][oO][cC][oO][nN][tT][rR][oO][lL])
112 MOD2 ([sS][tT][eT][pP][lL][iI][mM][iI][tT])
113 MOD3 ([qQ][uU][aA][dD][iI][nN][tT][eE][rR][pP])
114 MOD4 ([nN][oO][pP][rR][iI][nN][tT])
115 MODS ({MOD1}|{MOD2}|{MOD3}|{MOD4})
116 
117  /* Plot/Print specific identifiers */
118 SIM1 ([aA][cC]|[dD][cC]|[tT][rR][aA][nN]|[nN][oO][iI][sS][eE])
119 SIM2 ([dD][iI][sS][tT][oO]|[pP][zZ])
120 SIMS ({SIM1}|{SIM2})
121 
122  /* MOS specific device properties */
123 MOS1 ([lL]|[wW]|[aA][dDsS]|[pP][dDsS]|[nN][rR][dDsS]|[dD][eE][bB][uU][gG])
124 MOS2 ([rR][gG][eE][oO][mM][oO][dD]|[tT][sSdD]|[mM])
125 MOS ({MOS1}|{MOS2})
126 
127  /* analog behavioural */
128 TABLE [tT][aA][bB][lL][eE]
129 VALUE [vV][aA][lL][uU][eE]
130 FREQ [fF][rR][eE][qQ]
131 LAPLACE [lL][aA][pP][lL][aA][cC][eE]
132 POLY [pP][oO][lL][yY]
133 
134 %x COMMENT IVREF DEVPROP LREF MODREF1 MODREF2 IGNORE FUNREF FILEREF VREF
135 %x STARTUP VSINGLE ISWITCH VSWITCH CONTROL GEVALS INLINE SUBCKT TLPROP RLCPROP
136 %x FHVALS
137 %option yylineno noyywrap nounput prefix="spice_"
138 
139 %%
140 
141 <INITIAL>^{TITLE} { /* detect initial title lines */
142  spice_lval.str = strdup (spice_text);
143  BEGIN(STARTUP);
144  return TitleLine;
145 }
146 
147 <STARTUP,INITIAL>^{SPACE}+ { /* Spice3 ignores any lines starting spaces */
148  BEGIN(COMMENT);
149  }
150 
151 <STARTUP,INITIAL>^"*" { /* ignored region begins here */
152  BEGIN(COMMENT);
153  }
154 
155 <STARTUP,INITIAL,IVREF,DEVPROP,LREF,MODREF1,MODREF2,IGNORE,FUNREF,
156  FILEREF,VREF,VSINGLE,ISWITCH,VSWITCH,CONTROL,GEVALS,INLINE,SUBCKT,
157  TLPROP,RLCPROP,FHVALS>[\*\$] {
158  /* ignored inline region begins here (3f5, 2g6 and hspice) */
159  BEGIN(INLINE);
160  }
161 
162 <STARTUP,INITIAL>^"."[cC][oO][nN][tT][rR][oO][lL] {
163  /* control (interactive) region start */
164  BEGIN(CONTROL);
165 }
166 
167 <CONTROL>. { /* skip any character in here */ }
168 <CONTROL>{EOL} { /* skip any character in here */ }
169 
170 <CONTROL>^"."[eE][nN][dD][cC] {
171  BEGIN(STARTUP);
172 }
173 
174 <STARTUP,INITIAL>\x1a {
175  /* skip EOF character */
176 }
177 
178 <STARTUP,INITIAL>^"."[sS][uU][bB][cC][kK][tT] {
179  /* subcircuit definition start */
180  spice_lval.ident = strdup (&spice_text[1]);
181  BEGIN(SUBCKT);
182  return SUBCKT_Action;
183 }
184 
185 <STARTUP>^"."[eE][nN][dD][sS] { /* subcircuit definition end */
186  BEGIN(SUBCKT);
187  return ENDS_Action;
188 }
189 
190 <STARTUP,INITIAL>^[rRlLcC]{CSFX} { /* R, L and C instances */
191  spice_lval.ident = strdup (spice_text);
192  BEGIN(RLCPROP);
193  return RLC_Device;
194 }
195 
196 <STARTUP,INITIAL>^[kK]{CSFX} { /* Mutual inductor instances */
197  spice_lval.ident = strdup (spice_text);
198  BEGIN(LREF);
199  return K_Device;
200 }
201 
202 <STARTUP,INITIAL>^[iIvV]{CSFX} {
203  /* voltage and current source instances */
204  spice_lval.ident = strdup (spice_text);
205  BEGIN(FUNREF);
206  return IV_Source;
207 }
208 
209 <STARTUP,INITIAL>^[gGeE]{CSFX} {
210  /* voltage controlled source instances */
211  spice_lval.ident = strdup (spice_text);
212  BEGIN(GEVALS);
213  return GE_Source;
214 }
215 
216 <STARTUP,INITIAL>^[fFhH]{CSFX} {
217  /* current controlled source instances */
218  spice_lval.ident = strdup (spice_text);
219  BEGIN(FHVALS);
220  return FH_Source;
221 }
222 
223 <STARTUP,INITIAL>^[bB]{CSFX} {
224  /* non-linear dependent source instances */
225  spice_lval.ident = strdup (spice_text);
226  BEGIN(IGNORE);
227  return B_Source;
228 }
229 
230 <STARTUP,INITIAL>^[xX]{CSFX} { /* subcircuit instances */
231  spice_lval.ident = strdup (spice_text);
232  BEGIN(STARTUP);
233  return X_Device;
234 }
235 
236 <STARTUP,INITIAL>^[oO]{CSFX} { /* lossy transline */
237  spice_lval.ident = strdup (spice_text);
238  BEGIN(STARTUP);
239  return O_Device;
240 }
241 
242 <STARTUP,INITIAL>^[tT]{CSFX} { /* lossless transline */
243  spice_lval.ident = strdup (spice_text);
244  BEGIN(TLPROP);
245  return T_Device;
246 }
247 
248 <STARTUP,INITIAL>^[uU]{CSFX} { /* distributed lossy transline */
249  spice_lval.ident = strdup (spice_text);
250  BEGIN(STARTUP);
251  return U_Device;
252 }
253 
254 <STARTUP,INITIAL>^[sS]{CSFX} { /* voltage controlled switch */
255  spice_lval.ident = strdup (spice_text);
256  BEGIN(VSWITCH);
257  return S_Device;
258 }
259 
260 <STARTUP,INITIAL>^[wW]{CSFX} { /* current controlled switch */
261  spice_lval.ident = strdup (spice_text);
262  BEGIN(ISWITCH);
263  return W_Device;
264 }
265 
266 <STARTUP,INITIAL>^"."[mM][oO][dD][eE][lL] { /* device Model definitions */
267  spice_lval.ident = strdup (&spice_text[1]);
268  BEGIN(MODREF1);
269  return MODEL_Action;
270 }
271 
272 <STARTUP,INITIAL>^"."[tT][rR][aA][nN] { /* transient analysis */
273  spice_lval.ident = strdup (&spice_text[1]);
274  BEGIN(STARTUP);
275  return TRAN_Action;
276 }
277 
278 <STARTUP,INITIAL>^"."[pP][lL][oO][tT] { /* plotting action */
279  spice_lval.ident = strdup (&spice_text[1]);
280  BEGIN(IVREF);
281  return PLOT_Action;
282 }
283 
284 <STARTUP,INITIAL>^"."[aA][cC] { /* AC analysis */
285  spice_lval.ident = strdup (&spice_text[1]);
286  BEGIN(FUNREF);
287  return AC_Action;
288 }
289 
290 <STARTUP,INITIAL>^"."[dD][iI][sS][tT][oO] { /* distortion analysis */
291  spice_lval.ident = strdup (&spice_text[1]);
292  BEGIN(FUNREF);
293  return DISTO_Action;
294 }
295 
296 <STARTUP,INITIAL>^"."[nN][oO][dD][eE][sS][eE][tT] { /* nodeset functionality */
297  spice_lval.ident = strdup (&spice_text[1]);
298  BEGIN(VSINGLE);
299  return NODESET_Action;
300 }
301 
302 <STARTUP,INITIAL>^"."[iI][cC] { /* nodeset functionality */
303  spice_lval.ident = strdup (&spice_text[1]);
304  BEGIN(VSINGLE);
305  return NODESET_Action;
306 }
307 
308 <STARTUP,INITIAL>^"."[dD][cC] { /* DC analysis */
309  spice_lval.ident = strdup (&spice_text[1]);
310  BEGIN(IVREF);
311  return DC_Action;
312 }
313 
314 <STARTUP,INITIAL>^"."[oO][pP] { /* operating point analysis */
315  spice_lval.ident = strdup (&spice_text[1]);
316  BEGIN(STARTUP);
317  return OP_Action;
318 }
319 
320 <STARTUP,INITIAL>^"."[tT][eE][mM][pP] { /* temperature analysis (Spice 2g6) */
321  spice_lval.ident = strdup (&spice_text[1]);
322  BEGIN(STARTUP);
323  return TEMP_Action;
324 }
325 
326 <STARTUP,INITIAL>^"."[pP][rR][iI][nN][tT] { /* printing action */
327  spice_lval.ident = strdup (&spice_text[1]);
328  BEGIN(VREF);
329  return PRINT_Action;
330 }
331 
332 <STARTUP,INITIAL>^"."[oO][pP][tT][iI][oO][nN][sS] { /* general options */
333  spice_lval.ident = strdup (&spice_text[1]);
334  BEGIN(STARTUP);
335  return OPTIONS_Action;
336 }
337 
338 <STARTUP,INITIAL>^"."[oO][pP][tT] { /* general options (abbrev.) */
339  spice_lval.ident = strdup (&spice_text[1]);
340  BEGIN(STARTUP);
341  return OPTIONS_Action;
342 }
343 
344 <STARTUP,INITIAL>^"."[oO][pP][tT][iI][oO][nN] { /* general options (abbrev.) */
345  spice_lval.ident = strdup (&spice_text[1]);
346  BEGIN(STARTUP);
347  return OPTIONS_Action;
348 }
349 
350 <STARTUP,INITIAL>^"."[wW][iI][dD][tT][hH] { /* special width of ??? */
351  spice_lval.ident = strdup (&spice_text[1]);
352  BEGIN(STARTUP);
353  return WIDTH_Action;
354 }
355 
356 <STARTUP,INITIAL>^"."[nN][oO][iI][sS][eE] { /* noise analysis */
357  spice_lval.ident = strdup (&spice_text[1]);
358  BEGIN(IVREF);
359  return NOISE_Action;
360 }
361 
362 <STARTUP,INITIAL>^"."[iI][nN][cC][lL][uU][dD][eE] { /* file include */
363  spice_lval.ident = strdup (&spice_text[1]);
364  BEGIN(FILEREF);
365  return INCLUDE_Action;
366 }
367 
368 <STARTUP,INITIAL>^"."[pP][zZ] { /* pole-zero analysis */
369  spice_lval.ident = strdup (&spice_text[1]);
370  BEGIN(STARTUP);
371  return PZ_Action;
372 }
373 
374 <STARTUP,INITIAL>^"."[sS][aA][vV][eE] { /* save line */
375  spice_lval.ident = strdup (&spice_text[1]);
376  BEGIN(IGNORE);
377  return SAVE_Action;
378 }
379 
380 <STARTUP,INITIAL>^"."[sS][eE][nN][sS] { /* sensitivity analysis */
381  spice_lval.ident = strdup (&spice_text[1]);
382  BEGIN(IGNORE);
383  return SENS_Action;
384 }
385 
386 <STARTUP,INITIAL>^"."[tT][fF] { /* transfer function analysis */
387  spice_lval.ident = strdup (&spice_text[1]);
388  BEGIN(IGNORE);
389  return TF_Action;
390 }
391 
392 <STARTUP,INITIAL>^"."[fF][oO][uU][rR] { /* fourier analysis */
393  spice_lval.ident = strdup (&spice_text[1]);
394  BEGIN(IGNORE);
395  return FOUR_Action;
396 }
397 
398 <STARTUP>[cC][uU][rR]|[vV][oO][lL] { /* pole-zero specials */
399  spice_lval.ident = strdup (spice_text);
400  return CurVol;
401 }
402 
403 <STARTUP>[pP][oO][lL]|[zZ][eE][rR]|[pP][zZ] { /* other pole-zero specials */
404  spice_lval.ident = strdup (spice_text);
405  return PoleZero;
406 }
407 
408 <FILEREF>{FILE} { /* a file reference */
409  spice_lval.ident = strdup (spice_text);
410  return File;
411 }
412 
413 <IVREF,VREF>[aA][lL][lL] { /* a print special */
414  spice_lval.ident = strdup (spice_text);
415  return ALL_Special;
416 }
417 
418 <RLCPROP>[tT][cC] { /* a TC special */
419  spice_lval.ident = strdup (spice_text);
420  return TC_Special;
421 }
422 
423 <DEVPROP,VSWITCH,ISWITCH>[oO][fF][fF] { /* a device special */
424  spice_lval.ident = strdup (spice_text);
425  return OFF_Special;
426 }
427 
428 <VSWITCH,ISWITCH>[oO][nN] { /* a device special */
429  spice_lval.ident = strdup (spice_text);
430  return ON_Special;
431 }
432 
433 <TLPROP,DEVPROP>[iI][cC] { /* another device special */
434  spice_lval.ident = strdup (spice_text);
435  return IC_Special;
436 }
437 
438 <DEVPROP>[tT][eE][mM][pP] { /* another device special */
439  spice_lval.ident = strdup (spice_text);
440  return TEMP_Special;
441 }
442 
443 <DEVPROP>{MOS} { /* another device special */
444  spice_lval.ident = strdup (spice_text);
445  return MOS_Special;
446 }
447 
448 <IVREF,VREF>{VFUN} { /* voltage derivatives (plotting and printing) */
449  spice_lval.ident = strdup (spice_text);
450  return VoltFunc;
451 }
452 
453 <VSINGLE>[vV] { /* voltage derivatives (plotting and printing) */
454  spice_lval.ident = strdup (spice_text);
455  return VoltFunc;
456 }
457 
458 <STARTUP>{OPTS} { /* option specials */
459  spice_lval.ident = strdup (spice_text);
460  return Options;
461 }
462 
463 <STARTUP>{MODS} { /* Model specials */
464  spice_lval.ident = strdup (spice_text);
465  return ModelProps;
466 }
467 
468 <IVREF,VREF,ISWITCH,FHVALS>[vV]{CSFX} { /* voltage source references */
469  spice_lval.ident = strdup (spice_text);
470  return V_Source;
471 }
472 
473 <IVREF>[iI]{CSFX} { /* current source references */
474  spice_lval.ident = strdup (spice_text);
475  return I_Source;
476 }
477 
478 <IVREF,VREF>[iI] { /* I function (plotting and printing) */
479  spice_lval.ident = strdup (spice_text);
480  return CurrFunc;
481 }
482 
483 <IVREF,VREF>{SIMS} { /* print/plot specific identifiers */
484  spice_lval.ident = strdup (spice_text);
485  return SIM_Type;
486 }
487 
488 <LREF>[lL]{CSFX} { /* inductor references */
489  spice_lval.ident = strdup (spice_text);
490  return L_Device;
491 }
492 
493 <STARTUP>^[dD]{CSFX} { /* diode instances */
494  spice_lval.ident = strdup (spice_text);
495  BEGIN(DEVPROP);
496  return Diode_Device;
497 }
498 
499 <STARTUP>^[qQ]{CSFX} { /* BJT instances */
500  spice_lval.ident = strdup (spice_text);
501  BEGIN(DEVPROP);
502  return Bipolar_Device;
503 }
504 
505 <STARTUP>^[jJ]{CSFX} { /* JFET instances */
506  spice_lval.ident = strdup (spice_text);
507  BEGIN(DEVPROP);
508  return JFET_Device;
509 }
510 
511 <STARTUP>^[mM]{CSFX} { /* MOSFET instances */
512  spice_lval.ident = strdup (spice_text);
513  BEGIN(DEVPROP);
514  return MOSFET_Device;
515 }
516 
517 <STARTUP>^[zZ]{CSFX} { /* MESFET instances */
518  spice_lval.ident = strdup (spice_text);
519  BEGIN(DEVPROP);
520  return MESFET_Device;
521 }
522 
523 <STARTUP,INITIAL>"."[Ee][Nn][Dd]{SPACE}*{EOL}* { /* identify end of netlist */
524  return End;
525 }
526 
527 <STARTUP,IVREF,DEVPROP,LREF,FUNREF,VREF,VSINGLE,ISWITCH,VSWITCH,
528  GEVALS,TLPROP,RLCPROP,FHVALS>{DIGIT}+ {
529  /* identify node (containing digits) */
530  spice_lval.ident = strdup (spice_text);
531  return Digits;
532 }
533 
534 <STARTUP,IVREF,DEVPROP,LREF,FUNREF,VREF,VSINGLE,GEVALS,TLPROP,
535  RLCPROP,FHVALS>{NUMBER} {
536  /* identify float (any kind) */
537  spice_lval.ident = strdup (spice_text);
538  return Floats;
539 }
540 
541 <GEVALS,FHVALS,RLCPROP>{POLY} {
542  /* identify analog behaviour */
543  spice_lval.ident = strdup (spice_text);
544  return Behave;
545 }
546 
547 <GEVALS,FHVALS>{TABLE}|{VALUE}|{FREQ}|{LAPLACE} {
548  /* identify analog behaviour */
549  spice_lval.ident = strdup (spice_text);
550  BEGIN(IGNORE);
551  return Behave;
552 }
553 
554 <IVREF,FUNREF>{FUNCTION} { /* function specials (e.g. in sources) */
555  spice_lval.ident = strdup (spice_text);
556  return Function;
557 }
558 
559 <MODREF2>{MODEL} { /* Model specification specials */
560  spice_lval.ident = strdup (spice_text);
561  BEGIN(STARTUP);
562  return MODEL_Spec;
563 }
564 
565 <STARTUP,DEVPROP,MODREF2,ISWITCH,VSWITCH,
566  TLPROP,RLCPROP>{IDENT} { /* arbitrary identifier */
567  spice_lval.ident = strdup (spice_text);
568  spice_fix_identifier (spice_lval.ident);
569  return Identifier;
570 }
571 
572 <SUBCKT>{IDENT2} { /* arbitrary identifier */
573  spice_lval.ident = strdup (spice_text);
574  spice_fix_identifier (spice_lval.ident);
575  BEGIN(STARTUP);
576  return Identifier;
577 }
578 
579 <MODREF1>{IDENT2} { /* arbitrary identifier */
580  spice_lval.ident = strdup (spice_text);
581  spice_fix_identifier (spice_lval.ident);
582  BEGIN(MODREF2);
583  return Identifier;
584 }
585 
586 <IVREF,VREF>[vV]{CSFX}#[bB][rR][aA][nN][cC][hH] {
587  /* I function (plotting and printing) */
588  spice_lval.ident = strdup (spice_text);
589  return BranchFunc;
590 }
591 
592 <IVREF,VREF>@[a-zA-Z]{CSFX}\[[a-zA-Z]{CSFX}\] {
593  /* operating point (plotting and printing) */
594  spice_lval.ident = strdup (spice_text);
595  return OpFunc;
596 }
597 
598 <STARTUP,IVREF,DEVPROP,FUNREF,VREF,VSINGLE,ISWITCH,VSWITCH,GEVALS,
599  TLPROP,RLCPROP,FHVALS>{NODE} {
600  /* identify node */
601  spice_lval.ident = strdup (spice_text);
602  return Nodes;
603 }
604 
605 <STARTUP,IVREF,DEVPROP,LREF,IGNORE,FUNREF,FILEREF,VREF,VSINGLE,
606  ISWITCH,VSWITCH,GEVALS,SUBCKT,TLPROP,RLCPROP,FHVALS>{EOL} {
607  /* detect end of line */
608  BEGIN(STARTUP);
609  return Eol;
610 }
611 
612 <*>{SPACE}|{EOL}+\+|[()=,] {
613  /* skip spaces, '=', '(', ')', ',' and the leading '+' */
614 }
615 
616 <COMMENT>{EOL} { BEGIN(STARTUP); /* skipping ends here */ }
617 <COMMENT>. { /* skip any character in here */ }
618 <IGNORE>. { /* skip any character in here */ }
619 
620 <INLINE>{EOL} { BEGIN(STARTUP); return Eol; /* skipping ends here */ }
621 <INLINE>. { /* skip any character in here */ }
622 <*>. { /* skip any character in here */ }
623 
624 <*>. { /* any other character is invalid */
625  fprintf (stderr,
626  "line %d: syntax error, unrecognized character: `%s'\n",
627  spice_lineno, spice_text);
628  return InvalidCharacter;
629 }
630 
631 %%
#define INT(con)
Definition: evaluate.cpp:68
OFF_Special
Definition: parse_spice.y:729
BranchFunc
Definition: parse_spice.y:694
Identifier
Definition: parse_csv.y:87
t
Definition: parse_vcd.y:290
n
Definition: parse_citi.y:147
r
Definition: parse_mdl.y:515
ON_Special
Definition: parse_spice.y:726
RLC_Device Node Node Value MODEL_Ident PairList Eol
Definition: parse_spice.y:225
OpFunc
Definition: parse_spice.y:700
< INITIAL >< INITIAL >< INITIAL >< INITIAL > return InvalidCharacter
Definition: scan_netlist.l:698
x
Definition: parse_mdl.y:498
#define TABLE(x)
Definition: bondwire.cpp:65
name prefix
Definition: parse_spice.y:131
#define A(a)
Definition: eqndefined.cpp:72
int spice_lineno
Definition: parse_spice.y:40
vcd scopes ident
Definition: parse_vcd.y:124
#define Z0
Wave impedance in vacuum ( )
Definition: constants.h:53