/** * look up an attribute reference * if strict false, anything can be returned, not just attributes */ Variable VARfind( Scope scope, char * name, int strict ) { Variable result; /* first look up locally */ switch( scope->type ) { case OBJ_ENTITY: result = ENTITYfind_inherited_attribute( scope, name, 0 ); if( result ) { if( strict && ( DICT_type != OBJ_VARIABLE ) ) { fprintf( stderr, "ERROR: strict && ( DICT_type != OBJ_VARIABLE )\n" ); } return result; } break; case OBJ_INCREMENT: case OBJ_QUERY: case OBJ_ALIAS: result = ( Variable )DICTlookup( scope->symbol_table, name ); if( result ) { if( strict && ( DICT_type != OBJ_VARIABLE ) ) { fprintf( stderr, "ERROR: strict && ( DICT_type != OBJ_VARIABLE )\n" ); } return result; } return( VARfind( scope->superscope, name, strict ) ); } return 0; }
/** * look up an attribute reference * if strict false, anything can be returned, not just attributes */ Variable VARfind( Scope scope, char * name, int strict ) { Variable result; /* first look up locally */ switch( scope->type ) { case OBJ_ENTITY: result = ENTITYfind_inherited_attribute( scope, name, 0 ); if( result ) { if( strict && ( DICT_type != OBJ_VARIABLE ) ) { printf( "schema.c: press ^C now to trap to debugger\n" ); exp_pause(); } return result; } break; case OBJ_INCREMENT: case OBJ_QUERY: case OBJ_ALIAS: result = ( Variable )DICTlookup( scope->symbol_table, name ); if( result ) { if( strict && ( DICT_type != OBJ_VARIABLE ) ) { printf( "schema.c: press ^C now to trap to debugger\n" ); exp_pause(); } return result; } return( VARfind( scope->superscope, name, strict ) ); } return 0; }