Subversion Repositories Vertical

Rev

Rev 2 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

%{
/* 
 * $Header: C:/cvsroot/Vert03/rep2_src/rep2_yacc.y,v 1.1.1.1 2003/11/04 23:34:58 mjames Exp $
 *
 * $Log: rep2_yacc.y,v $
 * Revision 1.1.1.1  2003/11/04 23:34:58  mjames
 * Imported into local repositrory
 *
 * Revision 1.5  2003/03/04 15:25:12  mjames
 * Added #ident
 *
 * Revision 1.4  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.3  2002/01/16 10:08:34  mjames
 * Removed unused terminals
 *
 * Revision 1.2  2001/10/31 22:20:15  mjames
 * Tidying up problematical comments caused by CVS
 * 'intelligent' comment guessing
 *
 * Revision 1.1  2001/10/02 20:52:58  mjames
 * Another .REP file format reader
 *
 *

 
 *  */


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "expression.h"
#include "generic.h"
#include "database.h"
/* 
@title
PROGRAM rep2read
@text
Reads Yet Another Bloody Drawing Office File Format.
@break
Try this one as well as PROGRAM repread on '.REP' files.
@end
*/

#ident "@(#)$Header: C:/cvsroot/Vert03/rep2_src/rep2_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 ENDFILE
%token <string> ASTRING 
%type <string> netid

%%

file : objects;


objects   : objects object
          | object
          ;


object    : pin
          ;



pin   : ASTRING spaces ASTRING SPACE netid SPACE ASTRING SPACE ASTRING SPACE ASTRING endline
          { 

             /* socket pin_id [ net_id ] x y layer */
              define_pin(&routed_list,
                  find_socket(Ident,$1,Create,&socket_head),
                              $5,BIDIR,0,$3,
                              default_vhdl_datatype,NULL);
           };

netid     : ASTRING       { $$=$1; } 
          | /* nothing */ { $$ = ""; };


endline   : CR 
          | CR LF
          | LF
          ;




spaces : spaces SPACE 
       | SPACE ;
       
%%

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

int yywrap(void)
  {
  return 1;
  }