Subversion Repositories Vertical

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

%{
/*
 * $Id: net_yacc.y,v 1.1.1.1 2003/11/04 23:34:59 mjames Exp $
 *
 * $Log: net_yacc.y,v $
 * Revision 1.1.1.1  2003/11/04 23:34:59  mjames
 * Imported into local repositrory
 *
 * Revision 1.8  2002/10/02 19:37:28  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:09  mjames
 * Tidying up problematical comments caused by CVS
 * 'intelligent' comment guessing
 *
 * Revision 1.5  2001/10/02 20:53:27  mjames
 * Moved documentation about code to main program module.
 *
 * Revision 1.4  2001/09/16 19:55:42  mjames
 * tidying
 *
 * Revision 1.3  2001/06/06 12:10:20  mjames
 * Move from HPUX
 *
 * Revision 1.2  2000/12/04 13:14:03  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:38  mjames
 * Mike put it here
 *
 *
 * Revision 1.27  2000/10/04  10:37:07  10:37:07  mjames (Mike James)
 * Modified for Vertical2 : support COMPONENTS and SIGNALS
 * 
 * Revision 1.24  2000/09/27  10:58:04  10:58:04  mjames (Mike James)
 * Using correct return code from yyparse()
 * 
 * Revision 1.13  2000/03/08  16:19:19  16:19:19  mjames (Mike James)
 * New version including PC
 * 
 * Revision 1.10  2000/01/20  15:58:46  15:58:46  mjames (Mike James)
 * Part of Release R22
 * 
 * Revision 1.9  99/12/22  11:15:27  11:15:27  mjames (Mike James)
 * Part of Release Dec_22_1999
 * 
 * Revision 1.8  99/06/25  14:35:45  14:35:45  mjames (Mike James)
 * Added in reference to expression.h, but no changes made 
 * to the function of acfread yet.
 * 
 * Revision 1.7  99/05/04  09:52:32  09:52:32  mjames (Mike James)
 * General checkin
 * 
 * Revision 1.5  98/07/14  13:24:51  13:24:51  mjames (Mike James)
 * Altered calling of some database functions
 * 
 * Revision 1.4  98/02/11  11:26:46  11:26:46  mjames (Mike James)
 * Checked in for version 6.2a
 * 
 * Revision 1.3  97/04/23  08:45:10  08:45:10  mjames (Mike James)
 * CHecked in for release rel23041997
 * 
 * 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/net_src/net_yacc.y,v 1.1.1.1 2003/11/04 23:34:59 mjames Exp $"


static socket_t * current_chip;
static char curr_net_nam[MAXIDLEN];
int inside_block;
%}
%union { char * string; }
%token PACKAGES NETS END NL PLING SEMI DOT COMMA
%token <string> ASTRING

%%




objects : objects object
        | object
        ;


object  : package_list
        | nets_list
        | END  NL
        | gap
        ;


package_list : PACKAGES NL component_lines gap;
nets_list    : NETS     NL nets gap ;

component_lines : component_lines component_line
                | component_line
                ;


component_line :  ASTRING PLING ASTRING SEMI ASTRING NL {
                 current_chip = find_socket(Ident,$5,Create,&socket_head);
                 set_socket(current_chip,Type,$1) ;
                 set_socket(current_chip,Value,$3) ;
                 };


nets            : net nets
                | net
                ;


net  : net_name pins gap;


pins       : pins pin
                | pin
                | pins COMMA NL pins
                ;

net_name   : ASTRING SEMI { strcpy(curr_net_nam,$1); };


pin           : ASTRING DOT ASTRING { define_pin(&routed_list,
                              find_socket(Ident,$1,Create,&socket_head),
                              curr_net_nam,BIDIR,0,$3,
                              default_vhdl_datatype,NULL); };




gap              : NL gap
                  | NL
                  |
                  ;


%%

/* 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;
  }