Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
%{
/*
* $Id: rep_yacc.y,v 1.1.1.1 2003/11/04 23:34:58 mjames Exp $
* $Log: rep_yacc.y,v $
* Revision 1.1.1.1 2003/11/04 23:34:58 mjames
* Imported into local repositrory
*
* Revision 1.8 2002/10/02 19:37:27 MJAMES
* Moved dummy functions to a separate support file.
*
* Used correct number of arguments to define_pin
*
* Revision 1.7 2002/09/09 10:36:20 mjames
* Checkpoint checkin
*
* Revision 1.6 2001/10/31 22:20:16 mjames
* Tidying up problematical comments caused by CVS
* 'intelligent' comment guessing
*
* Revision 1.5 2001/10/02 20:50:34 mjames
* Moved documentation about code to main program module.
*
* Revision 1.4 2001/08/31 09:34:41 mjames
* removed DOS line endings
*
* Revision 1.3 2001/06/06 12:10:18 mjames
* Move from HPUX
*
* Revision 1.2 2000/12/04 13:14:04 mjames
* Imported all of the PCB syntax readers.
*
* Converted "a/b" to mean "a" divided by "b" insted of a single string
* "a/b" in Verilog
*
* Revision 1.1.1.1 2000/10/19 21:58:39 mjames
* Mike put it here
*
*
* Revision 1.2 96/12/23 15:16:50 15:16:50 mjames (Mike James)
* Altered because find_socket takes a reference
* to the head-of-list-pointer noth the pointer itself.
*
* Revision 1.1 96/12/13 08:43:46 08:43:46 mjames (Mike James)
* Initial revision
*
*
* */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "expression.h"
#include "generic.h"
#include "database.h"
#ident "@(#)$Header: C:/cvsroot/Vert03/rep_src/rep_yacc.y,v 1.1.1.1 2003/11/04 23:34:58 mjames Exp $"
static socket_t * current_chip;
static char curr_net_nam[MAXIDLEN];
int inside_block;
%}
%union { char * string; }
%token SPACE LF CR
%token <string> ASTRING
%%
file : objects;
objects : objects object
| object
;
object : net
| gap
;
net : net_name pin_lines gap;
net_name : ASTRING endline { strcpy(curr_net_nam,$1); };
pin_lines : pin_lines pin_line
| pin_line
;
pin_line : SPACE ASTRING SPACE ASTRING endline { define_pin(&routed_list,
find_socket(Ident,$2,Create,&socket_head),
curr_net_nam,BIDIR,0,$4,
default_vhdl_datatype,NULL); };
endline : CR
| CR LF
| LF
;
gap : endline gap
| endline
|
;
%%
/* defining lineno here */
int lineno;
extern char * yytext;
int yyerror(char * x)
{
int token;
printf("Error --> %s near string (%s) at line %d\n",x,yytext,lineno);
/* for(token = yylex();token >= 0 && token!=NL;token = yylex()); */
return 1;
}
int yywrap(void)
{
return 1;
}