Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 2 | mjames | 1 | %{ |
| 2 | /* $Id: orcad_yacc.y,v 1.1.1.1 2003/11/04 23:34:58 mjames Exp $ |
||
| 3 | * |
||
| 4 | * $Log: orcad_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.4 2002/10/02 19:37:28 MJAMES |
||
| 9 | * Moved dummy functions to a separate support file. |
||
| 10 | * |
||
| 11 | * Used correct number of arguments to define_pin |
||
| 12 | * |
||
| 13 | * Revision 1.3 2002/09/09 10:16:43 mjames |
||
| 14 | * Modified expression parser to match CC as previous one was |
||
| 15 | * broken |
||
| 16 | * |
||
| 17 | * Revision 1.2 2001/10/31 22:20:10 mjames |
||
| 18 | * Tidying up problematical comments caused by CVS |
||
| 19 | * 'intelligent' comment guessing |
||
| 20 | * |
||
| 21 | * Revision 1.1 2001/10/23 21:11:38 mjames |
||
| 22 | * Added in an Orcad reader into Vertical |
||
| 23 | * |
||
| 24 | * |
||
| 25 | * |
||
| 26 | * */ |
||
| 27 | #include <stdio.h> |
||
| 28 | #include <stdlib.h> |
||
| 29 | #include <string.h> |
||
| 30 | #include "expression.h" |
||
| 31 | #include "generic.h" |
||
| 32 | #include "database.h" |
||
| 33 | |||
| 34 | |||
| 35 | static char IDstr[] = "@(#)$Header: C:/cvsroot/Vert03/orcad_src/orcad_yacc.y,v 1.1.1.1 2003/11/04 23:34:58 mjames Exp $"; |
||
| 36 | |||
| 37 | |||
| 38 | static socket_t * current_chip; |
||
| 39 | static char curr_net_nam[MAXIDLEN]; |
||
| 40 | int inside_block; |
||
| 41 | %} |
||
| 42 | %union { char * string; } |
||
| 43 | %token SPACE LF CR |
||
| 44 | %token <string> ASTRING |
||
| 45 | |||
| 46 | %% |
||
| 47 | |||
| 48 | file : objects; |
||
| 49 | |||
| 50 | |||
| 51 | objects : objects net |
||
| 52 | | net |
||
| 53 | ; |
||
| 54 | |||
| 55 | |||
| 56 | net : net_name pin_lines space_endline |
||
| 57 | | net_name space_endline |
||
| 58 | | space_endline; |
||
| 59 | |||
| 60 | net_name : ASTRING space_endline { strcpy(curr_net_nam,$1); }; |
||
| 61 | |||
| 62 | |||
| 63 | pin_lines : pin_lines pin_line |
||
| 64 | | pin_line |
||
| 65 | ; |
||
| 66 | |||
| 67 | pin_line : SPACE pinlist space_endline; |
||
| 68 | |||
| 69 | |||
| 70 | |||
| 71 | pinlist : pinlist SPACE pin |
||
| 72 | | pin |
||
| 73 | ; |
||
| 74 | |||
| 75 | pin : ASTRING '.' ASTRING { define_pin(&routed_list, |
||
| 76 | find_socket(Ident,$1,Create,&socket_head), |
||
| 77 | curr_net_nam,BIDIR,0,$3, |
||
| 78 | default_vhdl_datatype,NULL); }; |
||
| 79 | |||
| 80 | space_endline : opt_space endline; |
||
| 81 | |||
| 82 | opt_space : SPACE |
||
| 83 | | /* nothing */ |
||
| 84 | ; |
||
| 85 | |||
| 86 | endline : CR |
||
| 87 | | CR LF |
||
| 88 | | LF |
||
| 89 | ; |
||
| 90 | |||
| 91 | |||
| 92 | |||
| 93 | %% |
||
| 94 | |||
| 95 | /* defining lineno here */ |
||
| 96 | |||
| 97 | int lineno; |
||
| 98 | extern char * yytext; |
||
| 99 | |||
| 100 | int yyerror(char * x) |
||
| 101 | { |
||
| 102 | int token; |
||
| 103 | printf("-- Error --> %s near string (%s) at line %d\n",x,yytext,lineno); |
||
| 104 | /* for(token = yylex();token >= 0 && token!=NL;token = yylex()); */ |
||
| 105 | return 1; |
||
| 106 | } |
||
| 107 | |||
| 108 | int yywrap(void) |
||
| 109 | { |
||
| 110 | return 1; |
||
| 111 | } |
||
| 112 | |||
| 113 | |||
| 114 |