dis_sql/src/sql_iff.cxx
//
// iff_ast_reference - Recursively output all symbol references.
//
// A symbol reference is any use of the symbol's name in the program,
// except for its definition (test of defined flag).  Also don't
// output reference entries of keyword symbols (like VARCHAR2), since they
// have their own entries with the rest of the keywords.
//
Recursively output all symbol references.
A symbol reference is any use of the symbol's name in the program,
except for its definition (test of defined flag).  Also don't
output reference entries of keyword symbols (like VARCHAR2), since they
have their own entries with the rest of the keywords.
Recursively output all symbol references . A symbol reference is any use of the symbol ' s name in the program except for its definition ( test of defined flag ) . Also don ' t output reference entries of keyword symbols ( like VARCHAR2 ) since they have their own entries with the rest of the keywords .
static int iff_ast_reference (ast_tree *at)
{
   ast_treelist * atl;
   if ( ! at ) {
      return (0);
   }
   if (( ! at->info.defined ) &&
       (at->info.reference & REFMASK_SMT) &&
       ( ! at->info.keyword ) &&
       at->sym &&
       ( ! at->sym->sym_replace )) {
      if (fprintf (iff_fp, "%s", IFFSTR_SMT) < 0) {
	 return (iff_io_error ());
      }
      if (iff_symbol_id (at->sym) < 0) {
	 return (-1);
      }
      if (iff_ast_loc (at->start, at->end) < 0) {
	 return (-1);
      }
      if (fputc ('\n', iff_fp) == EOF) { return (iff_io_error ()); }
   }
   for (atl = at->head; atl; atl = atl->next) {
      if (iff_ast_reference (atl->ast) < 0) {
	 return (-1);
      }
   }
   return (0);
}
static int iff_ast_reference ( ast_tree * at ) { ast_treelist * atl ; if ( ! at ) { return ( 0 ) ; } if ( ( ! at -> info . defined ) && ( at -> info . reference & REFMASK_SMT ) && ( ! at -> info . keyword ) && at -> sym && ( ! at -> sym -> sym_replace ) ) { if ( fprintf ( iff_fp , " " , IFFSTR_SMT ) < 0 ) { return ( iff_io_error ( ) ) ; } if ( iff_symbol_id ( at -> sym ) < 0 ) { return ( -1 ) ; } if ( iff_ast_loc ( at -> start , at -> end ) < 0 ) { return ( -1 ) ; } if ( fputc ( ' \n ' , iff_fp ) == EOF ) { return ( iff_io_error ( ) ) ; } } for ( atl = at -> head ; atl ; atl = atl -> next ) { if ( iff_ast_reference ( atl -> ast ) < 0 ) { return ( -1 ) ; } } return ( 0 ) ; }
iff_ast_reference - Recursively output all symbol references.
iff_ast_reference - Recursively output all symbol references .