Subversion Repositories Vertical

Rev

Rev 7 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 mjames 1
%{
2
/*
3
 * $Header: c:\\cygwin\\cvsroot/Vert03/eagle_src/eagle_lex.l,v 1.1.1.1 2003/11/04 23:34:56 mjames Exp $
4
 *
5
 * $Log: eagle_lex.l,v $
6
 * Revision 1.1.1.1  2003/11/04 23:34:56  mjames
7
 * Imported into local repositrory
8
 *
9
 * Revision 1.1  2002/12/04 22:28:28  mjames
10
 * Initial release Eagle PCB reader
11
 *
12
 *
13
 *  */
14
#include <stdio.h>
15
#if defined HAS_TCL
16
#include "tcl_l.h"
17
#endif
18
#include "expression.h"
19
#include "generic.h"
20
#include "database.h"
21
 
22
/* see makefile for why */
23
#include "protel_yacc.h"
24
#include "lx_support.h"
25
 
26
#define YYLMAX MAXIDLEN
27
 
11 mjames 28
#ident "@(#)$Header: c:\\cygwin\\cvsroot/Vert03/eagle_src/eagle_lex.l,v 1.1.1.1 2003/11/04 23:34:56 mjames Exp $"
2 mjames 29
 
30
extern  int yyval;
31
 
32
extern int yydebug;
33
 
34
 
35
extern int lineno;
36
%}
37
%s component
38
%s netlist
39
 
40
 
41
L2 [A-Za-z0-9_/\~\*\+\$]
11 mjames 42
L3 [A-Za-z0-9_/\~\-\*\+\$ \.]
43
L4 [A-Za-z0-9_/\~\*\+\$ \.\\\?]
2 mjames 44
 
45
S [^\"]
46
Q [\"]
47
 
11 mjames 48
Spc [ \t]
2 mjames 49
 
11 mjames 50
%%
2 mjames 51
 
52
{Q}{S}*{Q}        {  yylval.string = make_string(yytext,&lx_first,&lx_last) ; /* do it anyway */
53
                           if(yydebug) fprintf(stderr,"String (%s)\n",yylval.string);  return(ASTRING); };
54
 
11 mjames 55
<component>{L2}{L3}*      { yylval.string = make_string(yytext,&lx_first,&lx_last) ; /* do it anyway */
2 mjames 56
                           if(yydebug) fprintf(stderr,"String (%s)\n",yylval.string); return(ASTRING); };
57
 
11 mjames 58
<netlist>{L2}{L4}*         { yylval.string = make_string(yytext,&lx_first,&lx_last) ; /* do it anyway */
2 mjames 59
                           if(yydebug) fprintf(stderr,"String (%s)\n",yylval.string); return(ASTRING); };
60
 
11 mjames 61
{Spc}+            { return (SPC); /* white space */ };
62
"\n"              { lineno++; return(NL); };
2 mjames 63
"\["              { BEGIN(component); return (LBRK); };
64
"\]"              { return (RBRK); };
65
"\("              { BEGIN(netlist) ; return (LB2); };
66
"\)"              { return (RB2); };
67
<netlist>"-"      { return(MINUS); };
68
 
69
%%