Ejemplo n.º 1
0
static void UnionAllowedValueExpressions(
  CONSTRAINT_RECORD *constraint1,
  CONSTRAINT_RECORD *constraint2,
  CONSTRAINT_RECORD *newConstraint)
  {
   struct expr *theHead = NULL;

   theHead = AddToUnionList(constraint1->restrictionList,theHead,newConstraint);
   theHead = AddToUnionList(constraint2->restrictionList,theHead,newConstraint);

   newConstraint->restrictionList = theHead;
  }
Ejemplo n.º 2
0
static void UnionAllowedClassExpressions(
  void *theEnv,
  CONSTRAINT_RECORD *constraint1,
  CONSTRAINT_RECORD *constraint2,
  CONSTRAINT_RECORD *newConstraint)
  {
   struct expr *theHead = NULL;

   theHead = AddToUnionList(theEnv,constraint1->classList,theHead,newConstraint);
   theHead = AddToUnionList(theEnv,constraint2->classList,theHead,newConstraint);

   newConstraint->classList = theHead;
  }
Ejemplo n.º 3
0
Unions *AddUnion( char *name, ListNode *unions)
{   static int union_tok = FIRST_SORT;
    Unions *pos = FindUnion( name, unions);

    if( pos == NULL )
    {   pos = CreateUnion( name, union_tok++);
        AddToUnionList( pos, unions );
    }
    else if (UnionDefined(pos))
    {  fprintf( stderr,"Redefinition of union %s\n", name);
       exit(EXIT_FAILURE);
    }

    return( pos );
}