8 static int spf_i, ripmod, outputeol=0 ;
14 //#devicename {alphanum}({hdiv}|{alphanum}|{vector})*
17 %x COMMENT DOT RIPITALL
26 alpha ({upper_alpha}|{lower_alpha})
27 alphanum ({alpha}|{num})
28 version {num}+(\.{num})+
30 number -?{num}+(\.({num}*))?
31 enumber -?{num}+(\.({num}*))?(e|E)[+|-]?{num}+
37 vector ({v0}|{v1}|{v2}|{v3}|{v4})
38 hdiv ([[./:_|@#\$%\-!+\\'`~,;=\?\^\&\*])
39 identifier [^() \t\n."'*][^() \t\n]*
41 resistor ^(r|R){identifier}
42 capacity ^(c|C){identifier}
43 startbar ^\*\|{space}*
48 ^\* { BEGIN RIPITALL; ripmod=0;}
51 if (strcasecmp(yytext,"*|p")==0) return (_PIN);
52 if (strcasecmp(yytext,"*|i")==0) return (_INST);
53 if (strcasecmp(yytext,"*|s")==0) return (_SUB);
56 if (strcasecmp(yytext,"*|design")==0) return (_DESIGN) ;
57 if (strcasecmp(yytext,"*|date")==0) return (_DATE) ;
58 if (strcasecmp(yytext,"*|vendor")==0) return (_VENDOR) ;
59 if (strcasecmp(yytext,"*|program")==0) return (_PROGRAM) ;
60 if (strcasecmp(yytext,"*|version")==0) return (_VERSION) ;
61 if (strcasecmp(yytext,"*|dspf")==0) return (_DSPF) ;
62 if (strcasecmp(yytext,"*|ground_net")==0) return (_GROUND_NET) ;
63 if (strcasecmp(yytext,"*|net")==0) return (_NET) ;
66 if (strcasecmp(yytext,"*|divider")==0) ripmod=1;
67 if (strcasecmp(yytext,"*|delimiter")==0) ripmod=2;
68 if (strcasecmp(yytext,"*|busbit")==0) ripmod=3;
70 if (ripmod==0) {outputeol=0;}
72 <RIPITALL>.*$ {BEGIN INITIAL;
73 if (ripmod==1) { sprintf(spflval.text, "*|divider%s", yytext); return _DIVIDER; }
74 if (ripmod==2) { sprintf(spflval.text, "*|delimiter%s", yytext); return _DELIMITER; }
75 if (ripmod==3) { sprintf(spflval.text, "*|busbit%s", yytext); return _BUSBIT; }
82 return (_ENDOFSPICELINE);
86 {eolcont} {spf_Line++; }
87 {emptyline} {spf_Line++; }
88 {space} { /* separators */ }
89 \( {return (_LEFTPAR) ; }
90 \) {return (_RIGHTPAR) ; }
91 <COMMENT>{eolcont}.*$ {spf_Line++;}
92 <COMMENT>{emptyline} {spf_Line++;}
93 <COMMENT>{eol} {BEGIN INITIAL; spf_Line++;}
94 <COMMENT>.* {BEGIN INITIAL; spf_Line++;}
95 {begindot}[Ss][Uu][Bb][cC][kK][tT] {BEGIN INITIAL; outputeol=1; return (_SUBCKT) ; /* native */ }
96 {begindot}[Ee][nN][dD] {BEGIN INITIAL; outputeol=1; return (_END) ; /* SPICE */ }
97 {begindot}[eE][nN][dD][sS] {BEGIN INITIAL; outputeol=1; return (_ENDS) ; /* statements */ }
98 {begindot}. {BEGIN COMMENT;}
99 {resistor} {outputeol=1; strcpy(spflval.text, yytext) ; return (_RESISTANCE) ; }
100 {capacity} {outputeol=1; strcpy(spflval.text, yytext) ; return (_CAPACITANCE) ; }
103 ^[ \t]*[abABd-qD-Qs-zS-Z].*$ {BEGIN COMMENT;}
107 {qstring} {strcpy(spflval.text, yytext) ; return (_QSTRING) ; }
108 {identifier} {strcpy(spflval.text, yytext) ; return (_TEXT) ; }
109 . {outputeol=1; return *yytext;}
112 int yywrap() { return 1; }