dis_sql/src/sql_iff.cxx
//
// iff_ast_definition - Output symbol definitions (recursive) for tree
//
// Definitions are flaged with "defined".  Also outputs attributes
// associated with this symbol.
//
Output symbol definitions (recursive) for tree
Definitions are flaged with "defined".  Also outputs attributes
associated with this symbol.
Output symbol definitions ( recursive ) for tree Definitions are flaged with " defined " . Also outputs attributes associated with this symbol .
static int iff_ast_definition (ast_tree *at)
{
   ast_treelist * atl;
   int rep_flag = 0;
   if ( ! at ) {
      return (0);
   }
   if (at->info.defined && at->sym) {
      if (esql_mode && at->sym->sym_replace) {
	 rep_flag = 1;
      }
      if ( ! rep_flag ) {
	 if (iff_symbol_entry (at->sym, rep_flag) < 0) {
	    return (-1);
	 }
	 if (iff_ast_loc (at->start, at->end) < 0) {
	    return (-1);
	 }
	 if (fputc ('\n', iff_fp) == EOF) { return (iff_io_error ()); }
	 if (iff_symbol_attribute (at->sym) < 0) {
	    return (-1);
	 }
      }
   }
   for (atl = at->head; atl; atl = atl->next) {
      if (iff_ast_definition (atl->ast) < 0) {
	 return (-1);
      }
   }
   return (0);
}
static int iff_ast_definition ( ast_tree * at ) { ast_treelist * atl ; int rep_flag = 0 ; if ( ! at ) { return ( 0 ) ; } if ( at -> info . defined && at -> sym ) { if ( esql_mode && at -> sym -> sym_replace ) { rep_flag = 1 ; } if ( ! rep_flag ) { if ( iff_symbol_entry ( at -> sym , rep_flag ) < 0 ) { return ( -1 ) ; } if ( iff_ast_loc ( at -> start , at -> end ) < 0 ) { return ( -1 ) ; } if ( fputc ( ' \n ' , iff_fp ) == EOF ) { return ( iff_io_error ( ) ) ; } if ( iff_symbol_attribute ( at -> sym ) < 0 ) { return ( -1 ) ; } } } for ( atl = at -> head ; atl ; atl = atl -> next ) { if ( iff_ast_definition ( atl -> ast ) < 0 ) { return ( -1 ) ; } } return ( 0 ) ; }
iff_ast_definition - Output symbol definitions (recursive) for tree
Definitions are flaged with "defined".
iff_ast_definition - Output symbol definitions ( recursive ) for tree Definitions are flaged with " defined " .
// now recursively output symbol definitions for subtrees