Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | mjames | 1 | %{ |
2 | /* |
||
3 | * $Header: C:/cvsroot/Vert03/rep2_src/rep2_yacc.y,v 1.1.1.1 2003/11/04 23:34:58 mjames Exp $ |
||
4 | * |
||
5 | * $Log: rep2_yacc.y,v $ |
||
6 | * Revision 1.1.1.1 2003/11/04 23:34:58 mjames |
||
7 | * Imported into local repositrory |
||
8 | * |
||
9 | * Revision 1.5 2003/03/04 15:25:12 mjames |
||
10 | * Added #ident |
||
11 | * |
||
12 | * Revision 1.4 2002/10/02 19:37:27 MJAMES |
||
13 | * Moved dummy functions to a separate support file. |
||
14 | * |
||
15 | * Used correct number of arguments to define_pin |
||
16 | * |
||
17 | * Revision 1.3 2002/01/16 10:08:34 mjames |
||
18 | * Removed unused terminals |
||
19 | * |
||
20 | * Revision 1.2 2001/10/31 22:20:15 mjames |
||
21 | * Tidying up problematical comments caused by CVS |
||
22 | * 'intelligent' comment guessing |
||
23 | * |
||
24 | * Revision 1.1 2001/10/02 20:52:58 mjames |
||
25 | * Another .REP file format reader |
||
26 | * |
||
27 | * |
||
28 | |||
29 | |||
30 | * */ |
||
31 | |||
32 | |||
33 | #include <stdio.h> |
||
34 | #include <stdlib.h> |
||
35 | #include <string.h> |
||
36 | #include "expression.h" |
||
37 | #include "generic.h" |
||
38 | #include "database.h" |
||
39 | /* |
||
40 | @title |
||
41 | PROGRAM rep2read |
||
42 | @text |
||
43 | Reads Yet Another Bloody Drawing Office File Format. |
||
44 | @break |
||
45 | Try this one as well as PROGRAM repread on '.REP' files. |
||
46 | @end |
||
47 | */ |
||
48 | |||
49 | #ident "@(#)$Header: C:/cvsroot/Vert03/rep2_src/rep2_yacc.y,v 1.1.1.1 2003/11/04 23:34:58 mjames Exp $" |
||
50 | |||
51 | |||
52 | |||
53 | |||
54 | static socket_t * current_chip; |
||
55 | static char curr_net_nam[MAXIDLEN]; |
||
56 | int inside_block; |
||
57 | %} |
||
58 | %union { char * string; } |
||
59 | %token SPACE LF CR ENDFILE |
||
60 | %token <string> ASTRING |
||
61 | %type <string> netid |
||
62 | |||
63 | %% |
||
64 | |||
65 | file : objects; |
||
66 | |||
67 | |||
68 | objects : objects object |
||
69 | | object |
||
70 | ; |
||
71 | |||
72 | |||
73 | object : pin |
||
74 | ; |
||
75 | |||
76 | |||
77 | |||
78 | pin : ASTRING spaces ASTRING SPACE netid SPACE ASTRING SPACE ASTRING SPACE ASTRING endline |
||
79 | { |
||
80 | |||
81 | /* socket pin_id [ net_id ] x y layer */ |
||
82 | define_pin(&routed_list, |
||
83 | find_socket(Ident,$1,Create,&socket_head), |
||
84 | $5,BIDIR,0,$3, |
||
85 | default_vhdl_datatype,NULL); |
||
86 | }; |
||
87 | |||
88 | netid : ASTRING { $$=$1; } |
||
89 | | /* nothing */ { $$ = ""; }; |
||
90 | |||
91 | |||
92 | endline : CR |
||
93 | | CR LF |
||
94 | | LF |
||
95 | ; |
||
96 | |||
97 | |||
98 | |||
99 | |||
100 | spaces : spaces SPACE |
||
101 | | SPACE ; |
||
102 | |||
103 | %% |
||
104 | |||
105 | /* defining lineno here */ |
||
106 | |||
107 | int lineno; |
||
108 | extern char * yytext; |
||
109 | |||
110 | int yyerror(char * x) |
||
111 | { |
||
112 | int token; |
||
113 | printf("-- Error --> %s near string (%s) at line %d\n",x,yytext,lineno); |
||
114 | /* for(token = yylex();token >= 0 && token!=NL;token = yylex()); */ |
||
115 | return 0; |
||
116 | } |
||
117 | |||
118 | int yywrap(void) |
||
119 | { |
||
120 | return 1; |
||
121 | } |
||
122 | |||
123 | |||
124 |