Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 2 | mjames | 1 | %{ |
| 2 | /* |
||
| 3 | * $Id: rep_yacc.y,v 1.1.1.1 2003/11/04 23:34:58 mjames Exp $ |
||
| 4 | * $Log: rep_yacc.y,v $ |
||
| 5 | * Revision 1.1.1.1 2003/11/04 23:34:58 mjames |
||
| 6 | * Imported into local repositrory |
||
| 7 | * |
||
| 8 | * Revision 1.8 2002/10/02 19:37:27 MJAMES |
||
| 9 | * Moved dummy functions to a separate support file. |
||
| 10 | * |
||
| 11 | * Used correct number of arguments to define_pin |
||
| 12 | * |
||
| 13 | * Revision 1.7 2002/09/09 10:36:20 mjames |
||
| 14 | * Checkpoint checkin |
||
| 15 | * |
||
| 16 | * Revision 1.6 2001/10/31 22:20:16 mjames |
||
| 17 | * Tidying up problematical comments caused by CVS |
||
| 18 | * 'intelligent' comment guessing |
||
| 19 | * |
||
| 20 | * Revision 1.5 2001/10/02 20:50:34 mjames |
||
| 21 | * Moved documentation about code to main program module. |
||
| 22 | * |
||
| 23 | * Revision 1.4 2001/08/31 09:34:41 mjames |
||
| 24 | * removed DOS line endings |
||
| 25 | * |
||
| 26 | * Revision 1.3 2001/06/06 12:10:18 mjames |
||
| 27 | * Move from HPUX |
||
| 28 | * |
||
| 29 | * Revision 1.2 2000/12/04 13:14:04 mjames |
||
| 30 | * Imported all of the PCB syntax readers. |
||
| 31 | * |
||
| 32 | * Converted "a/b" to mean "a" divided by "b" insted of a single string |
||
| 33 | * "a/b" in Verilog |
||
| 34 | * |
||
| 35 | * Revision 1.1.1.1 2000/10/19 21:58:39 mjames |
||
| 36 | * Mike put it here |
||
| 37 | * |
||
| 38 | * |
||
| 39 | * Revision 1.2 96/12/23 15:16:50 15:16:50 mjames (Mike James) |
||
| 40 | * Altered because find_socket takes a reference |
||
| 41 | * to the head-of-list-pointer noth the pointer itself. |
||
| 42 | * |
||
| 43 | * Revision 1.1 96/12/13 08:43:46 08:43:46 mjames (Mike James) |
||
| 44 | * Initial revision |
||
| 45 | * |
||
| 46 | * |
||
| 47 | * */ |
||
| 48 | #include <stdio.h> |
||
| 49 | #include <stdlib.h> |
||
| 50 | #include <string.h> |
||
| 51 | #include "expression.h" |
||
| 52 | #include "generic.h" |
||
| 53 | #include "database.h" |
||
| 54 | |||
| 55 | |||
| 56 | #ident "@(#)$Header: C:/cvsroot/Vert03/rep_src/rep_yacc.y,v 1.1.1.1 2003/11/04 23:34:58 mjames Exp $" |
||
| 57 | |||
| 58 | |||
| 59 | static socket_t * current_chip; |
||
| 60 | static char curr_net_nam[MAXIDLEN]; |
||
| 61 | int inside_block; |
||
| 62 | %} |
||
| 63 | %union { char * string; } |
||
| 64 | %token SPACE LF CR |
||
| 65 | %token <string> ASTRING |
||
| 66 | |||
| 67 | %% |
||
| 68 | |||
| 69 | file : objects; |
||
| 70 | |||
| 71 | |||
| 72 | objects : objects object |
||
| 73 | | object |
||
| 74 | ; |
||
| 75 | |||
| 76 | |||
| 77 | object : net |
||
| 78 | | gap |
||
| 79 | ; |
||
| 80 | |||
| 81 | |||
| 82 | net : net_name pin_lines gap; |
||
| 83 | |||
| 84 | net_name : ASTRING endline { strcpy(curr_net_nam,$1); }; |
||
| 85 | |||
| 86 | pin_lines : pin_lines pin_line |
||
| 87 | | pin_line |
||
| 88 | ; |
||
| 89 | |||
| 90 | |||
| 91 | pin_line : SPACE ASTRING SPACE ASTRING endline { define_pin(&routed_list, |
||
| 92 | find_socket(Ident,$2,Create,&socket_head), |
||
| 93 | curr_net_nam,BIDIR,0,$4, |
||
| 94 | default_vhdl_datatype,NULL); }; |
||
| 95 | |||
| 96 | endline : CR |
||
| 97 | | CR LF |
||
| 98 | | LF |
||
| 99 | ; |
||
| 100 | |||
| 101 | |||
| 102 | gap : endline gap |
||
| 103 | | endline |
||
| 104 | | |
||
| 105 | ; |
||
| 106 | |||
| 107 | |||
| 108 | %% |
||
| 109 | |||
| 110 | /* defining lineno here */ |
||
| 111 | |||
| 112 | int lineno; |
||
| 113 | extern char * yytext; |
||
| 114 | |||
| 115 | int yyerror(char * x) |
||
| 116 | { |
||
| 117 | int token; |
||
| 118 | printf("Error --> %s near string (%s) at line %d\n",x,yytext,lineno); |
||
| 119 | /* for(token = yylex();token >= 0 && token!=NL;token = yylex()); */ |
||
| 120 | return 1; |
||
| 121 | } |
||
| 122 | |||
| 123 | int yywrap(void) |
||
| 124 | { |
||
| 125 | return 1; |
||
| 126 | } |
||
| 127 | |||
| 128 | |||
| 129 |