/*
@title
PROGRAM protel_read: Converter for Protel .net files
@application external
@text
PCB netlist to ACFP converter. Looks for netlists in ASCII containing tags like:
@listing
@text
Usage
@listing
protel_read <protel_file> [ d ]
@text
If a lower
case 'd' is present as the second argument, the Bison parser
(interpreter of keywords and syntax) prints extremely verbose diagnostics.
@break
Normally the acfp file produced on standard output is redirected to a file e.g.
@listing
eagle_read file.net > file.acfp
@text
Will produce file.acfp from file.net.
@break
Following this it is necessary to run the output through Vertical again in order to
set up properties on nets (power and ground being made not routable for instance) using the
del routable command. Alternatively the acfp file can be edited to set the net routing
flags for these nets.
@end
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#if defined HAS_TCL
#include "tcl_l.h"
#endif
#include "expression.h"
#include "generic.h"
#include "database.h"
#include "printout.h"
#include "routing.h"
#include "cmdparse.h"
#include "cmdlog.h"
#include "yacc_common.h"
#ident "@(#)$Header: c:\\cygwin\\cvsroot/Vert03/eagle_src/eagle_main.c,v 1.1.1.1 2003/11/04 23:34:56 mjames Exp $"
int inside_block;
int main(int argc , char * argv[])
{
InitialiseData();
ExecuteString("echo running \\$(VERTICAL_INIT) file name = $(VERTICAL_INIT) ", argc-1, (argv+1));
ExecuteString("do $(VERTICAL_INIT) ", argc-2, (argv+2));
Log(LOG_GENERAL,
"# Finished initialisation script\n");
print_header(stdout,"'Protel_Read': From Protel PCB .net file");
yydebug = 0;
if (argc>2 && argv[2][0]=='d')
yydebug = 1;
if (argc>1)
yyin
= fopen(argv
[1],"r");
else
yyin = stdin;
if(!yyin)
printf("cannot open input file (%s)\n",argv
[1]);
else
while(yyparse()==0);
perform_routing(Free);
list_database(stdout,0); /*no jumpers so flatten jumpers arg=0 */
list_devices(stdout,
PRINT_TYPE|PRINT_EXPAND_BUS|
PRINT_GENERIC|PRINT_GROUP|
PRINT_ROUTE_FLAGS | PRINT_EQUIVALENT_PINS);
}