Subversion Repositories Vertical

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 mjames 1
%{
2
 
3
/*
4
 * $Id: frb_lex.l,v 1.11 2002/10/02 19:37:29 MJAMES Exp $
5
 *
6
 * $Log: frb_lex.l,v $
7
 * Revision 1.11  2002/10/02 19:37:29  MJAMES
8
 * Moved dummy functions to a separate support file.
9
 *
10
 * Used correct number of arguments to define_pin
11
 *
12
 * Revision 1.10  2002/09/18 09:18:37  mjames
13
 * Added dummy function to make code link to create final application
14
 *
15
 * Revision 1.9  2002/01/21 09:34:50  mjames
16
 * FRBread adds the ability to ignore .ATT_PIN construct that appears in
17
 * a recent FRB file.
18
 *
19
 * Revision 1.8  2002/01/16 11:22:44  mjames
20
 * database.h header file is read in first as it undefined DLL stuff irrelevant
21
 * to HPUX
22
 *
23
 * Revision 1.7  2001/12/13 22:21:37  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.6  2001/10/31 22:20:05  mjames
29
 * Tidying up problematical comments caused by CVS
30
 * 'intelligent' comment guessing
31
 *
32
 * Revision 1.5  2001/09/16 19:57:29  mjames
33
 * tidying
34
 *
35
 * Revision 1.4  2001/06/06 12:10:22  mjames
36
 * Move from HPUX
37
 *
38
 * Revision 1.3  2001/05/01 15:20:39  mjames
39
 * Added comment leaders on some patterns matched but not used
40
 *
41
 * Revision 1.2  2001/03/29 08:27:07  mjames
42
 * Converted frbread for use with the newer files from the drawing office
43
 *
44
 * Revision 1.1  2001/02/12 10:51:28  mjames
45
 * Inserted new correct version number in vertcl_main.c
46
 *
47
 * Added lex files to the list.
48
 *
49
 * Revision 1.22  2000/03/08  16:19:01  16:19:01  mjames (Mike James)
50
 * New version including PC
51
 * 
52
 * Revision 1.19  2000/01/20  15:58:43  15:58:43  mjames (Mike James)
53
 * Part of Release R22
54
 * 
55
 * Revision 1.18  99/12/22  11:15:24  11:15:24  mjames (Mike James)
56
 * Part of Release Dec_22_1999
57
 * 
58
 * Revision 1.17  99/06/25  14:35:31  14:35:31  mjames (Mike James)
59
 * Added in reference to expression.h, but no changes made 
60
 * to the function of acfread yet.
61
 * 
62
 * Revision 1.16  98/02/11  11:25:59  11:25:59  mjames (Mike James)
63
 * Checked in for version 6.2a
64
 * 
65
 * Revision 1.15  97/04/23  08:45:03  08:45:03  mjames (Mike James)
66
 * CHecked in for release rel23041997
67
 * 
68
 * Revision 1.14  96/07/19  14:38:28  14:38:28  mjames (Mike James)
69
 * Update to give to PRL
70
 * 
71
 * Revision 1.13  1996/07/12  15:52:12  mjames
72
 * Sorted out things like Alias and Jumpers
73
 * Work Correctly
74
 * Print COrrectly
75
 *
76
 * Revision 1.12  96/06/17  10:52:22  10:52:22  mjames (Mike James)
77
 * Tidying up
78
 * 
79
 * Revision 1.11  96/06/04  11:52:43  11:52:43  mjames (Mike James)
80
 * Slight modifications
81
 *
82
 * Revision 1.10  96/04/26  16:03:54  16:03:54  mjames (Mike James)
83
 *  Set the limit on token length to be consistent with the rest of the code
84
 *
85
 * Revision 1.9  96/03/29  14:47:24  14:47:24  mjames (Mike James)
86
 * Added VHDL netlist writing to the capabilities of ACFREAD
87
 *
88
 * Revision 1.8  96/03/18  13:51:30  13:51:30  mjames (Mike James)
89
 * Real Revision 2.1
90
 *
91
 * Revision 1.6  96/02/13  09:13:19  09:13:19  mjames (Mike James)
92
 * Updated to be version 2.0 with net joining
93
 *
94
 * Revision 1.5  96/02/07  16:01:27  16:01:27  mjames (Mike James)
95
 * Added correct RCS header
96
 *
97
 * Revision 1.4  96/02/07  15:50:32  15:50:32  mjames (Mike James)
98
 * Added RCS ident message
99
 *
100
 * Revision 1.3  96/01/10  13:13:24  13:13:24  mjames (Mike James)
101
 * Works in debug mode with EPLD listings and PCB layout
102
 *
103
 * Revision 1.2  96/01/08  15:23:44  15:23:44  mjames (Mike James)
104
 * Managing to make sense of things now
105
 *
106
 * Revision 1.1  96/01/07  12:40:11  Mike_James
107
 * Initial revision
108
 *
109
 * Revision 1.1  96/01/04  17:55:24  17:55:24  mjames (Mike James)
110
 * Initial revision
111
 *
112
 * Revision 1.2  96/01/04  11:37:16  11:37:16  mjames (Mike James)
113
 * Compete parsing of FIT and ACF with ignore of junk .
114
 *
115
 * Revision 1.1  96/01/04  10:18:25  10:18:25  mjames (Mike James)
116
 * Initial revision
117
 *
118
 *  */
119
#include <stdio.h>
120
/* see makefile for why */
121
#include "expression.h"
122
#include "generic.h"
123
#include "database.h"
124
 
125
#include "frb_yacc.h"
126
#include "lx_support.h"
127
 
128
#define YYLMAX MAXIDLEN
129
 
130
#ident "@(#)$Header: /cygwin/cvsroot/vertical/frb_lex.l,v 1.11 2002/10/02 19:37:29 MJAMES Exp $"
131
 
132
extern  int yyval;
133
 
134
extern int lineno;
135
%}
136
 
137
L [A-Za-z\~\-]
138
 
139
L2 [A-Za-z0-9_/\~\-.\*]
140
 
141
Ct [ -\~]
142
 
143
Cm [^\n]
144
 
145
D [0-9]
146
Spc [ \r\t]
147
 
148
S [^\"]
149
Q [\"]
150
 
151
 
152
%%
153
".HEA"              { return (HEADER); };
154
".END"              { return (END); };
155
".TIM"              { return (TIME); };
156
".UNI"              { return (UNITS); };
157
".JOB"              { return (JOB); };
158
".TYP"              { return (TYPE); };
159
".APP"              { return (APP); };
160
".ADD_COM"          { free_strings(&lx_first,&lx_last);return(ADD_COM); };
161
".ADD_TER"          { free_strings(&lx_first,&lx_last);return(ADD_TER); };
162
".ATT_COM"          { free_strings(&lx_first,&lx_last);return(ATT_COM); };
163
".ATT_PIN"          { free_strings(&lx_first,&lx_last);return(ATT_PIN); };
164
".ATT_TRE"          { free_strings(&lx_first,&lx_last);return(ATT_TRE); };
165
".TER"              { free_strings(&lx_first,&lx_last);return(TER); };
166
 
167
{Q}{S}*{Q}        {  yylval.string = make_string(yytext,&lx_first,&lx_last) ; /* do it anyway */
168
                   return(ASTRING); };
169
{L2}+             {  yylval.string = make_string(yytext,&lx_first,&lx_last) ; /* do it anyway */
170
                   return(ASTRING); };
171
 
172
 
173
 
174
"--"{Cm}*"\n"     { lineno++; return(NL);/* VHDL comment */  };
175
"/\*"{Ct}*"*\/"   { break; /* c comment */   };
176
 
177
{Spc}             { break; /* white space */ };
178
"\r"|"\n"              { lineno++; return(NL); };
179
.                 { printf("?? unexpected char '%c' code %02X\n",yytext[0]>31?yytext[0]:' ',yytext[0]); };
180
<<EOF>>           { yyterminate(); };
181
%%