dis_sql/src/sql_iff.cxx
//
// iff_ast_relation_node 
//
// Set relation info (in instance of iff_relation class above) found
// in this tree node.  Output relation entry it this is the child
// symbol endpoint of a relation.
//
iff_ast_relation_node
Set relation info (in instance of iff_relation class above) found
in this tree node.  Output relation entry it this is the child
symbol endpoint of a relation.
iff_ast_relation_node Set relation info ( in instance of iff_relation class above ) found in this tree node . Output relation entry it this is the child symbol endpoint of a relation .
static int iff_ast_relation_node (ast_tree * at)
{
   char buffer [80];
   if ( ! at ) {
      return (0);
   }
   if (at->info.relation_attr_mask) {
      if (at->info.relation_attr_mask & RELMASK_ARG) {
	 sprintf (buffer, "%d", at->info.arg);
	 rel.add_attribute (IFFSTR_ATTR_ARG, buffer);
      }
      if (at->info.relation_attr_mask & RELMASK_CONST) {
	 rel.add_attribute (IFFSTR_ATTR_CONST);
      }
      if (at->info.relation_attr_mask & RELMASK_INPUT) {
	 rel.add_attribute (IFFSTR_ATTR_INPUT);
      }
      if (at->info.relation_attr_mask & RELMASK_OUTPUT) {
	 rel.add_attribute (IFFSTR_ATTR_OUTPUT);
      }
      if (at->info.relation_attr_mask & RELMASK_PCTROWTYPE) {
	 rel.add_attribute (IFFSTR_ATTR_PCTROWTYPE);
      }
      if (at->info.relation_attr_mask & RELMASK_PCTTYPE) {
	 rel.add_attribute (IFFSTR_ATTR_PCTTYPE);
      }
      if (at->info.relation_attr_mask & RELMASK_PRIVATE) {
	 rel.add_attribute (IFFSTR_ATTR_PRIVATE);
      }
      if (at->info.relation_attr_mask & RELMASK_PUBLIC) {
	 rel.add_attribute (IFFSTR_ATTR_PUBLIC);
      }
      if (at->info.relation_attr_mask & RELMASK_RETURN) {
	 rel.add_attribute (IFFSTR_ATTR_RETURN);
      }
      if (at->info.relation_attr_mask & RELMASK_SCALE) {
	 sprintf (buffer, "%d", at->info.scale);
	 rel.add_attribute (IFFSTR_ATTR_SCALE, buffer);
      }
      if (at->info.relation_attr_mask & RELMASK_SIZE) {
	 sprintf (buffer, "%d", at->info.size);
	 rel.add_attribute (IFFSTR_ATTR_SIZE, buffer);
      }
   }
    check for relationship kind
   if (at->info.relation) {
      switch (at->info.rk) {
	 case rk_type:
	    rel.set_label (IFFSTR_REL_TYPE);
	    break;
	 case rk_context:
	    rel.set_label (IFFSTR_REL_CONTEXT);
	    rel.reverse_symbols ();
	    break;
	 case rk_call:
	    rel.set_label (IFFSTR_REL_CALL);
	    rel.reverse_symbols ();
	    break;
	 case rk_arg:
	    rel.set_label (IFFSTR_REL_ARG);
	    break;
	 default:
	    break;
      }
   }
    Check for symbol.  Output relation entry for this symbol
    and its parent.  Then set this symbol as the parent for
    any child in a subtree.
   if (at->sym) {
      rel.set_source (at->sym);
      if (rel.output () < 0) {
	 return (-1);
      }
      rel.clear ();
      rel.set_target (at->sym);
   }
   return (0);
}
static int iff_ast_relation_node ( ast_tree * at ) { char buffer [ 80 ] ; if ( ! at ) { return ( 0 ) ; } if ( at -> info . relation_attr_mask ) { if ( at -> info . relation_attr_mask & RELMASK_ARG ) { sprintf ( buffer , " " , at -> info . arg ) ; rel . add_attribute ( IFFSTR_ATTR_ARG , buffer ) ; } if ( at -> info . relation_attr_mask & RELMASK_CONST ) { rel . add_attribute ( IFFSTR_ATTR_CONST ) ; } if ( at -> info . relation_attr_mask & RELMASK_INPUT ) { rel . add_attribute ( IFFSTR_ATTR_INPUT ) ; } if ( at -> info . relation_attr_mask & RELMASK_OUTPUT ) { rel . add_attribute ( IFFSTR_ATTR_OUTPUT ) ; } if ( at -> info . relation_attr_mask & RELMASK_PCTROWTYPE ) { rel . add_attribute ( IFFSTR_ATTR_PCTROWTYPE ) ; } if ( at -> info . relation_attr_mask & RELMASK_PCTTYPE ) { rel . add_attribute ( IFFSTR_ATTR_PCTTYPE ) ; } if ( at -> info . relation_attr_mask & RELMASK_PRIVATE ) { rel . add_attribute ( IFFSTR_ATTR_PRIVATE ) ; } if ( at -> info . relation_attr_mask & RELMASK_PUBLIC ) { rel . add_attribute ( IFFSTR_ATTR_PUBLIC ) ; } if ( at -> info . relation_attr_mask & RELMASK_RETURN ) { rel . add_attribute ( IFFSTR_ATTR_RETURN ) ; } if ( at -> info . relation_attr_mask & RELMASK_SCALE ) { sprintf ( buffer , " " , at -> info . scale ) ; rel . add_attribute ( IFFSTR_ATTR_SCALE , buffer ) ; } if ( at -> info . relation_attr_mask & RELMASK_SIZE ) { sprintf ( buffer , " " , at -> info . size ) ; rel . add_attribute ( IFFSTR_ATTR_SIZE , buffer ) ; } } if ( at -> info . relation ) { switch ( at -> info . rk ) { case rk_type : rel . set_label ( IFFSTR_REL_TYPE ) ; break ; case rk_context : rel . set_label ( IFFSTR_REL_CONTEXT ) ; rel . reverse_symbols ( ) ; break ; case rk_call : rel . set_label ( IFFSTR_REL_CALL ) ; rel . reverse_symbols ( ) ; break ; case rk_arg : rel . set_label ( IFFSTR_REL_ARG ) ; break ; default : break ; } } if ( at -> sym ) { rel . set_source ( at -> sym ) ; if ( rel . output ( ) < 0 ) { return ( -1 ) ; } rel . clear ( ) ; rel . set_target ( at -> sym ) ; } return ( 0 ) ; }
iff_ast_relation_node
Set relation info (in instance of iff_relation class above) found
in this tree node.
iff_ast_relation_node Set relation info ( in instance of iff_relation class above ) found in this tree node .
// Check for relation attributes and set. // Note that some attributes have values the rest are // booleans (their label in the entry implies true) // // check for relationship kind // Check for symbol.  Output relation entry for this symbol // and its parent.  Then set this symbol as the parent for // any child in a subtree.