/*
* $Id: chck_names.c,v 1.1.1.1 2003/11/04 23:34:57 mjames Exp $
*
* $Log: chck_names.c,v $
* Revision 1.1.1.1 2003/11/04 23:34:57 mjames
* Imported into local repositrory
*
* Revision 1.8 2002/01/15 12:38:53 mjames
* converted to use #ident
*
* Revision 1.7 2001/10/31 22:19:59 mjames
* Tidying up problematical comments caused by CVS
* 'intelligent' comment guessing
*
* Revision 1.6 2001/10/23 21:15:54 mjames
* Become less critical of old style wildcards. The user may be right in fact.
*
* Revision 1.5 2001/10/10 20:18:45 mjames
* Added a vert_regcomp function to compile regular expressions
* with '^' (match start string) and '$' (match end string) bracketing
* this => wildcard must match entire string not just a part of it.
*
* Revision 1.4 2001/10/10 12:49:47 mjames
* Passed wrong argument to wildcard validator within template ensure . Fixed
*
* Revision 1.3 2001/10/07 20:50:54 mjames
* Added wildcard checking (warn user about
* using wildcard '*' on the end of a string in stead of wildcard '.*')
*
* Revision 1.2 2001/06/06 12:10:26 mjames
* Move from HPUX
*
* Revision 1.1.1.1 2000/10/19 21:58:34 mjames
* Mike put it here
*
*
* Revision 1.35 2000/10/04 10:37:02 10:37:02 mjames (Mike James)
* Modified to become part of vertical2, complete
* with VHDL COMPONENT and SIGNAL declarations.
*
*/
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* TCL/Tk declarations */
#include "chck_names.h"
#include "cmdlog.h"
#include "cmdparse.h"
#include "database.h"
#include "expression.h"
#include "generic.h"
#include "lx_support.h"
#include "statistics.h"
#include "vertcl_main.h"
#ident \
"@(#)$Header: c:\\cygwin\\cvsroot/Vert03/vertlib/chck_names.c,v 1.1.1.1 2003/11/04 23:34:57 mjames Exp $"
/* exported flag */
int need_validate_names = 0;
static void list_dodgy_net_id_names (net_t *netlist)
{
while (netlist)
{
/*
printf("'%s' '%s'\n",netlist->name,netlist->identifier);
*/
if (strchr (netlist
->name
, ' '))
Log (
LOG_ERROR,
"# Warning : Net name '%s' has a SPACE in it\n",
netlist->name);
if (strchr (netlist
->identifier
, ' '))
Log (
LOG_ERROR,
"# Warning : Net identifier '%s' has a SPACE in it\n",
netlist->identifier);
netlist = netlist->next;
}
}
void validate_names (void)
{
list_dodgy_net_id_names (unrouted_list);
list_dodgy_net_id_names (routed_list);
list_dodgy_net_id_names (named_list);
}
/*************************************************/
/* check to see if a wildcard is formed 'old' or */
/* 'new' regexp style */
/*************************************************/
int check_wildcard (char *patt)
{
int l;
if (ISNULLSTR (patt))
{
Log (LOG_ERROR, "-- problem with zero length regular expression pattern\n");
return TCL_ERROR;
}
/*
if ( patt[0] == '$' )
{
Log(LOG_ERROR,"-- Need to use '\$' NOT '$' at beginning of regular expression
pattern '%s'\n",patt); return TCL_ERROR;
}
*/
if (patt[l - 1] == '*' && ((l == 1) || (l >= 2 && patt[l - 2] != '.')))
{
Log (
LOG_ERROR,
"-- May Need to use '.*' NOT '*' in regular expression pattern '%s'\n",
patt);
}
return TCL_OK;
}