Blame | Last modification | View Log | Download | RSS feed
%{
/*
* $Id: eagle_yacc.y,v 1.1.1.1 2003/11/04 23:34:56 mjames Exp $
*
* $Log: eagle_yacc.y,v $
* Revision 1.1.1.1 2003/11/04 23:34:56 mjames
* Imported into local repositrory
*
* Revision 1.1 2002/12/04 22:28:28 mjames
* Initial release Eagle PCB reader
*
* Revision 1.6 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.5 2002/09/09 10:16:42 mjames
* Modified expression parser to match CC as previous one was
* broken
*
* Revision 1.4 2001/10/31 22:20:11 mjames
* Tidying up problematical comments caused by CVS
* 'intelligent' comment guessing
*
* Revision 1.3 2001/10/02 20:53:27 mjames
* Moved documentation about code to main program module.
*
* Revision 1.2 2001/09/16 19:56:43 mjames
* tidying
*
* Revision 1.1 2001/07/05 13:10:51 MJAMES
* Created padsread for PADS-PCB netlists
*
* 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/eagle_src/eagle_yacc.y,v 1.1.1.1 2003/11/04 23:34:56 mjames Exp $"
static char text_buff[1024];
static socket_t * current_chip;
static char curr_net_nam[MAXIDLEN];
int inside_block;
%}
%union { char * string; }
%token SPC NL
%token <string> ASTRING
%%
eaglefile : lines;
lines : lines line
| line
;
skip_line : NL
| SPC NL
;
line : first_line
| add_line
| skip_line
;
first_line : net_ident SPC socket_pin NL ;
add_line : SPC socket_pin NL;
net_ident : ASTRING { strcpy(curr_net_nam,$1); };
socket_pin : socket_ident SPC ASTRING { define_pin(&routed_list,
current_chip,
curr_net_nam,BIDIR,0,$3,
default_vhdl_datatype,NULL); };
socket_ident: ASTRING { current_chip = find_socket(Ident,$1,Create,&socket_head);
set_socket(current_chip,Type,$1) ; /* same type as Ident so can pick up later */
};
%%
/* 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;
}