token function for bjt instance

This commit is contained in:
dwarning 2007-12-29 21:13:23 +00:00
parent 2785bf1125
commit 888a934fc5
2 changed files with 31 additions and 0 deletions

View File

@ -264,6 +264,35 @@ gettok_noparens(char **s)
return (copy(buf));
}
char *
gettok_instance(char **s)
{
char buf[BSIZE_SP];
int i = 0;
char c;
while ( isspace(**s) )
(*s)++; /* iterate over whitespace */
if (!**s)
return (NULL); /* return NULL if we come to end of line */
while ((c = **s) &&
!isspace(c) &&
( **s != '(' ) &&
( **s != ')' )
) {
buf[i++] = *(*s)++;
}
buf[i] = '\0';
/* Now iterate up to next non-whitespace char */
while ( isspace(**s) )
(*s)++;
return (copy(buf));
}
/*-------------------------------------------------------------------------*
* gettok_node was added by SDB on 12.3.2003
* It acts like gettok, except that it treats parens and commas like

View File

@ -18,6 +18,8 @@ int ciprefix(register char *p, register char *s);
void strtolower(char *str);
char * stripWhiteSpacesInsideParens(char *str);
char * gettok(char **s);
char * gettok_instance(char **);
#ifdef CIDER
/* cider integration */