To manage packages of inter code.
-
diff --git a/docs/bytecode-module/2-st.html b/docs/bytecode-module/2-st.html
index 1d0583473..7782b72f9 100644
--- a/docs/bytecode-module/2-st.html
+++ b/docs/bytecode-module/2-st.html
@@ -73,187 +73,278 @@ function togglePopup(material_id) {
To manage searchable tables of named symbols.
-
+
-
+
+(a) With a dictionary for (fairly) efficient lookup by name; and
+ (b) With an array for rapid lookup by ID number.
+
+
+
+
+
+define SYMBOL_BASE_VAL 0x40000000
+define NO_SYMBOLS_WORTH_A_DICTIONARY 5
+
typedef struct inter_symbols_table {
struct inter_package * owning_package ;
- struct dictionary * symbols_lookup ;
- int size ;
- struct inter_symbol ** symbol_array ;
- int n_index ;
- inter_ti next_free_ID ;
+
+ struct dictionary * symbols_dictionary ;
+
+ struct inter_symbol ** symbol_array ;
+ int symbol_array_size ;
+ inter_ti next_free_symbol_ID ;
+
+ inter_ti resource_ID ;
CLASS_DEFINITION
} inter_symbols_table ;
-The structure inter_symbols_table is accessed in 2/tw, 2/pck, 2/sym, 2/cnn, 2/trn, 3/iibf and here.
+The structure inter_symbols_table is accessed in 2/pck, 3/dfn, 3/iibf, 3/iitf, 4/tcc2 and here.
-define INITIAL_INTER_SYMBOLS_ID_RANGE 16
-define SYMBOLS_THRESHOLD 5
-define SYMBOL_BASE_VAL 0x40000000
-
-inter_symbols_table * InterSymbolsTables::new ( void ) {
+inter_symbols_table * InterSymbolsTable::new ( inter_ti resource_ID ) {
inter_symbols_table * ST = CREATE ( inter_symbols_table );
- ST -> symbols_lookup = NULL ;
- ST -> size = INITIAL_INTER_SYMBOLS_ID_RANGE ;
- ST -> symbol_array = ( inter_symbol **)
- Memory::calloc ( INITIAL_INTER_SYMBOLS_ID_RANGE , sizeof ( inter_symbol *), INTER_SYMBOLS_MREASON );
- for ( int i =0; i < INITIAL_INTER_SYMBOLS_ID_RANGE ; i ++) ST -> symbol_array [ i ] = NULL ;
- ST -> n_index = 0 ;
ST -> owning_package = NULL ;
- ST -> next_free_ID = SYMBOL_BASE_VAL ;
+
+ ST -> symbols_dictionary = NULL ;
+
+ ST -> symbol_array_size = 16 ;
+ ST -> symbol_array = ( inter_symbol **) Memory::calloc ( ST -> symbol_array_size ,
+ sizeof ( inter_symbol *), INTER_SYMBOLS_MREASON );
+ for ( int i =0; i <ST-> symbol_array_size ; i ++) ST -> symbol_array [ i ] = NULL ;
+ ST -> next_free_symbol_ID = SYMBOL_BASE_VAL ;
+
+ ST -> resource_ID = resource_ID ;
return ST ;
}
+
+
-void InterSymbolsTables::log ( OUTPUT_STREAM , void * vst ) {
- inter_symbols_table * ST = ( inter_symbols_table *) vst ;
- if ( ST == NULL ) WRITE ( "<null-stable>" );
- else {
- WRITE ( "<%d:" , ST -> allocation_id );
- if ( ST -> owning_package == NULL ) WRITE ( "(root)" );
- else WRITE ( "$6" , ST -> owning_package );
- WRITE ( ">" );
- }
+
+
+
+inter_package * InterSymbolsTable::package ( inter_symbols_table * ST ) {
+ if ( ST ) return ST -> owning_package ;
+ return NULL ;
}
-
+
define LOOP_OVER_SYMBOLS_TABLE ( S , T )
- for ( int i =0; i <T-> size ; i ++)
+ for ( int i =0; i <(T?(T-> symbol_array_size ):0); i ++)
for ( inter_symbol * S = T -> symbol_array [ i ]; S ; S = NULL )
+
+
+
+
+
+
-void InterSymbolsTables::write_declarations ( OUTPUT_STREAM , inter_symbols_table * ST , int L ) {
- if ( ST == NULL ) return ;
- for ( int i =0; i <ST-> size ; i ++) {
- inter_symbol * S = ST -> symbol_array [ i ];
- if ( S ) {
- Inter::Symbols::write_declaration ( OUT , S , L ); WRITE ( "\n" );
- }
- }
+inter_symbol * InterSymbolsTable::search_inner ( inter_symbols_table * T , text_stream * name ,
+ int create , inter_ti ID , int wire_following ) {
+ if ( T == NULL ) internal_error ( "no symbols table" );
+ Handle the empty symbol name as a special case 5.1 ;
+ Look for the name in the table, and return it if it exists 5.2 ;
+ if ( create ) Create a new symbol with this name, and return it 5.3 ;
+ return NULL ;
}
+
+
-inter_symbol * InterSymbolsTables::search_inner ( inter_symbols_table * T , text_stream * S , int create , inter_ti ID , int equating ) {
- if ( T == NULL ) internal_error ( "no IST" );
- if ( S == NULL ) return NULL ;
-
- if (( T -> symbols_lookup == NULL ) &&
- ( T -> next_free_ID - SYMBOL_BASE_VAL >= SYMBOLS_THRESHOLD )) {
- T -> symbols_lookup = Dictionaries::new ( INITIAL_INTER_SYMBOLS_ID_RANGE , FALSE );
- for ( int i =0; i <T-> size ; i ++) {
- inter_symbol * A = T -> symbol_array [ i ];
- if ( A ) {
- Dictionaries::create ( T -> symbols_lookup , A -> symbol_name );
- Dictionaries::write_value ( T -> symbols_lookup , A -> symbol_name , ( void *) A );
- }
- }
+
+ if ( Str::len ( name ) == 0 ) {
+ if ( create ) internal_error ( "cannot create a symbol with the empty name" );
+ return NULL ;
}
+
+
+
- if ( T -> symbols_lookup == NULL ) {
- for ( int i =0; i <T-> size ; i ++) {
- inter_symbol * A = T -> symbol_array [ i ];
- if (( A ) && ( Str::eq ( S , A -> symbol_name ))) {
- if ( equating ) A = Wiring::cable_end ( A );
- return A ;
+
+ inter_symbol * S = NULL ;
+ if ( T -> symbols_dictionary == NULL ) {
+ LOOP_OVER_SYMBOLS_TABLE ( A , T )
+ if ( Str::eq ( name , A -> symbol_name )) {
+ S = A ; break ;
}
- }
} else {
- dict_entry * de = Dictionaries::find ( T -> symbols_lookup , S );
- if ( de ) {
- inter_symbol * A = ( inter_symbol *) Dictionaries::read_value ( T -> symbols_lookup , S );
- if ( A ) {
- if ( equating ) A = Wiring::cable_end ( A );
- return A ;
- }
- }
+ dict_entry * de = Dictionaries::find ( T -> symbols_dictionary , name );
+ if ( de ) S = ( inter_symbol *) Dictionaries::read_value ( T -> symbols_dictionary , name );
}
-
- if ( create == FALSE ) return NULL ;
-
- if ( ID == 0 ) ID = T -> next_free_ID ++;
- inter_symbol * ST = Inter::Symbols::new ( S , T , ID );
-
- if ( T -> symbols_lookup ) {
- Dictionaries::create ( T -> symbols_lookup , S );
- Dictionaries::write_value ( T -> symbols_lookup , S , ( void *) ST );
+ if ( S ) {
+ if ( wire_following ) S = Wiring::cable_end ( S );
+ return S ;
}
+
+
+
+
+ if ( ID == 0 ) ID = T -> next_free_symbol_ID ++;
+ inter_symbol * S = Inter::Symbols::new ( name , T , ID );
+ Add S to the array 5.3.1 ;
+ if ( T -> symbols_dictionary ) {
+ Add S to the dictionary 5.3.2 ;
+ } else {
+ if ( T -> next_free_symbol_ID - SYMBOL_BASE_VAL >= NO_SYMBOLS_WORTH_A_DICTIONARY )
+ Make a dictionary from the whole symbols array, including the new S 5.3.3 ;
+ }
+ return S ;
+
+
+
+
+
int index = ( int ) ID - ( int ) SYMBOL_BASE_VAL ;
if ( index < 0 ) internal_error ( "bad symbol ID index" );
- if ( index >= T -> size ) {
- int new_size = T -> size ;
+ if ( index >= T -> symbol_array_size ) {
+ int new_size = T -> symbol_array_size ;
while ( index >= new_size ) new_size = new_size * 4 ;
inter_symbol ** enlarged = ( inter_symbol **)
Memory::calloc ( new_size , sizeof ( inter_symbol *), INTER_SYMBOLS_MREASON );
for ( int i =0; i < new_size ; i ++)
- if ( i < T -> size )
+ if ( i < T -> symbol_array_size )
enlarged [ i ] = T -> symbol_array [ i ];
else
enlarged [ i ] = NULL ;
- Memory::I7_free ( T -> symbol_array , INTER_SYMBOLS_MREASON , T -> size );
- T -> size = new_size ;
+ Memory::I7_free ( T -> symbol_array , INTER_SYMBOLS_MREASON , T -> symbol_array_size );
+ T -> symbol_array_size = new_size ;
T -> symbol_array = enlarged ;
}
- if ( index >= T -> size ) internal_error ( "inter symbols expansion failed" );
- T -> symbol_array [ index ] = ST ;
-
- return ST ;
-}
+ if ( index >= T -> symbol_array_size ) internal_error ( "inter symbols expansion failed" );
+ T -> symbol_array [ index ] = S ;
-
+This code is used in §5.3 .
+
-inter_symbol * InterSymbolsTables::symbol_from_name ( inter_symbols_table * T , text_stream * S ) {
- return InterSymbolsTables::search_inner ( T , S , FALSE , 0 , TRUE );
-}
-
-inter_symbol * InterSymbolsTables::symbol_from_name_not_equating ( inter_symbols_table * T , text_stream * S ) {
- return InterSymbolsTables::search_inner ( T , S , FALSE , 0 , FALSE );
-}
-
-inter_symbol * InterSymbolsTables::symbol_from_name_creating ( inter_symbols_table * T , text_stream * S ) {
- return InterSymbolsTables::search_inner ( T , S , TRUE , 0 , TRUE );
-}
-
-inter_symbol * InterSymbolsTables::symbol_from_name_creating_at_ID ( inter_symbols_table * T , text_stream * S , inter_ti ID ) {
- return InterSymbolsTables::search_inner ( T , S , TRUE , ID , TRUE );
-}
-
-inter_symbol * InterSymbolsTables::symbol_from_name_in_main ( inter_tree * I , text_stream * S ) {
- return InterSymbolsTables::symbol_from_name ( InterPackage::scope ( LargeScale::main_package_if_it_exists ( I )), S );
-}
-
-inter_symbol * InterSymbolsTables::symbol_from_name_in_basics ( inter_tree * I , text_stream * S ) {
- inter_package * P = InterPackage::by_url ( I , I "/main/generic/basics" );
- if ( P == NULL ) return NULL ;
- return InterSymbolsTables::symbol_from_name ( InterPackage::scope ( P ), S );
-}
-
-inter_symbol * InterSymbolsTables::symbol_from_name_in_veneer ( inter_tree * I , text_stream * S ) {
- inter_package * P = LargeScale::architecture_package_if_it_exists ( I );
- if ( P == NULL ) return NULL ;
- return InterSymbolsTables::symbol_from_name ( InterPackage::scope ( P ), S );
-}
-
-inter_symbol * InterSymbolsTables::symbol_from_name_in_main_or_basics ( inter_tree * I , text_stream * S ) {
- inter_symbol * symbol = InterSymbolsTables::symbol_from_name_in_basics ( I , S );
- if ( symbol == NULL ) symbol = InterSymbolsTables::symbol_from_name_in_veneer ( I , S );
- if ( symbol == NULL ) symbol = InterSymbolsTables::symbol_from_name_in_main ( I , S );
- return symbol ;
-}
+ Dictionaries::create ( T -> symbols_dictionary , name );
+ Dictionaries::write_value ( T -> symbols_dictionary , name , ( void *) S );
-
+This code is used in §5.3 .
+
-text_stream * InterSymbolsTables::render_identifier_unique ( inter_symbols_table * T , text_stream * name ) {
+ T -> symbols_dictionary = Dictionaries::new (16, FALSE );
+ LOOP_OVER_SYMBOLS_TABLE ( A , T ) {
+ Dictionaries::create ( T -> symbols_dictionary , A -> symbol_name );
+ Dictionaries::write_value ( T -> symbols_dictionary , A -> symbol_name , ( void *) A );
+ }
+
+This code is used in §5.3 .
+
+
+
+
+
+
+
+inter_symbol * InterSymbolsTable::symbol_from_name ( inter_symbols_table * T , text_stream * name ) {
+ return InterSymbolsTable::search_inner ( T , name , FALSE , 0 , TRUE );
+}
+
+
+
+
+inter_symbol * InterSymbolsTable::symbol_from_name_not_equating ( inter_symbols_table * T ,
+ text_stream * name ) {
+ return InterSymbolsTable::search_inner ( T , name , FALSE , 0 , FALSE );
+}
+
+
+
+
+inter_symbol * InterSymbolsTable::symbol_from_name_creating ( inter_symbols_table * T ,
+ text_stream * name ) {
+ return InterSymbolsTable::search_inner ( T , name , TRUE , 0 , TRUE );
+}
+
+
+
+
+inter_symbol * InterSymbolsTable::symbol_from_name_creating_at_ID ( inter_symbols_table * T ,
+ text_stream * name , inter_ti ID ) {
+ return InterSymbolsTable::search_inner ( T , name , TRUE , ID , TRUE );
+}
+
+
+
+
+inter_symbol * InterSymbolsTable::create_with_unique_name ( inter_symbols_table * T ,
+ text_stream * name ) {
+ return InterSymbolsTable::symbol_from_name_creating ( T ,
+ InterSymbolsTable::render_identifier_unique ( T , name ));
+}
+
+
+
+
+text_stream * InterSymbolsTable::render_identifier_unique ( inter_symbols_table * T ,
+ text_stream * name ) {
inter_symbol * ST ;
int N = 1 , A = 0 , still_unduplicated = TRUE ;
- while (( ST = InterSymbolsTables::symbol_from_name ( T , name )) != NULL ) {
+ while (( ST = InterSymbolsTable::symbol_from_name ( T , name )) != NULL ) {
if ( still_unduplicated ) {
name = Str::duplicate ( name );
still_unduplicated = FALSE ;
@@ -268,65 +359,87 @@ function togglePopup(material_id) {
}
return name ;
}
-
-inter_symbol * InterSymbolsTables::create_with_unique_name ( inter_symbols_table * T , text_stream * name ) {
- return InterSymbolsTables::symbol_from_name_creating ( T ,
- InterSymbolsTables::render_identifier_unique ( T , name ));
-}
-
-inter_symbol * InterSymbolsTables::unequated_symbol_from_id ( inter_symbols_table * T , inter_ti ID ) {
+inter_symbol * InterSymbolsTable::symbol_from_ID_not_equating ( inter_symbols_table * T ,
+ inter_ti ID ) {
if ( T == NULL ) return NULL ;
int index = ( int ) ID - ( int ) SYMBOL_BASE_VAL ;
if ( index < 0 ) return NULL ;
- if ( index >= T -> size ) return NULL ;
+ if ( index >= T -> symbol_array_size ) return NULL ;
return T -> symbol_array [ index ];
}
-inter_symbol * InterSymbolsTables::symbol_from_id ( inter_symbols_table * T , inter_ti ID ) {
- inter_symbol * S = InterSymbolsTables::unequated_symbol_from_id ( T , ID );
+inter_symbol * InterSymbolsTable::symbol_from_ID ( inter_symbols_table * T , inter_ti ID ) {
+ inter_symbol * S = InterSymbolsTable::symbol_from_ID_not_equating ( T , ID );
return Wiring::cable_end ( S );
}
-
-inter_symbol * InterSymbolsTables::symbol_from_frame_data ( inter_tree_node * P , int x ) {
- return InterSymbolsTables::symbol_from_id ( InterPackage::scope_of ( P ), P -> W . instruction [ x ]);
+inter_symbol * InterSymbolsTable::symbol_from_ID_at_node ( inter_tree_node * P , int x ) {
+ return InterSymbolsTable::symbol_from_ID ( InterPackage::scope_of ( P ), P -> W . instruction [ x ]);
}
-inter_symbol * InterSymbolsTables::global_symbol_from_frame_data ( inter_tree_node * P , int x ) {
- return InterSymbolsTables::symbol_from_id ( Inode::globals ( P ), P -> W . instruction [ x ]);
+inter_symbol * InterSymbolsTable::global_symbol_from_ID_at_node ( inter_tree_node * P , int x ) {
+ return InterSymbolsTable::symbol_from_ID ( Inode::globals ( P ), P -> W . instruction [ x ]);
}
-inter_symbol * InterSymbolsTables::local_symbol_from_id ( inter_package * owner , inter_ti ID ) {
- return InterSymbolsTables::symbol_from_id ( InterPackage::scope ( owner ), ID );
+inter_symbol * InterSymbolsTable::symbol_from_ID_in_package ( inter_package * owner , inter_ti ID ) {
+ return InterSymbolsTable::symbol_from_ID ( InterPackage::scope ( owner ), ID );
}
+
+
-inter_symbol * InterSymbolsTables::symbol_from_data_pair_and_table ( inter_ti val1 , inter_ti val2 , inter_symbols_table * T ) {
- if ( val1 == ALIAS_IVAL ) return InterSymbolsTables::symbol_from_id ( T , val2 );
+
+inter_symbol * InterSymbolsTable::symbol_from_data_pair ( inter_ti val1 , inter_ti val2 ,
+ inter_symbols_table * T ) {
+ if ( val1 == ALIAS_IVAL ) return InterSymbolsTable::symbol_from_ID ( T , val2 );
return NULL ;
}
-inter_symbol * InterSymbolsTables::symbol_from_data_pair_and_frame ( inter_ti val1 , inter_ti val2 , inter_tree_node * P ) {
- return InterSymbolsTables::symbol_from_data_pair_and_table ( val1 , val2 , InterPackage::scope_of ( P ));
+inter_symbol * InterSymbolsTable::symbol_from_data_pair_at_node ( inter_ti val1 ,
+ inter_ti val2 , inter_tree_node * P ) {
+ return InterSymbolsTable::symbol_from_data_pair ( val1 , val2 , InterPackage::scope_of ( P ));
}
-
-inter_ti InterSymbolsTables::id_from_symbol_inner_not_creating ( inter_tree * I , inter_package * P , inter_symbol * S ) {
+ +-----------------+
+ | Package P |
+ | |
+ | 0: example |
+ | 1: another |
+ | 2: plugh |
+ | 3: further |
+ +-----------------+
+
+
+
+
+
+
+inter_ti InterSymbolsTable::id_from_symbol_not_creating ( inter_tree * I ,
+ inter_package * P , inter_symbol * S ) {
if ( S == NULL ) internal_error ( "no symbol" );
- inter_symbols_table * T = InterPackage::scope ( P );
+ inter_symbols_table * T = InterPackage::scope ( P );
if ( T == NULL ) T = InterTree::global_scope ( I );
if ( T != S -> owning_table ) {
LOG ( "Symbol is $3, owned by $4, but we wanted ID from $4\n" , S , S -> owning_table , T );
@@ -335,128 +448,161 @@ symbols table, that's easy:
return S -> symbol_ID ;
}
-inter_ti InterSymbolsTables::id_from_symbol_not_creating ( inter_tree * I , inter_package * P , inter_symbol * S ) {
- return InterSymbolsTables::id_from_symbol_inner_not_creating ( I , P , S );
-}
-
-inter_ti InterSymbolsTables::id_from_bookmark_and_symbol_not_creating ( inter_bookmark * IBM , inter_symbol * S ) {
- return InterSymbolsTables::id_from_symbol_inner_not_creating ( InterBookmark::tree ( IBM ), InterBookmark::package ( IBM ), S );
+inter_ti InterSymbolsTable::id_from_global_symbol ( inter_tree * I , inter_symbol * S ) {
+ return InterSymbolsTable::id_from_symbol_not_creating ( I , NULL , S );
}
-
-
-
-inter_ti InterSymbolsTables::id_from_symbol_inner ( inter_symbols_table * G , inter_package * P , inter_symbol * S ) {
+ +-----------------+ +-----------------+
+ | Package P | | Package SP |
+ | | | |
+ | 0: example | | 0: xyzzy |
+ | 1: another | | 1: plugh |
+ | 2: further | | |
+ +-----------------+ +-----------------+
+
+
+
+
+ +-----------------+
+ | Package P |
+ | | +-----------------+
+ | 0: example | | Package SP |
+ | 1: another | | |
+ | 2: further | | 0: xyzzy |
+ | 3: plugh ~~~~~~~~~~~~~~> 1: plugh |
+ +-----------------+ +-----------------+
+
+
+
+
+
+
+
+
+
+
+
+ +-----------------+ +-----------------+
+ | Package P | | Package SP |
+ | | | |
+ | 0: plugh | | 0: xyzzy |
+ | 1: another | | 1: plugh |
+ | 2: further | | |
+ +-----------------+ +-----------------+
+
+
+
+
+ +-----------------+
+ | Package P |
+ | | +-----------------+
+ | 0: plugh | | Package SP |
+ | 1: another | | |
+ | 2: further | | 0: xyzzy |
+ | 3: plugh_1 ~~~~~~~~~~~~> 1: plugh |
+ +-----------------+ +-----------------+
+
+
+
+
+inter_ti InterSymbolsTable::id_from_symbol ( inter_tree * I , inter_package * P , inter_symbol * S ) {
if ( S == NULL ) internal_error ( "no symbol" );
- inter_symbols_table * T = InterPackage::scope ( P );
- if ( T == NULL ) T = G ;
- if ( T != S -> owning_table ) {
- LOGIF ( INTER_SYMBOLS , "Seek ID of $3 from $4, which is not its owner $4\n" , S , T , S -> owning_table );
- if ( S -> owning_table == G ) {
- LOG ( "Seek ID of $3 from $4, which is not its owner $4\n" , S , T , S -> owning_table );
- internal_error ( "attempted to equate to global" );
- }
- for ( int i =0; i <T-> size ; i ++)
- if ( Wiring::wired_to ( T -> symbol_array [ i ]) == S )
- return ( inter_ti ) T -> symbol_array [ i ]-> symbol_ID ;
- text_stream * N = InterSymbolsTables::render_identifier_unique ( T , S -> symbol_name );
- inter_symbol * X = InterSymbolsTables::search_inner ( T , N , TRUE , 0 , FALSE );
- if ( Wiring::is_wired ( X ) == FALSE ) {
- Wiring::wire_to ( X , S );
- LOGIF ( INTER_SYMBOLS , "Equating $3 to new $3\n" , S , X );
- }
- if ( Wiring::wired_to ( X ) != S ) {
- LOG ( "Want ID for $3 but there's already $3 locally which is wired to $3\n" , S , X , Wiring::wired_to ( X ));
- internal_error ( "external symbol clash" );
- }
- return X -> symbol_ID ;
- }
- return S -> symbol_ID ;
-}
-
-inter_ti InterSymbolsTables::id_from_symbol ( inter_tree * I , inter_package * P , inter_symbol * S ) {
- return InterSymbolsTables::id_from_symbol_inner ( InterTree::global_scope ( I ), P , S );
-}
-
-inter_ti InterSymbolsTables::id_from_symbol_F ( inter_tree_node * F , inter_package * P , inter_symbol * S ) {
- return InterSymbolsTables::id_from_symbol_inner ( Inode::globals ( F ), P , S );
-}
-
-inter_ti InterSymbolsTables::id_from_IRS_and_symbol ( inter_bookmark * IBM , inter_symbol * S ) {
- return InterSymbolsTables::id_from_symbol_inner ( InterTree::global_scope ( InterBookmark::tree ( IBM )), InterBookmark::package ( IBM ), S );
+ inter_symbols_table * P_table = InterPackage::scope ( P );
+ if ( P_table == NULL ) P_table = InterTree::global_scope ( I );
+ inter_symbols_table * SP_table = S -> owning_table ;
+ if ( P_table != SP_table ) We need an ID to a faraway symbol 16.1
+ else return S -> symbol_ID ;
}
-
+
+
+
-void InterSymbolsTables::resolve_forward_references ( inter_tree * I , inter_error_location * eloc ) {
- InterTree::traverse ( I , InterSymbolsTables::rfr_visitor , eloc , NULL , PACKAGE_IST );
-}
+ LOGIF ( INTER_SYMBOLS ,
+ "Seek ID of $3 from $4, which is not its owner $4\n" , S , P_table , SP_table );
+ if ( SP_table == InterTree::global_scope ( I ))
+ internal_error ( "cannot make a local symbol ID from a global symbol" );
+ If this table already has a symbol wired to that faraway symbol, fine: use that 16.1.1 ;
+ Otherwise make a new symbol in the table and wire it to the faraway one 16.1.2 ;
+
+This code is used in §16 .
+
-void InterSymbolsTables::rfr_visitor ( inter_tree * I , inter_tree_node * P , void * state ) {
- inter_error_location * eloc = ( inter_error_location *) state ;
- inter_package * pack = InterPackage::at_this_head ( P );
- if ( pack == NULL ) internal_error ( "no package defined here" );
- inter_symbols_table * T = InterPackage::scope ( pack );
- if ( T == NULL ) internal_error ( "package with no symbols" );
- for ( int i =0; i <T-> size ; i ++) {
- inter_symbol * symb = T -> symbol_array [ i ];
- if ( Wiring::is_wired_to_name ( symb )) {
- text_stream * N = Wiring::wired_to_name ( symb );
- if ( Inter::Symbols::get_scope ( symb ) == PLUG_ISYMS ) continue ;
- inter_symbol * S_to = InterSymbolsTables::url_name_to_symbol ( InterPackage::tree ( pack ), T , N );
- if ( S_to == NULL ) Inter::Errors::issue ( Inter::Errors::quoted ( I "unable to locate symbol" , N , eloc ));
- else if ( Inter::Symbols::get_scope ( symb ) == SOCKET_ISYMS )
- Wiring::convert_to_socket ( symb , S_to );
- else Wiring::wire_to ( symb , S_to );
- }
- }
+
+ LOOP_OVER_SYMBOLS_TABLE ( E , P_table )
+ if ( Wiring::wired_to ( E ) == S )
+ return ( inter_ti ) E -> symbol_ID ;
+
+This code is used in §16.1 .
+
+
+
+ inter_symbol * X = InterSymbolsTable::create_with_unique_name ( P_table , S -> symbol_name );
+ Wiring::wire_to ( X , S );
+ return X -> symbol_ID ;
+
+This code is used in §16.1 .
+
+
+
+inter_ti InterSymbolsTable::id_from_symbol_at_bookmark ( inter_bookmark * IBM ,
+ inter_symbol * S ) {
+ return InterSymbolsTable::id_from_symbol ( InterBookmark::tree ( IBM ),
+ InterBookmark::package ( IBM ), S );
}
-
+
+
+
+
+
define MAX_URL_SYMBOL_NAME_DEPTH 512
-inter_symbol * InterSymbolsTables::url_name_to_symbol ( inter_tree * I , inter_symbols_table * T , text_stream * S ) {
- inter_symbols_table * at = InterTree::global_scope ( I );
- if ( Str::get_first_char ( S ) == '/' ) {
- inter_package * at_P = I -> root_package ;
- TEMPORARY_TEXT ( C )
- LOOP_THROUGH_TEXT ( P , S ) {
- wchar_t c = Str::get ( P );
- if ( c == '/' ) {
- if ( Str::len ( C ) > 0 ) {
- at_P = InterPackage::by_name ( at_P , C );
- if ( at_P == NULL ) return NULL ;
- }
- Str::clear ( C );
- } else {
- PUT_TO ( C , c );
- }
- }
- return InterSymbolsTables::symbol_from_name ( InterPackage::scope ( at_P ), C );
- }
- inter_symbol * try = InterSymbolsTables::symbol_from_name ( at , S );
- if ( try ) return try ;
- if ( T ) return InterSymbolsTables::symbol_from_name ( T , S );
- return NULL ;
-}
-
-void InterSymbolsTables::symbol_to_url_name ( OUTPUT_STREAM , inter_symbol * S ) {
+void InterSymbolsTable::write_symbol_URL ( OUTPUT_STREAM , inter_symbol * S ) {
inter_package * chain [ MAX_URL_SYMBOL_NAME_DEPTH ];
int chain_length = 0 ;
- inter_package * P = S -> owning_table -> owning_package ;
+ inter_package * P = InterSymbolsTable::package ( S -> owning_table );
if ( P == NULL ) { WRITE ( "%S" , S -> symbol_name ); return ; }
while ( P ) {
if ( chain_length >= MAX_URL_SYMBOL_NAME_DEPTH ) internal_error ( "package nesting too deep" );
@@ -467,6 +613,70 @@ a global symbol in any non-global context.
WRITE ( "/%S" , S -> symbol_name );
}
+
+
+
+
+
+inter_symbol * InterSymbolsTable::URL_to_symbol ( inter_tree * I , text_stream * URL ) {
+ if ( Str::get_first_char ( URL ) == '/' ) {
+ inter_package * at_P = I -> root_package ;
+ TEMPORARY_TEXT ( C )
+ LOOP_THROUGH_TEXT ( P , URL ) {
+ wchar_t c = Str::get ( P );
+ if ( c == '/' ) {
+ if ( Str::len ( C ) > 0 ) {
+ at_P = InterPackage::from_name ( at_P , C );
+ if ( at_P == NULL ) return NULL ;
+ }
+ Str::clear ( C );
+ } else {
+ PUT_TO ( C , c );
+ }
+ }
+ return InterSymbolsTable::symbol_from_name ( InterPackage::scope ( at_P ), C );
+ }
+ return InterSymbolsTable::symbol_from_name ( InterTree::global_scope ( I ), URL );
+}
+
+
+
+
+
+
+void InterSymbolsTable::remove_symbol ( inter_symbol * S ) {
+ int index = ( int ) S -> symbol_ID - ( int ) SYMBOL_BASE_VAL ;
+ Wiring::wire_to ( S , NULL );
+ S -> owning_table -> symbol_array [ index ] = NULL ;
+}
+
+
+
+
+void InterSymbolsTable::log ( OUTPUT_STREAM , void * vst ) {
+ inter_symbols_table * ST = ( inter_symbols_table *) vst ;
+ if ( ST == NULL ) WRITE ( "<null-stable>" );
+ else {
+ WRITE ( "<%d:" , ST -> allocation_id );
+ inter_package * P = InterSymbolsTable::package ( ST );
+ if ( P == NULL ) WRITE ( "(root)" ); else WRITE ( "$6" , P );
+ WRITE ( ">" );
+ }
+}
+
diff --git a/docs/bytecode-module/2-sym.html b/docs/bytecode-module/2-sym.html
index ab7df9b38..ecb4cd9e5 100644
--- a/docs/bytecode-module/2-sym.html
+++ b/docs/bytecode-module/2-sym.html
@@ -97,7 +97,7 @@ function togglePopup(material_id) {
-inter_symbol * Inter::Symbols::new ( text_stream * name , inter_symbols_table * T , inter_ti ID ) {
+inter_symbol * Inter::Symbols::new ( text_stream * name , inter_symbols_table * T , inter_ti ID ) {
if ( Str::len ( name ) == 0 ) internal_error ( "symbol cannot have empty text as identifier" );
inter_symbol * symb = CREATE ( inter_symbol );
symb -> owning_table = T ;
@@ -123,27 +123,32 @@ function togglePopup(material_id) {
return symb ;
}
-int Inter::Symbols::get_type ( inter_symbol * S ) {
+inter_package * Inter::Symbols::package ( inter_symbol * S ) {
+ if ( S == NULL ) return NULL ;
+ return InterSymbolsTable::package ( S -> owning_table );
+}
+
+int Inter::Symbols::get_type ( inter_symbol * S ) {
return S -> symbol_status & SYMBOL_TYPE_MASK_ISYMT ;
}
-int Inter::Symbols::get_scope ( inter_symbol * S ) {
+int Inter::Symbols::get_scope ( inter_symbol * S ) {
return S -> symbol_status & SYMBOL_SCOPE_MASK_ISYMT ;
}
-void Inter::Symbols::set_type ( inter_symbol * S , int V ) {
+void Inter::Symbols::set_type ( inter_symbol * S , int V ) {
S -> symbol_status = S -> symbol_status - ( S -> symbol_status & SYMBOL_TYPE_MASK_ISYMT ) + V ;
}
-void Inter::Symbols::set_scope ( inter_symbol * S , int V ) {
+void Inter::Symbols::set_scope ( inter_symbol * S , int V ) {
S -> symbol_status = S -> symbol_status - ( S -> symbol_status & SYMBOL_SCOPE_MASK_ISYMT ) + V ;
}
-void Inter::Symbols::log ( OUTPUT_STREAM , void * vs ) {
+void Inter::Symbols::log ( OUTPUT_STREAM , void * vs ) {
inter_symbol * S = ( inter_symbol *) vs ;
if ( S == NULL ) WRITE ( "<no-symbol>" );
else {
- InterSymbolsTables::symbol_to_url_name ( DL , S );
+ InterSymbolsTable::write_symbol_URL ( DL , S );
WRITE ( "{%d}" , S -> symbol_ID - SYMBOL_BASE_VAL );
if ( Str::len ( S -> translate_text ) > 0 ) WRITE ( "'%S'" , S -> translate_text );
}
@@ -157,20 +162,20 @@ function togglePopup(material_id) {
-int Inter::Symbols::is_stored_in_data ( inter_ti val1 , inter_ti val2 ) {
+int Inter::Symbols::is_stored_in_data ( inter_ti val1 , inter_ti val2 ) {
if ( val1 == ALIAS_IVAL ) return TRUE ;
return FALSE ;
}
-void Inter::Symbols::to_data ( inter_tree * I , inter_package * pack , inter_symbol * S , inter_ti * val1 , inter_ti * val2 ) {
+void Inter::Symbols::to_data ( inter_tree * I , inter_package * pack , inter_symbol * S , inter_ti * val1 , inter_ti * val2 ) {
if ( S == NULL ) internal_error ( "no symbol" );
- * val1 = ALIAS_IVAL ; * val2 = InterSymbolsTables::id_from_symbol ( I , pack , S );
+ * val1 = ALIAS_IVAL ; * val2 = InterSymbolsTable::id_from_symbol ( I , pack , S );
}
-void Inter::Symbols::write_declaration ( OUTPUT_STREAM , inter_symbol * mark , int N ) {
+void Inter::Symbols::write_declaration ( OUTPUT_STREAM , inter_symbol * mark , int N ) {
for ( int L =0; L < N ; L ++) WRITE ( "\t" );
WRITE ( "symbol " );
switch ( Inter::Symbols::get_scope ( mark )) {
@@ -199,21 +204,21 @@ function togglePopup(material_id) {
WRITE ( " `%S`" , trans_name );
if ( Wiring::is_wired ( mark )) {
WRITE ( " --> " );
- InterSymbolsTables::symbol_to_url_name ( OUT , Wiring::wired_to ( mark ));
+ InterSymbolsTable::write_symbol_URL ( OUT , Wiring::wired_to ( mark ));
}
}
-void Inter::Symbols::define ( inter_symbol * S , inter_tree_node * P ) {
+void Inter::Symbols::define ( inter_symbol * S , inter_tree_node * P ) {
if ( S == NULL ) internal_error ( "tried to define null symbol" );
S -> definition = P ;
}
-inter_tree_node * Inter::Symbols::definition ( inter_symbol * S ) {
+inter_tree_node * Inter::Symbols::definition ( inter_symbol * S ) {
if ( S == NULL ) internal_error ( "tried to find definition of null symbol" );
return S -> definition ;
}
-int Inter::Symbols::is_defined ( inter_symbol * S ) {
+int Inter::Symbols::is_defined ( inter_symbol * S ) {
if ( S == NULL ) return FALSE ;
if ( Inter::Symbols::definition ( S )) return TRUE ;
return FALSE ;
@@ -232,7 +237,7 @@ function togglePopup(material_id) {
( P -> W . instruction [ FORMAT_CONST_IFLD ] == CONSTANT_DIRECT ) &&
( P -> W . instruction [ DATA_CONST_IFLD ] == ALIAS_IVAL )) {
inter_symbols_table * scope = S -> owning_table ;
- inter_symbol * alias_to = InterSymbolsTables::symbol_from_id ( scope , P -> W . instruction [ DATA_CONST_IFLD + 1 ]);
+ inter_symbol * alias_to = InterSymbolsTable::symbol_from_ID ( scope , P -> W . instruction [ DATA_CONST_IFLD + 1 ]);
return Inter::Symbols::evaluate_to_int ( alias_to );
}
return -1;
@@ -252,7 +257,7 @@ function togglePopup(material_id) {
( P -> W . instruction [ FORMAT_CONST_IFLD ] == CONSTANT_DIRECT ) &&
( P -> W . instruction [ DATA_CONST_IFLD ] == ALIAS_IVAL )) {
inter_symbols_table * scope = S -> owning_table ;
- inter_symbol * alias_to = InterSymbolsTables::symbol_from_id ( scope , P -> W . instruction [ DATA_CONST_IFLD + 1 ]);
+ inter_symbol * alias_to = InterSymbolsTable::symbol_from_ID ( scope , P -> W . instruction [ DATA_CONST_IFLD + 1 ]);
Inter::Symbols::set_int ( alias_to , N );
return ;
}
@@ -269,13 +274,7 @@ function togglePopup(material_id) {
}
}
-void Inter::Symbols::remove_from_table ( inter_symbol * S ) {
- int index = ( int ) S -> symbol_ID - ( int ) SYMBOL_BASE_VAL ;
- Wiring::wire_to ( S , NULL );
- S -> owning_table -> symbol_array [ index ] = NULL ;
-}
-
-void Inter::Symbols::undefine ( inter_symbol * S ) {
+void Inter::Symbols::undefine ( inter_symbol * S ) {
if ( S == NULL ) internal_error ( "tried to undefine null symbol" );
S -> definition = NULL ;
}
@@ -284,12 +283,12 @@ function togglePopup(material_id) {
symb -> symbol_status = ( symb -> symbol_status ) & NONTRANSIENT_SYMBOL_BITS ;
}
-int Inter::Symbols::get_flag ( inter_symbol * symb , int f ) {
+int Inter::Symbols::get_flag ( inter_symbol * symb , int f ) {
if ( symb == NULL ) internal_error ( "no symbol" );
return ( symb -> symbol_status & f )? TRUE:FALSE ;
}
-void Inter::Symbols::set_flag ( inter_symbol * symb , int f ) {
+void Inter::Symbols::set_flag ( inter_symbol * symb , int f ) {
if ( symb == NULL ) internal_error ( "no symbol" );
symb -> symbol_status = symb -> symbol_status | f ;
}
@@ -299,17 +298,17 @@ function togglePopup(material_id) {
if ( symb -> symbol_status & f ) symb -> symbol_status = symb -> symbol_status - f ;
}
-void Inter::Symbols::set_translate ( inter_symbol * symb , text_stream * S ) {
+void Inter::Symbols::set_translate ( inter_symbol * symb , text_stream * S ) {
if ( symb == NULL ) internal_error ( "no symbol" );
symb -> translate_text = Str::duplicate ( S );
}
-text_stream * Inter::Symbols::get_translate ( inter_symbol * symb ) {
+text_stream * Inter::Symbols::get_translate ( inter_symbol * symb ) {
if ( symb == NULL ) internal_error ( "no symbol" );
return symb -> translate_text ;
}
-void Inter::Symbols::annotate ( inter_symbol * symb , inter_annotation IA ) {
+void Inter::Symbols::annotate ( inter_symbol * symb , inter_annotation IA ) {
if ( symb == NULL ) internal_error ( "annotated null symbol" );
Inter::Annotations::add_to_set (&( symb -> ann_set ), IA );
}
@@ -324,7 +323,7 @@ function togglePopup(material_id) {
Inter::Symbols::annotate ( symb , IA );
}
-int Inter::Symbols::read_annotation ( const inter_symbol * symb , inter_ti ID ) {
+int Inter::Symbols::read_annotation ( const inter_symbol * symb , inter_ti ID ) {
inter_annotation * IA = Inter::Annotations::find (&( symb -> ann_set ), ID );
if ( IA ) return ( int ) IA -> annot_value ;
return -1;
@@ -336,14 +335,14 @@ function togglePopup(material_id) {
return NULL ;
}
-void Inter::Symbols::annotate_t ( inter_tree * I , inter_package * owner , inter_symbol * symb , inter_ti annot_ID , text_stream * S ) {
+void Inter::Symbols::annotate_t ( inter_tree * I , inter_package * owner , inter_symbol * symb , inter_ti annot_ID , text_stream * S ) {
inter_ti n = InterWarehouse::create_text ( InterTree::warehouse ( I ), owner );
Str::copy ( InterWarehouse::get_text ( InterTree::warehouse ( I ), n ), S );
inter_annotation IA = Inter::Annotations::from_bytecode ( annot_ID , n );
Inter::Symbols::annotate ( symb , IA );
}
-void Inter::Symbols::write_annotations ( OUTPUT_STREAM , inter_tree_node * F , inter_symbol * symb ) {
+void Inter::Symbols::write_annotations ( OUTPUT_STREAM , inter_tree_node * F , inter_symbol * symb ) {
if ( symb ) Inter::Annotations::write_set ( OUT , &( symb -> ann_set ), F );
}
@@ -354,7 +353,7 @@ function togglePopup(material_id) {
-int Inter::Symbols::is_predeclared ( inter_symbol * S ) {
+int Inter::Symbols::is_predeclared ( inter_symbol * S ) {
if ( S == NULL ) return FALSE ;
if ( Inter::Symbols::get_scope ( S ) != PUBLIC_ISYMS ) return FALSE ;
if ( Inter::Symbols::get_type ( S ) != MISC_ISYMT ) return FALSE ;
@@ -362,7 +361,7 @@ function togglePopup(material_id) {
return TRUE ;
}
-int Inter::Symbols::is_predeclared_local ( inter_symbol * S ) {
+int Inter::Symbols::is_predeclared_local ( inter_symbol * S ) {
if ( S == NULL ) return FALSE ;
if ( Inter::Symbols::get_scope ( S ) != PRIVATE_ISYMS ) return FALSE ;
if ( Inter::Symbols::get_type ( S ) != MISC_ISYMT ) return FALSE ;
@@ -377,7 +376,7 @@ function togglePopup(material_id) {
return TRUE ;
}
-int Inter::Symbols::is_extern ( inter_symbol * S ) {
+int Inter::Symbols::is_extern ( inter_symbol * S ) {
if ( S == NULL ) return FALSE ;
if ( Inter::Symbols::get_scope ( S ) == EXTERNAL_ISYMS ) return TRUE ;
if ( Inter::Symbols::get_scope ( S ) == PLUG_ISYMS ) return TRUE ;
@@ -390,7 +389,7 @@ function togglePopup(material_id) {
S -> definition = NULL ;
}
-int Inter::Symbols::is_label ( inter_symbol * S ) {
+int Inter::Symbols::is_label ( inter_symbol * S ) {
if ( S == NULL ) return FALSE ;
if ( Inter::Symbols::get_scope ( S ) != PRIVATE_ISYMS ) return FALSE ;
if ( Inter::Symbols::get_type ( S ) != LABEL_ISYMT ) return FALSE ;
@@ -420,7 +419,7 @@ function togglePopup(material_id) {
return TRUE ;
}
-int Inter::Symbols::is_connector ( inter_symbol * S ) {
+int Inter::Symbols::is_connector ( inter_symbol * S ) {
if (( S ) && (( Inter::Symbols::get_scope ( S ) == PLUG_ISYMS ) ||
( Inter::Symbols::get_scope ( S ) == SOCKET_ISYMS )))
return TRUE ;
diff --git a/docs/bytecode-module/2-trn.html b/docs/bytecode-module/2-trn.html
index e53a1a786..b68eaacf9 100644
--- a/docs/bytecode-module/2-trn.html
+++ b/docs/bytecode-module/2-trn.html
@@ -100,13 +100,12 @@ function togglePopup(material_id) {
if ( tidy_origin ) Correct any references from the origin to the migrant 1.5 ;
inter_package * connectors = LargeScale::connectors_package_if_it_exists ( origin_tree );
if ( connectors ) {
- inter_symbols_table * T = InterPackage::scope ( connectors );
+ inter_symbols_table * T = InterPackage::scope ( connectors );
if ( T == NULL ) internal_error ( "package with no symbols" );
- for ( int i =0; i <T-> size ; i ++) {
- inter_symbol * symb = T -> symbol_array [ i ];
- if (( symb ) && ( Inter::Symbols::get_scope ( symb ) == SOCKET_ISYMS )) {
+ LOOP_OVER_SYMBOLS_TABLE ( symb , T ) {
+ if ( Inter::Symbols::get_scope ( symb ) == SOCKET_ISYMS ) {
inter_symbol * target = Wiring::cable_end ( symb );
- inter_package * target_package = target -> owning_table -> owning_package ;
+ inter_package * target_package = Inter::Symbols::package ( target );
while (( target_package ) && ( target_package != migrant )) {
target_package = InterPackage::parent ( target_package );
}
@@ -138,11 +137,10 @@ function togglePopup(material_id) {
LOG ( "\n\n\nList of sockets in origin tree:\n" );
inter_package * connectors = LargeScale::connectors_package_if_it_exists ( origin_tree );
if ( connectors ) {
- inter_symbols_table * T = InterPackage::scope ( connectors );
+ inter_symbols_table * T = InterPackage::scope ( connectors );
if ( T == NULL ) internal_error ( "package with no symbols" );
- for ( int i =0; i <T-> size ; i ++) {
- inter_symbol * symb = T -> symbol_array [ i ];
- if (( symb ) && ( Inter::Symbols::get_scope ( symb ) == SOCKET_ISYMS )) {
+ LOOP_OVER_SYMBOLS_TABLE ( symb , T ) {
+ if ( Inter::Symbols::get_scope ( symb ) == SOCKET_ISYMS ) {
LOG ( "$3\n" , symb );
}
}
@@ -189,8 +187,8 @@ function togglePopup(material_id) {
- InterPackage::remove_subpackage_name ( InterPackage::parent ( migrant ), migrant );
- InterPackage::add_subpackage_name ( destination , migrant );
+ InterPackage::remove_subpackage_name ( InterPackage::parent ( migrant ), migrant );
+ InterPackage::add_subpackage_name ( destination , migrant );
NodePlacement::move_to_moving_bookmark ( migrant -> package_head , & insertion_point );
@@ -238,18 +236,17 @@ function togglePopup(material_id) {
P -> tree = I ;
if (( P -> W . instruction [ ID_IFLD ] == INV_IST ) && ( P -> W . instruction [ METHOD_INV_IFLD ] == INVOKED_PRIMITIVE )) {
inter_symbol * primitive =
- InterSymbolsTables::symbol_from_id ( InterTree::global_scope ( ipct -> origin_tree ), P -> W . instruction [ INVOKEE_INV_IFLD ]);
+ InterSymbolsTable::symbol_from_ID ( InterTree::global_scope ( ipct -> origin_tree ), P -> W . instruction [ INVOKEE_INV_IFLD ]);
if ( primitive ) Correct the reference to this primitive 3.1 ;
}
if ( P -> W . instruction [ ID_IFLD ] == PACKAGE_IST ) {
inter_package * pack = InterPackage::at_this_head ( P );
if ( pack == NULL ) internal_error ( "no package defined here" );
- if ( InterPackage::is_a_linkage_package ( pack )) return ;
+ if ( InterPackage::is_a_linkage_package ( pack )) return ;
Correct the reference to this package type 3.2 ;
- inter_symbols_table * T = InterPackage::scope ( pack );
+ inter_symbols_table * T = InterPackage::scope ( pack );
if ( T == NULL ) internal_error ( "package with no symbols" );
- for ( int i =0; i <T-> size ; i ++) {
- inter_symbol * symb = T -> symbol_array [ i ];
+ LOOP_OVER_SYMBOLS_TABLE ( symb , T ) {
if ( Wiring::is_wired ( symb )) {
inter_symbol * target = Wiring::cable_end ( symb );
if ( Inter::Symbols::read_annotation ( target , ARCHITECTURAL_IANN ) > 0 ) {
@@ -266,7 +263,7 @@ function togglePopup(material_id) {
}
Wiring::wire_to ( symb , equivalent );
} else {
- inter_package * target_package = target -> owning_table -> owning_package ;
+ inter_package * target_package = Inter::Symbols::package ( target );
while (( target_package ) && ( target_package != ipct -> migrant )) {
target_package = InterPackage::parent ( target_package );
}
@@ -284,20 +281,20 @@ function togglePopup(material_id) {
inter_symbol * equivalent_primitive = Inter::Transmigration::cached_equivalent ( primitive );
if ( equivalent_primitive == NULL ) {
- equivalent_primitive = InterSymbolsTables::symbol_from_name ( InterTree::global_scope ( ipct -> destination_tree ), primitive -> symbol_name );
+ equivalent_primitive = InterSymbolsTable::symbol_from_name ( InterTree::global_scope ( ipct -> destination_tree ), primitive -> symbol_name );
if ( equivalent_primitive == NULL ) Duplicate this primitive 3.1.1 ;
if ( equivalent_primitive ) Inter::Transmigration::cache ( primitive , equivalent_primitive );
}
if ( equivalent_primitive )
- P -> W . instruction [ INVOKEE_INV_IFLD ] = InterSymbolsTables::id_from_symbol_inner ( InterTree::global_scope ( ipct -> destination_tree ), NULL , equivalent_primitive );
+ P -> W . instruction [ INVOKEE_INV_IFLD ] = InterSymbolsTable::id_from_symbol ( ipct -> destination_tree , NULL , equivalent_primitive );
- equivalent_primitive = InterSymbolsTables::symbol_from_name_creating ( InterTree::global_scope ( ipct -> destination_tree ), primitive -> symbol_name );
- inter_tree_node * D = Inode::new_with_1_data_field ( ipct -> primitives_point , PRIMITIVE_IST , InterSymbolsTables::id_from_symbol_inner ( InterTree::global_scope ( ipct -> destination_tree ), NULL , equivalent_primitive ), NULL , 0 );
+ equivalent_primitive = InterSymbolsTable::symbol_from_name_creating ( InterTree::global_scope ( ipct -> destination_tree ), primitive -> symbol_name );
+ inter_tree_node * D = Inode::new_with_1_data_field ( ipct -> primitives_point , PRIMITIVE_IST , InterSymbolsTable::id_from_symbol ( ipct -> destination_tree , NULL , equivalent_primitive ), NULL , 0 );
inter_tree_node * old_D = primitive -> definition ;
for ( int i = CAT_PRIM_IFLD ; i <old_D-> W . extent ; i ++) {
Inode::extend_instruction_by ( D , 1 );
@@ -317,24 +314,24 @@ function togglePopup(material_id) {
inter_symbol * original_ptype =
- InterSymbolsTables::symbol_from_id (
+ InterSymbolsTable::symbol_from_ID (
InterTree::global_scope ( ipct -> origin_tree ), P -> W . instruction [ PTYPE_PACKAGE_IFLD ]);
inter_symbol * equivalent_ptype = Inter::Transmigration::cached_equivalent ( original_ptype );
if ( equivalent_ptype == NULL ) {
- equivalent_ptype = InterSymbolsTables::symbol_from_name ( InterTree::global_scope ( ipct -> destination_tree ), original_ptype -> symbol_name );
+ equivalent_ptype = InterSymbolsTable::symbol_from_name ( InterTree::global_scope ( ipct -> destination_tree ), original_ptype -> symbol_name );
if ( equivalent_ptype == NULL ) Duplicate this package type 3.2.1 ;
if ( equivalent_ptype ) Inter::Transmigration::cache ( original_ptype , equivalent_ptype );
}
if ( equivalent_ptype )
- P -> W . instruction [ PTYPE_PACKAGE_IFLD ] = InterSymbolsTables::id_from_symbol_inner ( InterTree::global_scope ( ipct -> destination_tree ), NULL , equivalent_ptype );
+ P -> W . instruction [ PTYPE_PACKAGE_IFLD ] = InterSymbolsTable::id_from_symbol ( ipct -> destination_tree , NULL , equivalent_ptype );
- equivalent_ptype = InterSymbolsTables::symbol_from_name_creating ( InterTree::global_scope ( ipct -> destination_tree ), original_ptype -> symbol_name );
- inter_tree_node * D = Inode::new_with_1_data_field ( ipct -> ptypes_point , PACKAGETYPE_IST , InterSymbolsTables::id_from_symbol_inner ( InterTree::global_scope ( ipct -> destination_tree ), NULL , equivalent_ptype ), NULL , 0 );
+ equivalent_ptype = InterSymbolsTable::symbol_from_name_creating ( InterTree::global_scope ( ipct -> destination_tree ), original_ptype -> symbol_name );
+ inter_tree_node * D = Inode::new_with_1_data_field ( ipct -> ptypes_point , PACKAGETYPE_IST , InterSymbolsTable::id_from_symbol ( ipct -> destination_tree , NULL , equivalent_ptype ), NULL , 0 );
inter_error_message * E = Inter::Defn::verify_construct ( InterBookmark::package ( ipct -> ptypes_point ), D );
if ( E ) {
Inter::Errors::issue ( E );
@@ -351,8 +348,8 @@ function togglePopup(material_id) {
inter_symbol * equivalent = Inter::Transmigration::cached_equivalent ( target );
if ( equivalent == NULL ) {
TEMPORARY_TEXT ( URL )
- InterSymbolsTables::symbol_to_url_name ( URL , target );
- equivalent = InterSymbolsTables::url_name_to_symbol ( ipct -> destination -> package_head -> tree , NULL , URL );
+ InterSymbolsTable::write_symbol_URL ( URL , target );
+ equivalent = InterSymbolsTable::URL_to_symbol ( ipct -> destination -> package_head -> tree , URL );
if (( equivalent == NULL ) && ( Inter::Kind::is ( target )))
equivalent = LargeScale::find_symbol_in_tree ( ipct -> destination -> package_head -> tree , target -> symbol_name );
if ( equivalent == NULL )
@@ -381,14 +378,13 @@ function togglePopup(material_id) {
if ( P -> W . instruction [ ID_IFLD ] == PACKAGE_IST ) {
inter_package * pack = InterPackage::at_this_head ( P );
if ( pack == NULL ) internal_error ( "no package defined here" );
- if ( InterPackage::is_a_linkage_package ( pack )) return ;
- inter_symbols_table * T = InterPackage::scope ( pack );
+ if ( InterPackage::is_a_linkage_package ( pack )) return ;
+ inter_symbols_table * T = InterPackage::scope ( pack );
if ( T == NULL ) internal_error ( "package with no symbols" );
- for ( int i =0; i <T-> size ; i ++) {
- inter_symbol * symb = T -> symbol_array [ i ];
+ LOOP_OVER_SYMBOLS_TABLE ( symb , T ) {
if ( Wiring::is_wired ( symb )) {
inter_symbol * target = Wiring::cable_end ( symb );
- inter_package * target_package = target -> owning_table -> owning_package ;
+ inter_package * target_package = Inter::Symbols::package ( target );
while (( target_package ) && ( target_package != ipct -> migrant )) {
target_package = InterPackage::parent ( target_package );
}
@@ -406,7 +402,7 @@ function togglePopup(material_id) {
inter_symbol * equivalent = Inter::Transmigration::cached_equivalent ( target );
if ( equivalent == NULL ) {
TEMPORARY_TEXT ( URL )
- InterSymbolsTables::symbol_to_url_name ( URL , target );
+ InterSymbolsTable::write_symbol_URL ( URL , target );
equivalent = Wiring::plug ( ipct -> origin_tree , URL );
DISCARD_TEXT ( URL )
Inter::Transmigration::cache ( target , equivalent );
diff --git a/docs/bytecode-module/2-tw.html b/docs/bytecode-module/2-tw.html
index 332853b31..8b0c5d3e3 100644
--- a/docs/bytecode-module/2-tw.html
+++ b/docs/bytecode-module/2-tw.html
@@ -250,8 +250,7 @@ been created, using InterWarehouse::set
inter_ti InterWarehouse::create_symbols_table ( inter_warehouse * warehouse ) {
inter_ti n = InterWarehouse::create_resource ( warehouse );
- inter_symbols_table * new_table = InterSymbolsTables::new ();
- new_table -> n_index = ( int ) n ;
+ inter_symbols_table * new_table = InterSymbolsTable::new ( n );
return InterWarehouse::create_ref_at ( warehouse , n ,
STORE_POINTER_inter_symbols_table ( new_table ), NULL );
}
diff --git a/docs/bytecode-module/3-dfn.html b/docs/bytecode-module/3-dfn.html
index 62bdbb8df..361f2c724 100644
--- a/docs/bytecode-module/3-dfn.html
+++ b/docs/bytecode-module/3-dfn.html
@@ -321,7 +321,7 @@ function togglePopup(material_id) {
if ( ilp . indent_level == 0 ) latest_block_package = NULL ;
- while (( InterBookmark::package ( IBM )) && ( InterPackage::is_a_root_package ( InterBookmark::package ( IBM )) == FALSE ) && ( ilp . indent_level <= InterBookmark::baseline ( IBM ))) {
+ while (( InterBookmark::package ( IBM )) && ( InterPackage::is_a_root_package ( InterBookmark::package ( IBM )) == FALSE ) && ( ilp . indent_level <= InterBookmark::baseline ( IBM ))) {
InterBookmark::move_into_package ( IBM , InterPackage::parent ( InterBookmark::package ( IBM )));
}
@@ -354,7 +354,7 @@ function togglePopup(material_id) {
inter_error_message * Inter::Defn::vet_level ( inter_bookmark * IBM , inter_ti cons , int level , inter_error_location * eloc ) {
int actual = level ;
if (( InterBookmark::package ( IBM )) &&
- ( InterPackage::is_a_root_package ( InterBookmark::package ( IBM )) == FALSE ))
+ ( InterPackage::is_a_root_package ( InterBookmark::package ( IBM )) == FALSE ))
actual = level - InterBookmark::baseline ( IBM ) - 1 ;
inter_construct * proposed = NULL ;
LOOP_OVER ( proposed , inter_construct )
@@ -378,10 +378,10 @@ function togglePopup(material_id) {
inter_construct * IC = NULL ;
inter_error_message * E = Inter::Defn::get_construct ( P , & IC );
if ( E ) return E ;
- inter_package * pack = InterPackage::container ( P );
+ inter_package * pack = InterPackage::container ( P );
int need = INSIDE_PLAIN_PACKAGE ;
if ( pack == NULL ) need = OUTSIDE_OF_PACKAGES ;
- else if ( InterPackage::is_a_function_body ( pack )) need = INSIDE_CODE_PACKAGE ;
+ else if ( InterPackage::is_a_function_body ( pack )) need = INSIDE_CODE_PACKAGE ;
if (( IC -> usage_permissions & need ) != need ) {
text_stream * M = Str::new ();
WRITE_TO ( M , "construct (%d) '" , P -> W . instruction [ LEVEL_IFLD ]);
diff --git a/docs/bytecode-module/3-idt.html b/docs/bytecode-module/3-idt.html
index 369280205..766bd16c7 100644
--- a/docs/bytecode-module/3-idt.html
+++ b/docs/bytecode-module/3-idt.html
@@ -159,7 +159,7 @@ function togglePopup(material_id) {
return Inode::error ( P , I "unknown kind for value" , NULL );
}
case ALIAS_IVAL: {
- inter_symbol * symb = InterSymbolsTables::symbol_from_id ( scope , V2 );
+ inter_symbol * symb = InterSymbolsTable::symbol_from_ID ( scope , V2 );
if ( symb == NULL ) {
LOG ( "No such symbol when verifying memory inter\n" );
LOG ( "V2 is %08x\n" , V2 );
@@ -201,7 +201,7 @@ function togglePopup(material_id) {
}
inter_symbol * Inter::Types::value_to_constant_symbol_kind ( inter_symbols_table * T , inter_ti V1 , inter_ti V2 ) {
- inter_symbol * symb = InterSymbolsTables::symbol_from_data_pair_and_table ( V1 , V2 , T );
+ inter_symbol * symb = InterSymbolsTable::symbol_from_data_pair ( V1 , V2 , T );
if ( symb ) {
inter_tree_node * D = Inter::Symbols::definition ( symb );
if ( D == NULL ) return NULL ;
@@ -243,7 +243,7 @@ function togglePopup(material_id) {
WRITE ( "\"" );
break ;
case ALIAS_IVAL: {
- inter_symbol * symb = InterSymbolsTables::symbol_from_id ( scope , V2 );
+ inter_symbol * symb = InterSymbolsTable::symbol_from_ID ( scope , V2 );
if ( symb ) WRITE ( "%S" , symb -> symbol_name ); else WRITE ( "<invalid-symbol>" );
break ;
}
@@ -308,7 +308,7 @@ function togglePopup(material_id) {
}
inter_data_type * idt = int32_idt ;
if ( kind_symbol ) idt = Inter::Kind::data_type ( kind_symbol );
- inter_symbol * symb = InterSymbolsTables::symbol_from_name ( scope , S );
+ inter_symbol * symb = InterSymbolsTable::symbol_from_name ( scope , S );
if ( symb ) {
inter_tree_node * D = Inter::Symbols::definition ( symb );
if ( Inter::Symbols::is_predeclared ( symb )) {
diff --git a/docs/bytecode-module/3-ie.html b/docs/bytecode-module/3-ie.html
index 92d2383d0..b782d162c 100644
--- a/docs/bytecode-module/3-ie.html
+++ b/docs/bytecode-module/3-ie.html
@@ -111,7 +111,7 @@ function togglePopup(material_id) {
CLASS_DEFINITION
} inter_error_message ;
-inter_error_message * Inter::Errors::quoted ( text_stream * err , text_stream * quote , inter_error_location * eloc ) {
+inter_error_message * Inter::Errors::quoted ( text_stream * err , text_stream * quote , inter_error_location * eloc ) {
inter_error_message * iem = Inter::Errors::plain ( err , eloc );
iem -> error_quote = Str::duplicate ( quote );
return iem ;
@@ -125,7 +125,7 @@ function togglePopup(material_id) {
return iem ;
}
-void Inter::Errors::issue ( inter_error_message * iem ) {
+void Inter::Errors::issue ( inter_error_message * iem ) {
if ( iem == NULL ) internal_error ( "no error to issue" );
Inter::Errors::issue_to ( STDERR , iem );
# ifdef CORE_MODULE
diff --git a/docs/bytecode-module/3-iibf.html b/docs/bytecode-module/3-iibf.html
index 609798883..1b82ba608 100644
--- a/docs/bytecode-module/3-iibf.html
+++ b/docs/bytecode-module/3-iibf.html
@@ -226,8 +226,8 @@ that's the end of the list and therefore the block. (There is no resource 0.)
if ( BinaryFiles::read_int32 ( fh , & from_N )) {
inter_ti n ;
switch ( i ) {
- case 0 : n = ( inter_ti ) InterTree::global_scope ( I )-> n_index ; break ;
- case 1 : n = ( inter_ti ) InterTree::root_package ( I )-> resource_ID ; break ;
+ case 0 : n = InterTree::global_scope ( I )-> resource_ID ; break ;
+ case 1 : n = InterTree::root_package ( I )-> resource_ID ; break ;
default: n = InterWarehouse::create_resource ( warehouse ); break ;
}
if ( trace_bin ) WRITE_TO ( STDOUT , "Reading resource %d <--- %d\n" , n , from_N );
@@ -325,7 +325,7 @@ that's the end of the list and therefore the block. (There is no resource 0.)
inter_symbols_table * tab = InterWarehouse::get_symbols_table ( warehouse , n );
if ( tab == NULL ) {
- tab = InterSymbolsTables::new ();
+ tab = InterSymbolsTable::new ( n );
InterWarehouse::create_ref_at ( warehouse , n , STORE_POINTER_inter_symbols_table ( tab ), NULL );
}
while ( BinaryFiles::read_int32 ( fh , & X )) {
@@ -353,7 +353,7 @@ that's the end of the list and therefore the block. (There is no resource 0.)
PUT_TO ( trans , ( int ) c );
}
- inter_symbol * S = InterSymbolsTables::symbol_from_name_creating_at_ID ( tab , name , X );
+ inter_symbol * S = InterSymbolsTable::symbol_from_name_creating_at_ID ( tab , name , X );
Inter::Symbols::set_type ( S , ( int ) st );
Inter::Symbols::set_scope ( S , ( int ) sc );
if ( uniq == 1 ) Inter::Symbols::set_flag ( S , MAKE_NAME_UNIQUE );
@@ -395,29 +395,26 @@ that's the end of the list and therefore the block. (There is no resource 0.)
inter_symbols_table * T = InterWarehouse::get_symbols_table ( warehouse , n );
if ( T ) {
- for ( int i =0; i <T-> size ; i ++) {
- inter_symbol * symb = T -> symbol_array [ i ];
- if ( symb ) {
- BinaryFiles::write_int32 ( fh , symb -> symbol_ID );
- BinaryFiles::write_int32 ( fh , ( unsigned int ) Inter::Symbols::get_type ( symb ));
- BinaryFiles::write_int32 ( fh , ( unsigned int ) Inter::Symbols::get_scope ( symb ));
- if ( Inter::Symbols::get_flag ( symb , MAKE_NAME_UNIQUE ))
- BinaryFiles::write_int32 ( fh , 1 );
- else
- BinaryFiles::write_int32 ( fh , 0 );
- BinaryFiles::write_int32 ( fh , ( unsigned int ) Str::len ( symb -> symbol_name ));
- LOOP_THROUGH_TEXT ( P , symb -> symbol_name )
- BinaryFiles::write_int32 ( fh , ( unsigned int ) Str::get ( P ));
- BinaryFiles::write_int32 ( fh , ( unsigned int ) Str::len ( symb -> translate_text ));
- LOOP_THROUGH_TEXT ( P , symb -> translate_text )
- BinaryFiles::write_int32 ( fh , ( unsigned int ) Str::get ( P ));
- Inter::Annotations::set_to_bytecode ( fh , &( symb -> ann_set ));
- if ( Inter::Symbols::get_scope ( symb ) == PLUG_ISYMS ) {
- text_stream * N = Wiring::wired_to_name ( symb );
- LOOP_THROUGH_TEXT ( pos , N )
- BinaryFiles::write_int32 ( fh , ( unsigned int ) Str::get ( pos ));
- BinaryFiles::write_int32 ( fh , 0 );
- }
+ LOOP_OVER_SYMBOLS_TABLE ( symb , T ) {
+ BinaryFiles::write_int32 ( fh , symb -> symbol_ID );
+ BinaryFiles::write_int32 ( fh , ( unsigned int ) Inter::Symbols::get_type ( symb ));
+ BinaryFiles::write_int32 ( fh , ( unsigned int ) Inter::Symbols::get_scope ( symb ));
+ if ( Inter::Symbols::get_flag ( symb , MAKE_NAME_UNIQUE ))
+ BinaryFiles::write_int32 ( fh , 1 );
+ else
+ BinaryFiles::write_int32 ( fh , 0 );
+ BinaryFiles::write_int32 ( fh , ( unsigned int ) Str::len ( symb -> symbol_name ));
+ LOOP_THROUGH_TEXT ( P , symb -> symbol_name )
+ BinaryFiles::write_int32 ( fh , ( unsigned int ) Str::get ( P ));
+ BinaryFiles::write_int32 ( fh , ( unsigned int ) Str::len ( symb -> translate_text ));
+ LOOP_THROUGH_TEXT ( P , symb -> translate_text )
+ BinaryFiles::write_int32 ( fh , ( unsigned int ) Str::get ( P ));
+ Inter::Annotations::set_to_bytecode ( fh , &( symb -> ann_set ));
+ if ( Inter::Symbols::get_scope ( symb ) == PLUG_ISYMS ) {
+ text_stream * N = Wiring::wired_to_name ( symb );
+ LOOP_THROUGH_TEXT ( pos , N )
+ BinaryFiles::write_int32 ( fh , ( unsigned int ) Str::get ( pos ));
+ BinaryFiles::write_int32 ( fh , 0 );
}
}
}
@@ -446,8 +443,8 @@ that's the end of the list and therefore the block. (There is no resource 0.)
stored_package = InterPackage::new ( I , n );
InterWarehouse::create_ref_at ( warehouse , n , STORE_POINTER_inter_package ( stored_package ), stored_package );
}
- if ( cl ) InterPackage::mark_as_a_function_body ( stored_package );
- if ( rl ) InterPackage::mark_as_a_root_package ( stored_package );
+ if ( cl ) InterPackage::mark_as_a_function_body ( stored_package );
+ if ( rl ) InterPackage::mark_as_a_root_package ( stored_package );
if ( sc != 0 ) {
if ( grid ) sc = grid [ sc ];
InterPackage::set_scope ( stored_package , InterWarehouse::get_symbols_table ( warehouse , sc ));
@@ -473,9 +470,9 @@ that's the end of the list and therefore the block. (There is no resource 0.)
inter_package * par = InterPackage::parent ( P );
if ( par == NULL ) BinaryFiles::write_int32 ( fh , 0 );
else BinaryFiles::write_int32 ( fh , ( unsigned int ) par -> resource_ID );
- BinaryFiles::write_int32 ( fh , ( unsigned int ) InterPackage::is_a_function_body ( P ));
- BinaryFiles::write_int32 ( fh , ( unsigned int ) InterPackage::is_a_root_package ( P ));
- BinaryFiles::write_int32 ( fh , ( unsigned int ) P -> package_scope -> n_index );
+ BinaryFiles::write_int32 ( fh , ( unsigned int ) InterPackage::is_a_function_body ( P ));
+ BinaryFiles::write_int32 ( fh , ( unsigned int ) InterPackage::is_a_root_package ( P ));
+ BinaryFiles::write_int32 ( fh , P -> package_scope -> resource_ID );
BinaryFiles::write_int32 ( fh , ( unsigned int ) Str::len ( P -> package_name_t ));
LOOP_THROUGH_TEXT ( C , P -> package_name_t )
BinaryFiles::write_int32 ( fh , ( unsigned int ) Str::get ( C ));
@@ -526,9 +523,9 @@ enough that the slot exists for the eventual list to be stored in.
Inter::Binary::read_error (& eloc , ftell ( fh ), I "bytecode incomplete" );
inter_symbols_table * to_T = InterWarehouse::get_symbols_table ( warehouse , to_T_id );
if ( from_T == NULL ) internal_error ( "no to_T" );
- inter_symbol * from_S = InterSymbolsTables::symbol_from_id ( from_T , from_ID );
+ inter_symbol * from_S = InterSymbolsTable::symbol_from_ID ( from_T , from_ID );
if ( from_S == NULL ) internal_error ( "no from_S" );
- inter_symbol * to_S = InterSymbolsTables::symbol_from_id ( to_T , to_ID );
+ inter_symbol * to_S = InterSymbolsTable::symbol_from_ID ( to_T , to_ID );
if ( to_S == NULL ) internal_error ( "no to_S" );
Wiring::wire_to ( from_S , to_S );
}
@@ -543,14 +540,13 @@ enough that the slot exists for the eventual list to be stored in.
inter_symbols_table * from_T = InterWarehouse::get_symbols_table ( warehouse , n );
if ( from_T ) {
BinaryFiles::write_int32 ( fh , ( unsigned int ) n );
- for ( int i =0; i <from_T-> size ; i ++) {
- inter_symbol * symb = from_T -> symbol_array [ i ];
+ LOOP_OVER_SYMBOLS_TABLE ( symb , from_T ) {
if ( Wiring::is_wired ( symb )) {
inter_symbol * W = Wiring::wired_to ( symb );
BinaryFiles::write_int32 ( fh , symb -> symbol_ID );
- BinaryFiles::write_int32 ( fh , ( unsigned int ) W -> owning_table -> n_index );
+ BinaryFiles::write_int32 ( fh , W -> owning_table -> resource_ID );
if ( trace_bin )
- WRITE_TO ( STDOUT , "Write eqn %d -> %d\n" , n , W -> owning_table -> n_index );
+ WRITE_TO ( STDOUT , "Write eqn %d -> %d\n" , n , W -> owning_table -> resource_ID );
BinaryFiles::write_int32 ( fh , W -> symbol_ID );
}
}
@@ -576,7 +572,7 @@ enough that the slot exists for the eventual list to be stored in.
if ( grid ) PID = grid [ PID ];
if ( trace_bin ) WRITE_TO ( STDOUT , "PID %d\n" , PID );
if ( PID ) owner = InterWarehouse::get_package ( warehouse , PID );
- if ( trace_bin ) WRITE_TO ( STDOUT , "Owner has ID %d, table %d\n" , owner -> resource_ID , owner -> package_scope -> n_index );
+ if ( trace_bin ) WRITE_TO ( STDOUT , "Owner has ID %d, table %d\n" , owner -> resource_ID , owner -> package_scope -> resource_ID );
}
inter_tree_node * P = Inode::new_node ( warehouse , I , extent -1, & eloc , owner );
diff --git a/docs/bytecode-module/3-iitf.html b/docs/bytecode-module/3-iitf.html
index bd38299ec..257033851 100644
--- a/docs/bytecode-module/3-iitf.html
+++ b/docs/bytecode-module/3-iitf.html
@@ -73,7 +73,7 @@ function togglePopup(material_id) {
To read inter from a textual file.
-
+
@@ -86,7 +86,7 @@ function togglePopup(material_id) {
inter_bookmark IBM = InterBookmark::at_start_of_this_repository ( I );
inter_error_location eloc = Inter::Errors::file_location ( NULL , NULL );
TextFiles::read ( F , FALSE , "can't open inter file" , FALSE , Inter::Textual::read_line , 0 , & IBM );
- InterSymbolsTables::resolve_forward_references ( I , & eloc );
+ Inter::Textual::resolve_forward_references ( I , & eloc );
InterTree::traverse ( I , Inter::Textual::lint_visitor , NULL , NULL , - PACKAGE_IST );
Primitives::index_primitives_in_tree ( I );
}
@@ -98,7 +98,7 @@ function togglePopup(material_id) {
inter_symbol * Inter::Textual::new_symbol ( inter_error_location * eloc , inter_symbols_table * T , text_stream * name , inter_error_message ** E ) {
* E = NULL ;
- inter_symbol * symb = InterSymbolsTables::symbol_from_name ( T , name );
+ inter_symbol * symb = InterSymbolsTable::symbol_from_name ( T , name );
if ( symb ) {
if ( Inter::Symbols::is_predeclared ( symb )) {
Inter::Symbols::undefine ( symb );
@@ -107,12 +107,12 @@ function togglePopup(material_id) {
* E = Inter::Errors::quoted ( I "symbol already exists" , name , eloc );
return NULL ;
}
- return InterSymbolsTables::symbol_from_name_creating ( T , name );
+ return InterSymbolsTable::symbol_from_name_creating ( T , name );
}
inter_symbol * Inter::Textual::find_symbol ( inter_tree * I , inter_error_location * eloc , inter_symbols_table * T , text_stream * name , inter_ti construct , inter_error_message ** E ) {
* E = NULL ;
- inter_symbol * symb = InterSymbolsTables::symbol_from_name ( T , name );
+ inter_symbol * symb = InterSymbolsTable::symbol_from_name ( T , name );
if ( symb == NULL ) { * E = Inter::Errors::quoted ( I "no such symbol" , name , eloc ); return NULL ; }
inter_tree_node * D = Inter::Symbols::definition ( symb );
if ( Inter::Symbols::is_extern ( symb )) return symb ;
@@ -126,7 +126,7 @@ function togglePopup(material_id) {
inter_symbol * Inter::Textual::find_undefined_symbol ( inter_bookmark * IBM , inter_error_location * eloc , inter_symbols_table * T , text_stream * name , inter_error_message ** E ) {
* E = NULL ;
- inter_symbol * symb = InterSymbolsTables::symbol_from_name ( T , name );
+ inter_symbol * symb = InterSymbolsTable::symbol_from_name ( T , name );
if ( symb == NULL ) { * E = Inter::Errors::quoted ( I "no such symbol" , name , eloc ); return NULL ; }
if (( Inter::Symbols::is_defined ( symb )) &&
( Inter::Symbols::is_predeclared ( symb ) == FALSE ) &&
@@ -142,7 +142,7 @@ function togglePopup(material_id) {
inter_symbol * Inter::Textual::find_KOI ( inter_error_location * eloc , inter_symbols_table * T , text_stream * name , inter_error_message ** E ) {
* E = NULL ;
- inter_symbol * symb = InterSymbolsTables::symbol_from_name ( T , name );
+ inter_symbol * symb = InterSymbolsTable::symbol_from_name ( T , name );
if ( symb == NULL ) { * E = Inter::Errors::quoted ( I "no such symbol" , name , eloc ); return NULL ; }
inter_tree_node * D = Inter::Symbols::definition ( symb );
if ( D == NULL ) { * E = Inter::Errors::quoted ( I "undefined symbol" , name , eloc ); return NULL ; }
@@ -202,6 +202,34 @@ function togglePopup(material_id) {
}
The structure textual_write_state is private to this section.
+
+
+
+void Inter::Textual::resolve_forward_references ( inter_tree * I , inter_error_location * eloc ) {
+ InterTree::traverse ( I , Inter::Textual::rfr_visitor , eloc , NULL , PACKAGE_IST );
+}
+
+void Inter::Textual::rfr_visitor ( inter_tree * I , inter_tree_node * P , void * state ) {
+ inter_error_location * eloc = ( inter_error_location *) state ;
+ inter_package * pack = InterPackage::at_this_head ( P );
+ if ( pack == NULL ) internal_error ( "no package defined here" );
+ inter_symbols_table * T = InterPackage::scope ( pack );
+ if ( T == NULL ) internal_error ( "package with no symbols" );
+ for ( int i =0; i <T-> symbol_array_size ; i ++) {
+ inter_symbol * symb = T -> symbol_array [ i ];
+ if ( Wiring::is_wired_to_name ( symb )) {
+ text_stream * N = Wiring::wired_to_name ( symb );
+ if ( Inter::Symbols::get_scope ( symb ) == PLUG_ISYMS ) continue ;
+ inter_symbol * S_to = InterSymbolsTable::URL_to_symbol ( InterPackage::tree ( pack ), N );
+ if ( S_to == NULL ) S_to = InterSymbolsTable::symbol_from_name ( T , N );
+ if ( S_to == NULL ) Inter::Errors::issue ( Inter::Errors::quoted ( I "unable to locate symbol" , N , eloc ));
+ else if ( Inter::Symbols::get_scope ( symb ) == SOCKET_ISYMS )
+ Wiring::convert_to_socket ( symb , S_to );
+ else Wiring::wire_to ( symb , S_to );
+ }
+ }
+}
+
diff --git a/docs/bytecode-module/3-mtd.html b/docs/bytecode-module/3-mtd.html
index 9950c75a1..e3e436b6c 100644
--- a/docs/bytecode-module/3-mtd.html
+++ b/docs/bytecode-module/3-mtd.html
@@ -82,7 +82,7 @@ function togglePopup(material_id) {
}
int Metadata::exists ( inter_package * pack , text_stream * key ) {
- inter_symbol * md = InterSymbolsTables::symbol_from_name ( InterPackage::scope ( pack ), key );
+ inter_symbol * md = InterSymbolsTable::symbol_from_name ( InterPackage::scope ( pack ), key );
if ( md == NULL ) return FALSE ;
inter_tree_node * D = md -> definition ;
if ( D == NULL ) return FALSE ;
@@ -90,7 +90,7 @@ function togglePopup(material_id) {
}
inter_symbol * Metadata::read_symbol ( inter_package * pack , text_stream * key ) {
- inter_symbol * md = InterSymbolsTables::symbol_from_name ( InterPackage::scope ( pack ), key );
+ inter_symbol * md = InterSymbolsTable::symbol_from_name ( InterPackage::scope ( pack ), key );
if ( md == NULL ) {
LOG ( "unable to find metadata key %S in package $6\n" , key , pack );
Metadata::err ( "not found" , pack , key );
@@ -103,14 +103,14 @@ function togglePopup(material_id) {
}
if ( D -> W . instruction [ DATA_CONST_IFLD ] != ALIAS_IVAL ) Metadata::err ( "not symbol" , pack , key );
- inter_symbol * s = InterSymbolsTables::symbol_from_id ( InterPackage::scope ( pack ),
+ inter_symbol * s = InterSymbolsTable::symbol_from_ID ( InterPackage::scope ( pack ),
D -> W . instruction [ DATA_CONST_IFLD + 1 ]);
if ( s == NULL ) Metadata::err ( "no symbol" , pack , key );
return s ;
}
inter_symbol * Metadata::read_optional_symbol ( inter_package * pack , text_stream * key ) {
- inter_symbol * md = InterSymbolsTables::symbol_from_name ( InterPackage::scope ( pack ), key );
+ inter_symbol * md = InterSymbolsTable::symbol_from_name ( InterPackage::scope ( pack ), key );
if ( md == NULL ) return NULL ;
inter_tree_node * D = md -> definition ;
if ( D == NULL ) Metadata::err ( "not defined" , pack , key );
@@ -120,14 +120,14 @@ function togglePopup(material_id) {
}
if ( D -> W . instruction [ DATA_CONST_IFLD ] != ALIAS_IVAL ) Metadata::err ( "not symbol" , pack , key );
- inter_symbol * s = InterSymbolsTables::symbol_from_id ( InterPackage::scope ( pack ),
+ inter_symbol * s = InterSymbolsTable::symbol_from_ID ( InterPackage::scope ( pack ),
D -> W . instruction [ DATA_CONST_IFLD + 1 ]);
if ( s == NULL ) Metadata::err ( "no symbol" , pack , key );
return s ;
}
inter_tree_node * Metadata::read_optional_list ( inter_package * pack , text_stream * key ) {
- inter_symbol * md = InterSymbolsTables::symbol_from_name ( InterPackage::scope ( pack ), key );
+ inter_symbol * md = InterSymbolsTable::symbol_from_name ( InterPackage::scope ( pack ), key );
if ( md == NULL ) return NULL ;
inter_tree_node * D = md -> definition ;
if ( D == NULL ) Metadata::err ( "not defined" , pack , key );
@@ -139,7 +139,7 @@ function togglePopup(material_id) {
}
inter_ti Metadata::read_numeric ( inter_package * pack , text_stream * key ) {
- inter_symbol * md = InterSymbolsTables::symbol_from_name ( InterPackage::scope ( pack ), key );
+ inter_symbol * md = InterSymbolsTable::symbol_from_name ( InterPackage::scope ( pack ), key );
if ( md == NULL ) Metadata::err ( "not found" , pack , key );
inter_tree_node * D = md -> definition ;
if ( D == NULL ) Metadata::err ( "not defined" , pack , key );
@@ -149,7 +149,7 @@ function togglePopup(material_id) {
}
inter_ti Metadata::read_optional_numeric ( inter_package * pack , text_stream * key ) {
- inter_symbol * md = InterSymbolsTables::symbol_from_name ( InterPackage::scope ( pack ), key );
+ inter_symbol * md = InterSymbolsTable::symbol_from_name ( InterPackage::scope ( pack ), key );
if ( md == NULL ) return 0 ;
inter_tree_node * D = md -> definition ;
if ( D == NULL ) Metadata::err ( "not defined" , pack , key );
@@ -159,7 +159,7 @@ function togglePopup(material_id) {
}
text_stream * Metadata::read_textual ( inter_package * pack , text_stream * key ) {
- inter_symbol * md = InterSymbolsTables::symbol_from_name ( InterPackage::scope ( pack ), key );
+ inter_symbol * md = InterSymbolsTable::symbol_from_name ( InterPackage::scope ( pack ), key );
if ( md == NULL ) Metadata::err ( "not found" , pack , key );
inter_tree_node * D = md -> definition ;
if ( D == NULL ) Metadata::err ( "not defined" , pack , key );
@@ -171,7 +171,7 @@ function togglePopup(material_id) {
}
text_stream * Metadata::read_optional_textual ( inter_package * pack , text_stream * key ) {
- inter_symbol * md = InterSymbolsTables::symbol_from_name ( InterPackage::scope ( pack ), key );
+ inter_symbol * md = InterSymbolsTable::symbol_from_name ( InterPackage::scope ( pack ), key );
if ( md == NULL ) return NULL ;
inter_tree_node * D = md -> definition ;
if ( D == NULL ) Metadata::err ( "not defined" , pack , key );
@@ -185,7 +185,7 @@ function togglePopup(material_id) {
void Metadata::err ( char * err , inter_package * pack , text_stream * key ) {
LOG ( "Error on metadata %S in $6\n" , key , pack );
WRITE_TO ( STDERR , "Error on metadata %S in " , key );
- InterPackage::write_url_name ( STDERR , pack );
+ InterPackage::write_URL ( STDERR , pack );
WRITE_TO ( STDERR , "\n" );
internal_error ( err );
}
diff --git a/docs/bytecode-module/3-vi.html b/docs/bytecode-module/3-vi.html
index 1fcd6fd80..91092e2da 100644
--- a/docs/bytecode-module/3-vi.html
+++ b/docs/bytecode-module/3-vi.html
@@ -77,14 +77,14 @@ function togglePopup(material_id) {
inter_error_message * Inter::Verify::defn ( inter_package * owner , inter_tree_node * P , int index ) {
- inter_symbols_table * T = InterPackage::scope ( owner );
+ inter_symbols_table * T = InterPackage::scope ( owner );
if ( T == NULL ) T = Inode::globals ( P );
- inter_symbol * S = InterSymbolsTables::unequated_symbol_from_id ( T , P -> W . instruction [ index ]);
+ inter_symbol * S = InterSymbolsTable::symbol_from_ID_not_equating ( T , P -> W . instruction [ index ]);
if ( S == NULL ) return Inode::error ( P , I "no symbol for ID (case 1)" , NULL );
if ( Wiring::is_wired ( S )) {
inter_symbol * E = Wiring::cable_end ( S );
LOG ( "This is $6 but $3 is wired to $3 in $6\n" ,
- InterPackage::container ( P ), S , E , InterPackage::container ( E -> definition ));
+ InterPackage::container ( P ), S , E , InterPackage::container ( E -> definition ));
return Inode::error ( P , I "symbol defined outside its native scope" , S -> symbol_name );
}
inter_tree_node * D = Inter::Symbols::definition ( S );
@@ -101,7 +101,7 @@ function togglePopup(material_id) {
}
inter_error_message * Inter::Verify::local_defn ( inter_tree_node * P , int index , inter_symbols_table * T ) {
- inter_symbol * S = InterSymbolsTables::symbol_from_id ( T , P -> W . instruction [ index ]);
+ inter_symbol * S = InterSymbolsTable::symbol_from_ID ( T , P -> W . instruction [ index ]);
if ( S == NULL ) return Inode::error ( P , I "no symbol for ID (case 2)" , NULL );
if (( Inter::Symbols::is_defined ( S )) &&
( Inter::Symbols::is_predeclared_local ( S ) == FALSE ))
@@ -111,9 +111,9 @@ function togglePopup(material_id) {
}
inter_error_message * Inter::Verify::symbol ( inter_package * owner , inter_tree_node * P , inter_ti ID , inter_ti construct ) {
- inter_symbols_table * T = InterPackage::scope ( owner );
+ inter_symbols_table * T = InterPackage::scope ( owner );
if ( T == NULL ) T = Inode::globals ( P );
- inter_symbol * S = InterSymbolsTables::symbol_from_id ( T , ID );
+ inter_symbol * S = InterSymbolsTable::symbol_from_ID ( T , ID );
if ( S == NULL ) return Inode::error ( P , I "no symbol for ID (case 3)" , NULL );
inter_tree_node * D = Inter::Symbols::definition ( S );
if ( Inter::Symbols::is_extern ( S )) return NULL ;
@@ -128,7 +128,7 @@ function togglePopup(material_id) {
}
inter_error_message * Inter::Verify::global_symbol ( inter_tree_node * P , inter_ti ID , inter_ti construct ) {
- inter_symbol * S = InterSymbolsTables::symbol_from_id ( Inode::globals ( P ), ID );
+ inter_symbol * S = InterSymbolsTable::symbol_from_ID ( Inode::globals ( P ), ID );
if ( S == NULL ) { internal_error ( "IO" ); return Inode::error ( P , I "3no symbol for ID" , NULL ); }
inter_tree_node * D = Inter::Symbols::definition ( S );
if ( Inter::Symbols::is_extern ( S )) return NULL ;
@@ -143,7 +143,7 @@ function togglePopup(material_id) {
}
inter_error_message * Inter::Verify::local_symbol ( inter_tree_node * P , inter_ti ID , inter_ti construct , inter_symbols_table * T ) {
- inter_symbol * S = InterSymbolsTables::symbol_from_id ( T , ID );
+ inter_symbol * S = InterSymbolsTable::symbol_from_ID ( T , ID );
if ( S == NULL ) return Inode::error ( P , I "4no symbol for ID" , NULL );
inter_tree_node * D = Inter::Symbols::definition ( S );
if ( Inter::Symbols::is_extern ( S )) return NULL ;
@@ -158,9 +158,9 @@ function togglePopup(material_id) {
}
inter_error_message * Inter::Verify::symbol_KOI ( inter_package * owner , inter_tree_node * P , inter_ti ID ) {
- inter_symbols_table * T = InterPackage::scope ( owner );
+ inter_symbols_table * T = InterPackage::scope ( owner );
if ( T == NULL ) T = Inode::globals ( P );
- inter_symbol * S = InterSymbolsTables::symbol_from_id ( T , ID );
+ inter_symbol * S = InterSymbolsTable::symbol_from_ID ( T , ID );
if ( S == NULL ) return Inode::error ( P , I "5no symbol for ID" , NULL );
inter_tree_node * D = Inter::Symbols::definition ( S );
if ( Inter::Symbols::is_extern ( S )) return NULL ;
@@ -181,7 +181,7 @@ function togglePopup(material_id) {
}
inter_error_message * Inter::Verify::value ( inter_package * owner , inter_tree_node * P , int index , inter_symbol * kind_symbol ) {
- inter_symbols_table * T = InterPackage::scope ( owner );
+ inter_symbols_table * T = InterPackage::scope ( owner );
if ( T == NULL ) T = Inode::globals ( P );
if ( kind_symbol == NULL ) return Inode::error ( P , I "unknown kind for value" , NULL );
inter_ti V1 = P -> W . instruction [ index ];
diff --git a/docs/bytecode-module/4-tac.html b/docs/bytecode-module/4-tac.html
index 4699245b6..bbbf8a2b3 100644
--- a/docs/bytecode-module/4-tac.html
+++ b/docs/bytecode-module/4-tac.html
@@ -104,7 +104,7 @@ function togglePopup(material_id) {
return ;
}
- inter_symbol * symbol = InterSymbolsTables::symbol_from_name ( InterBookmark::scope ( IBM ), ilp -> mr . exp [0]);
+ inter_symbol * symbol = InterSymbolsTable::symbol_from_name ( InterBookmark::scope ( IBM ), ilp -> mr . exp [0]);
if ( symbol == NULL ) {
* E = Inter::Errors::plain ( I "no such symbol" , eloc );
return ;
@@ -118,7 +118,7 @@ function togglePopup(material_id) {
}
inter_error_message * Inter::Append::new ( inter_bookmark * IBM , inter_symbol * symbol , inter_ti append_text , inter_ti level , struct inter_error_location * eloc ) {
- inter_tree_node * P = Inode::new_with_2_data_fields ( IBM , APPEND_IST , InterSymbolsTables::id_from_IRS_and_symbol ( IBM , symbol ), append_text , eloc , level );
+ inter_tree_node * P = Inode::new_with_2_data_fields ( IBM , APPEND_IST , InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , symbol ), append_text , eloc , level );
inter_error_message * E = Inter::Defn::verify_construct ( InterBookmark::package ( IBM ), P ); if ( E ) return E ;
NodePlacement::move_to_moving_bookmark ( P , IBM );
return NULL ;
@@ -128,7 +128,7 @@ function togglePopup(material_id) {
inter_ti vcount = Inode::bump_verification_count ( P );
if ( P -> W . extent != EXTENT_APPEND_IFR ) { * E = Inode::error ( P , I "extent wrong" , NULL ); return ; }
- inter_symbol * symbol = InterSymbolsTables::symbol_from_id ( InterPackage::scope ( owner ), P -> W . instruction [ SYMBOL_APPEND_IFLD ]);;
+ inter_symbol * symbol = InterSymbolsTable::symbol_from_ID ( InterPackage::scope ( owner ), P -> W . instruction [ SYMBOL_APPEND_IFLD ]);;
if ( symbol == NULL ) { * E = Inode::error ( P , I "no target name" , NULL ); return ; }
if ( P -> W . instruction [ TEXT_APPEND_IFLD ] == 0 ) { * E = Inode::error ( P , I "no translation text" , NULL ); return ; }
@@ -140,7 +140,7 @@ function togglePopup(material_id) {
}
void Inter::Append::write ( inter_construct * IC , OUTPUT_STREAM , inter_tree_node * P , inter_error_message ** E ) {
- inter_symbol * symbol = InterSymbolsTables::symbol_from_frame_data ( P , SYMBOL_APPEND_IFLD );
+ inter_symbol * symbol = InterSymbolsTable::symbol_from_ID_at_node ( P , SYMBOL_APPEND_IFLD );
inter_ti ID = P -> W . instruction [ TEXT_APPEND_IFLD ];
text_stream * S = Inode::ID_to_text ( P , ID );
WRITE ( "append %S \"" , symbol -> symbol_name );
diff --git a/docs/bytecode-module/4-tcc2.html b/docs/bytecode-module/4-tcc2.html
index 141b63369..fea1d5c19 100644
--- a/docs/bytecode-module/4-tcc2.html
+++ b/docs/bytecode-module/4-tcc2.html
@@ -129,7 +129,7 @@ function togglePopup(material_id) {
else if ( Regexp::match (& mr2 , S , L "quotient{ (%c*) }" )) op = CONSTANT_QUOTIENT_LIST ;
if ( op != 0 ) {
inter_tree_node * P =
- Inode::new_with_3_data_fields ( IBM , CONSTANT_IST , InterSymbolsTables::id_from_IRS_and_symbol ( IBM , con_name ), InterSymbolsTables::id_from_IRS_and_symbol ( IBM , con_kind ), op , eloc , ( inter_ti ) ilp -> indent_level );
+ Inode::new_with_3_data_fields ( IBM , CONSTANT_IST , InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , con_name ), InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , con_kind ), op , eloc , ( inter_ti ) ilp -> indent_level );
* E = Inter::Defn::verify_construct ( InterBookmark::package ( IBM ), P );
if (* E ) return ;
text_stream * conts = mr2 . exp [0];
@@ -159,7 +159,7 @@ function togglePopup(material_id) {
else if ( Regexp::match (& mr2 , S , L "quotient{ (%c*) }" )) form = CONSTANT_QUOTIENT_LIST ;
if ( form != 0 ) {
inter_tree_node * P =
- Inode::new_with_3_data_fields ( IBM , CONSTANT_IST , InterSymbolsTables::id_from_IRS_and_symbol ( IBM , con_name ), InterSymbolsTables::id_from_IRS_and_symbol ( IBM , con_kind ), form , eloc , ( inter_ti ) ilp -> indent_level );
+ Inode::new_with_3_data_fields ( IBM , CONSTANT_IST , InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , con_name ), InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , con_kind ), form , eloc , ( inter_ti ) ilp -> indent_level );
* E = Inter::Defn::verify_construct ( InterBookmark::package ( IBM ), P );
if (* E ) return ;
text_stream * conts = mr2 . exp [0];
@@ -183,7 +183,7 @@ function togglePopup(material_id) {
match_results mr2 = Regexp::create_mr ();
if ( Regexp::match (& mr2 , S , L "{ (%c*) }" )) {
inter_tree_node * P =
- Inode::new_with_3_data_fields ( IBM , CONSTANT_IST , InterSymbolsTables::id_from_IRS_and_symbol ( IBM , con_name ), InterSymbolsTables::id_from_IRS_and_symbol ( IBM , con_kind ), CONSTANT_STRUCT , eloc , ( inter_ti ) ilp -> indent_level );
+ Inode::new_with_3_data_fields ( IBM , CONSTANT_IST , InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , con_name ), InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , con_kind ), CONSTANT_STRUCT , eloc , ( inter_ti ) ilp -> indent_level );
int arity = Inter::Kind::arity ( con_kind );
int counter = 0 ;
text_stream * conts = mr2 . exp [0];
@@ -211,7 +211,7 @@ function togglePopup(material_id) {
match_results mr2 = Regexp::create_mr ();
if ( Regexp::match (& mr2 , S , L "{ (%c*) }" )) {
inter_tree_node * P =
- Inode::new_with_3_data_fields ( IBM , CONSTANT_IST , InterSymbolsTables::id_from_IRS_and_symbol ( IBM , con_name ), InterSymbolsTables::id_from_IRS_and_symbol ( IBM , con_kind ), CONSTANT_INDIRECT_LIST , eloc , ( inter_ti ) ilp -> indent_level );
+ Inode::new_with_3_data_fields ( IBM , CONSTANT_IST , InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , con_name ), InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , con_kind ), CONSTANT_INDIRECT_LIST , eloc , ( inter_ti ) ilp -> indent_level );
* E = Inter::Defn::verify_construct ( InterBookmark::package ( IBM ), P );
if (* E ) return ;
text_stream * conts = mr2 . exp [0];
@@ -241,17 +241,17 @@ function togglePopup(material_id) {
}
DISCARD_TEXT ( parsed_text )
if (* E ) return ;
- * E = Inter::Constant::new_textual ( IBM , InterSymbolsTables::id_from_IRS_and_symbol ( IBM , con_name ), InterSymbolsTables::id_from_IRS_and_symbol ( IBM , con_kind ), ID , ( inter_ti ) ilp -> indent_level , eloc );
+ * E = Inter::Constant::new_textual ( IBM , InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , con_name ), InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , con_kind ), ID , ( inter_ti ) ilp -> indent_level , eloc );
return ;
}
}
if (( idt ) && ( idt -> type_ID == ROUTINE_IDT )) {
- inter_package * block = InterPackage::by_name ( InterBookmark::package ( IBM ), S );
+ inter_package * block = InterPackage::from_name ( InterBookmark::package ( IBM ), S );
if ( block == NULL ) {
* E = Inter::Errors::quoted ( I "no such code block" , S , eloc ); return ;
}
- * E = Inter::Constant::new_function ( IBM , InterSymbolsTables::id_from_IRS_and_symbol ( IBM , con_name ), InterSymbolsTables::id_from_IRS_and_symbol ( IBM , con_kind ), block , ( inter_ti ) ilp -> indent_level , eloc );
+ * E = Inter::Constant::new_function ( IBM , InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , con_name ), InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , con_kind ), block , ( inter_ti ) ilp -> indent_level , eloc );
return ;
}
@@ -264,7 +264,7 @@ function togglePopup(material_id) {
if (* E ) return ;
}
- * E = Inter::Constant::new_numerical ( IBM , InterSymbolsTables::id_from_IRS_and_symbol ( IBM , con_name ), InterSymbolsTables::id_from_IRS_and_symbol ( IBM , con_kind ), con_val1 , con_val2 , ( inter_ti ) ilp -> indent_level , eloc );
+ * E = Inter::Constant::new_numerical ( IBM , InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , con_name ), InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , con_kind ), con_val1 , con_val2 , ( inter_ti ) ilp -> indent_level , eloc );
}
inter_error_message * Inter::Constant::parse_text ( text_stream * parsed_text , text_stream * S , int from , int to , inter_error_location * eloc ) {
@@ -392,7 +392,7 @@ function togglePopup(material_id) {
void Inter::Constant::verify ( inter_construct * IC , inter_tree_node * P , inter_package * owner , inter_error_message ** E ) {
* E = Inter::Verify::defn ( owner , P , DEFN_CONST_IFLD ); if (* E ) return ;
* E = Inter::Verify::symbol ( owner , P , P -> W . instruction [ KIND_CONST_IFLD ], KIND_IST ); if (* E ) return ;
- inter_symbol * con_kind = InterSymbolsTables::symbol_from_id ( InterPackage::scope ( owner ), P -> W . instruction [ KIND_CONST_IFLD ]);
+ inter_symbol * con_kind = InterSymbolsTable::symbol_from_ID ( InterPackage::scope ( owner ), P -> W . instruction [ KIND_CONST_IFLD ]);
switch ( P -> W . instruction [ FORMAT_CONST_IFLD ]) {
case CONSTANT_DIRECT:
if ( P -> W . extent != DATA_CONST_IFLD + 2 ) { * E = Inode::error ( P , I "extent wrong" , NULL ); return ; }
@@ -420,7 +420,7 @@ function togglePopup(material_id) {
for ( int i = DATA_CONST_IFLD ; i <P-> W . extent ; i = i +2) {
inter_ti V1 = P -> W . instruction [ i ];
inter_ti V2 = P -> W . instruction [ i +1];
- inter_symbol * K = Inter::Types::value_to_constant_symbol_kind ( InterPackage::scope ( owner ), V1 , V2 );
+ inter_symbol * K = Inter::Types::value_to_constant_symbol_kind ( InterPackage::scope ( owner ), V1 , V2 );
if ( Inter::Kind::constructor ( K ) != COLUMN_ICON ) { * E = Inode::error ( P , I "not a table column constant" , NULL ); return ; }
}
} else {
@@ -461,8 +461,8 @@ function togglePopup(material_id) {
}
void Inter::Constant::write ( inter_construct * IC , OUTPUT_STREAM , inter_tree_node * P , inter_error_message ** E ) {
- inter_symbol * con_name = InterSymbolsTables::symbol_from_frame_data ( P , DEFN_CONST_IFLD );
- inter_symbol * con_kind = InterSymbolsTables::symbol_from_frame_data ( P , KIND_CONST_IFLD );
+ inter_symbol * con_name = InterSymbolsTable::symbol_from_ID_at_node ( P , DEFN_CONST_IFLD );
+ inter_symbol * con_kind = InterSymbolsTable::symbol_from_ID_at_node ( P , KIND_CONST_IFLD );
int hex = FALSE ;
if ( Inter::Annotations::find (&( con_name -> ann_set ), HEX_IANN )) hex = TRUE ;
if (( con_name ) && ( con_kind )) {
@@ -470,7 +470,7 @@ function togglePopup(material_id) {
switch ( P -> W . instruction [ FORMAT_CONST_IFLD ]) {
case CONSTANT_DIRECT:
Inter::Types::write ( OUT , P , con_kind ,
- P -> W . instruction [ DATA_CONST_IFLD ], P -> W . instruction [ DATA_CONST_IFLD +1], InterPackage::scope_of ( P ), hex );
+ P -> W . instruction [ DATA_CONST_IFLD ], P -> W . instruction [ DATA_CONST_IFLD +1], InterPackage::scope_of ( P ), hex );
break ;
case CONSTANT_SUM_LIST:
case CONSTANT_PRODUCT_LIST:
@@ -486,7 +486,7 @@ function togglePopup(material_id) {
for ( int i = DATA_CONST_IFLD ; i <P-> W . extent ; i = i +2) {
if ( i > DATA_CONST_IFLD ) WRITE ( "," );
WRITE ( " " );
- Inter::Types::write ( OUT , P , conts_kind , P -> W . instruction [ i ], P -> W . instruction [ i +1], InterPackage::scope_of ( P ), hex );
+ Inter::Types::write ( OUT , P , conts_kind , P -> W . instruction [ i ], P -> W . instruction [ i +1], InterPackage::scope_of ( P ), hex );
}
WRITE ( " }" );
break ;
@@ -497,7 +497,7 @@ function togglePopup(material_id) {
if ( i > DATA_CONST_IFLD ) WRITE ( "," );
WRITE ( " " );
inter_symbol * conts_kind = Inter::Kind::operand_symbol ( con_kind , counter ++);
- Inter::Types::write ( OUT , P , conts_kind , P -> W . instruction [ i ], P -> W . instruction [ i +1], InterPackage::scope_of ( P ), hex );
+ Inter::Types::write ( OUT , P , conts_kind , P -> W . instruction [ i ], P -> W . instruction [ i +1], InterPackage::scope_of ( P ), hex );
}
WRITE ( " }" );
break ;
@@ -527,7 +527,7 @@ function togglePopup(material_id) {
inter_tree_node * D = Inter::Symbols::definition ( con_symbol );
if ( D == NULL ) return NULL ;
if ( D -> W . instruction [ ID_IFLD ] != CONSTANT_IST ) return NULL ;
- return InterSymbolsTables::symbol_from_frame_data ( D , KIND_CONST_IFLD );
+ return InterSymbolsTable::symbol_from_ID_at_node ( D , KIND_CONST_IFLD );
}
inter_package * Inter::Constant::code_block ( inter_symbol * con_symbol ) {
@@ -549,7 +549,7 @@ function togglePopup(material_id) {
}
inter_symbols_table * Inter::Constant::local_symbols ( inter_symbol * con_symbol ) {
- return InterPackage::scope ( Inter::Constant::code_block ( con_symbol ));
+ return InterPackage::scope ( Inter::Constant::code_block ( con_symbol ));
}
int Inter::Constant::char_acceptable ( int c ) {
@@ -573,8 +573,8 @@ function togglePopup(material_id) {
inter_ti val2 = D -> W . instruction [ DATA_CONST_IFLD + 1 ];
if ( val1 == ALIAS_IVAL ) {
inter_symbol * alias =
- InterSymbolsTables::symbol_from_data_pair_and_table (
- val1 , val2 , InterPackage::scope ( D -> package ));
+ InterSymbolsTable::symbol_from_data_pair (
+ val1 , val2 , InterPackage::scope ( D -> package ));
return Inter::Constant::constant_depth ( alias ) + 1 ;
}
return 1 ;
@@ -589,8 +589,8 @@ function togglePopup(material_id) {
inter_ti val2 = D -> W . instruction [ i + 1 ];
if ( val1 == ALIAS_IVAL ) {
inter_symbol * alias =
- InterSymbolsTables::symbol_from_data_pair_and_table (
- val1 , val2 , InterPackage::scope ( D -> package ));
+ InterSymbolsTable::symbol_from_data_pair (
+ val1 , val2 , InterPackage::scope ( D -> package ));
total += Inter::Constant::constant_depth ( alias );
} else total ++;
}
@@ -602,7 +602,7 @@ function togglePopup(material_id) {
inter_ti Inter::Constant::evaluate ( inter_symbols_table * T , inter_ti val1 , inter_ti val2 ) {
if ( val1 == LITERAL_IVAL ) return val2 ;
if ( Inter::Symbols::is_stored_in_data ( val1 , val2 )) {
- inter_symbol * aliased = InterSymbolsTables::symbol_from_data_pair_and_table ( val1 , val2 , T );
+ inter_symbol * aliased = InterSymbolsTable::symbol_from_data_pair ( val1 , val2 , T );
if ( aliased == NULL ) internal_error ( "bad aliased symbol" );
inter_tree_node * D = aliased -> definition ;
if ( D == NULL ) internal_error ( "undefined symbol" );
@@ -610,7 +610,7 @@ function togglePopup(material_id) {
case CONSTANT_DIRECT: {
inter_ti dval1 = D -> W . instruction [ DATA_CONST_IFLD ];
inter_ti dval2 = D -> W . instruction [ DATA_CONST_IFLD + 1 ];
- inter_ti e = Inter::Constant::evaluate ( InterPackage::scope_of ( D ), dval1 , dval2 );
+ inter_ti e = Inter::Constant::evaluate ( InterPackage::scope_of ( D ), dval1 , dval2 );
return e ;
}
case CONSTANT_SUM_LIST:
@@ -619,7 +619,7 @@ function togglePopup(material_id) {
case CONSTANT_QUOTIENT_LIST: {
inter_ti result = 0 ;
for ( int i = DATA_CONST_IFLD ; i <D-> W . extent ; i = i +2) {
- inter_ti extra = Inter::Constant::evaluate ( InterPackage::scope_of ( D ), D -> W . instruction [ i ], D -> W . instruction [ i +1]);
+ inter_ti extra = Inter::Constant::evaluate ( InterPackage::scope_of ( D ), D -> W . instruction [ i ], D -> W . instruction [ i +1]);
if ( i == DATA_CONST_IFLD ) result = extra ;
else {
if ( D -> W . instruction [ FORMAT_CONST_IFLD ] == CONSTANT_SUM_LIST ) result = result + extra ;
diff --git a/docs/bytecode-module/4-tdc.html b/docs/bytecode-module/4-tdc.html
index de2a2a893..ce5cca462 100644
--- a/docs/bytecode-module/4-tdc.html
+++ b/docs/bytecode-module/4-tdc.html
@@ -108,7 +108,7 @@ function togglePopup(material_id) {
* E = Inter::Types::read ( ilp -> line , eloc , InterBookmark::tree ( IBM ), InterBookmark::package ( IBM ), con_kind , ilp -> mr . exp [1], & con_val1 , & con_val2 , InterBookmark::scope ( IBM ));
if (* E ) return ;
- * E = Inter::DefaultValue::new ( IBM , InterSymbolsTables::id_from_IRS_and_symbol ( IBM , con_kind ), con_val1 , con_val2 , ( inter_ti ) ilp -> indent_level , eloc );
+ * E = Inter::DefaultValue::new ( IBM , InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , con_kind ), con_val1 , con_val2 , ( inter_ti ) ilp -> indent_level , eloc );
}
inter_error_message * Inter::DefaultValue::new ( inter_bookmark * IBM , inter_ti KID , inter_ti val1 , inter_ti val2 , inter_ti level , inter_error_location * eloc ) {
@@ -124,11 +124,11 @@ function togglePopup(material_id) {
}
void Inter::DefaultValue::write ( inter_construct * IC , OUTPUT_STREAM , inter_tree_node * P , inter_error_message ** E ) {
- inter_symbol * con_kind = InterSymbolsTables::symbol_from_frame_data ( P , KIND_DEF_IFLD );
+ inter_symbol * con_kind = InterSymbolsTable::symbol_from_ID_at_node ( P , KIND_DEF_IFLD );
if ( con_kind ) {
WRITE ( "defaultvalue %S = " , con_kind -> symbol_name );
Inter::Types::write ( OUT , P , con_kind ,
- P -> W . instruction [ VAL1_DEF_IFLD ], P -> W . instruction [ VAL1_DEF_IFLD +1], InterPackage::scope_of ( P ), FALSE );
+ P -> W . instruction [ VAL1_DEF_IFLD ], P -> W . instruction [ VAL1_DEF_IFLD +1], InterPackage::scope_of ( P ), FALSE );
} else {
* E = Inode::error ( P , I "defaultvalue can't be written" , NULL );
}
diff --git a/docs/bytecode-module/4-tic.html b/docs/bytecode-module/4-tic.html
index d8766d3a2..b356af10d 100644
--- a/docs/bytecode-module/4-tic.html
+++ b/docs/bytecode-module/4-tic.html
@@ -125,7 +125,7 @@ function togglePopup(material_id) {
* E = Inter::Types::read ( ilp -> line , eloc , InterBookmark::tree ( IBM ), InterBookmark::package ( IBM ), NULL , vtext , & v1 , & v2 , InterBookmark::scope ( IBM ));
if (* E ) return ;
}
- * E = Inter::Instance::new ( IBM , InterSymbolsTables::id_from_IRS_and_symbol ( IBM , inst_name ), InterSymbolsTables::id_from_IRS_and_symbol ( IBM , inst_kind ), v1 , v2 , ( inter_ti ) ilp -> indent_level , eloc );
+ * E = Inter::Instance::new ( IBM , InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , inst_name ), InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , inst_kind ), v1 , v2 , ( inter_ti ) ilp -> indent_level , eloc );
}
inter_error_message * Inter::Instance::new ( inter_bookmark * IBM , inter_ti SID , inter_ti KID , inter_ti V1 , inter_ti V2 , inter_ti level , inter_error_location * eloc ) {
@@ -147,9 +147,9 @@ function togglePopup(material_id) {
void Inter::Instance::verify ( inter_construct * IC , inter_tree_node * P , inter_package * owner , inter_error_message ** E ) {
if ( P -> W . extent != EXTENT_INST_IFR ) { * E = Inode::error ( P , I "extent wrong" , NULL ); return ; }
* E = Inter::Verify::defn ( owner , P , DEFN_INST_IFLD ); if (* E ) return ;
- inter_symbol * inst_name = InterSymbolsTables::symbol_from_id ( InterPackage::scope ( owner ), P -> W . instruction [ DEFN_INST_IFLD ]);
+ inter_symbol * inst_name = InterSymbolsTable::symbol_from_ID ( InterPackage::scope ( owner ), P -> W . instruction [ DEFN_INST_IFLD ]);
* E = Inter::Verify::symbol ( owner , P , P -> W . instruction [ KIND_INST_IFLD ], KIND_IST ); if (* E ) return ;
- inter_symbol * inst_kind = InterSymbolsTables::symbol_from_id ( InterPackage::scope ( owner ), P -> W . instruction [ KIND_INST_IFLD ]);
+ inter_symbol * inst_kind = InterSymbolsTable::symbol_from_ID ( InterPackage::scope ( owner ), P -> W . instruction [ KIND_INST_IFLD ]);
inter_data_type * idt = Inter::Kind::data_type ( inst_kind );
if ( Inter::Types::is_enumerated ( idt )) {
if ( P -> W . instruction [ VAL1_INST_IFLD ] == UNDEF_IVAL ) {
@@ -173,14 +173,14 @@ function togglePopup(material_id) {
}
void Inter::Instance::write ( inter_construct * IC , OUTPUT_STREAM , inter_tree_node * P , inter_error_message ** E ) {
- inter_symbol * inst_name = InterSymbolsTables::symbol_from_frame_data ( P , DEFN_INST_IFLD );
- inter_symbol * inst_kind = InterSymbolsTables::symbol_from_frame_data ( P , KIND_INST_IFLD );
+ inter_symbol * inst_name = InterSymbolsTable::symbol_from_ID_at_node ( P , DEFN_INST_IFLD );
+ inter_symbol * inst_kind = InterSymbolsTable::symbol_from_ID_at_node ( P , KIND_INST_IFLD );
if (( inst_name ) && ( inst_kind )) {
inter_data_type * idt = Inter::Kind::data_type ( inst_kind );
if ( idt ) {
WRITE ( "instance %S %S = " , inst_name -> symbol_name , inst_kind -> symbol_name );
Inter::Types::write ( OUT , P , NULL ,
- P -> W . instruction [ VAL1_INST_IFLD ], P -> W . instruction [ VAL2_INST_IFLD ], InterPackage::scope_of ( P ), FALSE );
+ P -> W . instruction [ VAL1_INST_IFLD ], P -> W . instruction [ VAL2_INST_IFLD ], InterPackage::scope_of ( P ), FALSE );
} else { * E = Inode::error ( P , I "instance with bad data type" , NULL ); return ; }
} else { * E = Inode::error ( P , I "bad instance" , NULL ); return ; }
Inter::Symbols::write_annotations ( OUT , P , inst_name );
@@ -198,7 +198,7 @@ function togglePopup(material_id) {
inter_tree_node * D = Inter::Symbols::definition ( inst_name );
if ( D == NULL ) return NULL ;
if ( D -> W . instruction [ ID_IFLD ] != INSTANCE_IST ) return NULL ;
- return InterSymbolsTables::symbol_from_frame_data ( D , KIND_INST_IFLD );
+ return InterSymbolsTable::symbol_from_ID_at_node ( D , KIND_INST_IFLD );
}
diff --git a/docs/bytecode-module/4-tkc.html b/docs/bytecode-module/4-tkc.html
index 3f7482065..522c28c2e 100644
--- a/docs/bytecode-module/4-tkc.html
+++ b/docs/bytecode-module/4-tkc.html
@@ -139,14 +139,14 @@ function togglePopup(material_id) {
constructor = RULEBOOK_ICON ;
inter_symbol * conts_kind = Inter::Textual::find_symbol ( InterBookmark::tree ( IBM ), eloc , InterBookmark::scope ( IBM ), mr2 . exp [0], KIND_IST , E );
if (* E ) return ;
-
operands [0] = InterSymbolsTables::id_from_IRS_and_symbol ( IBM , conts_kind ); arity = 1 ;
+
operands [0] = InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , conts_kind ); arity = 1 ;
} else if ( Regexp::match (& mr2 , ilp -> mr . exp [1], L "list of (%i+)" )) {
idt = Inter::Textual::data_type ( eloc , I "list" , E );
if (* E ) return ;
constructor = LIST_ICON ;
inter_symbol * conts_kind = Inter::Textual::find_symbol ( InterBookmark::tree ( IBM ), eloc , InterBookmark::scope ( IBM ), mr2 . exp [0], KIND_IST , E );
if (* E ) return ;
-
operands [0] = InterSymbolsTables::id_from_IRS_and_symbol ( IBM , conts_kind ); arity = 1 ;
+
operands [0] = InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , conts_kind ); arity = 1 ;
} else if ( Regexp::match (& mr2 , ilp -> mr . exp [1], L "relation of (%i+) to (%i+)" )) {
idt = Inter::Textual::data_type ( eloc , I "relation" , E );
if (* E ) return ;
@@ -155,8 +155,8 @@ function togglePopup(material_id) {
if (* E ) return ;
inter_symbol * Y_kind = Inter::Textual::find_symbol ( InterBookmark::tree ( IBM ), eloc , InterBookmark::scope ( IBM ), mr2 . exp [1], KIND_IST , E );
if (* E ) return ;
-
operands [0] = InterSymbolsTables::id_from_IRS_and_symbol ( IBM , X_kind );
-
operands [1] = InterSymbolsTables::id_from_IRS_and_symbol ( IBM , Y_kind );
+
operands [0] = InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , X_kind );
+
operands [1] = InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , Y_kind );
arity = 2 ;
} else if ( Regexp::match (& mr2 , ilp -> mr . exp [1], L "column of (%i+)" )) {
idt = Inter::Textual::data_type ( eloc , I "column" , E );
@@ -164,14 +164,14 @@ function togglePopup(material_id) {
constructor = COLUMN_ICON ;
inter_symbol * conts_kind = Inter::Textual::find_symbol ( InterBookmark::tree ( IBM ), eloc , InterBookmark::scope ( IBM ), mr2 . exp [0], KIND_IST , E );
if (* E ) return ;
-
operands [0] = InterSymbolsTables::id_from_IRS_and_symbol ( IBM , conts_kind ); arity = 1 ;
+
operands [0] = InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , conts_kind ); arity = 1 ;
} else if ( Regexp::match (& mr2 , ilp -> mr . exp [1], L "description of (%i+)" )) {
idt = Inter::Textual::data_type ( eloc , I "description" , E );
if (* E ) return ;
constructor = DESCRIPTION_ICON ;
inter_symbol * conts_kind = Inter::Textual::find_symbol ( InterBookmark::tree ( IBM ), eloc , InterBookmark::scope ( IBM ), mr2 . exp [0], KIND_IST , E );
if (* E ) return ;
-
operands [0] = InterSymbolsTables::id_from_IRS_and_symbol ( IBM , conts_kind ); arity = 1 ;
+
operands [0] = InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , conts_kind ); arity = 1 ;
} else if (( Regexp::match (& mr2 , ilp -> mr . exp [1], L "(function) (%c+) -> (%i+)" )) ||
( Regexp::match (& mr2 , ilp -> mr . exp [1], L "(rule) (%c+) -> (%i+)" ))) {
idt = Inter::Textual::data_type ( eloc , I "routine" , E );
@@ -190,7 +190,7 @@ function togglePopup(material_id) {
if (* E ) return ;
Str::copy ( from , mr3 . exp [1]);
if ( arity >= MAX_ICON_OPERANDS ) { * E = Inter::Errors::plain ( I "too many args" , eloc ); return ; }
-
operands [ arity ++] = InterSymbolsTables::id_from_IRS_and_symbol ( IBM , arg_kind );
+
operands [ arity ++] = InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , arg_kind );
}
}
if ( Str::eq ( to , I "void" )) {
@@ -200,7 +200,7 @@ function togglePopup(material_id) {
inter_symbol * res_kind = Inter::Textual::find_symbol ( InterBookmark::tree ( IBM ), eloc , InterBookmark::scope ( IBM ), to , KIND_IST , E );
if (* E ) return ;
if ( arity >= MAX_ICON_OPERANDS ) { * E = Inter::Errors::plain ( I "too many args" , eloc ); return ; }
-
operands [ arity ++] = InterSymbolsTables::id_from_IRS_and_symbol ( IBM , res_kind );
+
operands [ arity ++] = InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , res_kind );
}
} else if ( Regexp::match (& mr2 , ilp -> mr . exp [1], L "struct (%c+)" )) {
idt = Inter::Textual::data_type ( eloc , I "struct" , E );
@@ -213,7 +213,7 @@ function togglePopup(material_id) {
if (* E ) return ;
Str::copy ( elements , mr3 . exp [1]);
if ( arity >= MAX_ICON_OPERANDS ) { * E = Inter::Errors::plain ( I "too many args" , eloc ); return ; }
-
operands [ arity ++] = InterSymbolsTables::id_from_IRS_and_symbol ( IBM , arg_kind );
+
operands [ arity ++] = InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , arg_kind );
}
} else {
idt = Inter::Textual::data_type ( eloc , ilp -> mr . exp [1], E );
@@ -221,8 +221,8 @@ function togglePopup(material_id) {
}
if ( idt == NULL ) internal_error ( "null IDT" );
-
* E = Inter::Kind::new ( IBM , InterSymbolsTables::id_from_IRS_and_symbol ( IBM , symb ), idt -> type_ID ,
-
( super_kind )?( InterSymbolsTables::id_from_IRS_and_symbol ( IBM , super_kind )):0,
+
* E = Inter::Kind::new ( IBM , InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , symb ), idt -> type_ID ,
+
( super_kind )?( InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , super_kind )):0,
constructor , arity , operands , ( inter_ti ) ilp -> indent_level , eloc );
}
@@ -253,14 +253,14 @@ function togglePopup(material_id) {
* E = Inter::Verify::defn ( owner , P , DEFN_KIND_IFLD ); if (* E ) return ;
* E = Inter::Verify::data_type ( P , DATA_TYPE_KIND_IFLD ); if (* E ) return ;
if ( P -> W . instruction [ ENUM_RANGE_KIND_IFLD ] != 0 ) {
-
inter_symbol * the_kind = InterSymbolsTables::symbol_from_id ( InterPackage::scope ( owner ), P -> W . instruction [ DEFN_KIND_IFLD ]);
+
inter_symbol * the_kind = InterSymbolsTable::symbol_from_ID ( InterPackage::scope ( owner ), P -> W . instruction [ DEFN_KIND_IFLD ]);
if (( the_kind == NULL ) ||
( Inter::Types::is_enumerated ( Inter::Types::find_by_ID ( P -> W . instruction [ DATA_TYPE_KIND_IFLD ])) == FALSE ))
{ * E = Inode::error ( P , I "spurious extent in non-enumeration" , NULL ); return ; }
}
if ( P -> W . instruction [ SUPER_KIND_IFLD ] != 0 ) {
* E = Inter::Verify::symbol ( owner , P , P -> W . instruction [ SUPER_KIND_IFLD ], KIND_IST ); if (* E ) return ;
-
inter_symbol * super_kind = InterSymbolsTables::symbol_from_id ( InterPackage::scope ( owner ), P -> W . instruction [ SUPER_KIND_IFLD ]);
+
inter_symbol * super_kind = InterSymbolsTable::symbol_from_ID ( InterPackage::scope ( owner ), P -> W . instruction [ SUPER_KIND_IFLD ]);
if ( Inter::Types::is_enumerated ( Inter::Kind::data_type ( super_kind )) == FALSE )
{ * E = Inode::error ( P , I "subkind of nonenumerated kind" , NULL ); return ; }
}
@@ -327,39 +327,39 @@ function togglePopup(material_id) {
}
void Inter::Kind::write ( inter_construct * IC , OUTPUT_STREAM , inter_tree_node * P , inter_error_message ** E ) {
-
inter_symbol * symb = InterSymbolsTables::symbol_from_frame_data ( P , DEFN_KIND_IFLD );
+
inter_symbol * symb = InterSymbolsTable::symbol_from_ID_at_node ( P , DEFN_KIND_IFLD );
inter_data_type * idt = Inter::Types::find_by_ID ( P -> W . instruction [ DATA_TYPE_KIND_IFLD ]);
if (( symb ) && ( idt )) {
WRITE ( "kind %S " , symb -> symbol_name );
if ( P -> W . instruction [ SUPER_KIND_IFLD ]) {
-
inter_symbol * super = InterSymbolsTables::symbol_from_frame_data ( P , SUPER_KIND_IFLD );
+
inter_symbol * super = InterSymbolsTable::symbol_from_ID_at_node ( P , SUPER_KIND_IFLD );
WRITE ( "<= %S" , super -> symbol_name );
} else {
switch ( P -> W . instruction [ CONSTRUCTOR_KIND_IFLD ]) {
case BASE_ICON: WRITE ( "%S" , idt -> reserved_word ); break ;
case LIST_ICON: {
-
inter_symbol * conts_kind = InterSymbolsTables::symbol_from_frame_data ( P , OPERANDS_KIND_IFLD );
+
inter_symbol * conts_kind = InterSymbolsTable::symbol_from_ID_at_node ( P , OPERANDS_KIND_IFLD );
WRITE ( "list of %S" , conts_kind -> symbol_name );
break ;
}
case RULEBOOK_ICON: {
-
inter_symbol * conts_kind = InterSymbolsTables::symbol_from_frame_data ( P , OPERANDS_KIND_IFLD );
+
inter_symbol * conts_kind = InterSymbolsTable::symbol_from_ID_at_node ( P , OPERANDS_KIND_IFLD );
WRITE ( "rulebook of %S" , conts_kind -> symbol_name );
break ;
}
case COLUMN_ICON: {
-
inter_symbol * conts_kind = InterSymbolsTables::symbol_from_frame_data ( P , OPERANDS_KIND_IFLD );
+
inter_symbol * conts_kind = InterSymbolsTable::symbol_from_ID_at_node ( P , OPERANDS_KIND_IFLD );
WRITE ( "column of %S" , conts_kind -> symbol_name );
break ;
}
case DESCRIPTION_ICON: {
-
inter_symbol * conts_kind = InterSymbolsTables::symbol_from_frame_data ( P , OPERANDS_KIND_IFLD );
+
inter_symbol * conts_kind = InterSymbolsTable::symbol_from_ID_at_node ( P , OPERANDS_KIND_IFLD );
WRITE ( "description of %S" , conts_kind -> symbol_name );
break ;
}
case RELATION_ICON: {
-
inter_symbol * X_kind = InterSymbolsTables::symbol_from_frame_data ( P , OPERANDS_KIND_IFLD );
-
inter_symbol * Y_kind = InterSymbolsTables::symbol_from_frame_data ( P , OPERANDS_KIND_IFLD +1);
+
inter_symbol * X_kind = InterSymbolsTable::symbol_from_ID_at_node ( P , OPERANDS_KIND_IFLD );
+
inter_symbol * Y_kind = InterSymbolsTable::symbol_from_ID_at_node ( P , OPERANDS_KIND_IFLD +1);
WRITE ( "relation of %S to %S" , X_kind -> symbol_name , Y_kind -> symbol_name );
break ;
}
@@ -376,7 +376,7 @@ function togglePopup(material_id) {
if ( P -> W . instruction [ OPERANDS_KIND_IFLD + i ] == 0 ) {
WRITE ( "void" );
} else {
-
inter_symbol * K = InterSymbolsTables::symbol_from_frame_data ( P , OPERANDS_KIND_IFLD + i );
+
inter_symbol * K = InterSymbolsTable::symbol_from_ID_at_node ( P , OPERANDS_KIND_IFLD + i );
WRITE ( "%S" , K -> symbol_name );
}
}
@@ -386,7 +386,7 @@ function togglePopup(material_id) {
WRITE ( "struct" );
int arity = P -> W . extent - MIN_EXTENT_KIND_IFR ;
for ( int i =0; i < arity ; i ++) {
-
inter_symbol * K = InterSymbolsTables::symbol_from_frame_data ( P , OPERANDS_KIND_IFLD + i );
+
inter_symbol * K = InterSymbolsTable::symbol_from_ID_at_node ( P , OPERANDS_KIND_IFLD + i );
WRITE ( " %S" , K -> symbol_name );
}
break ;
@@ -435,8 +435,8 @@ function togglePopup(material_id) {
if ( D == NULL ) return NULL ;
if ( i >= D -> W . extent - MIN_EXTENT_KIND_IFR ) return NULL ;
inter_ti CID = D -> W . instruction [ OPERANDS_KIND_IFLD + i ];
-
inter_symbols_table * T = InterPackage::scope_of ( D );
-
return InterSymbolsTables::symbol_from_id ( T , CID );
+
inter_symbols_table * T = InterPackage::scope_of ( D );
+
return InterSymbolsTable::symbol_from_ID ( T , CID );
}
inter_data_type * Inter::Kind::data_type ( inter_symbol * kind_symbol ) {
@@ -457,7 +457,7 @@ function togglePopup(material_id) {
if ( kind_symbol == NULL ) return NULL ;
inter_tree_node * D = Inter::Symbols::definition ( kind_symbol );
if ( D == NULL ) return NULL ;
-
return InterSymbolsTables::symbol_from_frame_data ( D , SUPER_KIND_IFLD );
+
return InterSymbolsTable::symbol_from_ID_at_node ( D , SUPER_KIND_IFLD );
}
int Inter::Kind::is ( inter_symbol * kind_symbol ) {
diff --git a/docs/bytecode-module/4-tpc.html b/docs/bytecode-module/4-tpc.html
index 33a5cc29a..1258b3f2e 100644
--- a/docs/bytecode-module/4-tpc.html
+++ b/docs/bytecode-module/4-tpc.html
@@ -103,7 +103,7 @@ function togglePopup(material_id) {
if ( Inter::Annotations::exist (&( ilp -> set ))) { * E = Inter::Errors::plain ( I "__annotations are not allowed" , eloc ); return ; }
-
inter_symbol * target_name = InterSymbolsTables::symbol_from_name ( InterBookmark::scope ( IBM ), ilp -> mr . exp [0]);
+
inter_symbol * target_name = InterSymbolsTable::symbol_from_name ( InterBookmark::scope ( IBM ), ilp -> mr . exp [0]);
if ( target_name == NULL )
target_name = Inter::Textual::new_symbol ( eloc , InterBookmark::scope ( IBM ), ilp -> mr . exp [0], E );
if (* E ) return ;
@@ -133,7 +133,7 @@ function togglePopup(material_id) {
}
inter_error_message * Inter::Pragma::new ( inter_bookmark * IBM , inter_symbol * target_name , inter_ti pragma_text , inter_ti level , struct inter_error_location * eloc ) {
-
inter_tree_node * P = Inode::new_with_2_data_fields ( IBM , PRAGMA_IST , InterSymbolsTables::id_from_IRS_and_symbol ( IBM , target_name ), pragma_text , eloc , level );
+
inter_tree_node * P = Inode::new_with_2_data_fields ( IBM , PRAGMA_IST , InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , target_name ), pragma_text , eloc , level );
inter_error_message * E = Inter::Defn::verify_construct ( InterBookmark::package ( IBM ), P ); if ( E ) return E ;
NodePlacement::move_to_moving_bookmark ( P , IBM );
return NULL ;
@@ -145,13 +145,13 @@ function togglePopup(material_id) {
void Inter::Pragma::verify ( inter_construct * IC , inter_tree_node * P , inter_package * owner , inter_error_message ** E ) {
if ( P -> W . extent != EXTENT_PRAGMA_IFR ) { * E = Inode::error ( P , I "extent wrong" , NULL ); return ; }
-
inter_symbol * target_name = InterSymbolsTables::symbol_from_frame_data ( P , TARGET_PRAGMA_IFLD );
+
inter_symbol * target_name = InterSymbolsTable::symbol_from_ID_at_node ( P , TARGET_PRAGMA_IFLD );
if ( target_name == NULL ) { * E = Inode::error ( P , I "no target name" , NULL ); return ; }
if ( P -> W . instruction [ TEXT_PRAGMA_IFLD ] == 0 ) { * E = Inode::error ( P , I "no pragma text" , NULL ); return ; }
}
void Inter::Pragma::write ( inter_construct * IC , OUTPUT_STREAM , inter_tree_node * P , inter_error_message ** E ) {
-
inter_symbol * target_name = InterSymbolsTables::symbol_from_frame_data ( P , TARGET_PRAGMA_IFLD );
+
inter_symbol * target_name = InterSymbolsTable::symbol_from_ID_at_node ( P , TARGET_PRAGMA_IFLD );
inter_ti ID = P -> W . instruction [ TEXT_PRAGMA_IFLD ];
text_stream * S = Inode::ID_to_text ( P , ID );
WRITE ( "pragma %S \"%S\"" , target_name -> symbol_name , S );
diff --git a/docs/bytecode-module/4-tpc2.html b/docs/bytecode-module/4-tpc2.html
index 28d29bbb0..e691c31c6 100644
--- a/docs/bytecode-module/4-tpc2.html
+++ b/docs/bytecode-module/4-tpc2.html
@@ -108,7 +108,7 @@ function togglePopup(material_id) {
}
inter_error_message * Inter::PackageType::new_packagetype ( inter_bookmark * IBM , inter_symbol * ptype , inter_ti level , inter_error_location * eloc ) {
-
inter_tree_node * P = Inode::new_with_1_data_field ( IBM , PACKAGETYPE_IST , InterSymbolsTables::id_from_IRS_and_symbol ( IBM , ptype ), eloc , level );
+
inter_tree_node * P = Inode::new_with_1_data_field ( IBM , PACKAGETYPE_IST , InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , ptype ), eloc , level );
inter_error_message * E = Inter::Defn::verify_construct ( InterBookmark::package ( IBM ), P );
if ( E ) return E ;
NodePlacement::move_to_moving_bookmark ( P , IBM );
@@ -121,7 +121,7 @@ function togglePopup(material_id) {
}
void Inter::PackageType::write ( inter_construct * IC , OUTPUT_STREAM , inter_tree_node * P , inter_error_message ** E ) {
-
inter_symbol * ptype_name = InterSymbolsTables::symbol_from_frame_data ( P , DEFN_PTYPE_IFLD );
+
inter_symbol * ptype_name = InterSymbolsTable::symbol_from_ID_at_node ( P , DEFN_PTYPE_IFLD );
if ( ptype_name ) WRITE ( "packagetype %S" , ptype_name -> symbol_name );
else { * E = Inode::error ( P , I "cannot write packagetype" , NULL ); return ; }
}
diff --git a/docs/bytecode-module/4-tpc3.html b/docs/bytecode-module/4-tpc3.html
index 24c33d587..bbd47fc7e 100644
--- a/docs/bytecode-module/4-tpc3.html
+++ b/docs/bytecode-module/4-tpc3.html
@@ -119,7 +119,7 @@ function togglePopup(material_id) {
WRITE_TO ( mutable , "%S" , name );
inter_package * pack ;
int N = 1 , A = 0 ;
-
while (( pack = InterPackage::by_name ( InterBookmark::package ( IBM ), mutable )) != NULL ) {
+
while (( pack = InterPackage::from_name ( InterBookmark::package ( IBM ), mutable )) != NULL ) {
TEMPORARY_TEXT ( TAIL )
WRITE_TO ( TAIL , "_%d" , N ++);
if ( A > 0 ) Str::truncate ( mutable , Str::len ( mutable ) - A );
@@ -139,7 +139,7 @@ function togglePopup(material_id) {
inter_ti STID = InterWarehouse::create_symbols_table ( InterBookmark::warehouse ( IBM ));
inter_tree_node * P = Inode::new_with_3_data_fields ( IBM ,
PACKAGE_IST ,
-
InterSymbolsTables::id_from_symbol ( InterBookmark::tree ( IBM ), NULL , ptype_name ), STID , 0 , eloc , level );
+
InterSymbolsTable::id_from_symbol ( InterBookmark::tree ( IBM ), NULL , ptype_name ), STID , 0 , eloc , level );
inter_ti PID = InterWarehouse::create_package ( InterBookmark::warehouse ( IBM ), InterBookmark::tree ( IBM ));
inter_package * pack = InterWarehouse::get_package ( InterBookmark::warehouse ( IBM ), PID );
pack -> package_head = P ;
@@ -153,9 +153,9 @@ function togglePopup(material_id) {
InterPackage::set_name ( InterPackage::tree ( InterBookmark::package ( IBM )), InterBookmark::package ( IBM ), pack , name_text );
if ( Str::eq ( ptype_name -> symbol_name , I "_code" ))
-
InterPackage::mark_as_a_function_body ( pack );
+
InterPackage::mark_as_a_function_body ( pack );
if ( Str::eq ( ptype_name -> symbol_name , I "_linkage" ))
-
InterPackage::mark_as_a_linkage_package ( pack );
+
InterPackage::mark_as_a_linkage_package ( pack );
if ( created ) * created = pack ;
LOGIF ( INTER_SYMBOLS , "Package $6 at IBM $5\n" , pack , IBM );
@@ -172,14 +172,14 @@ function togglePopup(material_id) {
inter_package * pack = Inode::ID_to_package ( P , P -> W . instruction [ PID_PACKAGE_IFLD ]);
if ( pack ) pack -> package_head = P ;
else internal_error ( "uh?" );
-
inter_symbols_table * T = InterPackage::scope ( owner );
+
inter_symbols_table * T = InterPackage::scope ( owner );
if ( T == NULL ) T = Inode::globals ( P );
Inter::Defn::set_latest_block_package ( pack );
}
void InterPackage::write ( inter_construct * IC , OUTPUT_STREAM , inter_tree_node * P , inter_error_message ** E ) {
inter_package * pack = InterPackage::at_this_head ( P );
-
inter_symbol * ptype_name = InterSymbolsTables::global_symbol_from_frame_data ( P , PTYPE_PACKAGE_IFLD );
+
inter_symbol * ptype_name = InterSymbolsTable::global_symbol_from_ID_at_node ( P , PTYPE_PACKAGE_IFLD );
if (( pack ) && ( ptype_name )) {
WRITE ( "package %S %S" , InterPackage::name ( pack ), ptype_name -> symbol_name );
} else {
@@ -191,8 +191,12 @@ function togglePopup(material_id) {
inter_error_message * InterPackage::write_symbols ( OUTPUT_STREAM , inter_tree_node * P ) {
inter_package * pack = InterPackage::at_this_head ( P );
if ( pack ) {
-
inter_symbols_table * locals = InterPackage::scope ( pack );
-
InterSymbolsTables::write_declarations ( OUT , locals , ( int ) ( P -> W . instruction [ LEVEL_IFLD ] + 1 ));
+
inter_symbols_table * locals = InterPackage::scope ( pack );
+
int L = ( int ) ( P -> W . instruction [ LEVEL_IFLD ] + 1 );
+
LOOP_OVER_SYMBOLS_TABLE ( S , locals ) {
+
Inter::Symbols::write_declaration ( OUT , S , L );
+
WRITE ( "\n" );
+
}
}
return NULL ;
}
@@ -212,7 +216,7 @@ function togglePopup(material_id) {
return Inode::ID_to_package ( D , D -> W . instruction [ PID_PACKAGE_IFLD ]);
}
-
inter_package * InterPackage::at_this_head ( inter_tree_node * D ) {
+
inter_package * InterPackage::at_this_head ( inter_tree_node * D ) {
if ( D == NULL ) return NULL ;
if ( D -> W . instruction [ ID_IFLD ] != PACKAGE_IST ) return NULL ;
return Inode::ID_to_package ( D , D -> W . instruction [ PID_PACKAGE_IFLD ]);
@@ -221,7 +225,7 @@ function togglePopup(material_id) {
inter_symbol * InterPackage::type ( inter_package * pack ) {
if ( pack == NULL ) return NULL ;
inter_tree_node * D = pack -> package_head ;
-
inter_symbol * ptype_name = InterSymbolsTables::global_symbol_from_frame_data ( D , PTYPE_PACKAGE_IFLD );
+
inter_symbol * ptype_name = InterSymbolsTable::global_symbol_from_ID_at_node ( D , PTYPE_PACKAGE_IFLD );
return ptype_name ;
}
@@ -234,7 +238,7 @@ function togglePopup(material_id) {
}
void InterPackage::verify_children ( inter_construct * IC , inter_tree_node * P , inter_error_message ** E ) {
-
inter_symbol * ptype_name = InterSymbolsTables::global_symbol_from_frame_data ( P , PTYPE_PACKAGE_IFLD );
+
inter_symbol * ptype_name = InterSymbolsTable::global_symbol_from_ID_at_node ( P , PTYPE_PACKAGE_IFLD );
if ( Str::eq ( ptype_name -> symbol_name , I "_code" )) {
LOOP_THROUGH_INTER_CHILDREN ( C , P ) {
if (( C -> W . instruction [0] != LABEL_IST ) && ( C -> W . instruction [0] != LOCAL_IST ) && ( C -> W . instruction [0] != SYMBOL_IST )) {
diff --git a/docs/bytecode-module/4-tpc4.html b/docs/bytecode-module/4-tpc4.html
index a9564352b..3d9b1bcd4 100644
--- a/docs/bytecode-module/4-tpc4.html
+++ b/docs/bytecode-module/4-tpc4.html
@@ -108,7 +108,7 @@ function togglePopup(material_id) {
Inter::Annotations::copy_set_to_symbol (&( ilp -> set ), prop_name );
-
* E = Inter::Property::new ( IBM , InterSymbolsTables::id_from_IRS_and_symbol ( IBM , prop_name ), InterSymbolsTables::id_from_IRS_and_symbol ( IBM , prop_kind ), ( inter_ti ) ilp -> indent_level , eloc );
+
* E = Inter::Property::new ( IBM , InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , prop_name ), InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , prop_kind ), ( inter_ti ) ilp -> indent_level , eloc );
}
inter_error_message * Inter::Property::new ( inter_bookmark * IBM , inter_ti PID , inter_ti KID , inter_ti level , inter_error_location * eloc ) {
@@ -139,8 +139,8 @@ function togglePopup(material_id) {
}
void Inter::Property::write ( inter_construct * IC , OUTPUT_STREAM , inter_tree_node * P , inter_error_message ** E ) {
-
inter_symbol * prop_name = InterSymbolsTables::symbol_from_frame_data ( P , DEFN_PROP_IFLD );
-
inter_symbol * prop_kind = InterSymbolsTables::symbol_from_frame_data ( P , KIND_PROP_IFLD );
+
inter_symbol * prop_name = InterSymbolsTable::symbol_from_ID_at_node ( P , DEFN_PROP_IFLD );
+
inter_symbol * prop_kind = InterSymbolsTable::symbol_from_ID_at_node ( P , KIND_PROP_IFLD );
if (( prop_name ) && ( prop_kind )) {
WRITE ( "property %S %S" , prop_name -> symbol_name , prop_kind -> symbol_name );
Inter::Symbols::write_annotations ( OUT , P , prop_name );
@@ -152,7 +152,7 @@ function togglePopup(material_id) {
inter_tree_node * D = Inter::Symbols::definition ( prop_symbol );
if ( D == NULL ) return NULL ;
if ( D -> W . instruction [ ID_IFLD ] != PROPERTY_IST ) return NULL ;
-
return InterSymbolsTables::symbol_from_frame_data ( D , KIND_PROP_IFLD );
+
return InterSymbolsTable::symbol_from_ID_at_node ( D , KIND_PROP_IFLD );
}
diff --git a/docs/bytecode-module/4-tpc5.html b/docs/bytecode-module/4-tpc5.html
index 92d56df0c..72e588516 100644
--- a/docs/bytecode-module/4-tpc5.html
+++ b/docs/bytecode-module/4-tpc5.html
@@ -116,7 +116,7 @@ function togglePopup(material_id) {
inter_tree_node * X ;
LOOP_THROUGH_INTER_NODE_LIST ( X , FL ) {
-
inter_symbol * prop_X = InterSymbolsTables::symbol_from_frame_data ( X , PROP_PVAL_IFLD );
+
inter_symbol * prop_X = InterSymbolsTable::symbol_from_ID_at_node ( X , PROP_PVAL_IFLD );
if ( prop_X == prop_name )
{ * E = Inter::Errors::quoted ( I "property already given" , ilp -> mr . exp [0], eloc ); return ; }
}
@@ -127,7 +127,7 @@ function togglePopup(material_id) {
* E = Inter::Types::read ( ilp -> line , eloc , InterBookmark::tree ( IBM ), InterBookmark::package ( IBM ), val_kind , ilp -> mr . exp [2], & con_val1 , & con_val2 , InterBookmark::scope ( IBM ));
if (* E ) return ;
-
* E = Inter::PropertyValue::new ( IBM , InterSymbolsTables::id_from_IRS_and_symbol ( IBM , prop_name ), InterSymbolsTables::id_from_IRS_and_symbol ( IBM , owner_name ),
+
* E = Inter::PropertyValue::new ( IBM , InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , prop_name ), InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , owner_name ),
con_val1 , con_val2 , ( inter_ti ) ilp -> indent_level , eloc );
}
@@ -138,7 +138,7 @@ function togglePopup(material_id) {
inter_node_list * FL = Inode::ID_to_frame_list ( F , plist_ID );
inter_tree_node * X ;
LOOP_THROUGH_INTER_NODE_LIST ( X , FL ) {
-
inter_symbol * prop_allowed = InterSymbolsTables::symbol_from_frame_data ( X , PROP_PERM_IFLD );
+
inter_symbol * prop_allowed = InterSymbolsTable::symbol_from_ID_at_node ( X , PROP_PERM_IFLD );
if ( prop_allowed == prop_name )
return TRUE ;
}
@@ -151,7 +151,7 @@ function togglePopup(material_id) {
if ( FL == NULL ) internal_error ( "no permissions list" );
inter_tree_node * X ;
LOOP_THROUGH_INTER_NODE_LIST ( X , FL ) {
-
inter_symbol * prop_allowed = InterSymbolsTables::symbol_from_frame_data ( X , PROP_PERM_IFLD );
+
inter_symbol * prop_allowed = InterSymbolsTable::symbol_from_ID_at_node ( X , PROP_PERM_IFLD );
if ( prop_allowed == prop_name )
return TRUE ;
}
@@ -177,8 +177,8 @@ function togglePopup(material_id) {
* E = Inter::Verify::symbol_KOI ( owner , P , P -> W . instruction [ OWNER_PVAL_IFLD ]); if (* E ) return ;
if ( vcount == 0 ) {
-
inter_symbol * prop_name = InterSymbolsTables::symbol_from_id ( InterPackage::scope ( owner ), P -> W . instruction [ PROP_PVAL_IFLD ]);;
-
inter_symbol * owner_name = InterSymbolsTables::symbol_from_id ( InterPackage::scope ( owner ), P -> W . instruction [ OWNER_PVAL_IFLD ]);;
+
inter_symbol * prop_name = InterSymbolsTable::symbol_from_ID ( InterPackage::scope ( owner ), P -> W . instruction [ PROP_PVAL_IFLD ]);;
+
inter_symbol * owner_name = InterSymbolsTable::symbol_from_ID ( InterPackage::scope ( owner ), P -> W . instruction [ OWNER_PVAL_IFLD ]);;
if ( Inter::PropertyValue::permitted ( P , owner , owner_name , prop_name ) == FALSE ) {
text_stream * err = Str::new ();
@@ -204,12 +204,12 @@ function togglePopup(material_id) {
}
void Inter::PropertyValue::write ( inter_construct * IC , OUTPUT_STREAM , inter_tree_node * P , inter_error_message ** E ) {
-
inter_symbol * prop_name = InterSymbolsTables::symbol_from_frame_data ( P , PROP_PVAL_IFLD );
-
inter_symbol * owner_name = InterSymbolsTables::symbol_from_frame_data ( P , OWNER_PVAL_IFLD );
+
inter_symbol * prop_name = InterSymbolsTable::symbol_from_ID_at_node ( P , PROP_PVAL_IFLD );
+
inter_symbol * owner_name = InterSymbolsTable::symbol_from_ID_at_node ( P , OWNER_PVAL_IFLD );
if (( prop_name ) && ( owner_name )) {
-
inter_symbol * val_kind = Inter::Property::kind_of ( InterSymbolsTables::symbol_from_frame_data ( P , PROP_PVAL_IFLD ));
+
inter_symbol * val_kind = Inter::Property::kind_of ( InterSymbolsTable::symbol_from_ID_at_node ( P , PROP_PVAL_IFLD ));
WRITE ( "propertyvalue %S %S = " , prop_name -> symbol_name , owner_name -> symbol_name );
-
Inter::Types::write ( OUT , P , val_kind , P -> W . instruction [ DVAL1_PVAL_IFLD ], P -> W . instruction [ DVAL2_PVAL_IFLD ], InterPackage::scope_of ( P ), FALSE );
+
Inter::Types::write ( OUT , P , val_kind , P -> W . instruction [ DVAL1_PVAL_IFLD ], P -> W . instruction [ DVAL2_PVAL_IFLD ], InterPackage::scope_of ( P ), FALSE );
} else { * E = Inode::error ( P , I "cannot write propertyvalue" , NULL ); return ; }
}
diff --git a/docs/bytecode-module/4-tpc6.html b/docs/bytecode-module/4-tpc6.html
index c4aa16a4a..3b737cf86 100644
--- a/docs/bytecode-module/4-tpc6.html
+++ b/docs/bytecode-module/4-tpc6.html
@@ -121,7 +121,7 @@ function togglePopup(material_id) {
inter_tree_node * X ;
LOOP_THROUGH_INTER_NODE_LIST ( X , FL ) {
-
inter_symbol * prop_allowed = InterSymbolsTables::symbol_from_frame_data ( X , PROP_PERM_IFLD );
+
inter_symbol * prop_allowed = InterSymbolsTable::symbol_from_ID_at_node ( X , PROP_PERM_IFLD );
if ( prop_allowed == prop_name )
{ * E = Inter::Errors::quoted ( I "permission already given" , ilp -> mr . exp [0], eloc ); return ; }
}
@@ -134,7 +134,7 @@ function togglePopup(material_id) {
inter_tree_node * X ;
LOOP_THROUGH_INTER_NODE_LIST ( X , FL ) {
-
inter_symbol * prop_allowed = InterSymbolsTables::symbol_from_frame_data ( X , PROP_PERM_IFLD );
+
inter_symbol * prop_allowed = InterSymbolsTable::symbol_from_ID_at_node ( X , PROP_PERM_IFLD );
if ( prop_allowed == prop_name )
{ * E = Inter::Errors::quoted ( I "permission already given" , ilp -> mr . exp [0], eloc ); return ; }
}
@@ -152,8 +152,8 @@ function togglePopup(material_id) {
if (* E ) return ;
}
-
* E = Inter::Permission::new ( IBM , InterSymbolsTables::id_from_IRS_and_symbol ( IBM , prop_name ), InterSymbolsTables::id_from_IRS_and_symbol ( IBM , owner_name ),
-
InterSymbolsTables::id_from_IRS_and_symbol ( IBM , pp_name ), ( store )?( InterSymbolsTables::id_from_IRS_and_symbol ( IBM , store )):0, ( inter_ti ) ilp -> indent_level , eloc );
+
* E = Inter::Permission::new ( IBM , InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , prop_name ), InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , owner_name ),
+
InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , pp_name ), ( store )?( InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , store )):0, ( inter_ti ) ilp -> indent_level , eloc );
}
inter_error_message * Inter::Permission::new ( inter_bookmark * IBM , inter_ti PID , inter_ti KID ,
@@ -175,8 +175,8 @@ function togglePopup(material_id) {
if ( P -> W . instruction [ STORAGE_PERM_IFLD ]) {
* E = Inter::Verify::symbol ( owner , P , P -> W . instruction [ STORAGE_PERM_IFLD ], CONSTANT_IST ); if (* E ) return ;
}
-
inter_symbol * prop_name = InterSymbolsTables::symbol_from_id ( InterPackage::scope ( owner ), P -> W . instruction [ PROP_PERM_IFLD ]);;
-
inter_symbol * owner_name = InterSymbolsTables::symbol_from_id ( InterPackage::scope ( owner ), P -> W . instruction [ OWNER_PERM_IFLD ]);;
+
inter_symbol * prop_name = InterSymbolsTable::symbol_from_ID ( InterPackage::scope ( owner ), P -> W . instruction [ PROP_PERM_IFLD ]);;
+
inter_symbol * owner_name = InterSymbolsTable::symbol_from_ID ( InterPackage::scope ( owner ), P -> W . instruction [ OWNER_PERM_IFLD ]);;
if ( vcount == 0 ) {
inter_node_list * FL = NULL ;
@@ -188,11 +188,11 @@ function togglePopup(material_id) {
if ( FL == NULL ) internal_error ( "no permissions list" );
inter_tree_node * X ;
LOOP_THROUGH_INTER_NODE_LIST ( X , FL ) {
-
inter_symbol * prop_X = InterSymbolsTables::symbol_from_frame_data ( X , PROP_PERM_IFLD );
-
inter_symbol * prop_P = InterSymbolsTables::symbol_from_id ( InterPackage::scope ( owner ), P -> W . instruction [ PROP_PERM_IFLD ]);;
+
inter_symbol * prop_X = InterSymbolsTable::symbol_from_ID_at_node ( X , PROP_PERM_IFLD );
+
inter_symbol * prop_P = InterSymbolsTable::symbol_from_ID ( InterPackage::scope ( owner ), P -> W . instruction [ PROP_PERM_IFLD ]);;
if ( prop_X == prop_P ) { * E = Inode::error ( P , I "duplicate permission" , prop_name -> symbol_name ); return ; }
-
inter_symbol * owner_X = InterSymbolsTables::symbol_from_frame_data ( X , OWNER_PERM_IFLD );
-
inter_symbol * owner_P = InterSymbolsTables::symbol_from_id ( InterPackage::scope ( owner ), P -> W . instruction [ OWNER_PERM_IFLD ]);;
+
inter_symbol * owner_X = InterSymbolsTable::symbol_from_ID_at_node ( X , OWNER_PERM_IFLD );
+
inter_symbol * owner_P = InterSymbolsTable::symbol_from_ID ( InterPackage::scope ( owner ), P -> W . instruction [ OWNER_PERM_IFLD ]);;
if ( owner_X != owner_P ) { * E = Inode::error ( P , I "kind permission list malformed" , owner_name -> symbol_name ); return ; }
}
} else {
@@ -200,11 +200,11 @@ function togglePopup(material_id) {
if ( FL == NULL ) internal_error ( "no permissions list" );
inter_tree_node * X ;
LOOP_THROUGH_INTER_NODE_LIST ( X , FL ) {
-
inter_symbol * prop_X = InterSymbolsTables::symbol_from_frame_data ( X , PROP_PERM_IFLD );
-
inter_symbol * prop_P = InterSymbolsTables::symbol_from_id ( InterPackage::scope ( owner ), P -> W . instruction [ PROP_PERM_IFLD ]);;
+
inter_symbol * prop_X = InterSymbolsTable::symbol_from_ID_at_node ( X , PROP_PERM_IFLD );
+
inter_symbol * prop_P = InterSymbolsTable::symbol_from_ID ( InterPackage::scope ( owner ), P -> W . instruction [ PROP_PERM_IFLD ]);;
if ( prop_X == prop_P ) { * E = Inode::error ( P , I "duplicate permission" , prop_name -> symbol_name ); return ; }
-
inter_symbol * owner_X = InterSymbolsTables::symbol_from_frame_data ( X , OWNER_PERM_IFLD );
-
inter_symbol * owner_P = InterSymbolsTables::symbol_from_id ( InterPackage::scope ( owner ), P -> W . instruction [ OWNER_PERM_IFLD ]);;
+
inter_symbol * owner_X = InterSymbolsTable::symbol_from_ID_at_node ( X , OWNER_PERM_IFLD );
+
inter_symbol * owner_P = InterSymbolsTable::symbol_from_ID ( InterPackage::scope ( owner ), P -> W . instruction [ OWNER_PERM_IFLD ]);;
if ( owner_X != owner_P ) { * E = Inode::error ( P , I "instance permission list malformed" , owner_name -> symbol_name ); return ; }
}
}
@@ -217,12 +217,12 @@ function togglePopup(material_id) {
}
void Inter::Permission::write ( inter_construct * IC , OUTPUT_STREAM , inter_tree_node * P , inter_error_message ** E ) {
-
inter_symbol * prop_name = InterSymbolsTables::symbol_from_frame_data ( P , PROP_PERM_IFLD );
-
inter_symbol * owner_name = InterSymbolsTables::symbol_from_frame_data ( P , OWNER_PERM_IFLD );
+
inter_symbol * prop_name = InterSymbolsTable::symbol_from_ID_at_node ( P , PROP_PERM_IFLD );
+
inter_symbol * owner_name = InterSymbolsTable::symbol_from_ID_at_node ( P , OWNER_PERM_IFLD );
if (( prop_name ) && ( owner_name )) {
WRITE ( "permission %S %S" , prop_name -> symbol_name , owner_name -> symbol_name );
if ( P -> W . instruction [ STORAGE_PERM_IFLD ]) {
-
inter_symbol * store = InterSymbolsTables::symbol_from_frame_data ( P , STORAGE_PERM_IFLD );
+
inter_symbol * store = InterSymbolsTable::symbol_from_ID_at_node ( P , STORAGE_PERM_IFLD );
WRITE ( " %S" , store -> symbol_name );
}
} else { * E = Inode::error ( P , I "cannot write permission" , NULL ); return ; }
diff --git a/docs/bytecode-module/4-tpc7.html b/docs/bytecode-module/4-tpc7.html
index b4881adc2..d3bac9620 100644
--- a/docs/bytecode-module/4-tpc7.html
+++ b/docs/bytecode-module/4-tpc7.html
@@ -109,7 +109,7 @@ function togglePopup(material_id) {
inter_symbol * prim_name = Inter::Textual::new_symbol ( eloc , InterBookmark::scope ( IBM ), ilp -> mr . exp [0], E );
if (* E ) return ;
-
inter_tree_node * F = Inode::new_with_1_data_field ( IBM , PRIMITIVE_IST , InterSymbolsTables::id_from_IRS_and_symbol ( IBM , prim_name ), eloc , ( inter_ti ) ilp -> indent_level );
+
inter_tree_node * F = Inode::new_with_1_data_field ( IBM , PRIMITIVE_IST , InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , prim_name ), eloc , ( inter_ti ) ilp -> indent_level );
text_stream * in = ilp -> mr . exp [1];
match_results mr2 = Regexp::create_mr ();
@@ -156,7 +156,7 @@ function togglePopup(material_id) {
void Inter::Primitive::verify ( inter_construct * IC , inter_tree_node * P , inter_package * owner , inter_error_message ** E ) {
if ( P -> W . extent < MIN_EXTENT_PRIM_IFR ) { * E = Inode::error ( P , I "primitive extent wrong" , NULL ); return ; }
* E = Inter::Verify::defn ( owner , P , DEFN_PRIM_IFLD ); if (* E ) return ;
-
inter_symbol * prim_name = InterSymbolsTables::symbol_from_id ( Inode::globals ( P ), P -> W . instruction [ DEFN_PRIM_IFLD ]);
+
inter_symbol * prim_name = InterSymbolsTable::symbol_from_ID ( Inode::globals ( P ), P -> W . instruction [ DEFN_PRIM_IFLD ]);
if (( prim_name == NULL ) || ( Str::get_first_char ( prim_name -> symbol_name ) != '!' ))
{ * E = Inode::error ( P , I "primitive not beginning with '!'" , NULL ); return ; }
int voids = 0 , args = 0 ;
@@ -169,7 +169,7 @@ function togglePopup(material_id) {
}
void Inter::Primitive::write ( inter_construct * IC , OUTPUT_STREAM , inter_tree_node * P , inter_error_message ** E ) {
-
inter_symbol * prim_name = InterSymbolsTables::symbol_from_frame_data ( P , DEFN_PRIM_IFLD );
+
inter_symbol * prim_name = InterSymbolsTable::symbol_from_ID_at_node ( P , DEFN_PRIM_IFLD );
if ( prim_name ) {
WRITE ( "primitive %S" , prim_name -> symbol_name );
int cats = 0 ;
diff --git a/docs/bytecode-module/4-tsc.html b/docs/bytecode-module/4-tsc.html
index 0e531e596..081cc4366 100644
--- a/docs/bytecode-module/4-tsc.html
+++ b/docs/bytecode-module/4-tsc.html
@@ -120,7 +120,7 @@ function togglePopup(material_id) {
inter_symbol * name_name = NULL ;
inter_ti level = 0 ;
if ( routine ) {
-
inter_symbols_table * locals = InterPackage::scope ( routine );
+
inter_symbols_table * locals = InterPackage::scope ( routine );
if ( locals == NULL ) { * E = Inter::Errors::plain ( I "function has no symbols table" , eloc ); return ; }
name_name = Inter::Textual::new_symbol ( eloc , locals , symbol_name , E );
if (* E ) return ;
@@ -147,7 +147,7 @@ function togglePopup(material_id) {
* E = Inter::Errors::plain ( I "a symbol cannot be both translated and equated" , eloc ); return ;
}
-
if ( InterPackage::is_a_linkage_package ( InterBookmark::package ( IBM ))) {
+
if ( InterPackage::is_a_linkage_package ( InterBookmark::package ( IBM ))) {
if ( Inter::Symbols::is_connector ( name_name ) == FALSE ) {
* E = Inter::Errors::plain ( I "in a _linkage package, all symbols must be plugs or sockets" , eloc ); return ;
}
@@ -155,7 +155,8 @@ function togglePopup(material_id) {
if ( Inter::Symbols::get_scope ( name_name ) == PLUG_ISYMS )
Wiring::convert_to_plug ( name_name , equate_name );
else {
-
inter_symbol * eq = InterSymbolsTables::url_name_to_symbol ( InterBookmark::tree ( IBM ), InterBookmark::scope ( IBM ), equate_name );
+
inter_symbol * eq = InterSymbolsTable::URL_to_symbol ( InterBookmark::tree ( IBM ), equate_name );
+
if ( eq == NULL ) eq = InterSymbolsTable::symbol_from_name ( InterBookmark::scope ( IBM ), equate_name );
if ( eq == NULL ) {
Wiring::wire_to_name ( name_name , equate_name );
Inter::Symbols::set_scope ( name_name , EXTERNAL_ISYMS );
@@ -172,7 +173,8 @@ function togglePopup(material_id) {
}
if ( trans_name ) Inter::Symbols::set_translate ( name_name , trans_name );
if ( equate_name ) {
-
inter_symbol * eq = InterSymbolsTables::url_name_to_symbol ( InterBookmark::tree ( IBM ), InterBookmark::scope ( IBM ), equate_name );
+
inter_symbol * eq = InterSymbolsTable::URL_to_symbol ( InterBookmark::tree ( IBM ), equate_name );
+
if ( eq == NULL ) eq = InterSymbolsTable::symbol_from_name ( InterBookmark::scope ( IBM ), equate_name );
if ( eq == NULL ) {
Wiring::wire_to_name ( name_name , equate_name );
Inter::Symbols::set_scope ( name_name , EXTERNAL_ISYMS );
diff --git a/docs/bytecode-module/4-tvc2.html b/docs/bytecode-module/4-tvc2.html
index ecdd4b175..a23e20ad6 100644
--- a/docs/bytecode-module/4-tvc2.html
+++ b/docs/bytecode-module/4-tvc2.html
@@ -113,7 +113,7 @@ function togglePopup(material_id) {
* E = Inter::Types::read ( ilp -> line , eloc , InterBookmark::tree ( IBM ), InterBookmark::package ( IBM ), var_kind , ilp -> mr . exp [2], & var_val1 , & var_val2 , InterBookmark::scope ( IBM ));
if (* E ) return ;
-
* E = Inter::Variable::new ( IBM , InterSymbolsTables::id_from_IRS_and_symbol ( IBM , var_name ), InterSymbolsTables::id_from_IRS_and_symbol ( IBM , var_kind ), var_val1 , var_val2 , ( inter_ti ) ilp -> indent_level , eloc );
+
* E = Inter::Variable::new ( IBM , InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , var_name ), InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , var_kind ), var_val1 , var_val2 , ( inter_ti ) ilp -> indent_level , eloc );
}
inter_error_message * Inter::Variable::new ( inter_bookmark * IBM , inter_ti VID , inter_ti KID , inter_ti var_val1 , inter_ti var_val2 , inter_ti level , inter_error_location * eloc ) {
@@ -131,11 +131,11 @@ function togglePopup(material_id) {
}
void Inter::Variable::write ( inter_construct * IC , OUTPUT_STREAM , inter_tree_node * P , inter_error_message ** E ) {
-
inter_symbol * var_name = InterSymbolsTables::symbol_from_frame_data ( P , DEFN_VAR_IFLD );
-
inter_symbol * var_kind = InterSymbolsTables::symbol_from_frame_data ( P , KIND_VAR_IFLD );
+
inter_symbol * var_name = InterSymbolsTable::symbol_from_ID_at_node ( P , DEFN_VAR_IFLD );
+
inter_symbol * var_kind = InterSymbolsTable::symbol_from_ID_at_node ( P , KIND_VAR_IFLD );
if (( var_name ) && ( var_kind )) {
WRITE ( "variable %S %S = " , var_name -> symbol_name , var_kind -> symbol_name );
-
Inter::Types::write ( OUT , P , var_kind , P -> W . instruction [ VAL1_VAR_IFLD ], P -> W . instruction [ VAL2_VAR_IFLD ], InterPackage::scope_of ( P ), FALSE );
+
Inter::Types::write ( OUT , P , var_kind , P -> W . instruction [ VAL1_VAR_IFLD ], P -> W . instruction [ VAL2_VAR_IFLD ], InterPackage::scope_of ( P ), FALSE );
Inter::Symbols::write_annotations ( OUT , P , var_name );
} else { * E = Inode::error ( P , I "cannot write variable" , NULL ); return ; }
}
@@ -145,7 +145,7 @@ function togglePopup(material_id) {
inter_tree_node * D = Inter::Symbols::definition ( con_symbol );
if ( D == NULL ) return NULL ;
if ( D -> W . instruction [ ID_IFLD ] != VARIABLE_IST ) return NULL ;
-
return InterSymbolsTables::symbol_from_frame_data ( D , KIND_VAR_IFLD );
+
return InterSymbolsTable::symbol_from_ID_at_node ( D , KIND_VAR_IFLD );
}
diff --git a/docs/bytecode-module/5-tcc2.html b/docs/bytecode-module/5-tcc2.html
index a2075b77e..22b52b358 100644
--- a/docs/bytecode-module/5-tcc2.html
+++ b/docs/bytecode-module/5-tcc2.html
@@ -118,7 +118,7 @@ function togglePopup(material_id) {
}
inter_error_message * Inter::Cast::new ( inter_bookmark * IBM , inter_symbol * from_kind , inter_symbol * to_kind , inter_ti level , inter_error_location * eloc ) {
-
inter_tree_node * P = Inode::new_with_3_data_fields ( IBM , CAST_IST , 0 , InterSymbolsTables::id_from_IRS_and_symbol ( IBM , to_kind ), InterSymbolsTables::id_from_IRS_and_symbol ( IBM , from_kind ), eloc , ( inter_ti ) level );
+
inter_tree_node * P = Inode::new_with_3_data_fields ( IBM , CAST_IST , 0 , InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , to_kind ), InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , from_kind ), eloc , ( inter_ti ) level );
inter_error_message * E = Inter::Defn::verify_construct ( InterBookmark::package ( IBM ), P ); if ( E ) return E ;
NodePlacement::move_to_moving_bookmark ( P , IBM );
return NULL ;
@@ -131,10 +131,10 @@ function togglePopup(material_id) {
}
void Inter::Cast::write ( inter_construct * IC , OUTPUT_STREAM , inter_tree_node * P , inter_error_message ** E ) {
-
inter_symbols_table * locals = InterPackage::scope_of ( P );
+
inter_symbols_table * locals = InterPackage::scope_of ( P );
if ( locals == NULL ) { * E = Inode::error ( P , I "function has no symbols table" , NULL ); return ; }
-
inter_symbol * from_kind = InterSymbolsTables::symbol_from_frame_data ( P , FROM_KIND_CAST_IFLD );
-
inter_symbol * to_kind = InterSymbolsTables::symbol_from_frame_data ( P , TO_KIND_CAST_IFLD );
+
inter_symbol * from_kind = InterSymbolsTable::symbol_from_ID_at_node ( P , FROM_KIND_CAST_IFLD );
+
inter_symbol * to_kind = InterSymbolsTable::symbol_from_ID_at_node ( P , TO_KIND_CAST_IFLD );
if (( from_kind ) && ( to_kind )) {
WRITE ( "cast %S <- %S" , to_kind -> symbol_name , from_kind -> symbol_name );
} else { * E = Inode::error ( P , I "cannot write cast" , NULL ); return ; }
diff --git a/docs/bytecode-module/5-tic.html b/docs/bytecode-module/5-tic.html
index dc6d1eb3f..ca545c34f 100644
--- a/docs/bytecode-module/5-tic.html
+++ b/docs/bytecode-module/5-tic.html
@@ -112,8 +112,8 @@ function togglePopup(material_id) {
inter_package * routine = Inter::Defn::get_latest_block_package ();
if ( routine == NULL ) { * E = Inter::Errors::plain ( I "'inv' used outside function" , eloc ); return ; }
-
inter_symbol * invoked_name = InterSymbolsTables::symbol_from_name ( InterTree::global_scope ( InterBookmark::tree ( IBM )), ilp -> mr . exp [0]);
-
if ( invoked_name == NULL ) invoked_name = InterSymbolsTables::symbol_from_name ( InterBookmark::scope ( IBM ), ilp -> mr . exp [0]);
+
inter_symbol * invoked_name = InterSymbolsTable::symbol_from_name ( InterTree::global_scope ( InterBookmark::tree ( IBM )), ilp -> mr . exp [0]);
+
if ( invoked_name == NULL ) invoked_name = InterSymbolsTable::symbol_from_name ( InterBookmark::scope ( IBM ), ilp -> mr . exp [0]);
if ( invoked_name == NULL ) { * E = Inter::Errors::quoted ( I "'inv' on unknown routine or primitive" , ilp -> mr . exp [0], eloc ); return ; }
if (( Inter::Symbols::is_extern ( invoked_name )) ||
@@ -136,7 +136,7 @@ function togglePopup(material_id) {
}
inter_error_message * Inter::Inv::new_primitive ( inter_bookmark * IBM , inter_symbol * invoked_name , inter_ti level , inter_error_location * eloc ) {
-
inter_tree_node * P = Inode::new_with_3_data_fields ( IBM , INV_IST , 0 , INVOKED_PRIMITIVE , InterSymbolsTables::id_from_symbol ( InterBookmark::tree ( IBM ), NULL , invoked_name ),
+
inter_tree_node * P = Inode::new_with_3_data_fields ( IBM , INV_IST , 0 , INVOKED_PRIMITIVE , InterSymbolsTable::id_from_symbol ( InterBookmark::tree ( IBM ), NULL , invoked_name ),
eloc , ( inter_ti ) level );
inter_error_message * E = Inter::Defn::verify_construct ( InterBookmark::package ( IBM ), P );
if ( E ) return E ;
@@ -145,7 +145,7 @@ function togglePopup(material_id) {
}
inter_error_message * Inter::Inv::new_call ( inter_bookmark * IBM , inter_symbol * invoked_name , inter_ti level , inter_error_location * eloc ) {
-
inter_tree_node * P = Inode::new_with_3_data_fields ( IBM , INV_IST , 0 , INVOKED_ROUTINE , InterSymbolsTables::id_from_IRS_and_symbol ( IBM , invoked_name ), eloc , ( inter_ti ) level );
+
inter_tree_node * P = Inode::new_with_3_data_fields ( IBM , INV_IST , 0 , INVOKED_ROUTINE , InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , invoked_name ), eloc , ( inter_ti ) level );
inter_error_message * E = Inter::Defn::verify_construct ( InterBookmark::package ( IBM ), P );
if ( E ) return E ;
NodePlacement::move_to_moving_bookmark ( P , IBM );
@@ -194,8 +194,8 @@ function togglePopup(material_id) {
inter_symbol * Inter::Inv::invokee ( inter_tree_node * P ) {
if ( P -> W . instruction [ METHOD_INV_IFLD ] == INVOKED_PRIMITIVE )
-
return InterSymbolsTables::global_symbol_from_frame_data ( P , INVOKEE_INV_IFLD );
-
return InterSymbolsTables::symbol_from_frame_data ( P , INVOKEE_INV_IFLD );
+
return InterSymbolsTable::global_symbol_from_ID_at_node ( P , INVOKEE_INV_IFLD );
+
return InterSymbolsTable::symbol_from_ID_at_node ( P , INVOKEE_INV_IFLD );
}
void Inter::Inv::verify_children ( inter_construct * IC , inter_tree_node * P , inter_error_message ** E ) {
@@ -207,10 +207,10 @@ function togglePopup(material_id) {
inter_symbol * invokee = Inter::Inv::invokee ( P );
if ( Primitives::is_BIP_for_indirect_call_returning_value ( Primitives::to_BIP ( I , invokee ))) {
inter_symbol * better = Primitives::from_BIP ( I , Primitives::BIP_for_indirect_call_returning_value ( arity_as_invoked - 1 ));
-
P -> W . instruction [ INVOKEE_INV_IFLD ] = InterSymbolsTables::id_from_symbol_F ( P , NULL , better );
+
P -> W . instruction [ INVOKEE_INV_IFLD ] = InterSymbolsTable::id_from_global_symbol ( Inode::tree ( P ), better );
} else if ( Primitives::is_BIP_for_void_indirect_call ( Primitives::to_BIP ( I , invokee ))) {
inter_symbol * better = Primitives::from_BIP ( I , Primitives::BIP_for_void_indirect_call ( arity_as_invoked - 1 ));
-
P -> W . instruction [ INVOKEE_INV_IFLD ] = InterSymbolsTables::id_from_symbol_F ( P , NULL , better );
+
P -> W . instruction [ INVOKEE_INV_IFLD ] = InterSymbolsTable::id_from_global_symbol ( Inode::tree ( P ), better );
}
}
if (( Inter::Inv::arity ( P ) != -1) &&
diff --git a/docs/bytecode-module/5-tlc.html b/docs/bytecode-module/5-tlc.html
index 905588622..e551f743f 100644
--- a/docs/bytecode-module/5-tlc.html
+++ b/docs/bytecode-module/5-tlc.html
@@ -104,17 +104,17 @@ function togglePopup(material_id) {
if (* E ) return ;
inter_package * routine = Inter::Defn::get_latest_block_package ();
if ( routine == NULL ) { * E = Inter::Errors::plain ( I "'label' used outside function" , eloc ); return ; }
-
inter_symbols_table * locals = InterPackage::scope ( routine );
+
inter_symbols_table * locals = InterPackage::scope ( routine );
if ( locals == NULL ) { * E = Inter::Errors::plain ( I "function has no symbols table" , eloc ); return ; }
-
inter_symbol * lab_name = InterSymbolsTables::symbol_from_name ( locals , ilp -> mr . exp [0]);
+
inter_symbol * lab_name = InterSymbolsTable::symbol_from_name ( locals , ilp -> mr . exp [0]);
if ( Inter::Symbols::is_label ( lab_name ) == FALSE ) { * E = Inter::Errors::plain ( I "not a label" , eloc ); return ; }
* E = Inter::Label::new ( IBM , lab_name , ( inter_ti ) ilp -> indent_level , eloc );
}
inter_error_message * Inter::Label::new ( inter_bookmark * IBM , inter_symbol * lab_name , inter_ti level , inter_error_location * eloc ) {
-
inter_tree_node * P = Inode::new_with_2_data_fields ( IBM , LABEL_IST , 0 , InterSymbolsTables::id_from_IRS_and_symbol ( IBM , lab_name ), eloc , level );
+
inter_tree_node * P = Inode::new_with_2_data_fields ( IBM , LABEL_IST , 0 , InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , lab_name ), eloc , level );
inter_error_message * E = Inter::Defn::verify_construct ( InterBookmark::package ( IBM ), P ); if ( E ) return E ;
NodePlacement::move_to_moving_bookmark ( P , IBM );
return NULL ;
@@ -122,20 +122,20 @@ function togglePopup(material_id) {
void Inter::Label::verify ( inter_construct * IC , inter_tree_node * P , inter_package * owner , inter_error_message ** E ) {
if ( P -> W . extent != EXTENT_LABEL_IFR ) { * E = Inode::error ( P , I "extent wrong" , NULL ); return ; }
-
inter_symbol * lab_name = InterSymbolsTables::local_symbol_from_id ( owner , P -> W . instruction [ DEFN_LABEL_IFLD ]);
+
inter_symbol * lab_name = InterSymbolsTable::symbol_from_ID_in_package ( owner , P -> W . instruction [ DEFN_LABEL_IFLD ]);
if ( Inter::Symbols::is_label ( lab_name ) == FALSE ) {
* E = Inode::error ( P , I "not a label" , ( lab_name )?( lab_name -> symbol_name ): NULL );
return ;
}
if ( P -> W . instruction [ LEVEL_IFLD ] < 1 ) { * E = Inode::error ( P , I "label with bad level" , NULL ); return ; }
-
inter_symbols_table * locals = InterPackage::scope ( owner );
+
inter_symbols_table * locals = InterPackage::scope ( owner );
if ( locals == NULL ) { * E = Inode::error ( P , I "no symbols table in function" , NULL ); return ; }
* E = Inter::Verify::local_defn ( P , DEFN_LABEL_IFLD , locals );
}
void Inter::Label::write ( inter_construct * IC , OUTPUT_STREAM , inter_tree_node * P , inter_error_message ** E ) {
-
inter_package * pack = InterPackage::container ( P );
-
inter_symbol * lab_name = InterSymbolsTables::local_symbol_from_id ( pack , P -> W . instruction [ DEFN_LABEL_IFLD ]);
+
inter_package * pack = InterPackage::container ( P );
+
inter_symbol * lab_name = InterSymbolsTable::symbol_from_ID_in_package ( pack , P -> W . instruction [ DEFN_LABEL_IFLD ]);
if ( lab_name ) {
WRITE ( "%S" , lab_name -> symbol_name );
} else { * E = Inode::error ( P , I "cannot write label" , NULL ); return ; }
diff --git a/docs/bytecode-module/5-tlc2.html b/docs/bytecode-module/5-tlc2.html
index 83bf238fe..1d6efea89 100644
--- a/docs/bytecode-module/5-tlc2.html
+++ b/docs/bytecode-module/5-tlc2.html
@@ -104,7 +104,7 @@ function togglePopup(material_id) {
if (* E ) return ;
inter_package * routine = Inter::Defn::get_latest_block_package ();
if ( routine == NULL ) { * E = Inter::Errors::plain ( I "'local' used outside function" , eloc ); return ; }
-
inter_symbols_table * locals = InterPackage::scope ( routine );
+
inter_symbols_table * locals = InterPackage::scope ( routine );
if ( locals == NULL ) { * E = Inter::Errors::plain ( I "function has no symbols table" , eloc ); return ; }
inter_symbol * var_name = Inter::Textual::find_undefined_symbol ( IBM , eloc , locals , ilp -> mr . exp [0], E );
@@ -121,7 +121,7 @@ function togglePopup(material_id) {
}
inter_error_message * Inter::Local::new ( inter_bookmark * IBM , inter_symbol * var_name , inter_symbol * var_kind , inter_ti ID , inter_ti level , inter_error_location * eloc ) {
-
inter_tree_node * P = Inode::new_with_3_data_fields ( IBM , LOCAL_IST , 0 , InterSymbolsTables::id_from_IRS_and_symbol ( IBM , var_name ), var_kind ?( InterSymbolsTables::id_from_IRS_and_symbol ( IBM , var_kind )):0, eloc , level );
+
inter_tree_node * P = Inode::new_with_3_data_fields ( IBM , LOCAL_IST , 0 , InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , var_name ), var_kind ?( InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , var_kind )):0, eloc , level );
Inode::attach_comment ( P , ID );
inter_error_message * E = Inter::Defn::verify_construct ( InterBookmark::package ( IBM ), P ); if ( E ) return E ;
NodePlacement::move_to_moving_bookmark ( P , IBM );
@@ -130,16 +130,16 @@ function togglePopup(material_id) {
void Inter::Local::verify ( inter_construct * IC , inter_tree_node * P , inter_package * owner , inter_error_message ** E ) {
if ( P -> W . extent != EXTENT_LOCAL_IFR ) { * E = Inode::error ( P , I "extent wrong" , NULL ); return ; }
-
inter_symbols_table * locals = InterPackage::scope ( owner );
+
inter_symbols_table * locals = InterPackage::scope ( owner );
if ( locals == NULL ) { * E = Inode::error ( P , I "no symbols table in function" , NULL ); return ; }
* E = Inter::Verify::local_defn ( P , DEFN_LOCAL_IFLD , locals ); if (* E ) return ;
* E = Inter::Verify::symbol ( owner , P , P -> W . instruction [ KIND_LOCAL_IFLD ], KIND_IST ); if (* E ) return ;
}
void Inter::Local::write ( inter_construct * IC , OUTPUT_STREAM , inter_tree_node * P , inter_error_message ** E ) {
-
inter_package * pack = InterPackage::container ( P );
-
inter_symbol * var_name = InterSymbolsTables::local_symbol_from_id ( pack , P -> W . instruction [ DEFN_LOCAL_IFLD ]);
-
inter_symbol * var_kind = InterSymbolsTables::symbol_from_frame_data ( P , KIND_LOCAL_IFLD );
+
inter_package * pack = InterPackage::container ( P );
+
inter_symbol * var_name = InterSymbolsTable::symbol_from_ID_in_package ( pack , P -> W . instruction [ DEFN_LOCAL_IFLD ]);
+
inter_symbol * var_kind = InterSymbolsTable::symbol_from_ID_at_node ( P , KIND_LOCAL_IFLD );
if ( var_name ) {
WRITE ( "local %S %S" , var_name -> symbol_name , var_kind -> symbol_name );
Inter::Symbols::write_annotations ( OUT , P , var_name );
@@ -151,7 +151,7 @@ function togglePopup(material_id) {
inter_tree_node * D = Inter::Symbols::definition ( con_symbol );
if ( D == NULL ) return NULL ;
if ( D -> W . instruction [ ID_IFLD ] != LOCAL_IST ) return NULL ;
-
return InterSymbolsTables::symbol_from_frame_data ( D , KIND_LOCAL_IFLD );
+
return InterSymbolsTable::symbol_from_ID_at_node ( D , KIND_LOCAL_IFLD );
}
diff --git a/docs/bytecode-module/5-tlc3.html b/docs/bytecode-module/5-tlc3.html
index c83d984ef..9bb63e6e5 100644
--- a/docs/bytecode-module/5-tlc3.html
+++ b/docs/bytecode-module/5-tlc3.html
@@ -106,17 +106,17 @@ function togglePopup(material_id) {
inter_package * routine = Inter::Defn::get_latest_block_package ();
if ( routine == NULL ) { * E = Inter::Errors::plain ( I "'lab' used outside function" , eloc ); return ; }
-
inter_symbols_table * locals = InterPackage::scope ( routine );
+
inter_symbols_table * locals = InterPackage::scope ( routine );
if ( locals == NULL ) { * E = Inter::Errors::plain ( I "function has no symbols table" , eloc ); return ; }
-
inter_symbol * label = InterSymbolsTables::symbol_from_name ( locals , ilp -> mr . exp [0]);
+
inter_symbol * label = InterSymbolsTable::symbol_from_name ( locals , ilp -> mr . exp [0]);
if ( Inter::Symbols::is_label ( label ) == FALSE ) { * E = Inter::Errors::plain ( I "not a label" , eloc ); return ; }
* E = Inter::Lab::new ( IBM , label , ( inter_ti ) ilp -> indent_level , eloc );
}
inter_error_message * Inter::Lab::new ( inter_bookmark * IBM , inter_symbol * label , inter_ti level , inter_error_location * eloc ) {
-
inter_tree_node * P = Inode::new_with_2_data_fields ( IBM , LAB_IST , 0 , InterSymbolsTables::id_from_IRS_and_symbol ( IBM , label ), eloc , ( inter_ti ) level );
+
inter_tree_node * P = Inode::new_with_2_data_fields ( IBM , LAB_IST , 0 , InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , label ), eloc , ( inter_ti ) level );
inter_error_message * E = Inter::Defn::verify_construct ( InterBookmark::package ( IBM ), P ); if ( E ) return E ;
NodePlacement::move_to_moving_bookmark ( P , IBM );
return NULL ;
@@ -124,21 +124,21 @@ function togglePopup(material_id) {
void Inter::Lab::verify ( inter_construct * IC , inter_tree_node * P , inter_package * owner , inter_error_message ** E ) {
if ( P -> W . extent != EXTENT_LAB_IFR ) { * E = Inode::error ( P , I "extent wrong" , NULL ); return ; }
-
inter_symbol * label = InterSymbolsTables::local_symbol_from_id ( owner , P -> W . instruction [ LABEL_LAB_IFLD ]);
+
inter_symbol * label = InterSymbolsTable::symbol_from_ID_in_package ( owner , P -> W . instruction [ LABEL_LAB_IFLD ]);
if ( Inter::Symbols::is_label ( label ) == FALSE ) { * E = Inode::error ( P , I "no such label" , NULL ); return ; }
}
void Inter::Lab::write ( inter_construct * IC , OUTPUT_STREAM , inter_tree_node * P , inter_error_message ** E ) {
-
inter_package * pack = InterPackage::container ( P );
-
inter_symbol * label = InterSymbolsTables::local_symbol_from_id ( pack , P -> W . instruction [ LABEL_LAB_IFLD ]);
+
inter_package * pack = InterPackage::container ( P );
+
inter_symbol * label = InterSymbolsTable::symbol_from_ID_in_package ( pack , P -> W . instruction [ LABEL_LAB_IFLD ]);
if ( label ) {
WRITE ( "lab %S" , label -> symbol_name );
} else { * E = Inode::error ( P , I "cannot write lab" , NULL ); return ; }
}
inter_symbol * Inter::Lab::label_symbol ( inter_tree_node * P ) {
-
inter_package * pack = InterPackage::container ( P );
-
inter_symbol * lab = InterSymbolsTables::local_symbol_from_id ( pack , P -> W . instruction [ LABEL_LAB_IFLD ]);
+
inter_package * pack = InterPackage::container ( P );
+
inter_symbol * lab = InterSymbolsTable::symbol_from_ID_in_package ( pack , P -> W . instruction [ LABEL_LAB_IFLD ]);
if ( lab == NULL ) internal_error ( "bad lab" );
return lab ;
}
diff --git a/docs/bytecode-module/5-trc.html b/docs/bytecode-module/5-trc.html
index 6266882b3..7cd3b4193 100644
--- a/docs/bytecode-module/5-trc.html
+++ b/docs/bytecode-module/5-trc.html
@@ -108,7 +108,7 @@ function togglePopup(material_id) {
inter_package * routine = Inter::Defn::get_latest_block_package ();
if ( routine == NULL ) { * E = Inter::Errors::plain ( I "'ref' used outside function" , eloc ); return ; }
-
inter_symbols_table * locals = InterPackage::scope ( routine );
+
inter_symbols_table * locals = InterPackage::scope ( routine );
if ( locals == NULL ) { * E = Inter::Errors::plain ( I "function has no symbols table" , eloc ); return ; }
inter_symbol * ref_kind = Inter::Textual::find_symbol ( InterBookmark::tree ( IBM ), eloc , InterBookmark::scope ( IBM ), ilp -> mr . exp [0], KIND_IST , E );
@@ -123,7 +123,7 @@ function togglePopup(material_id) {
}
inter_error_message * Inter::Ref::new ( inter_bookmark * IBM , inter_symbol * ref_kind , int level , inter_ti val1 , inter_ti val2 , inter_error_location * eloc ) {
-
inter_tree_node * P = Inode::new_with_4_data_fields ( IBM , REF_IST , 0 , InterSymbolsTables::id_from_IRS_and_symbol ( IBM , ref_kind ), val1 , val2 , eloc , ( inter_ti ) level );
+
inter_tree_node * P = Inode::new_with_4_data_fields ( IBM , REF_IST , 0 , InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , ref_kind ), val1 , val2 , eloc , ( inter_ti ) level );
inter_error_message * E = Inter::Defn::verify_construct ( InterBookmark::package ( IBM ), P ); if ( E ) return E ;
NodePlacement::move_to_moving_bookmark ( P , IBM );
return NULL ;
@@ -131,18 +131,18 @@ function togglePopup(material_id) {
void Inter::Ref::verify ( inter_construct * IC , inter_tree_node * P , inter_package * owner , inter_error_message ** E ) {
if ( P -> W . extent != EXTENT_REF_IFR ) { * E = Inode::error ( P , I "extent wrong" , NULL ); return ; }
-
inter_symbols_table * locals = InterPackage::scope ( owner );
+
inter_symbols_table * locals = InterPackage::scope ( owner );
if ( locals == NULL ) { * E = Inode::error ( P , I "no symbols table in function" , NULL ); return ; }
* E = Inter::Verify::symbol ( owner , P , P -> W . instruction [ KIND_REF_IFLD ], KIND_IST ); if (* E ) return ;
-
inter_symbol * ref_kind = InterSymbolsTables::symbol_from_id ( InterPackage::scope ( owner ), P -> W . instruction [ KIND_REF_IFLD ]);;
+
inter_symbol * ref_kind = InterSymbolsTable::symbol_from_ID ( InterPackage::scope ( owner ), P -> W . instruction [ KIND_REF_IFLD ]);;
* E = Inter::Verify::local_value ( P , VAL1_REF_IFLD , ref_kind , locals ); if (* E ) return ;
}
void Inter::Ref::write ( inter_construct * IC , OUTPUT_STREAM , inter_tree_node * P , inter_error_message ** E ) {
-
inter_package * pack = InterPackage::container ( P );
-
inter_symbols_table * locals = InterPackage::scope ( pack );
+
inter_package * pack = InterPackage::container ( P );
+
inter_symbols_table * locals = InterPackage::scope ( pack );
if ( locals == NULL ) { * E = Inode::error ( P , I "function has no symbols table" , NULL ); return ; }
-
inter_symbol * ref_kind = InterSymbolsTables::symbol_from_frame_data ( P , KIND_REF_IFLD );
+
inter_symbol * ref_kind = InterSymbolsTable::symbol_from_ID_at_node ( P , KIND_REF_IFLD );
if ( ref_kind ) {
WRITE ( "ref %S " , ref_kind -> symbol_name );
Inter::Types::write ( OUT , P , ref_kind , P -> W . instruction [ VAL1_REF_IFLD ], P -> W . instruction [ VAL2_REF_IFLD ], locals , FALSE );
diff --git a/docs/bytecode-module/5-tvc.html b/docs/bytecode-module/5-tvc.html
index e07d9f3e2..2199177ac 100644
--- a/docs/bytecode-module/5-tvc.html
+++ b/docs/bytecode-module/5-tvc.html
@@ -109,7 +109,7 @@ function togglePopup(material_id) {
inter_package * routine = Inter::Defn::get_latest_block_package ();
if ( routine == NULL ) { * E = Inter::Errors::plain ( I "'val' used outside function" , eloc ); return ; }
-
inter_symbols_table * locals = InterPackage::scope ( routine );
+
inter_symbols_table * locals = InterPackage::scope ( routine );
if ( locals == NULL ) { * E = Inter::Errors::plain ( I "function has no symbols table" , eloc ); return ; }
inter_symbol * val_kind = Inter::Textual::find_symbol ( InterBookmark::tree ( IBM ), eloc , InterBookmark::scope ( IBM ), ilp -> mr . exp [0], KIND_IST , E );
@@ -131,7 +131,7 @@ function togglePopup(material_id) {
}
inter_error_message * Inter::Val::new ( inter_bookmark * IBM , inter_symbol * val_kind , int level , inter_ti val1 , inter_ti val2 , inter_error_location * eloc ) {
-
inter_tree_node * P = Inode::new_with_4_data_fields ( IBM , VAL_IST , 0 , InterSymbolsTables::id_from_IRS_and_symbol ( IBM , val_kind ), val1 , val2 , eloc , ( inter_ti ) level );
+
inter_tree_node * P = Inode::new_with_4_data_fields ( IBM , VAL_IST , 0 , InterSymbolsTable::id_from_symbol_at_bookmark ( IBM , val_kind ), val1 , val2 , eloc , ( inter_ti ) level );
inter_error_message * E = Inter::Defn::verify_construct ( InterBookmark::package ( IBM ), P ); if ( E ) return E ;
NodePlacement::move_to_moving_bookmark ( P , IBM );
return NULL ;
@@ -143,17 +143,17 @@ function togglePopup(material_id) {
void Inter::Val::verify ( inter_construct * IC , inter_tree_node * P , inter_package * owner , inter_error_message ** E ) {
if ( P -> W . extent != EXTENT_VAL_IFR ) { * E = Inode::error ( P , I "extent wrong" , NULL ); return ; }
-
inter_symbols_table * locals = InterPackage::scope ( owner );
+
inter_symbols_table * locals = InterPackage::scope ( owner );
if ( locals == NULL ) { * E = Inode::error ( P , I "function has no symbols table" , NULL ); return ; }
* E = Inter::Verify::symbol ( owner , P , P -> W . instruction [ KIND_VAL_IFLD ], KIND_IST ); if (* E ) return ;
-
inter_symbol * val_kind = InterSymbolsTables::symbol_from_id ( InterPackage::scope ( owner ), P -> W . instruction [ KIND_VAL_IFLD ]);
+
inter_symbol * val_kind = InterSymbolsTable::symbol_from_ID ( InterPackage::scope ( owner ), P -> W . instruction [ KIND_VAL_IFLD ]);
* E = Inter::Verify::local_value ( P , VAL1_VAL_IFLD , val_kind , locals ); if (* E ) return ;
}
void Inter::Val::write ( inter_construct * IC , OUTPUT_STREAM , inter_tree_node * P , inter_error_message ** E ) {
-
inter_symbols_table * locals = InterPackage::scope_of ( P );
+
inter_symbols_table * locals = InterPackage::scope_of ( P );
if ( locals == NULL ) { * E = Inode::error ( P , I "function has no symbols table" , NULL ); return ; }
-
inter_symbol * val_kind = InterSymbolsTables::symbol_from_frame_data ( P , KIND_VAL_IFLD );
+
inter_symbol * val_kind = InterSymbolsTable::symbol_from_ID_at_node ( P , KIND_VAL_IFLD );
if ( val_kind ) {
WRITE ( "val %S " , val_kind -> symbol_name );
Inter::Types::write ( OUT , P , val_kind , P -> W . instruction [ VAL1_VAL_IFLD ], P -> W . instruction [ VAL2_VAL_IFLD ], locals , FALSE );
diff --git a/docs/final-module/2-cg.html b/docs/final-module/2-cg.html
index dafe7490a..74d6be851 100644
--- a/docs/final-module/2-cg.html
+++ b/docs/final-module/2-cg.html
@@ -202,12 +202,12 @@ object.
code_generation * gen = ( code_generation *) state ;
switch ( P -> W . instruction [ ID_IFLD ]) {
case VARIABLE_IST: {
-
inter_symbol * var_name = InterSymbolsTables::symbol_from_frame_data ( P , DEFN_VAR_IFLD );
+
inter_symbol * var_name = InterSymbolsTable::symbol_from_ID_at_node ( P , DEFN_VAR_IFLD );
ADD_TO_LINKED_LIST ( var_name , inter_symbol , gen -> global_variables );
break ;
}
case PROPERTY_IST: {
-
inter_symbol * prop_name = InterSymbolsTables::symbol_from_frame_data ( P , DEFN_PROP_IFLD );
+
inter_symbol * prop_name = InterSymbolsTable::symbol_from_ID_at_node ( P , DEFN_PROP_IFLD );
if ( Inter::Symbols::read_annotation ( prop_name , ASSIMILATED_IANN ) == 1 )
ADD_TO_LINKED_LIST ( prop_name , inter_symbol , gen -> assimilated_properties );
else
@@ -215,12 +215,12 @@ object.
break ;
}
case INSTANCE_IST: {
-
inter_symbol * inst_name = InterSymbolsTables::symbol_from_frame_data ( P , DEFN_KIND_IFLD );
+
inter_symbol * inst_name = InterSymbolsTable::symbol_from_ID_at_node ( P , DEFN_KIND_IFLD );
ADD_TO_LINKED_LIST ( inst_name , inter_symbol , gen -> instances );
break ;
}
case KIND_IST: {
-
inter_symbol * kind_name = InterSymbolsTables::symbol_from_frame_data ( P , DEFN_INST_IFLD );
+
inter_symbol * kind_name = InterSymbolsTable::symbol_from_ID_at_node ( P , DEFN_INST_IFLD );
ADD_TO_LINKED_LIST ( kind_name , inter_symbol , gen -> kinds );
break ;
}
@@ -523,9 +523,8 @@ what we've worked on so far.
void CodeGen::clear_transients ( inter_tree * I , inter_tree_node * P , void * state ) {
inter_package * pack = InterPackage::at_this_head ( P );
inter_symbols_table * T = InterPackage::scope ( pack );
-
for ( int i =0; i <T-> size ; i ++)
-
if ( T -> symbol_array [ i ])
-
Inter::Symbols::clear_transient_flags ( T -> symbol_array [ i ]);
+
LOOP_OVER_SYMBOLS_TABLE ( S , T )
+
Inter::Symbols::clear_transient_flags ( S );
}
void VanillaConstants::constant ( code_generation * gen , inter_tree_node * P ) {
inter_symbol * con_name =
- InterSymbolsTables::symbol_from_frame_data ( P , DEFN_CONST_IFLD );
+ InterSymbolsTable::symbol_from_ID_at_node ( P , DEFN_CONST_IFLD );
if ( con_name == NULL ) internal_error ( "no constant" );
if ( con_name -> metadata_key == FALSE ) {
if ( Inter::Symbols::read_annotation ( con_name , ACTION_IANN ) == 1 ) {
diff --git a/docs/final-module/2-vc2.html b/docs/final-module/2-vc2.html
index 54a41624a..aeca62794 100644
--- a/docs/final-module/2-vc2.html
+++ b/docs/final-module/2-vc2.html
@@ -114,7 +114,7 @@ These we offer to the generator to deal with as it likes:
void VanillaCode::label ( code_generation * gen , inter_tree_node * P ) {
inter_package * pack = InterPackage::container ( P );
inter_symbol * lab_name =
- InterSymbolsTables::local_symbol_from_id ( pack , P -> W . instruction [ DEFN_LABEL_IFLD ]);
+ InterSymbolsTable::symbol_from_ID_in_package ( pack , P -> W . instruction [ DEFN_LABEL_IFLD ]);
Generators::place_label ( gen , lab_name -> symbol_name );
}
@@ -185,7 +185,7 @@ need to.
inter_ti val2 = F -> W . instruction [ VAL2_VAL_IFLD ];
if ( Inter::Symbols::is_stored_in_data ( val1 , val2 )) {
inter_symbol * symb =
-
InterSymbolsTables::symbol_from_id ( InterPackage::scope_of ( F ), val2 );
+
InterSymbolsTable::symbol_from_ID ( InterPackage::scope_of ( F ), val2 );
if (( symb ) && ( Str::eq ( symb -> symbol_name , I "__assembly_negated_label" ))) {
label_sense = FALSE ;
continue ;
@@ -225,9 +225,9 @@ a variable here.
if ( Inter::Symbols::is_stored_in_data ( val1 , val2 )) {
inter_package * pack = InterPackage::container ( P );
inter_symbol * named_s =
-
InterSymbolsTables::local_symbol_from_id ( pack , val2 );
+
InterSymbolsTable::symbol_from_ID_in_package ( pack , val2 );
if ( named_s == NULL ) named_s =
-
InterSymbolsTables::symbol_from_id ( InterPackage::scope_of ( P ), val2 );
+
InterSymbolsTable::symbol_from_ID ( InterPackage::scope_of ( P ), val2 );
if ( named_s == NULL ) internal_error ( "unknown constant in val/ref in Inter tree" );
if (( Str::eq ( Inter::Symbols::name ( named_s ), I "self" )) ||
(( named_s -> definition ) &&
@@ -259,7 +259,7 @@ function body.
void VanillaCode::lab ( code_generation * gen , inter_tree_node * P ) {
inter_package * pack = InterPackage::container ( P );
inter_symbol * label_s =
-
InterSymbolsTables::local_symbol_from_id ( pack , P -> W . instruction [ LABEL_LAB_IFLD ]);
+
InterSymbolsTable::symbol_from_ID_in_package ( pack , P -> W . instruction [ LABEL_LAB_IFLD ]);
if ( label_s == NULL ) internal_error ( "unknown label in lab in Inter tree" );
Generators::evaluate_label ( gen , label_s -> symbol_name );
}
diff --git a/docs/final-module/2-vf.html b/docs/final-module/2-vf.html
index 6aa5e030d..de967419a 100644
--- a/docs/final-module/2-vf.html
+++ b/docs/final-module/2-vf.html
@@ -93,7 +93,7 @@ so generators can if they choose ignore this.
void VanillaFunctions::predeclare_this ( inter_tree * I , inter_tree_node * P , void * state ) {
code_generation * gen = ( code_generation *) state ;
inter_symbol * constant_s =
-
InterSymbolsTables::symbol_from_frame_data ( P , DEFN_CONST_IFLD );
+
InterSymbolsTable::symbol_from_ID_at_node ( P , DEFN_CONST_IFLD );
if ( Inter::Constant::is_routine ( constant_s )) {
vanilla_function * vf = VanillaFunctions::new ( gen , constant_s );
Generators::predeclare_function ( gen , vf );
@@ -204,7 +204,7 @@ in some way by the generator. (As indeed the C generator does, mangling this to
if ( P -> W . instruction [ ID_IFLD ] == LOCAL_IST ) {
inter_package * pack = InterPackage::container ( P );
inter_symbol * local_s =
-
InterSymbolsTables::local_symbol_from_id ( pack , P -> W . instruction [ DEFN_LOCAL_IFLD ]);
+
InterSymbolsTable::symbol_from_ID_in_package ( pack , P -> W . instruction [ DEFN_LOCAL_IFLD ]);
ADD_TO_LINKED_LIST ( Inter::Symbols::name ( local_s ), text_stream , vf -> locals );
if ( Str::eq ( local_s -> symbol_name , I "_vararg_count" ))
vf -> takes_variable_arguments = TRUE ;
@@ -232,7 +232,7 @@ in some way by the generator. (As indeed the C generator does, mangling this to
inter_ti val1 = D -> W . instruction [ DATA_CONST_IFLD ];
inter_ti val2 = D -> W . instruction [ DATA_CONST_IFLD + 1 ];
if ( Inter::Symbols::is_stored_in_data ( val1 , val2 )) {
-
inter_symbol * S = InterSymbolsTables::symbol_from_data_pair_and_table (
+
inter_symbol * S = InterSymbolsTable::symbol_from_data_pair (
val1 , val2 , InterPackage::scope_of ( D ));
if ( S ) fn_s = S ;
}
diff --git a/docs/final-module/2-vi.html b/docs/final-module/2-vi.html
index 24fab0990..7a2e4b080 100644
--- a/docs/final-module/2-vi.html
+++ b/docs/final-module/2-vi.html
@@ -571,7 +571,7 @@ The opening byte gives some metadata bits, and then there's a word.
inter_ti val1 , inter_ti val2 ) {
if ( Inter::Symbols::is_stored_in_data ( val1 , val2 )) {
inter_symbol * S =
-
InterSymbolsTables::symbol_from_data_pair_and_table ( val1 , val2 ,
+
InterSymbolsTable::symbol_from_data_pair ( val1 , val2 ,
InterPackage::scope_of ( P ));
if ( S == NULL ) internal_error ( "bad symbol in grammar token data" );
return S ;
diff --git a/docs/final-module/2-vnl.html b/docs/final-module/2-vnl.html
index 290b83920..5b32d29cd 100644
--- a/docs/final-module/2-vnl.html
+++ b/docs/final-module/2-vnl.html
@@ -112,7 +112,7 @@ can act on them or ignore them as it pleases.
void Vanilla::pragma ( inter_tree * I , inter_tree_node * P , void * state ) {
code_generation * gen = ( code_generation *) state ;
- inter_symbol * target_s = InterSymbolsTables::symbol_from_frame_data ( P , TARGET_PRAGMA_IFLD );
+ inter_symbol * target_s = InterSymbolsTable::symbol_from_ID_at_node ( P , TARGET_PRAGMA_IFLD );
if ( target_s == NULL ) internal_error ( "bad pragma" );
inter_ti ID = P -> W . instruction [ TEXT_PRAGMA_IFLD ];
text_stream * S = Inode::ID_to_text ( P , ID );
@@ -237,7 +237,7 @@ generated name. So a splat is not quite generator-independent after all.
if ( c == URL_SYMBOL_CHAR ) break ;
PUT_TO ( T , c );
}
- inter_symbol * symb = InterSymbolsTables::url_name_to_symbol ( I , NULL , T );
+ inter_symbol * symb = InterSymbolsTable::URL_to_symbol ( I , T );
WRITE ( "%S" , Inter::Symbols::name ( symb ));
DISCARD_TEXT ( T )
} else PUT ( c );
diff --git a/docs/final-module/2-vo.html b/docs/final-module/2-vo.html
index d440c7166..daf1bc7fc 100644
--- a/docs/final-module/2-vo.html
+++ b/docs/final-module/2-vo.html
@@ -219,7 +219,7 @@ altered.
inner_name = Str::duplicate ( name );
Dictionaries::create ( first_with_name , inner_name );
Dictionaries::write_value ( first_with_name , inner_name , ( void *) prop_name );
- Inter::Symbols::annotate_t ( gen -> from , prop_name -> owning_table -> owning_package ,
+ Inter::Symbols::annotate_t ( gen -> from , Inter::Symbols::package ( prop_name ),
prop_name , INNER_PROPERTY_NAME_IANN , inner_name );
Set the translation to a new metadata array 2.2.1 ;
} else {
@@ -233,7 +233,7 @@ altered.
int N = Inter::Symbols::read_annotation ( existing_prop_name , INNER_PROPERTY_NAME_IANN );
if ( N > 0 ) inner_name = InterWarehouse::get_text ( InterTree::warehouse ( gen -> from ), ( inter_ti ) N );
Inter::Symbols::set_translate ( prop_name , Inter::Symbols::name ( existing_prop_name ));
- Inter::Symbols::annotate_t ( gen -> from , prop_name -> owning_table -> owning_package ,
+ Inter::Symbols::annotate_t ( gen -> from , Inter::Symbols::package ( prop_name ),
prop_name , INNER_PROPERTY_NAME_IANN , inner_name );
}
LOGIF ( PROPERTY_ALLOCATION , "! Translation %S, inner name %S\n" ,
@@ -339,7 +339,7 @@ assimilated properties never do have.
inter_tree_node * X ;
LOOP_THROUGH_INTER_NODE_LIST ( X , EVL ) {
inter_symbol * owner_s =
- InterSymbolsTables::symbol_from_frame_data ( X , OWNER_PERM_IFLD );
+ InterSymbolsTable::symbol_from_ID_at_node ( X , OWNER_PERM_IFLD );
if ( owner_s == kind_s )
Generators::symbol_array_entry ( gen , kind_s , WORD_ARRAY_FORMAT );
}
@@ -360,7 +360,7 @@ can be given properties, even when other objects of the same kind may lack them.
inter_tree_node * X ;
LOOP_THROUGH_INTER_NODE_LIST ( X , EVL ) {
inter_symbol * owner_s =
- InterSymbolsTables::symbol_from_frame_data ( X , OWNER_PERM_IFLD );
+ InterSymbolsTable::symbol_from_ID_at_node ( X , OWNER_PERM_IFLD );
if ( owner_s == inst_s )
Generators::symbol_array_entry ( gen , inst_s , WORD_ARRAY_FORMAT );
}
@@ -381,7 +381,7 @@ not as wasteful as it looks.)
inter_tree_node * X ;
LOOP_THROUGH_INTER_NODE_LIST ( X , EVL ) {
inter_symbol * owner_s =
- InterSymbolsTables::symbol_from_frame_data ( X , OWNER_PERM_IFLD );
+ InterSymbolsTable::symbol_from_ID_at_node ( X , OWNER_PERM_IFLD );
if ( owner_s == RunningPipelines::get_symbol ( gen -> from_step , object_kind_RPSYM )) {
Generators::mangled_array_entry ( gen , I "K0_kind" , WORD_ARRAY_FORMAT );
inter_symbol * kind_s ;
@@ -483,7 +483,7 @@ so we use "marks" on those already done.
inter_tree_node * X ;
LOOP_THROUGH_INTER_NODE_LIST ( X , FL ) {
- inter_symbol * prop_name = InterSymbolsTables::symbol_from_frame_data ( X , PROP_PERM_IFLD );
+ inter_symbol * prop_name = InterSymbolsTable::symbol_from_ID_at_node ( X , PROP_PERM_IFLD );
if ( prop_name == NULL ) internal_error ( "no property" );
if ( CodeGen::marked ( prop_name ) == FALSE ) {
CodeGen::mark ( prop_name );
@@ -517,7 +517,7 @@ by table, no sticks exist and we must compile them.
text_stream * ident = NULL ;
if ( X -> W . instruction [ STORAGE_PERM_IFLD ]) {
- inter_symbol * store = InterSymbolsTables::symbol_from_frame_data ( X , STORAGE_PERM_IFLD );
+ inter_symbol * store = InterSymbolsTable::symbol_from_ID_at_node ( X , STORAGE_PERM_IFLD );
if ( store == NULL ) internal_error ( "bad PP in inter" );
ident = Inter::Symbols::name ( store );
} else {
@@ -567,7 +567,7 @@ number of instances, and is worth it for simplicity and speed.
inter_tree_node * Y ;
LOOP_THROUGH_INTER_NODE_LIST ( Y , PVL ) {
- inter_symbol * p_name = InterSymbolsTables::symbol_from_id (
+ inter_symbol * p_name = InterSymbolsTable::symbol_from_ID (
InterPackage::scope_of ( Y ), Y -> W . instruction [ PROP_PVAL_IFLD ]);
if (( p_name == prop_name ) && ( found == 0 )) {
found = 1 ;
@@ -622,7 +622,7 @@ was all taken care of with the sticks of property values already declared.
inter_symbol * inst_s ;
LOOP_OVER_LINKED_LIST ( inst_s , inter_symbol , gen -> instances_in_declaration_order ) {
inter_tree_node * P = Inter::Symbols::definition ( inst_s );
- inter_symbol * inst_kind = InterSymbolsTables::symbol_from_frame_data ( P , KIND_INST_IFLD );
+ inter_symbol * inst_kind = InterSymbolsTable::symbol_from_ID_at_node ( P , KIND_INST_IFLD );
int N = -1;
if ( Inter::Kind::is_a ( inst_kind , RunningPipelines::get_symbol ( gen -> from_step , object_kind_RPSYM )) == FALSE )
N = ( int ) ( P -> W . instruction [ VAL2_INST_IFLD ]);
@@ -651,7 +651,7 @@ function calls.
inter_tree_node * X ;
LOOP_THROUGH_INTER_NODE_LIST ( X , FL )
Generators::assign_property ( gen ,
- InterSymbolsTables::symbol_from_frame_data ( X , PROP_PVAL_IFLD ),
+ InterSymbolsTable::symbol_from_ID_at_node ( X , PROP_PVAL_IFLD ),
X -> W . instruction [ DVAL1_PVAL_IFLD ], X -> W . instruction [ DVAL2_PVAL_IFLD ], X );
This code is used in §4.2 , §4.3 .
@@ -744,7 +744,7 @@ are not objects.
if ( PL == NULL ) internal_error ( "no permissions list" );
inter_tree_node * X ;
LOOP_THROUGH_INTER_NODE_LIST ( X , PL ) {
-
inter_symbol * owner_s = InterSymbolsTables::symbol_from_id (
+
inter_symbol * owner_s = InterSymbolsTable::symbol_from_ID (
InterPackage::scope_of ( X ), X -> W . instruction [ OWNER_PERM_IFLD ]);
if ( owner_s == NULL ) internal_error ( "bad owner" );
inter_symbol * owner_kind_s = NULL ;
diff --git a/docs/final-module/4-i6c.html b/docs/final-module/4-i6c.html
index a2812c094..64469b23f 100644
--- a/docs/final-module/4-i6c.html
+++ b/docs/final-module/4-i6c.html
@@ -251,7 +251,7 @@ they were any other arrays. Here goes:
WRITE ( " " );
inter_ti val1 = P -> W . instruction [ i ], val2 = P -> W . instruction [ i +1];
if ( Inter::Symbols::is_stored_in_data ( val1 , val2 )) {
-
inter_symbol * A = InterSymbolsTables::symbol_from_data_pair_and_table (
+
inter_symbol * A = InterSymbolsTable::symbol_from_data_pair (
val1 , val2 , InterPackage::scope_of ( P ));
if ( A == NULL ) internal_error ( "bad aliased symbol" );
if ( Inter::Symbols::read_annotation ( A , SCOPE_FILTER_IANN ) == 1 ) WRITE ( "scope=" );
diff --git a/docs/final-module/4-i6c2.html b/docs/final-module/4-i6c2.html
index 516a72890..28bff9263 100644
--- a/docs/final-module/4-i6c2.html
+++ b/docs/final-module/4-i6c2.html
@@ -976,7 +976,7 @@ See
Vanilla Objects for more on inner n
inter_ti val2 = prop_node -> W . instruction [ VAL2_VAL_IFLD ];
if ( Inter::Symbols::is_stored_in_data ( val1 , val2 ))
prop_symbol =
-
InterSymbolsTables::symbol_from_id ( InterPackage::scope_of ( prop_node ), val2 );
+
InterSymbolsTable::symbol_from_ID ( InterPackage::scope_of ( prop_node ), val2 );
}
if (( prop_symbol ) && ( Inter::Symbols::get_flag ( prop_symbol , ATTRIBUTE_MARK_BIT ))) {
return VanillaObjects::inner_property_name ( gen , prop_symbol );
@@ -1017,7 +1017,7 @@ and the property is stored in a VM-property;
inter_ti val2 = kind_node -> W . instruction [ VAL2_VAL_IFLD ];
if ( Inter::Symbols::is_stored_in_data ( val1 , val2 ))
kind_symbol =
-
InterSymbolsTables::symbol_from_id ( InterPackage::scope_of ( kind_node ), val2 );
+
InterSymbolsTable::symbol_from_ID ( InterPackage::scope_of ( kind_node ), val2 );
}
if ( Str::eq ( Inter::Symbols::name ( kind_symbol ), I "OBJECT_TY" ) == FALSE )
return I6G_CANNOT_PROVE ;
@@ -1028,7 +1028,7 @@ and the property is stored in a VM-property;
inter_ti val2 = prop_node -> W . instruction [ VAL2_VAL_IFLD ];
if ( Inter::Symbols::is_stored_in_data ( val1 , val2 ))
prop_symbol =
-
InterSymbolsTables::symbol_from_id ( InterPackage::scope_of ( prop_node ), val2 );
+
InterSymbolsTable::symbol_from_ID ( InterPackage::scope_of ( prop_node ), val2 );
}
if (( prop_symbol ) && ( Inter::Symbols::get_flag ( prop_symbol , ATTRIBUTE_MARK_BIT ))) {
return I6G_CAN_PROVE_IS_OBJ_ATTRIBUTE ;
diff --git a/docs/final-module/4-i6o.html b/docs/final-module/4-i6o.html
index 10f3f3881..24c7d1348 100644
--- a/docs/final-module/4-i6o.html
+++ b/docs/final-module/4-i6o.html
@@ -575,7 +575,7 @@ we must use the pecualiar I6 syntax here to get the right outcome.
CodeGen::select_temporary ( gen , val );
int inline_this = FALSE ;
if ( Inter::Symbols::is_stored_in_data ( val1 , val2 )) {
-
inter_symbol * S = InterSymbolsTables::symbol_from_data_pair_and_frame ( val1 , val2 , X );
+
inter_symbol * S = InterSymbolsTable::symbol_from_data_pair_at_node ( val1 , val2 , X );
if (( S ) && ( Inter::Symbols::read_annotation ( S , INLINE_ARRAY_IANN ) == 1 )) {
inter_tree_node * P = Inter::Symbols::definition ( S );
text_stream * OUT = CodeGen::current ( gen );
@@ -644,7 +644,7 @@ each enumerative kind, and is indexed by weak kind ID.
segmentation_pos saved = CodeGen::select ( gen , arrays_I7CGS );
text_stream * OUT = CodeGen::current ( gen );
WRITE ( "Array value_ranges --> 0" );
-
inter_symbol * max_weak_id = InterSymbolsTables::url_name_to_symbol ( gen -> from , NULL ,
+
inter_symbol * max_weak_id = InterSymbolsTable::URL_to_symbol ( gen -> from ,
I "/main/synoptic/kinds/BASE_KIND_HWM" );
if ( max_weak_id ) {
int M = Inter::Symbols::evaluate_to_int ( max_weak_id );
@@ -677,7 +677,7 @@ the value property holders for each enumerative kind.
segmentation_pos saved = CodeGen::select ( gen , arrays_I7CGS );
text_stream * OUT = CodeGen::current ( gen );
WRITE ( "Array value_property_holders --> 0" );
-
inter_symbol * max_weak_id = InterSymbolsTables::url_name_to_symbol ( gen -> from , NULL ,
+
inter_symbol * max_weak_id = InterSymbolsTable::URL_to_symbol ( gen -> from ,
I "/main/synoptic/kinds/BASE_KIND_HWM" );
if ( max_weak_id ) {
int M = Inter::Symbols::evaluate_to_int ( max_weak_id );
diff --git a/docs/final-module/5-cnm.html b/docs/final-module/5-cnm.html
index e3dc3d216..b8a59d2d8 100644
--- a/docs/final-module/5-cnm.html
+++ b/docs/final-module/5-cnm.html
@@ -204,7 +204,7 @@ to begin with