* Sebastian Hammer, Adam Dickmeiss
*
* $Log: d1_absyn.c,v $
- * Revision 1.3 1995-11-01 16:34:55 quinn
+ * Revision 1.4 1996-05-01 12:45:28 quinn
+ * Support use of local tag names in abs file.
+ *
+ * Revision 1.3 1995/11/01 16:34:55 quinn
* Making data1 look for tables in data1_tabpath
*
* Revision 1.2 1995/11/01 13:54:44 quinn
level = i;
if (!(new = *ppl[level] = xmalloc(sizeof(*new))))
abort;
- new ->next = new->children = 0;
+ new->next = new->children = 0;
+ new->tag = 0;
+ new->att = 0;
ppl[level] = &new->next;
ppl[level+1] = &new->children;
- if (sscanf(p, "(%d,%d)", &type, &value) < 2)
+ /* well-defined tag */
+ if (sscanf(p, "(%d,%d)", &type, &value) == 2)
{
- logf(LOG_WARN, "Malformed element '%s' in %s", p, file);
- fclose(f);
- return 0;
+ if (!res->tagset)
+ {
+ logf(LOG_WARN, "No tagset loaded in %s", file);
+ fclose(f);
+ return 0;
+ }
+ if (!(new->tag = data1_gettagbynum(res->tagset, type, value)))
+ {
+ logf(LOG_WARN, "Couldn't find tag %s in tagset in %s",
+ p, file);
+ fclose(f);
+ return 0;
+ }
}
- if (!res->tagset)
+ /* private tag */
+ else if (*p)
{
- logf(LOG_WARN, "No tagset loaded in %s", file);
- fclose(f);
- return 0;
+ data1_tag *nt = new->tag = xmalloc(sizeof(*new->tag));
+ nt->which = DATA1T_string;
+ nt->value.string = xstrdup(p);
+ nt->names = xmalloc(sizeof(*new->tag->names));
+ nt->names->name = nt->value.string;
+ nt->names->next = 0;
+ nt->kind = DATA1K_string;
}
- if (!(new->tag = data1_gettagbynum(res->tagset, type, value)))
+ else
{
- logf(LOG_WARN, "Couldn't find tag %s in tagset in %s",
- p, file);
+ logf(LOG_WARN, "Bad element is %s", file);
fclose(f);
return 0;
}
+
if (*att == '!')
strcpy(att, name);
if (*att == '-')
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: d1_grs.c,v $
- * Revision 1.3 1995-11-13 09:27:35 quinn
+ * Revision 1.4 1996-05-01 12:45:30 quinn
+ * Support use of local tag names in abs file.
+ *
+ * Revision 1.3 1995/11/13 09:27:35 quinn
* Fiddling with the variant stuff.
*
* Revision 1.2 1995/11/01 13:54:46 quinn
}
res->tagType = odr_malloc(o, sizeof(int));
- *res->tagType = tag ? tag->tagset->type : 3;
+ *res->tagType = (tag && tag->tagset) ? tag->tagset->type : 3;
res->tagValue = odr_malloc(o, sizeof(Z_StringOrNumeric));
if (tag && tag->which == DATA1T_numeric)
{
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: d1_map.c,v $
- * Revision 1.7 1995-12-13 13:44:31 quinn
+ * Revision 1.8 1996-05-01 12:45:31 quinn
+ * Support use of local tag names in abs file.
+ *
+ * Revision 1.7 1995/12/13 13:44:31 quinn
* Modified Data1-system to use nmem
*
* Revision 1.6 1995/12/12 16:37:08 quinn
return 0;
if (n->u.tag.element)
{
- if (n->u.tag.element->tag->tagset->type != t->type)
+ if (n->u.tag.element->tag->tagset)
+ {
+ if (n->u.tag.element->tag->tagset->type != t->type)
+ return 0;
+ }
+ else if (t->type != 3)
return 0;
if (n->u.tag.element->tag->which == DATA1T_numeric)
{