#include "symtab.h"
#include "newalloc.h"
-extern char *currModName ;
structdef *structWithName (char *);
/*------------------------------------------------------------------*/
/* get the stack offset */
s++;
nsym->offset = strtol(s,&s,10);
- *rs = s;
+ if ( nsym->addrspace == 'R' )
+ {
+ /* get registeroffset */
+ while (*s && *s != '[') s++ ;
+ s++ ;
+ if ( *s == 'r' )
+ {
+ nsym->addr = strtol(s+1,&s,10);
+ }
+ while (*s && *s != ']') s++ ;
+ }
+
+ *rs = s;
addSet(&symbols,nsym);
return nsym;
{
symbol *sym = NULL ;
- /* first try & find a local variable for the
- given name */
- if ( applyToSet(symbols,symLocal,
+ if ((ctxt) && (ctxt->func) &&
+ (ctxt->func->sym) && (ctxt->func->sym->name)) {
+ /* first try & find a local variable for the given name */
+ if ( applyToSet(symbols,symLocal,
name,
ctxt->func->sym->name,
ctxt->block,
ctxt->level,
&sym))
- return sym;
+ return sym;
+ sym = NULL;
+ }
+
+ if ((ctxt) && (ctxt->func) &&
+ (ctxt->func->mod) && (ctxt->func->mod->name)) {
+ /* then try local to this module */
+ if (applyToSet(symbols,symLocal,
+ name,
+ ctxt->func->mod->name,
+ 0,0,&sym))
+ return sym;
+ sym = NULL;
+ }
- sym = NULL;
- /* then try local to this module */
- if (applyToSet(symbols,symLocal,
- name,
- ctxt->func->mod->name,
- 0,0,&sym))
- return sym;
- sym = NULL;
/* no:: try global */
if ( applyToSet(symbols,symGlobal,name,&sym))
- return sym;
+ return sym;
/* cannot find return null */
return NULL;