Browse Source

numparam/xpressn.c, drop `getidtype()'

pre-master-46
rlar 10 years ago
parent
commit
00c3d2f79e
  1. 2
      src/frontend/numparam/numparam.h
  2. 4
      src/frontend/numparam/spicenum.c
  3. 15
      src/frontend/numparam/xpressn.c

2
src/frontend/numparam/numparam.h

@ -75,6 +75,6 @@ bool nupa_assignment(dico_t *, char *s, char mode);
bool nupa_subcktcall(dico_t *, char *s, char *x, char *inst_name); bool nupa_subcktcall(dico_t *, char *s, char *x, char *inst_name);
void nupa_subcktexit(dico_t *); void nupa_subcktexit(dico_t *);
dico_t *nupa_fetchinstance(void); dico_t *nupa_fetchinstance(void);
nupa_type getidtype(dico_t *, char *s);
entry_t *entrynb(dico_t *dico, char *s);
entry_t *attrib(dico_t *, NGHASHPTR htable, char *t, char op); entry_t *attrib(dico_t *, NGHASHPTR htable, char *t, char op);
void del_attrib(void *); void del_attrib(void *);

4
src/frontend/numparam/spicenum.c

@ -215,6 +215,7 @@ findsubname(dico_t *dico, SPICE_DSTRINGPTR dstr_p)
found = (k >= 0) && alfanum(s[k + 1]); /* suppose an identifier */ found = (k >= 0) && alfanum(s[k + 1]); /* suppose an identifier */
if (found) { if (found) {
entry_t *entry;
/* check for known subckt name */ /* check for known subckt name */
spice_dstring_reinit(&name); spice_dstring_reinit(&name);
j = k + 1; j = k + 1;
@ -222,7 +223,8 @@ findsubname(dico_t *dico, SPICE_DSTRINGPTR dstr_p)
cadd(&name, upcase(s[j])); cadd(&name, upcase(s[j]));
j++; j++;
} }
found = (getidtype(dico, spice_dstring_value(&name)) == NUPA_SUBCKT);
entry = entrynb(dico, spice_dstring_value(&name));
found = entry && (entry->tp == NUPA_SUBCKT);
} }
} }

15
src/frontend/numparam/xpressn.c

@ -367,7 +367,7 @@ donedico(dico_t *dico)
* look thru the stack of local symbols and then look at the global * look thru the stack of local symbols and then look at the global
* symbols in that order. * symbols in that order.
* ----------------------------------------------------------------- */ * ----------------------------------------------------------------- */
static entry_t *
entry_t *
entrynb(dico_t *dico, char *s) entrynb(dico_t *dico, char *s)
{ {
int depth; /* stack depth */ int depth; /* stack depth */
@ -388,19 +388,6 @@ entrynb(dico_t *dico, char *s)
} }
nupa_type
getidtype(dico_t *dico, char *s)
/* test if identifier s is known. Answer its type, or '?' if not in table */
{
entry_t *entry = entrynb(dico, s);
if (entry)
return entry->tp;
return NUPA_UNKNOWN;
}
static double static double
fetchnumentry(dico_t *dico, char *s, bool *perr) fetchnumentry(dico_t *dico, char *s, bool *perr)
{ {

Loading…
Cancel
Save