Example #1
0
const char * TypeDescriptorName( Type t ) {
    static char b [BUFSIZ];
    Schema parent = t->superscope;
    /* NOTE - I corrected a prev bug here in which the *current* schema was
    ** passed to this function.  Now we take "parent" - the schema in which
    ** Type t was defined - which was actually used to create t's name. DAR */

    if( !parent ) {
        parent = TYPEget_body( t )->entity->superscope;
        /* This works in certain cases that don't work otherwise (basically a
        ** kludge).  For some reason types which are really entity choices of
        ** a select have no superscope value, but their super may be tracked
        ** by following through the entity they reference, as above. */
    }

    sprintf( b, "%s::%s%s", SCHEMAget_name( parent ), TYPEprefix( t ),
             TYPEget_name( t ) );
    return b;
}
Example #2
0
void USEREFout( Schema schema, Dictionary refdict, Linked_List reflist, char * type, FILE * file ) {
    Dictionary dict;
    DictionaryEntry de;
    struct Rename * r;
    Linked_List list;
    char td_name[BUFSIZ];
    char sch_name[BUFSIZ];

    strncpy( sch_name, PrettyTmpName( SCHEMAget_name( schema ) ), BUFSIZ );

    LISTdo( reflist, s, Schema ) {
        fprintf( file, "        // %s FROM %s; (all objects)\n", type, s->symbol.name );
        fprintf( file, "        is = new Interface_spec(\"%s\",\"%s\");\n", sch_name, PrettyTmpName( s->symbol.name ) );
        fprintf( file, "        is->all_objects_(1);\n" );
        if( !strcmp( type, "USE" ) ) {
            fprintf( file, "        %s::schema->use_interface_list_()->Append(is);\n", SCHEMAget_name( schema ) );
        } else {
            fprintf( file, "        %s::schema->ref_interface_list_()->Append(is);\n", SCHEMAget_name( schema ) );
        }
    }
void
SCHEMAdump( Schema schema, FILE * file ) {
    fprintf( file, "SCHEMA %s:\n", SCHEMAget_name( schema ) );
    SCOPEdump( schema, file );
    fprintf( file, "END SCHEMA %s\n\n", SCHEMAget_name( schema ) );
}