Exemplo n.º 1
0
Bool EqualConst(ConstNode *u1, ConstNode *u2) {

  /* The type field of Const nodes is a Node which is either of
     type Prim or Adcl(Char)
     Legal BasicTypes for primNodes are Sin, Uint,
     Slong, Ulong, Float, or Double */

  primNode *p1, *p2;
  
  if (EqualTypeNodes(u1->type, u2->type)) {
    switch(u1->type->typ) {
    case Prim:
      p1 = &(u1->type->u.prim);  /* Get BasicType of the Type nodes */
      p2 = &(u2->type->u.prim);

      if(EqualPrim(p1, p2)) {
	switch(p1->basic) {
	case Sint:
	  return (u1->value.i == u2->value.i);
	case Uint:
	  return (u1->value.u == u2->value.u);
	case Slong:
	  return (u1->value.l == u2->value.l);
	case Ulong:
	  return (u1->value.ul == u2->value.ul);
	case Float:
	  return (u1->value.f == u2->value.f);
	case Double:
	  return (u1->value.d == u2->value.d);
	default:
	  return FALSE;
	}
      }
      else {
	return FALSE;
      }
    case Adcl:
      return EqualStrings(u1->value.s, u2->value.s);
    default:
      return FALSE;
    }
  }
  else {
    return FALSE;
  }
}
Exemplo n.º 2
0
 void convert(char const * name, EDensity & density)
 {
   density = static_cast<EDensity>(FindFirstBySecond(s_density, name, EqualStrings()));
 }
Exemplo n.º 3
0
 void convert(char const * name, ESemantic & sem)
 {
   sem = static_cast<ESemantic>(FindFirstBySecond(s_semantics, name, EqualStrings()));
 }
Exemplo n.º 4
0
Bool EqualText(textNode *u1, textNode *u2) {
  return (EqualStrings(u1->text, u2->text));
}
Exemplo n.º 5
0
Bool EqualAttrib(attribNode *u1, attribNode *u2) {
  return (EqualStrings(u1->name, u2->name));
}
Exemplo n.º 6
0
Bool EqualDecl(declNode *u1, declNode *u2) {
  return (tq_equal(u1->tq, u2->tq)
	  && (EqualStrings(u1->name, u2->name)));
}
Exemplo n.º 7
0
Bool EqualTdef(tdefNode *u1, tdefNode *u2) {
  return ( EqualStrings(u1->name, u2->name)
	   && tq_equal(u1->tq, u2->tq));
}
Exemplo n.º 8
0
Bool EqualLabel(labelNode *u1, labelNode *u2) {
  return (EqualStrings(u1->name, u2->name));
}
Exemplo n.º 9
0
Bool EqualId(idNode *u1, idNode *u2) {
  return (EqualStrings(u1->text, u2->text));
}