Subversion Repositories Vertical

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 mjames 1
%{
2
/*
3
 * $Id: net_yacc.y,v 1.1.1.1 2003/11/04 23:34:59 mjames Exp $
4
 *
5
 * $Log: net_yacc.y,v $
6
 * Revision 1.1.1.1  2003/11/04 23:34:59  mjames
7
 * Imported into local repositrory
8
 *
9
 * Revision 1.8  2002/10/02 19:37:28  MJAMES
10
 * Moved dummy functions to a separate support file.
11
 *
12
 * Used correct number of arguments to define_pin
13
 *
14
 * Revision 1.7  2002/09/09 10:36:20  mjames
15
 * Checkpoint checkin
16
 *
17
 * Revision 1.6  2001/10/31 22:20:09  mjames
18
 * Tidying up problematical comments caused by CVS
19
 * 'intelligent' comment guessing
20
 *
21
 * Revision 1.5  2001/10/02 20:53:27  mjames
22
 * Moved documentation about code to main program module.
23
 *
24
 * Revision 1.4  2001/09/16 19:55:42  mjames
25
 * tidying
26
 *
27
 * Revision 1.3  2001/06/06 12:10:20  mjames
28
 * Move from HPUX
29
 *
30
 * Revision 1.2  2000/12/04 13:14:03  mjames
31
 * Imported all of the PCB syntax readers.
32
 *
33
 * Converted "a/b" to mean "a" divided by "b" insted of a single string
34
 * "a/b" in Verilog
35
 *
36
 * Revision 1.1.1.1  2000/10/19 21:58:38  mjames
37
 * Mike put it here
38
 *
39
 *
40
 * Revision 1.27  2000/10/04  10:37:07  10:37:07  mjames (Mike James)
41
 * Modified for Vertical2 : support COMPONENTS and SIGNALS
42
 * 
43
 * Revision 1.24  2000/09/27  10:58:04  10:58:04  mjames (Mike James)
44
 * Using correct return code from yyparse()
45
 * 
46
 * Revision 1.13  2000/03/08  16:19:19  16:19:19  mjames (Mike James)
47
 * New version including PC
48
 * 
49
 * Revision 1.10  2000/01/20  15:58:46  15:58:46  mjames (Mike James)
50
 * Part of Release R22
51
 * 
52
 * Revision 1.9  99/12/22  11:15:27  11:15:27  mjames (Mike James)
53
 * Part of Release Dec_22_1999
54
 * 
55
 * Revision 1.8  99/06/25  14:35:45  14:35:45  mjames (Mike James)
56
 * Added in reference to expression.h, but no changes made 
57
 * to the function of acfread yet.
58
 * 
59
 * Revision 1.7  99/05/04  09:52:32  09:52:32  mjames (Mike James)
60
 * General checkin
61
 * 
62
 * Revision 1.5  98/07/14  13:24:51  13:24:51  mjames (Mike James)
63
 * Altered calling of some database functions
64
 * 
65
 * Revision 1.4  98/02/11  11:26:46  11:26:46  mjames (Mike James)
66
 * Checked in for version 6.2a
67
 * 
68
 * Revision 1.3  97/04/23  08:45:10  08:45:10  mjames (Mike James)
69
 * CHecked in for release rel23041997
70
 * 
71
 * Revision 1.2  96/12/23  15:16:50  15:16:50  mjames (Mike James)
72
 * Altered because find_socket takes a reference
73
 * to the head-of-list-pointer noth the pointer itself.
74
 * 
75
 * Revision 1.1  96/12/13  08:43:46  08:43:46  mjames (Mike James)
76
 * Initial revision
77
 * 
78
 *
79
 *  */
80
 
81
 
82
 
83
 
84
#include <stdio.h>
85
#include <stdlib.h>
86
#include <string.h>
87
#include "expression.h"
88
#include "generic.h"
89
#include "database.h"
90
 
91
 
92
#ident "@(#)$Header: C:/cvsroot/Vert03/net_src/net_yacc.y,v 1.1.1.1 2003/11/04 23:34:59 mjames Exp $"
93
 
94
 
95
static socket_t * current_chip;
96
static char curr_net_nam[MAXIDLEN];
97
int inside_block;
98
%}
99
%union { char * string; }
100
%token PACKAGES NETS END NL PLING SEMI DOT COMMA
101
%token <string> ASTRING
102
 
103
%%
104
 
105
 
106
 
107
 
108
objects : objects object
109
        | object
110
        ;
111
 
112
 
113
object  : package_list
114
        | nets_list
115
        | END  NL
116
        | gap
117
        ;
118
 
119
 
120
package_list : PACKAGES NL component_lines gap;
121
nets_list    : NETS     NL nets gap ;
122
 
123
component_lines : component_lines component_line
124
                | component_line
125
                ;
126
 
127
 
128
component_line :  ASTRING PLING ASTRING SEMI ASTRING NL {
129
                 current_chip = find_socket(Ident,$5,Create,&socket_head);
130
                 set_socket(current_chip,Type,$1) ;
131
                 set_socket(current_chip,Value,$3) ;
132
                 };
133
 
134
 
135
nets            : net nets
136
                | net
137
                ;
138
 
139
 
140
net  : net_name pins gap;
141
 
142
 
143
pins       : pins pin
144
                | pin
145
                | pins COMMA NL pins
146
                ;
147
 
148
net_name   : ASTRING SEMI { strcpy(curr_net_nam,$1); };
149
 
150
 
151
pin           : ASTRING DOT ASTRING { define_pin(&routed_list,
152
                              find_socket(Ident,$1,Create,&socket_head),
153
                              curr_net_nam,BIDIR,0,$3,
154
                              default_vhdl_datatype,NULL); };
155
 
156
 
157
 
158
 
159
gap              : NL gap
160
                  | NL
161
                  |
162
                  ;
163
 
164
 
165
%%
166
 
167
/* defining lineno here */
168
 
169
int lineno;
170
extern char * yytext;
171
 
172
int yyerror(char * x)
173
  {
174
  int token;
175
  printf("Error --> %s near string (%s) at line %d\n",x,yytext,lineno);
176
/*  for(token = yylex();token >= 0 && token!=NL;token = yylex()); */
177
  return 1;
178
  }
179
 
180
int yywrap(void)
181
  {
182
  return 1;
183
  }
184
 
185
 
186