51 #include "tokens_citi.h"
58 ID [a-zA-
Z_][a-zA-
Z0-9_\.]*
60 EXPONENT [Ee][+-]?{DIGIT}+
62 FLOAT1 [+-]?{DIGIT}+{EXPONENT}
63 FLOAT2 [+-]?{DIGIT}*
"."{DIGIT}+({EXPONENT})?
67 %
x COMMENTS FLOATS LISTS DATAS VALUES
68 %option yylineno noyywrap nounput
prefix=
"citi_"
72 <INITIAL,FLOATS,LISTS>{EOL}+ {
return Eol; }
76 <INITIAL,DATAS>{
INT} {
77 citi_lval.d = strtol (citi_text, NULL, 10);
81 <INITIAL>[a-zA-Z]
"."{DIGIT}+
"."{DIGIT}+ {
85 <INITIAL,DATAS>(
"RI"|
"MAG"|
"MAGANGLE"|
"DBANGLE") {
86 citi_lval.ident = strdup (citi_text);
90 <INITIAL>^
"CITIFILE" {
return CITIFILE; }
91 <INITIAL>^
"VAR" {
return VAR; }
92 <INITIAL>^
"DATA" { BEGIN(DATAS);
return DATA; }
93 <INITIAL>^
"NAME" {
return NAME; }
94 <INITIAL>^
"BEGIN" { BEGIN(FLOATS);
return Begin; }
95 <INITIAL>^
"CONSTANT" { BEGIN(VALUES);
return CONSTANT; }
96 <INITIAL>^
"COMMENT" { BEGIN(COMMENTS); }
98 <INITIAL>^
"SEG_LIST_BEGIN" { BEGIN(LISTS);
return SegListBegin; }
99 <INITIAL>^
"VAR_LIST_BEGIN" { BEGIN(LISTS);
return VarListBegin; }
100 <LISTS>^
"SEG_LIST_END" { BEGIN(INITIAL);
return SegListEnd; }
101 <LISTS>^
"VAR_LIST_END" { BEGIN(INITIAL);
return VarListEnd; }
102 <LISTS>^
"SEG" {
return SEG; }
104 <INITIAL,DATAS,VALUES>{
ID} {
105 citi_lval.ident = strdup (citi_text);
109 <FLOATS,LISTS,VALUES>({FLOAT1}|{FLOAT2}|{
INT}) {
110 citi_lval.f = strtod (citi_text, NULL);
114 <VALUES>{EOL}+ { BEGIN(INITIAL);
return Eol; }
116 <DATAS>
"," {
return ','; }
117 <DATAS>
"[" {
return '['; }
118 <DATAS>
"]" { BEGIN(INITIAL);
return ']'; }
119 <DATAS>{EOL}+ { BEGIN(INITIAL);
return Eol; }
121 <FLOATS>
"," {
return ','; }
123 <FLOATS>^
"END" { BEGIN(INITIAL);
return End; }
130 <COMMENTS>{EOL}+ { BEGIN(INITIAL); }
134 "line %d: syntax error, unrecognized character: `%s'\n",
RLC_Device Node Node Value MODEL_Ident PairList Eol
< INITIAL >< INITIAL >< INITIAL >< INITIAL > return InvalidCharacter
WS[\t\n\r] SIMPLEID *[a-zA-Z_][a-zA-Z0-9_] POSTID[a-zA-Z0-9_] ID
void logprint(int level, const char *format,...)
#define Z0
Wave impedance in vacuum ( )