2 %option never-interactive
6 * Copyright (c) 1998-2000 Stephen Williams (steve@icarus.com)
8 * This source code is free software; you can redistribute it
9 * and/or modify it in source code form under the terms of the GNU
10 * General Public License as published by the Free Software
11 * Foundation; either version 2 of the License, or (at your option)
14 * This program 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.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
24 #ident "$Id: lexor.lex,v 1.96 2007/06/14 03:50:00 steve Exp $"
29 //# define YYSTYPE lexval
32 # include "compiler.h"
33 # include "parse_misc.h"
34 # include "parse_api.h"
38 # include "lexor_keyword.h"
41 # define YY_USER_INIT reset_lexor();
42 # define yylval VLlval
45 * Lexical location information is passed in the yylloc variable to th
46 * parser. The file names, strings, are kept in a list so that I can
47 * re-use them. The set_file_name function will return a pointer to
48 * the name as it exists in the list (and delete the passed string.)
49 * If the name is new, it will be added to the list.
51 extern YYLTYPE yylloc;
53 struct file_name_cell {
55 struct file_name_cell*next;
59 static struct file_name_cell*file_names = 0;
61 static const char* set_file_name(char*text)
63 struct file_name_cell*cur = file_names;
65 if (strcmp(cur->text, text) == 0) {
73 cur = new struct file_name_cell;
75 cur->next = file_names;
77 /* Check this file name with the list of library file
78 names. If there is a match, then turn on the
79 pform_library_flag. This is how the parser knows that
80 modules declared in this file are library modules. */
81 cur->library_flag = library_file_map[cur->text];
82 pform_library_flag = cur->library_flag;
87 extern void pform_set_timescale(int, int, const char*file, unsigned line);
90 static void line_directive();
91 static void line_directive2();
93 static verinum*make_unsized_binary(const char*txt);
94 static verinum*make_undef_highz_dec(const char*txt);
95 static verinum*make_unsized_dec(const char*txt);
96 static verinum*make_unsized_octal(const char*txt);
97 static verinum*make_unsized_hex(const char*txt);
99 static int dec_buf_div2(char *buf);
101 static void process_timescale(const char*txt);
103 static int comment_enter;
119 ^"#line"[ ]+\"[^\"]*\"[ ]+[0-9]+.* { line_directive(); }
120 ^"`line"[ ]+[0-9]+[ ]+\"[^\"]*\".* { line_directive2(); }
123 \n { yylloc.first_line += 1; }
125 /* C++ style comments start with / / and run to the end of the
126 current line. These are very easy to handle. */
128 "//".* { comment_enter = YY_START; BEGIN(LCOMMENT); }
129 <LCOMMENT>. { yymore(); }
130 <LCOMMENT>\n { yylloc.first_line += 1; BEGIN(comment_enter); }
133 /* The contents of C-style comments are ignored, like white space. */
135 "/*" { comment_enter = YY_START; BEGIN(CCOMMENT); }
136 <CCOMMENT>. { yymore(); }
137 <CCOMMENT>\n { yylloc.first_line += 1; yymore(); }
138 <CCOMMENT>"*/" { BEGIN(comment_enter); }
141 "(*" { return K_PSTAR; }
142 "*)" { return K_STARP; }
143 "<<" { return K_LS; }
144 "<<<" { return K_LS; /* Note: Functionally, <<< is the same as <<. */}
145 ">>" { return K_RS; }
146 ">>>" { return K_RSS; }
147 "**" { return K_POW; }
148 "<=" { return K_LE; }
149 ">=" { return K_GE; }
150 "=>" { return K_EG; }
151 "*>" { return K_SG; }
152 "==" { return K_EQ; }
153 "!=" { return K_NE; }
154 "===" { return K_CEQ; }
155 "!==" { return K_CNE; }
156 "||" { return K_LOR; }
157 "&&" { return K_LAND; }
158 "&&&" { return K_TAND; }
159 "~|" { return K_NOR; }
160 "~^" { return K_NXOR; }
161 "^~" { return K_NXOR; }
162 "~&" { return K_NAND; }
163 "->" { return K_TRIGGER; }
164 "+:" { return K_PO_POS; }
165 "-:" { return K_PO_NEG; }
167 /* Watch out for the tricky case of (*). Cannot parse this as "(*"
168 and ")", but since I know that this is really ( * ), replace it
169 with "*" and return that. */
170 "("{W}*"*"{W}*")" { return '*'; }
172 <EDGES>"]" { BEGIN(0); return yytext[0]; }
173 [}{;:\[\],()#=.@&!?<>%|^~+*/-] { return yytext[0]; }
175 \" { BEGIN(CSTRING); }
176 <CSTRING>\\\\ { yymore(); /* Catch \\, which is a \ escaping itself */ }
177 <CSTRING>\\\" { yymore(); /* Catch \", which is an escaped quote */ }
178 <CSTRING>\n { BEGIN(0);
179 yylval.text = strdup(yytext);
180 VLerror(yylloc, "Missing close quote of string.");
181 yylloc.first_line += 1;
183 <CSTRING>\" { BEGIN(0);
184 yylval.text = strdup(yytext);
185 yylval.text[strlen(yytext)-1] = 0;
187 <CSTRING>. { yymore(); }
189 <UDPTABLE>\(\?0\) { return '_'; }
190 <UDPTABLE>\(\?1\) { return '+'; }
191 <UDPTABLE>\(\?[xX]\) { return '%'; }
192 <UDPTABLE>\(\?\?\) { return '*'; }
193 <UDPTABLE>\(01\) { return 'r'; }
194 <UDPTABLE>\(0[xX]\) { return 'Q'; }
195 <UDPTABLE>\(b[xX]\) { return 'q'; }
196 <UDPTABLE>\(b0\) { return 'f'; /* b0 is 10|00, but only 10 is meaningful */}
197 <UDPTABLE>\(b1\) { return 'r'; /* b1 is 11|01, but only 01 is meaningful */}
198 <UDPTABLE>\(0\?\) { return 'P'; }
199 <UDPTABLE>\(10\) { return 'f'; }
200 <UDPTABLE>\(1[xX]\) { return 'M'; }
201 <UDPTABLE>\(1\?\) { return 'N'; }
202 <UDPTABLE>\([xX]0\) { return 'F'; }
203 <UDPTABLE>\([xX]1\) { return 'R'; }
204 <UDPTABLE>\([xX]\?\) { return 'B'; }
205 <UDPTABLE>[bB] { return 'b'; }
206 <UDPTABLE>[lL] { return 'l'; /* IVL extension */ }
207 <UDPTABLE>[hH] { return 'h'; /* IVL extension */ }
208 <UDPTABLE>[fF] { return 'f'; }
209 <UDPTABLE>[rR] { return 'r'; }
210 <UDPTABLE>[xX] { return 'x'; }
211 <UDPTABLE>[nN] { return 'n'; }
212 <UDPTABLE>[pP] { return 'p'; }
213 <UDPTABLE>[01\?\*\-] { return yytext[0]; }
215 <EDGES>"01" { return K_edge_descriptor; }
216 <EDGES>"0x" { return K_edge_descriptor; }
217 <EDGES>"0z" { return K_edge_descriptor; }
218 <EDGES>"10" { return K_edge_descriptor; }
219 <EDGES>"1x" { return K_edge_descriptor; }
220 <EDGES>"1z" { return K_edge_descriptor; }
221 <EDGES>"x0" { return K_edge_descriptor; }
222 <EDGES>"x1" { return K_edge_descriptor; }
223 <EDGES>"z0" { return K_edge_descriptor; }
224 <EDGES>"z1" { return K_edge_descriptor; }
226 [a-zA-Z_][a-zA-Z0-9$_]* {
227 int rc = lexor_keyword_code(yytext, yyleng);
230 yylval.text = strdup(yytext);
231 if (strncmp(yylval.text,"PATHPULSE$", 10) == 0)
232 rc = PATHPULSE_IDENTIFIER;
238 if (! gn_cadence_types_enabled()) {
239 yylval.text = strdup(yytext);
260 yylval.text = strdup(yytext+1);
264 if (strcmp(yytext,"$setuphold") == 0)
266 if (strcmp(yytext,"$attribute") == 0)
268 if (strcmp(yytext,"$hold") == 0)
270 if (strcmp(yytext,"$period") == 0)
272 if (strcmp(yytext,"$recovery") == 0)
274 if (strcmp(yytext,"$recrem") == 0)
276 if (strcmp(yytext,"$setup") == 0)
278 if (strcmp(yytext,"$width") == 0)
280 yylval.text = strdup(yytext);
281 return SYSTEM_IDENTIFIER; }
284 \'[sS]?[dD][ \t]*[0-9][0-9_]* { yylval.number = make_unsized_dec(yytext);
285 return BASED_NUMBER; }
286 \'[sS]?[dD][ \t]*[xzXZ?]_* { yylval.number = make_undef_highz_dec(yytext);
287 return BASED_NUMBER; }
288 \'[sS]?[bB][ \t]*[0-1xzXZ_\?]+ { yylval.number = make_unsized_binary(yytext);
289 return BASED_NUMBER; }
290 \'[sS]?[oO][ \t]*[0-7xzXZ_\?]+ { yylval.number = make_unsized_octal(yytext);
291 return BASED_NUMBER; }
292 \'[sS]?[hH][ \t]*[0-9a-fA-FxzXZ_\?]+ { yylval.number = make_unsized_hex(yytext);
293 return BASED_NUMBER; }
296 yylval.number = make_unsized_dec(yytext);
297 based_size = yylval.number->as_ulong();
300 [0-9][0-9_]*\.[0-9][0-9_]*([Ee][+-]?[0-9][0-9_]*)? {
301 yylval.realtime = new verireal(yytext);
304 [0-9][0-9_]*[Ee][+-]?[0-9][0-9_]* {
305 yylval.realtime = new verireal(yytext);
309 /* Notice and handle the timescale directive. */
311 ^{W}?`timescale { BEGIN(PPTIMESCALE); }
312 <PPTIMESCALE>.* { process_timescale(yytext); }
314 yylloc.first_line += 1;
318 /* These are directives that I do not yet support. I think that IVL
319 should handle these, not an external preprocessor. */
321 ^{W}?`celldefine{W}?.* { }
322 ^{W}?`delay_mode_distributed{W}?.* { }
323 ^{W}?`delay_mode_unit{W}?.* { }
324 ^{W}?`delay_mode_path{W}?.* { }
325 ^{W}?`disable_portfaults{W}?.* { }
326 ^{W}?`enable_portfaults{W}?.* { }
327 ^{W}?`endcelldefine{W}?.* { }
329 ^{W}?`nosuppress_faults{W}?.* { }
330 ^{W}?`nounconnected_drive{W}?.* { }
332 ^{W}?`resetall{W}?.* { }
333 ^{W}?`suppress_faults{W}?.* { }
334 ^{W}?`unconnected_drive{W}?.* { }
335 ^{W}?`uselib{W}?.* { }
337 /* Notice and handle the default_nettype directive. The lexor
338 detects the default_nettype keyword, and the second part of the
339 rule collects the rest of the line and processes it. We only need
340 to look for the first work, and interpret it. */
342 `default_nettype{W}? { BEGIN(PPDEFAULT_NETTYPE); }
343 <PPDEFAULT_NETTYPE>.* {
344 NetNet::Type net_type;
345 size_t wordlen = strcspn(yytext, " \t\f\r\n");
347 if (strcmp(yytext,"wire") == 0) {
348 net_type = NetNet::WIRE;
350 } else if (strcmp(yytext,"none") == 0) {
351 net_type = NetNet::NONE;
354 cerr << yylloc.text << ":" << yylloc.first_line
355 << " error: Net type " << yytext
356 << " is not a valid (and supported)"
357 << " default net type." << endl;
358 net_type = NetNet::WIRE;
361 pform_set_default_nettype(net_type, yylloc.text, yylloc.first_line);
363 <PPDEFAULT_NETTYPE>\n {
364 yylloc.first_line += 1;
368 /* These are directives that are not supported by me and should have
369 been handled by an external preprocessor such as ivlpp. */
372 cerr << yylloc.text << ":" << yylloc.first_line <<
373 ": `define not supported. Use an external preprocessor."
378 cerr << yylloc.text << ":" << yylloc.first_line <<
379 ": `else not supported. Use an external preprocessor."
384 cerr << yylloc.text << ":" << yylloc.first_line <<
385 ": `endif not supported. Use an external preprocessor."
390 cerr << yylloc.text << ":" << yylloc.first_line <<
391 ": `ifdef not supported. Use an external preprocessor."
396 cerr << yylloc.text << ":" << yylloc.first_line <<
397 ": `include not supported. Use an external preprocessor."
402 cerr << yylloc.text << ":" << yylloc.first_line <<
403 ": `undef not supported. Use an external preprocessor."
408 `{W} { cerr << yylloc.text << ":" << yylloc.first_line << ": error: "
409 << "Stray tic (`) here. Perhaps you put white space" << endl;
410 cerr << yylloc.text << ":" << yylloc.first_line << ": : "
411 << "between the tic and preprocessor directive?"
415 /* Final catchall. something got lost or mishandled. */
417 . { cerr << yylloc.text << ":" << yylloc.first_line
418 << ": error: unmatched character (";
419 if (isgraph(yytext[0]))
422 cerr << "hex " << hex << (0xffU & ((unsigned) (yytext[0])));
430 * The UDP state table needs some slightly different treatment by the
431 * lexor. The level characters are normally accepted as other things,
432 * so the parser needs to switch my mode when it believes in needs to.
434 void lex_start_table()
444 static verinum*make_unsized_binary(const char*txt)
446 bool sign_flag = false;
447 const char*ptr = txt;
448 assert(*ptr == '\'');
451 if (tolower(*ptr) == 's') {
456 assert(tolower(*ptr) == 'b');
459 while (*ptr && ((*ptr == ' ') || (*ptr == '\t')))
463 for (const char*idx = ptr ; *idx ; idx += 1)
464 if (*idx != '_') size += 1;
466 if ((based_size > 0) && (size > based_size)) yywarn(yylloc,
467 "extra digits given for sized binary constant.");
469 verinum::V*bits = new verinum::V[size];
475 bits[--idx] = verinum::V0;
478 bits[--idx] = verinum::V1;
480 case 'z': case 'Z': case '?':
481 bits[--idx] = verinum::Vz;
484 bits[--idx] = verinum::Vx;
489 fprintf(stderr, "%c\n", ptr[0]);
495 verinum*out = new verinum(bits, size, false);
496 out->has_sign(sign_flag);
502 static verinum*make_unsized_octal(const char*txt)
504 bool sign_flag = false;
505 const char*ptr = txt;
506 assert(*ptr == '\'');
509 if (tolower(*ptr) == 's') {
514 assert(tolower(*ptr) == 'o');
517 while (*ptr && ((*ptr == ' ') || (*ptr == '\t')))
521 for (const char*idx = ptr ; *idx ; idx += 1)
522 if (*idx != '_') size += 3;
524 if (based_size > 0) {
525 int rem = based_size % 3;
526 if (rem != 0) based_size += 3 - rem;
527 if (size > based_size) yywarn(yylloc,
528 "extra digits given for sized octal constant.");
531 verinum::V*bits = new verinum::V[size];
537 case '0': case '1': case '2': case '3':
538 case '4': case '5': case '6': case '7':
540 bits[--idx] = (val&4) ? verinum::V1 : verinum::V0;
541 bits[--idx] = (val&2) ? verinum::V1 : verinum::V0;
542 bits[--idx] = (val&1) ? verinum::V1 : verinum::V0;
545 bits[--idx] = verinum::Vx;
546 bits[--idx] = verinum::Vx;
547 bits[--idx] = verinum::Vx;
549 case 'z': case 'Z': case '?':
550 bits[--idx] = verinum::Vz;
551 bits[--idx] = verinum::Vz;
552 bits[--idx] = verinum::Vz;
562 verinum*out = new verinum(bits, size, false);
563 out->has_sign(sign_flag);
569 static verinum*make_unsized_hex(const char*txt)
571 bool sign_flag = false;
572 const char*ptr = txt;
573 assert(*ptr == '\'');
576 if (tolower(*ptr) == 's') {
580 assert(tolower(*ptr) == 'h');
583 while (*ptr && ((*ptr == ' ') || (*ptr == '\t')))
587 for (const char*idx = ptr ; *idx ; idx += 1)
588 if (*idx != '_') size += 4;
590 if (based_size > 0) {
591 int rem = based_size % 4;
592 if (rem != 0) based_size += 4 - rem;
593 if (size > based_size) yywarn(yylloc,
594 "extra digits given for sized hex constant.");
597 verinum::V*bits = new verinum::V[size];
603 case '0': case '1': case '2': case '3': case '4':
604 case '5': case '6': case '7': case '8': case '9':
606 bits[--idx] = (val&8) ? verinum::V1 : verinum::V0;
607 bits[--idx] = (val&4) ? verinum::V1 : verinum::V0;
608 bits[--idx] = (val&2) ? verinum::V1 : verinum::V0;
609 bits[--idx] = (val&1) ? verinum::V1 : verinum::V0;
611 case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
612 case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
613 val = tolower(*ptr) - 'a' + 10;
614 bits[--idx] = (val&8) ? verinum::V1 : verinum::V0;
615 bits[--idx] = (val&4) ? verinum::V1 : verinum::V0;
616 bits[--idx] = (val&2) ? verinum::V1 : verinum::V0;
617 bits[--idx] = (val&1) ? verinum::V1 : verinum::V0;
620 bits[--idx] = verinum::Vx;
621 bits[--idx] = verinum::Vx;
622 bits[--idx] = verinum::Vx;
623 bits[--idx] = verinum::Vx;
625 case 'z': case 'Z': case '?':
626 bits[--idx] = verinum::Vz;
627 bits[--idx] = verinum::Vz;
628 bits[--idx] = verinum::Vz;
629 bits[--idx] = verinum::Vz;
639 verinum*out = new verinum(bits, size, false);
640 out->has_sign(sign_flag);
646 /* Divide the integer given by the string by 2. Return the remainder bit. */
647 static int dec_buf_div2(char *buf)
650 int len = strlen(buf);
657 /* dst_ptr overwrites buf, but all characters that are overwritten
658 were already used by the reader. */
661 while(buf[pos] == '0')
664 for(; pos<len; ++pos){
668 assert(isdigit(buf[pos]));
670 partial= partial*10 + (buf[pos]-'0');
673 *dst_ptr = partial/2 + '0';
674 partial = partial & 1;
684 // If result of division was zero string, it should remain that way.
685 // Don't eat the last zero...
695 /* Support a single x, z or ? as a decimal constant (from 1364-2005). */
696 static verinum* make_undef_highz_dec(const char* ptr)
698 bool signed_flag = false;
700 assert(*ptr == '\'');
701 /* The number may have decorations of the form 'sd<code>,
702 possibly with space between the d and the <code>.
703 Also, the 's' is optional, and marks the number as signed. */
706 if (tolower(*ptr) == 's') {
711 assert(tolower(*ptr) == 'd');
714 while (*ptr && ((*ptr == ' ') || (*ptr == '\t')))
717 /* Process the code. */
718 verinum::V* bits = new verinum::V[1];
722 bits[0] = verinum::Vx;
727 bits[0] = verinum::Vz;
733 while (*ptr == '_') ptr += 1;
736 verinum*out = new verinum(bits, 1, false);
737 out->has_sign(signed_flag);
743 * Making a decimal number is much easier then the other base numbers
744 * because there are no z or x values to worry about. It is much
745 * harder then other base numbers because the width needed in bits is
749 static verinum*make_unsized_dec(const char*ptr)
752 bool signed_flag = false;
755 if (ptr[0] == '\'') {
756 /* The number has decorations of the form 'sd<digits>,
757 possibly with space between the d and the <digits>.
758 Also, the 's' is optional, and markes the number as
762 if (tolower(*ptr) == 's') {
767 assert(tolower(*ptr) == 'd');
770 while (*ptr && ((*ptr == ' ') || (*ptr == '\t')))
774 /* ... or an undecorated decimal number is passed
775 it. These numbers are treated as signed decimal. */
776 assert(isdigit(*ptr));
781 /* Copy the digits into a buffer that I can use to do in-place
784 while ((idx < sizeof buf) && (*ptr != 0)) {
793 if (idx == sizeof buf) {
794 fprintf(stderr, "Ridiculously long"
795 " decimal constant will be truncated!\n");
800 unsigned tmp_size = idx * 4 + 1;
801 verinum::V *bits = new verinum::V[tmp_size];
804 while (idx < tmp_size) {
805 int rem = dec_buf_div2(buf);
806 bits[idx++] = (rem == 1) ? verinum::V1 : verinum::V0;
809 assert(strcmp(buf, "0") == 0);
811 /* Now calculate the minimum number of bits needed to
812 represent this unsigned number. */
813 unsigned size = tmp_size;
814 while ((size > 1) && (bits[size-1] == verinum::V0))
817 /* Now account for the signedness. Don't leave a 1 in the high
818 bit if this is a signed number. */
819 if (signed_flag && (bits[size-1] == verinum::V1)) {
821 assert(size <= tmp_size);
824 /* Since we never have the real number of bits that a decimal
825 number represents we do not check for extra bits. */
826 // if (based_size > 0) { }
828 verinum*res = new verinum(bits, size, false);
829 res->has_sign(signed_flag);
837 * The timescale parameter has the form:
838 * " <num> xs / <num> xs"
840 static void process_timescale(const char*txt)
843 const char*cp = txt + strspn(txt, " \t");
850 num = strtoul(cp, &tmp, 10);
852 VLerror(yylloc, "Invalid timescale string.");
861 VLerror(yylloc, "Invalid timescale unit number.");
866 cp += strspn(cp, " \t");
867 ctmp = cp + strcspn(cp, " \t/");
869 if (strncmp("s", cp, ctmp-cp) == 0) {
872 } else if (strncmp("ms", cp, ctmp-cp) == 0) {
875 } else if (strncmp("us", cp, ctmp-cp) == 0) {
878 } else if (strncmp("ns", cp, ctmp-cp) == 0) {
881 } else if (strncmp("ps", cp, ctmp-cp) == 0) {
884 } else if (strncmp("fs", cp, ctmp-cp) == 0) {
888 VLerror(yylloc, "Invalid timescale unit of measurement");
893 cp += strspn(cp, " \t/");
895 num = strtoul(cp, &tmp, 10);
897 VLerror(yylloc, "Invalid timescale string.");
906 VLerror(yylloc, "Invalid timescale precision number.");
911 cp += strspn(cp, " \t");
912 ctmp = cp + strcspn(cp, " \t\r");
914 if (strncmp("s", cp, ctmp-cp) == 0) {
917 } else if (strncmp("ms", cp, ctmp-cp) == 0) {
920 } else if (strncmp("us", cp, ctmp-cp) == 0) {
923 } else if (strncmp("ns", cp, ctmp-cp) == 0) {
926 } else if (strncmp("ps", cp, ctmp-cp) == 0) {
929 } else if (strncmp("fs", cp, ctmp-cp) == 0) {
933 VLerror(yylloc, "Invalid timescale precision units of measurement");
937 pform_set_timescale(unit, prec, yylloc.text, yylloc.first_line);
946 * The line directive matches lines of the form #line "foo" N and
947 * calls this function. Here I parse out the file name and line
948 * number, and change the yylloc to suite.
950 static void line_directive()
952 char*qt1 = strchr(yytext, '"');
956 char*qt2 = strchr(qt1, '"');
959 char*buf = new char[qt2-qt1+1];
960 strncpy(buf, qt1, qt2-qt1);
963 yylloc.text = set_file_name(buf);
966 yylloc.first_line = strtoul(qt2,0,0);
969 static void line_directive2()
971 assert(strncmp(yytext,"`line",5) == 0);
972 char*cp = yytext + strlen("`line");
973 cp += strspn(cp, " ");
974 yylloc.first_line = strtoul(cp,&cp,10);
976 yylloc.first_line -= 1;
978 cp += strspn(cp, " ");
979 if (*cp == 0) return;
981 char*qt1 = strchr(yytext, '"');
985 char*qt2 = strchr(qt1, '"');
988 char*buf = new char[qt2-qt1+1];
989 strncpy(buf, qt1, qt2-qt1);
992 yylloc.text = set_file_name(buf);
995 extern FILE*vl_input;
999 yylloc.first_line = 1;
1001 /* Start the file_names list. From here on, as I get a file
1002 name, I will add it to this list. Only add the name if it
1003 is not already in the list. */
1004 file_names = new struct file_name_cell;
1005 file_names->text = strdup(vl_file.c_str());
1006 file_names->next = 0;
1007 yylloc.text = file_names->text;