From c3b7e28bec210d8201154fb5e494c9280e1cc74f Mon Sep 17 00:00:00 2001
From: Graham Nelson
-void SymbolAnnotation::copy_set_to_symbol(inter_annotation_set *set, inter_symbol *S) { +void SymbolAnnotation::copy_set_to_symbol(inter_annotation_set *set, inter_symbol *S) { if (set) { S->annotations.boolean_annotations |= set->boolean_annotations; if (set->other_annotations) { @@ -465,7 +465,7 @@ if true, because if false then they are indistinguishable from not being there a-void SymbolAnnotation::write_annotations(OUTPUT_STREAM, inter_tree_node *F, inter_symbol *S) { +void SymbolAnnotation::write_annotations(OUTPUT_STREAM, inter_tree_node *F, inter_symbol *S) { if (S) SymbolAnnotation::write_set(OUT, &(S->annotations), F); } diff --git a/docs/bytecode-module/2-bkm.html b/docs/bytecode-module/2-bkm.html index 3e5c09928..ff3b759e8 100644 --- a/docs/bytecode-module/2-bkm.html +++ b/docs/bytecode-module/2-bkm.html @@ -200,7 +200,7 @@ equal to P.-inter_package *InterBookmark::package(inter_bookmark *IBM) { +inter_package *InterBookmark::package(inter_bookmark *IBM) { if (IBM == NULL) return NULL; inter_package *pack = IBM->R->package; if ((IBM->placement_wrt_R == AS_FIRST_CHILD_OF_NODEPLACEMENT) || @@ -230,7 +230,7 @@ equal to P. return 0; } -inter_symbols_table *InterBookmark::scope(inter_bookmark *IBM) { +inter_symbols_table *InterBookmark::scope(inter_bookmark *IBM) { inter_package *pack = InterBookmark::package(IBM); if (pack) return InterPackage::scope(pack); return InterTree::global_scope(InterBookmark::tree(IBM)); diff --git a/docs/bytecode-module/2-in.html b/docs/bytecode-module/2-in.html index 9f9f6913a..1b51abfd9 100644 --- a/docs/bytecode-module/2-in.html +++ b/docs/bytecode-module/2-in.html @@ -119,7 +119,7 @@ of access matters more. struct warehouse_floor_space W; } inter_tree_node;-
§2. Do not call this directly in order to create a node.
@@ -204,7 +204,7 @@ call those creator functions, not these. return P; } -inter_tree_node *Inode::new_with_2_data_fields(inter_bookmark *IBM, int S, +inter_tree_node *Inode::new_with_2_data_fields(inter_bookmark *IBM, int S, inter_ti V1, inter_ti V2, inter_error_location *eloc, inter_ti level) { inter_tree *I = InterBookmark::tree(IBM); inter_tree_node *P = Inode::new_node(InterTree::warehouse(I), I, 4, @@ -487,7 +487,7 @@ we are in, which in turn depends on the node). return InterWarehouse::get_package(Inode::warehouse(F), ID); } -inter_node_list *Inode::ID_to_frame_list(inter_tree_node *F, inter_ti N) { +inter_node_list *Inode::ID_to_frame_list(inter_tree_node *F, inter_ti N) { return InterWarehouse::get_node_list(Inode::warehouse(F), N); } @@ -496,7 +496,7 @@ to identify it as occurring at a particular node. We can get one thus:-inter_error_message *Inode::error(inter_tree_node *F, text_stream *err, text_stream *quote) { +inter_error_message *Inode::error(inter_tree_node *F, text_stream *err, text_stream *quote) { inter_error_message *iem = CREATE(inter_error_message); inter_error_location *eloc = Inode::get_error_location(F); if (eloc) diff --git a/docs/bytecode-module/2-np.html b/docs/bytecode-module/2-np.html index 66ff9cb0d..0c4348e4e 100644 --- a/docs/bytecode-module/2-np.html +++ b/docs/bytecode-module/2-np.html @@ -307,7 +307,7 @@ way to reach as low as that from -void NodePlacement::move_to_moving_bookmark(inter_tree_node *C, inter_bookmark *IBM) { +void NodePlacement::move_to_moving_bookmark(inter_tree_node *C, inter_bookmark *IBM) { if (C == NULL) internal_error("no node to insert"); if (IBM == NULL) internal_error("nowhere to insert"); NodePlacement::move_to(C, NodePlacement::to_position(C, InterBookmark::snapshot(IBM))); diff --git a/docs/bytecode-module/2-pck.html b/docs/bytecode-module/2-pck.html index 521ff35d8..bce125d67 100644 --- a/docs/bytecode-module/2-pck.html +++ b/docs/bytecode-module/2-pck.html @@ -244,7 +244,7 @@ extracted from the bytecode of its -inter_symbols_table *InterPackage::scope(inter_package *pack) { +inter_symbols_table *InterPackage::scope(inter_package *pack) { if (pack == NULL) return NULL; return pack->package_scope; } @@ -282,7 +282,7 @@ equal to the special root package. return pack; } -inter_symbols_table *InterPackage::scope_of(inter_tree_node *P) { +inter_symbols_table *InterPackage::scope_of(inter_tree_node *P) { inter_package *pack = InterPackage::container(P); if (pack) return pack->package_scope; return Inode::globals(P); diff --git a/docs/bytecode-module/2-st.html b/docs/bytecode-module/2-st.html index 29d8fb0f5..b46efc2f9 100644 --- a/docs/bytecode-module/2-st.html +++ b/docs/bytecode-module/2-st.html @@ -378,7 +378,7 @@ to access this: one following equations, the other not. return T->symbol_array[index]; } -inter_symbol *InterSymbolsTable::symbol_from_ID(inter_symbols_table *T, inter_ti ID) { +inter_symbol *InterSymbolsTable::symbol_from_ID(inter_symbols_table *T, inter_ti ID) { inter_symbol *S = InterSymbolsTable::symbol_from_ID_not_following(T, ID); return Wiring::cable_end(S); } @@ -387,7 +387,7 @@ to access this: one following equations, the other not.-inter_symbol *InterSymbolsTable::symbol_from_ID_at_node(inter_tree_node *P, int 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]); } @@ -566,7 +566,7 @@ them on a package-by-package basis, so it is an error to call this function if-inter_ti InterSymbolsTable::id_from_symbol_at_bookmark(inter_bookmark *IBM, +inter_ti InterSymbolsTable::id_at_bookmark(inter_bookmark *IBM, inter_symbol *S) { return InterSymbolsTable::id_from_symbol(InterBookmark::tree(IBM), InterBookmark::package(IBM), S); diff --git a/docs/bytecode-module/2-sym.html b/docs/bytecode-module/2-sym.html index e7dbada52..65ca6de95 100644 --- a/docs/bytecode-module/2-sym.html +++ b/docs/bytecode-module/2-sym.html @@ -401,7 +401,7 @@ might be the node holding the instruction: if (S) InterSymbol::define(S, NULL); } -inter_tree_node *InterSymbol::definition(inter_symbol *S) { +inter_tree_node *InterSymbol::definition(inter_symbol *S) { if (S == NULL) internal_error("tried to find definition of null symbol"); return S->definition; } @@ -467,7 +467,7 @@ in the current package. So:-text_stream *InterSymbol::identifier(inter_symbol *S) { +text_stream *InterSymbol::identifier(inter_symbol *S) { if (S == NULL) return NULL; return S->identifier; } diff --git a/docs/bytecode-module/2-tw.html b/docs/bytecode-module/2-tw.html index 2f4debf4b..e6d294679 100644 --- a/docs/bytecode-module/2-tw.html +++ b/docs/bytecode-module/2-tw.html @@ -424,7 +424,7 @@ in order to cache the results of those two calculations. int extent; } warehouse_floor_space;-+
- The structure warehouse_floor_space is accessed in 2/it, 2/in, 2/bkm, 2/np, 2/pck, 2/st, 2/sym, 2/ann, 2/trn, 3/ic, 3/iibf, 3/iitf, 3/vi, 3/ivp, 3/idt, 3/mtd, 4/tac, 4/tcc, 4/tcc2, 4/tic, 4/tic2, 4/tpc, 4/tpc3, 4/tpc4, 4/tpc5, 4/tpc6, 4/tpc7, 4/ttc, 5/tac, 5/tcc, 5/tcc2, 5/tec, 5/tic, 5/tlc, 5/tlc2, 5/tlc3, 5/trc2, 5/tsc and here.
- The structure warehouse_floor_space is accessed in 2/it, 2/in, 2/bkm, 2/np, 2/pck, 2/st, 2/sym, 2/ann, 2/trn, 3/ic, 3/iibf, 3/iitf, 3/vi, 3/ivp, 3/idt, 3/mtd, 4/tac, 4/tcc, 4/tcc2, 4/tic, 4/tic2, 4/tpc, 4/tpc3, 4/tpc4, 4/tpc5, 4/tpc6, 4/tpc7, 4/ttc, 4/tvc, 5/tac, 5/tcc, 5/tcc2, 5/tec, 5/tic, 5/tlc, 5/tlc2, 5/tlc3, 5/trc2, 5/tsc and here.
§15. We provide an API of just two functions to handle all this. Firstly, InterWarehouse::make_floor_space makes room for an instruction of n words. (This is the frame extent, and does not include the PREFRAME_SIZE.) diff --git a/docs/bytecode-module/3-ic.html b/docs/bytecode-module/3-ic.html index 1f92d707b..ccef37460 100644 --- a/docs/bytecode-module/3-ic.html +++ b/docs/bytecode-module/3-ic.html @@ -98,7 +98,7 @@ function togglePopup(material_id) { CLASS_DEFINITION } inter_construct; -inter_construct *InterInstruction::create_construct(inter_ti ID, text_stream *name) { +inter_construct *InterInstruction::create_construct(inter_ti ID, text_stream *name) { inter_construct *IC = CREATE(inter_construct); IC->construct_ID = ID; IC->construct_name = Str::duplicate(name); @@ -151,11 +151,11 @@ Those must be explicitly granted when a new construct is created. define CAN_HAVE_ANNOTATIONS_ICUP 16
-void InterInstruction::permit(inter_construct *IC, int usage) { +void InterInstruction::permit(inter_construct *IC, int usage) { IC->usage_permissions |= usage; } -void InterInstruction::allow_in_depth_range(inter_construct *IC, int l1, int l2) { +void InterInstruction::allow_in_depth_range(inter_construct *IC, int l1, int l2) { IC->min_level = l1; IC->max_level = l2; } @@ -167,7 +167,7 @@ number of words of bytecode it occupies:define UNLIMITED_INSTRUCTION_FRAME_LENGTH 0x7fffffff-void InterInstruction::fix_instruction_length_between(inter_construct *IC, int l1, int l2) { +void InterInstruction::fix_instruction_length_between(inter_construct *IC, int l1, int l2) { IC->min_extent = l1; IC->max_extent = l2; } @@ -314,7 +314,7 @@ but give it no syntax. If so, it will be inexpressible in textual Inter code.define MAX_RECOGNITION_REGEXP_LENGTH 64-void InterInstruction::specify_syntax(inter_construct *IC, text_stream *syntax) { +void InterInstruction::specify_syntax(inter_construct *IC, text_stream *syntax) { IC->syntax = syntax; TEMPORARY_TEXT(regexp) for (int i = 0; i < Str::len(syntax); i++) { diff --git a/docs/bytecode-module/3-idt.html b/docs/bytecode-module/3-idt.html index 326c85338..8e496cae2 100644 --- a/docs/bytecode-module/3-idt.html +++ b/docs/bytecode-module/3-idt.html @@ -118,7 +118,7 @@ invalidate existing Inter binary files, necessitating a bump of define MIN_INTER_TYPE_CONSTRUCTOR UNCHECKED_ITCONC define MAX_INTER_TYPE_CONSTRUCTOR VOID_ITCONC -int InterTypes::is_valid_constructor_code(inter_ti constructor) { +int InterTypes::is_valid_constructor_code(inter_ti constructor) { if ((constructor < MIN_INTER_TYPE_CONSTRUCTOR) || (constructor > MAX_INTER_TYPE_CONSTRUCTOR)) return FALSE; return TRUE; @@ -278,7 +278,7 @@ type name, and so can be stored in an-inter_type InterTypes::from_constructor_code(inter_ti constructor_code) { +inter_type InterTypes::from_constructor_code(inter_ti constructor_code) { if (InterTypes::is_valid_constructor_code(constructor_code) == FALSE) internal_error("invalid constructor code"); inter_type type; @@ -287,10 +287,10 @@ type name, and so can be stored in an return type; } -inter_type InterTypes::from_type_name(inter_symbol *S) { +inter_type InterTypes::from_type_name(inter_symbol *S) { if (S) { inter_type type; - type.underlying_constructor = TypenameInstruction::constructor(S); + type.underlying_constructor = TypenameInstruction::constructor(S); type.type_name = S; return type; } @@ -321,11 +321,11 @@ in which all data is unchecke- - Defining the Lab construct. +-inter_type InterTypes::unchecked(void) { +inter_type InterTypes::unchecked(void) { return InterTypes::from_constructor_code(UNCHECKED_ITCONC); } -int InterTypes::is_unchecked(inter_type type) { +int InterTypes::is_unchecked(inter_type type) { if (InterTypes::constructor_code(type) == UNCHECKED_ITCONC) return TRUE; return FALSE; } @@ -336,7 +336,7 @@ only with a typename can we have an arity other than the default (e.g. a-int InterTypes::arity_is_possible(inter_type type, int arity) { +int InterTypes::arity_is_possible(inter_type type, int arity) { inter_type_constructor *itc = InterTypes::constructor(type); if (itc->arity == (int) arity) return TRUE; if (itc->constructor_ID == TABLE_ITCONC) @@ -351,20 +351,20 @@ only with a typename can we have an arity other than the default (e.g. a int InterTypes::type_arity(inter_type type) { inter_symbol *type_name = InterTypes::type_name(type); - if (type_name) return TypenameInstruction::arity(type_name); + if (type_name) return TypenameInstruction::arity(type_name); return InterTypes::constructor(type)->arity; } inter_type InterTypes::type_operand(inter_type type, int n) { inter_symbol *type_name = InterTypes::type_name(type); - if (type_name) return TypenameInstruction::operand_type(InterTypes::type_name(type), n); + if (type_name) return TypenameInstruction::operand_type(InterTypes::type_name(type), n); return InterTypes::unchecked(); }§14. Converting inter_type to TID.
-inter_type InterTypes::from_TID(inter_symbols_table *T, inter_ti TID) { +inter_type InterTypes::from_TID(inter_symbols_table *T, inter_ti TID) { if (TID >= SYMBOL_BASE_VAL) return InterTypes::from_type_name(InterSymbolsTable::symbol_from_ID(T, TID)); if (InterTypes::is_valid_constructor_code(TID)) @@ -372,7 +372,7 @@ only with a typename can we have an arity other than the default (e.g. a return InterTypes::unchecked(); } -inter_type InterTypes::from_TID_in_field(inter_tree_node *P, int field) { +inter_type InterTypes::from_TID_in_field(inter_tree_node *P, int field) { return InterTypes::from_TID(InterPackage::scope(Inode::get_package(P)), P->W.instruction[field]); } @@ -388,7 +388,7 @@ only with a typename can we have an arity other than the default (e.g. a inter_ti InterTypes::to_TID_at(inter_bookmark *IBM, inter_type type) { if (type.type_name) - return InterSymbolsTable::id_from_symbol_at_bookmark(IBM, type.type_name); + return InterSymbolsTable::id_at_bookmark(IBM, type.type_name); return type.underlying_constructor; }@@ -411,7 +411,7 @@ Inter because it's primarily designed as a language for programs to write. inter_ti *operand_TIDs; } inter_semisimple_type_description; -void InterTypes::initialise_isstd(inter_semisimple_type_description *results) { +void InterTypes::initialise_isstd(inter_semisimple_type_description *results) { results->constructor_code = UNCHECKED_ITCONC; results->arity = 0; results->capacity = DEFAULT_SIZE_OF_ISSTD_OPERAND_ARRAY; @@ -443,7 +443,7 @@ prevents a memory leak if really large results were returned.-void InterTypes::dispose_of_isstd(inter_semisimple_type_description *results) { +void InterTypes::dispose_of_isstd(inter_semisimple_type_description *results) { results->constructor_code = UNCHECKED_ITCONC; results->arity = 0; Free operand memory16.2; @@ -462,7 +462,7 @@ prevents a memory leak if really large results were returned.-inter_error_message *InterTypes::parse_semisimple(text_stream *text, inter_symbols_table *T, +inter_error_message *InterTypes::parse_semisimple(text_stream *text, inter_symbols_table *T, inter_error_location *eloc, inter_semisimple_type_description *results) { results->constructor_code = UNCHECKED_ITCONC; results->arity = 0; @@ -648,7 +648,7 @@ useful error message in response to a semisimple but not simple piece of syntax.-inter_type InterTypes::parse_simple(inter_symbols_table *T, inter_error_location *eloc, +inter_type InterTypes::parse_simple(inter_symbols_table *T, inter_error_location *eloc, text_stream *text, inter_error_message **E) { if (Str::len(text) > 0) { inter_semisimple_type_description parsed_description; @@ -678,7 +678,7 @@ just print that name, K_whate-void InterTypes::write_type(OUTPUT_STREAM, inter_type type) { +void InterTypes::write_type(OUTPUT_STREAM, inter_type type) { if (type.type_name) { TextualInter::write_symbol(OUT, type.type_name); } else { @@ -686,7 +686,7 @@ just print that name, K_whate } } -void InterTypes::write_typename_definition(OUTPUT_STREAM, inter_symbol *type_name) { +void InterTypes::write_typename_definition(OUTPUT_STREAM, inter_symbol *type_name) { InterTypes::write_type_longhand(OUT, InterTypes::from_type_name(type_name)); }@@ -739,7 +739,7 @@ just print that name, K_whate-int InterTypes::is_enumerated(inter_type type) { +int InterTypes::is_enumerated(inter_type type) { inter_type_constructor *itc = InterTypes::constructor(type); if (itc->is_enumerated) return TRUE; return FALSE; @@ -820,7 +820,7 @@ enumerated type for "thing", for example. inter_symbol *typenameB_s = B.type_name; inter_symbol *typenameA_s = A.type_name; if ((typenameB_s) && (typenameA_s) && - (TypenameInstruction::is_a(typenameA_s, typenameB_s) == FALSE)) + (TypenameInstruction::is_a(typenameA_s, typenameB_s) == FALSE)) Throw type mismatch error22.5; } return NULL; diff --git a/docs/bytecode-module/3-ie.html b/docs/bytecode-module/3-ie.html index c59753389..fb73cecb9 100644 --- a/docs/bytecode-module/3-ie.html +++ b/docs/bytecode-module/3-ie.html @@ -130,13 +130,13 @@ of ways.)-inter_error_message *InterErrors::quoted(text_stream *err, text_stream *quote, inter_error_location *eloc) { +inter_error_message *InterErrors::quoted(text_stream *err, text_stream *quote, inter_error_location *eloc) { inter_error_message *iem = InterErrors::plain(err, eloc); iem->error_quote = Str::duplicate(quote); return iem; } -inter_error_message *InterErrors::plain(text_stream *err, inter_error_location *eloc) { +inter_error_message *InterErrors::plain(text_stream *err, inter_error_location *eloc) { inter_error_message *iem = CREATE(inter_error_message); iem->error_body = Str::duplicate(err); iem->error_quote = NULL; diff --git a/docs/bytecode-module/3-iitf.html b/docs/bytecode-module/3-iitf.html index 7fbe5ec26..d6345c17f 100644 --- a/docs/bytecode-module/3-iitf.html +++ b/docs/bytecode-module/3-iitf.html @@ -246,7 +246,7 @@ scope; the name must currently be free, or an error is generated.-inter_symbol *TextualInter::new_symbol(inter_error_location *eloc, inter_symbols_table *T, +inter_symbol *TextualInter::new_symbol(inter_error_location *eloc, inter_symbols_table *T, text_stream *name, inter_error_message **E) { *E = NULL; inter_symbol *S = InterSymbolsTable::symbol_from_name(T, name); @@ -265,7 +265,7 @@ enables us to tell if it's, e.g., a variable, defined by <-inter_symbol *TextualInter::find_symbol(inter_bookmark *IBM, inter_error_location *eloc, +inter_symbol *TextualInter::find_symbol(inter_bookmark *IBM, inter_error_location *eloc, text_stream *name, inter_ti construct, inter_error_message **E) { return TextualInter::find_symbol_in_table(InterBookmark::scope(IBM), eloc, name, construct, E); } @@ -537,7 +537,7 @@ outer structure:-void TextualInter::write_pair(OUTPUT_STREAM, inter_tree_node *P, inter_pair pair, int hex) { +void TextualInter::write_pair(OUTPUT_STREAM, inter_tree_node *P, inter_pair pair, int hex) { inter_tree *I = Inode::tree(P); if (InterValuePairs::is_number(pair)) Print numeric literal syntax12.1 @@ -552,7 +552,7 @@ outer structure: else WRITE("<invalid-value-type>"); } -inter_error_message *TextualInter::parse_pair(text_stream *line, inter_error_location *eloc, +inter_error_message *TextualInter::parse_pair(text_stream *line, inter_error_location *eloc, inter_bookmark *IBM, inter_type type_wanted, text_stream *S, inter_pair *pair) { inter_symbols_table *scope = InterBookmark::scope(IBM); inter_tree *I = InterBookmark::tree(IBM); @@ -873,7 +873,7 @@ therefore used typelessly.-void TextualInter::write_optional_type_marker(OUTPUT_STREAM, inter_tree_node *P, int field) { +void TextualInter::write_optional_type_marker(OUTPUT_STREAM, inter_tree_node *P, int field) { inter_type type = InterTypes::from_TID_in_field(P, field); if (type.type_name) { WRITE("("); TextualInter::write_symbol_from(OUT, P, field); WRITE(") "); diff --git a/docs/bytecode-module/3-ivp.html b/docs/bytecode-module/3-ivp.html index 2329eebc0..8acfef601 100644 --- a/docs/bytecode-module/3-ivp.html +++ b/docs/bytecode-module/3-ivp.html @@ -438,7 +438,7 @@ which return inter_pair to signal-inter_pair InterValuePairs::undef(void) { +inter_pair InterValuePairs::undef(void) { inter_pair pair; pair.data_format = UNDEF_IVAL; pair.data_content = 0; @@ -460,14 +460,14 @@ following functions:-inter_pair InterValuePairs::get(inter_tree_node *P, int field) { +inter_pair InterValuePairs::get(inter_tree_node *P, int field) { inter_pair pair; pair.data_format = P->W.instruction[field]; pair.data_content = P->W.instruction[field+1]; return pair; } -void InterValuePairs::set(inter_tree_node *P, int field, inter_pair pair) { +void InterValuePairs::set(inter_tree_node *P, int field, inter_pair pair) { P->W.instruction[field] = pair.data_format; P->W.instruction[field+1] = pair.data_content; } @@ -491,7 +491,7 @@ in from a binary Inter file (because in that process, resource ID numbers change-inter_pair InterValuePairs::transpose(inter_pair pair, inter_ti *grid, inter_ti grid_extent, +inter_pair InterValuePairs::transpose(inter_pair pair, inter_ti *grid, inter_ti grid_extent, inter_error_message **E) { switch (pair.data_format) { case FUNCTIONAL_IVAL: diff --git a/docs/bytecode-module/3-vi.html b/docs/bytecode-module/3-vi.html index 3fe0ef927..03c23682b 100644 --- a/docs/bytecode-module/3-vi.html +++ b/docs/bytecode-module/3-vi.html @@ -88,7 +88,7 @@ and this is why the code to create instructions automatically calls us.)-inter_error_message *VerifyingInter::instruction(inter_package *owner, inter_tree_node *P) { +inter_error_message *VerifyingInter::instruction(inter_package *owner, inter_tree_node *P) { if (Inode::get_vflag(P) == FALSE) { Inode::set_vflag(P); inter_construct *IC = NULL; @@ -209,7 +209,7 @@ the program has not yet been loaded); but it cannot be the wrong sort of thing.-inter_error_message *VerifyingInter::SID_field(inter_package *owner, inter_tree_node *P, +inter_error_message *VerifyingInter::SID_field(inter_package *owner, inter_tree_node *P, int field, inter_ti construct) { return VerifyingInter::SID(owner, P, P->W.instruction[field], construct); } @@ -284,7 +284,7 @@ or FUNCTION_ITCONC-inter_error_message *VerifyingInter::constructor_field(inter_tree_node *P, int field) { +inter_error_message *VerifyingInter::constructor_field(inter_tree_node *P, int field) { inter_ti ID = P->W.instruction[field]; if (InterTypes::is_valid_constructor_code(ID) == FALSE) return Inode::error(P, I"unknown type constructor", NULL); @@ -296,7 +296,7 @@ or FUNCTION_ITCONC-inter_error_message *VerifyingInter::TID_field(inter_package *owner, inter_tree_node *P, +inter_error_message *VerifyingInter::TID_field(inter_package *owner, inter_tree_node *P, int field) { inter_ti TID = P->W.instruction[field]; if (TID == 0) return NULL; @@ -320,7 +320,7 @@ or FUNCTION_ITCONC-inter_error_message *VerifyingInter::node_list_field(inter_package *owner, inter_tree_node *P, +inter_error_message *VerifyingInter::node_list_field(inter_package *owner, inter_tree_node *P, int field) { inter_ti text_ID = P->W.instruction[field]; inter_warehouse *W = InterTree::warehouse(Inode::tree(P)); @@ -357,7 +357,7 @@ the context of the current package:-inter_error_message *VerifyingInter::data_pair_fields(inter_package *owner, +inter_error_message *VerifyingInter::data_pair_fields(inter_package *owner, inter_tree_node *P, int first_field, inter_type type) { return InterValuePairs::verify(owner, P, InterValuePairs::get(P, first_field), type); } diff --git a/docs/bytecode-module/4-tac.html b/docs/bytecode-module/4-tac.html index 7a8413528..a2ffa4558 100644 --- a/docs/bytecode-module/4-tac.html +++ b/docs/bytecode-module/4-tac.html @@ -102,7 +102,7 @@ compulsory words ID_IFLDinter_error_message *AppendInstruction::new(inter_bookmark *IBM, inter_symbol *S, text_stream *append_text, inter_ti level, struct inter_error_location *eloc) { inter_tree_node *P = Inode::new_with_2_data_fields(IBM, APPEND_IST, - /* SYMBOL_APPEND_IFLD: */ InterSymbolsTable::id_from_symbol_at_bookmark(IBM, S), + /* SYMBOL_APPEND_IFLD: */ InterSymbolsTable::id_at_bookmark(IBM, S), /* CONTENT_APPEND_IFLD: */ InterWarehouse::create_text_at(IBM, append_text), eloc, level); inter_error_message *E = VerifyingInter::instruction(InterBookmark::package(IBM), P); diff --git a/docs/bytecode-module/4-tcc2.html b/docs/bytecode-module/4-tcc2.html index 20d6592cb..69ba38c13 100644 --- a/docs/bytecode-module/4-tcc2.html +++ b/docs/bytecode-module/4-tcc2.html @@ -111,7 +111,7 @@ instruction can be any odd number of words from 5 upwards. inter_error_message *ConstantInstruction::new(inter_bookmark *IBM, inter_symbol *S, inter_type type, inter_pair val, inter_ti level, inter_error_location *eloc) { inter_tree_node *P = Inode::new_with_5_data_fields(IBM, CONSTANT_IST, - /* DEFN_CONST_IFLD: */ InterSymbolsTable::id_from_symbol_at_bookmark(IBM, S), + /* DEFN_CONST_IFLD: */ InterSymbolsTable::id_at_bookmark(IBM, S), /* TYPE_CONST_IFLD: */ InterTypes::to_TID_at(IBM, type), /* FORMAT_CONST_IFLD: */ CONST_LIST_FORMAT_NONE, /* DATA_CONST_IFLD: */ InterValuePairs::to_word1(val), @@ -144,7 +144,7 @@ can therefore be calculated as half of (the instruction extent minus inter_error_location *eloc) { if (format == CONST_LIST_FORMAT_NONE) internal_error("not a list"); inter_tree_node *AP = Inode::new_with_3_data_fields(IBM, CONSTANT_IST, - /* DEFN_CONST_IFLD: */ InterSymbolsTable::id_from_symbol_at_bookmark(IBM, S), + /* DEFN_CONST_IFLD: */ InterSymbolsTable::id_at_bookmark(IBM, S), /* TYPE_CONST_IFLD: */ InterTypes::to_TID_at(IBM, type), /* FORMAT_CONST_IFLD: */ (inter_ti) format, eloc, level); diff --git a/docs/bytecode-module/4-tdc.html b/docs/bytecode-module/4-tdc.html index 1deeb8e79..9ba3ba0d4 100644 --- a/docs/bytecode-module/4-tdc.html +++ b/docs/bytecode-module/4-tdc.html @@ -101,7 +101,7 @@ compulsory words ID_IFLDinter_error_message *DefaultValueInstruction::new(inter_bookmark *IBM, inter_symbol *typename, inter_pair val, inter_ti level, inter_error_location *eloc) { inter_tree_node *P = Inode::new_with_3_data_fields(IBM, DEFAULTVALUE_IST, - /* TYPE_DEF_IFLD: */ InterSymbolsTable::id_from_symbol_at_bookmark(IBM, typename), + /* TYPE_DEF_IFLD: */ InterSymbolsTable::id_at_bookmark(IBM, typename), /* VAL1_DEF_IFLD: */ InterValuePairs::to_word1(val), /* VAL2_DEF_IFLD: */ InterValuePairs::to_word2(val), eloc, level); diff --git a/docs/bytecode-module/4-tic2.html b/docs/bytecode-module/4-tic2.html index bee81fb03..307b99fb4 100644 --- a/docs/bytecode-module/4-tic2.html +++ b/docs/bytecode-module/4-tic2.html @@ -108,8 +108,8 @@ compulsory words ID_IFLD inter_warehouse *warehouse = InterBookmark::warehouse(IBM); inter_package *pack = InterBookmark::package(IBM); inter_tree_node *P = Inode::new_with_6_data_fields(IBM, INSTANCE_IST, - /* DEFN_INST_IFLD: */ InterSymbolsTable::id_from_symbol_at_bookmark(IBM, S), - /* TYPE_INST_IFLD: */ InterSymbolsTable::id_from_symbol_at_bookmark(IBM, typename_s), + /* DEFN_INST_IFLD: */ InterSymbolsTable::id_at_bookmark(IBM, S), + /* TYPE_INST_IFLD: */ InterSymbolsTable::id_at_bookmark(IBM, typename_s), /* VAL1_INST_IFLD: */ InterValuePairs::to_word1(val), /* VAL2_INST_IFLD: */ InterValuePairs::to_word2(val), /* PROP_LIST_INST_IFLD: */ InterWarehouse::create_node_list(warehouse, pack), @@ -125,6 +125,8 @@ compulsory words ID_IFLD inter_ti *grid, inter_ti grid_extent, inter_error_message **E) { P->W.instruction[PROP_LIST_INST_IFLD] = grid[P->W.instruction[PROP_LIST_INST_IFLD]]; P->W.instruction[PERM_LIST_INST_IFLD] = grid[P->W.instruction[PERM_LIST_INST_IFLD]]; + InterValuePairs::set(P, VAL1_INST_IFLD, + InterValuePairs::transpose(InterValuePairs::get(P, VAL1_INST_IFLD), grid, grid_extent, E)); }§3. Verification does more than making sanity checks: it also calculates and sets @@ -147,7 +149,7 @@ the typename_s that it has a new instance. if (InterTypes::is_enumerated(inst_type)) { if (InterValuePairs::is_undef(InterValuePairs::get(P, VAL1_INST_IFLD))) InterValuePairs::set(P, VAL1_INST_IFLD, - InterValuePairs::number(TypenameInstruction::next_enumerated_value(typename_s))); + InterValuePairs::number(TypenameInstruction::next_enumerated_value(typename_s))); } else { *E = Inode::error(P, I"not a kind which has instances", NULL); return; } @@ -156,7 +158,7 @@ the typename_s that it has a new instance. if (*E) return; inter_symbol *instance_s = InstanceInstruction::instance(P); - TypenameInstruction::new_instance(typename_s, instance_s); + TypenameInstruction::new_instance(typename_s, instance_s); }
§4. Creating from textual Inter syntax.
diff --git a/docs/bytecode-module/4-tpc.html b/docs/bytecode-module/4-tpc.html index 792f0d498..7cf5561bf 100644 --- a/docs/bytecode-module/4-tpc.html +++ b/docs/bytecode-module/4-tpc.html @@ -149,7 +149,7 @@ same package, you'll get bag< TextualInter::new_symbol(eloc, InterBookmark::scope(IBM), name_text, &E); if (E) return E; inter_tree_node *P = Inode::new_with_4_data_fields(IBM, PACKAGE_IST, - /* DEFN_PACKAGE_IFLD: */ InterSymbolsTable::id_from_symbol_at_bookmark(IBM, package_name), + /* DEFN_PACKAGE_IFLD: */ InterSymbolsTable::id_at_bookmark(IBM, package_name), /* PTYPE_PACKAGE_IFLD: */ InterSymbolsTable::id_from_symbol(I, NULL, ptype_name), /* SYMBOLS_PACKAGE_IFLD: */ STID, /* PID_PACKAGE_IFLD: */ 0, but see just below... diff --git a/docs/bytecode-module/4-tpc2.html b/docs/bytecode-module/4-tpc2.html index b8886c129..a1413af04 100644 --- a/docs/bytecode-module/4-tpc2.html +++ b/docs/bytecode-module/4-tpc2.html @@ -99,7 +99,7 @@ compulsory words ID_IFLDinter_error_message *PackageTypeInstruction::new(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, - /* DEFN_PTYPE_IFLD: */ InterSymbolsTable::id_from_symbol_at_bookmark(IBM, ptype), + /* DEFN_PTYPE_IFLD: */ InterSymbolsTable::id_at_bookmark(IBM, ptype), eloc, level); inter_error_message *E = VerifyingInter::instruction(InterBookmark::package(IBM), P); if (E) return E; diff --git a/docs/bytecode-module/4-tpc3.html b/docs/bytecode-module/4-tpc3.html index 3a406c37e..272b17b87 100644 --- a/docs/bytecode-module/4-tpc3.html +++ b/docs/bytecode-module/4-tpc3.html @@ -102,10 +102,10 @@ compulsory words ID_IFLD inter_symbol *owner_s, inter_symbol *storage_s, inter_ti level, inter_error_location *eloc) { inter_ti SID = 0; - if (storage_s) SID = InterSymbolsTable::id_from_symbol_at_bookmark(IBM, storage_s); + if (storage_s) SID = InterSymbolsTable::id_at_bookmark(IBM, storage_s); inter_tree_node *P = Inode::new_with_3_data_fields(IBM, PERMISSION_IST, - /* PROP_PERM_IFLD: */ InterSymbolsTable::id_from_symbol_at_bookmark(IBM, prop_s), - /* OWNER_PERM_IFLD: */ InterSymbolsTable::id_from_symbol_at_bookmark(IBM, owner_s), + /* PROP_PERM_IFLD: */ InterSymbolsTable::id_at_bookmark(IBM, prop_s), + /* OWNER_PERM_IFLD: */ InterSymbolsTable::id_at_bookmark(IBM, owner_s), /* STORAGE_PERM_IFLD: */ SID, eloc, level); inter_error_message *E = VerifyingInter::instruction(InterBookmark::package(IBM), P); @@ -139,12 +139,12 @@ the new permission to the list for the owner and for the property. inter_symbol *owner_s = InterSymbolsTable::symbol_from_ID_at_node(P, OWNER_PERM_IFLD); inter_node_list *FL = NULL; - if (TypenameInstruction::is(owner_s)) { + if (TypenameInstruction::is(owner_s)) { if (InterTypes::is_enumerated(InterTypes::from_type_name(owner_s)) == FALSE) { *E = Inode::error(P, I"property permission for non-enumerated kind", NULL); return; } - FL = TypenameInstruction::permissions_list(owner_s); + FL = TypenameInstruction::permissions_list(owner_s); } else if (InstanceInstruction::is(owner_s)) { FL = InstanceInstruction::permissions_list(owner_s); } else { @@ -191,13 +191,13 @@ messages if we report early. } inter_node_list *FL; - if (TypenameInstruction::is(owner_s)) { + if (TypenameInstruction::is(owner_s)) { if (InterTypes::is_enumerated(InterTypes::from_type_name(owner_s)) == FALSE) { *E = InterErrors::quoted(I"not a kind which can have property values", owner_name, eloc); return; } - FL = TypenameInstruction::permissions_list(owner_s); + FL = TypenameInstruction::permissions_list(owner_s); } else if (InstanceInstruction::is(owner_s)) { FL = InstanceInstruction::permissions_list(owner_s); } else { diff --git a/docs/bytecode-module/4-tpc5.html b/docs/bytecode-module/4-tpc5.html index 4621df740..8821a1672 100644 --- a/docs/bytecode-module/4-tpc5.html +++ b/docs/bytecode-module/4-tpc5.html @@ -111,7 +111,7 @@ a primitive ins text_stream *from, text_stream *to, inter_ti level, inter_error_location *eloc) { inter_tree_node *F = Inode::new_with_1_data_field(IBM, PRIMITIVE_IST, - /* DEFN_PRIM_IFLD: */ InterSymbolsTable::id_from_symbol_at_bookmark(IBM, prim_name), + /* DEFN_PRIM_IFLD: */ InterSymbolsTable::id_at_bookmark(IBM, prim_name), eloc, level); inter_error_message *E = NULL; diff --git a/docs/bytecode-module/4-tpc6.html b/docs/bytecode-module/4-tpc6.html index d722aa525..3e51af36f 100644 --- a/docs/bytecode-module/4-tpc6.html +++ b/docs/bytecode-module/4-tpc6.html @@ -106,7 +106,7 @@ compulsory words ID_IFLD inter_package *pack = InterBookmark::package(IBM); inter_warehouse *warehouse = InterBookmark::warehouse(IBM); inter_tree_node *P = Inode::new_with_3_data_fields(IBM, PROPERTY_IST, - /* DEFN_PROP_IFLD: */ InterSymbolsTable::id_from_symbol_at_bookmark(IBM, prop_s), + /* DEFN_PROP_IFLD: */ InterSymbolsTable::id_at_bookmark(IBM, prop_s), /* TYPE_PROP_IFLD: */ InterTypes::to_TID_at(IBM, prop_type), /* PERM_LIST_PROP_IFLD: */ InterWarehouse::create_node_list(warehouse, pack), eloc, level); diff --git a/docs/bytecode-module/4-tpc7.html b/docs/bytecode-module/4-tpc7.html index 4755c001a..b78bab854 100644 --- a/docs/bytecode-module/4-tpc7.html +++ b/docs/bytecode-module/4-tpc7.html @@ -85,6 +85,7 @@ function togglePopup(material_id) { InterInstruction::fix_instruction_length_between(IC, 6, 6); InterInstruction::permit(IC, INSIDE_PLAIN_PACKAGE_ICUP); METHOD_ADD(IC, CONSTRUCT_READ_MTID, PropertyValueInstruction::read); + METHOD_ADD(IC, CONSTRUCT_TRANSPOSE_MTID, PropertyValueInstruction::transpose); METHOD_ADD(IC, CONSTRUCT_VERIFY_MTID, PropertyValueInstruction::verify); METHOD_ADD(IC, CONSTRUCT_WRITE_MTID, PropertyValueInstruction::write); } @@ -103,8 +104,8 @@ compulsory words ID_IFLD inter_symbol *prop_s, inter_symbol *owner_s, inter_pair val, inter_ti level, inter_error_location *eloc) { inter_tree_node *P = Inode::new_with_4_data_fields(IBM, PROPERTYVALUE_IST, - /* PROP_PVAL_IFLD: */ InterSymbolsTable::id_from_symbol_at_bookmark(IBM, prop_s), - /* OWNER_PVAL_IFLD: */ InterSymbolsTable::id_from_symbol_at_bookmark(IBM, owner_s), + /* PROP_PVAL_IFLD: */ InterSymbolsTable::id_at_bookmark(IBM, prop_s), + /* OWNER_PVAL_IFLD: */ InterSymbolsTable::id_at_bookmark(IBM, owner_s), /* VAL1_PVAL_IFLD: */ InterValuePairs::to_word1(val), /* VAL2_PVAL_IFLD: */ InterValuePairs::to_word2(val), eloc, level); @@ -113,13 +114,19 @@ compulsory words ID_IFLD NodePlacement::move_to_moving_bookmark(P, IBM); return NULL; } + +void PropertyValueInstruction::transpose(inter_construct *IC, inter_tree_node *P, + inter_ti *grid, inter_ti grid_extent, inter_error_message **E) { + InterValuePairs::set(P, VAL1_PVAL_IFLD, + InterValuePairs::transpose(InterValuePairs::get(P, VAL1_PVAL_IFLD), grid, grid_extent, E)); +}§3. Verification begins with sanity checks, but then also adds the new property value to the list of properties of the owner.
-void PropertyValueInstruction::verify(inter_construct *IC, inter_tree_node *P, +void PropertyValueInstruction::verify(inter_construct *IC, inter_tree_node *P, inter_package *owner, inter_error_message **E) { *E = VerifyingInter::SID_field(owner, P, PROP_PVAL_IFLD, PROPERTY_IST); if (*E) return; @@ -141,8 +148,8 @@ value to the list of properties of the owner. } inter_node_list *FL; - if (TypenameInstruction::is(owner_s)) - FL = TypenameInstruction::properties_list(owner_s); + if (TypenameInstruction::is(owner_s)) + FL = TypenameInstruction::properties_list(owner_s); else FL = InstanceInstruction::properties_list(owner_s); inter_tree_node *X; @@ -166,13 +173,13 @@ value to the list of properties of the owner. owner = InstanceInstruction::typename(owner); } while (owner) { - inter_node_list *FL = TypenameInstruction::permissions_list(owner); + inter_node_list *FL = TypenameInstruction::permissions_list(owner); if (FL == NULL) internal_error("no permissions list"); inter_tree_node *X; LOOP_THROUGH_INTER_NODE_LIST(X, FL) if (PermissionInstruction::property(X) == prop_s) return TRUE; - owner = TypenameInstruction::super(owner); + owner = TypenameInstruction::super(owner); } return FALSE; } @@ -180,7 +187,7 @@ value to the list of properties of the owner.§4. Creating from textual Inter syntax.
-void PropertyValueInstruction::read(inter_construct *IC, inter_bookmark *IBM, +void PropertyValueInstruction::read(inter_construct *IC, inter_bookmark *IBM, inter_line_parse *ilp, inter_error_location *eloc, inter_error_message **E) { text_stream *prop_name = ilp->mr.exp[0], *owner_name = ilp->mr.exp[1]; inter_symbol *prop_s = TextualInter::find_symbol(IBM, eloc, prop_name, PROPERTY_IST, E); @@ -198,7 +205,7 @@ value to the list of properties of the owner. (inter_ti) ilp->indent_level, eloc); } -inter_symbol *PropertyValueInstruction::parse_owner(inter_error_location *eloc, +inter_symbol *PropertyValueInstruction::parse_owner(inter_error_location *eloc, inter_symbols_table *T, text_stream *name, inter_error_message **E) { *E = NULL; inter_symbol *symb = InterSymbolsTable::symbol_from_name(T, name); @@ -222,7 +229,7 @@ value to the list of properties of the owner.§5. Writing to textual Inter syntax.
-void PropertyValueInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P, +void PropertyValueInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P, inter_error_message **E) { inter_symbol *prop_s = PropertyValueInstruction::property(P); inter_symbol *owner_s = PropertyValueInstruction::owner(P); @@ -234,19 +241,19 @@ value to the list of properties of the owner.-inter_symbol *PropertyValueInstruction::property(inter_tree_node *P) { +inter_symbol *PropertyValueInstruction::property(inter_tree_node *P) { if (P == NULL) return NULL; if (P->W.instruction[ID_IFLD] != PROPERTYVALUE_IST) return NULL; return InterSymbolsTable::symbol_from_ID_at_node(P, PROP_PVAL_IFLD); } -inter_symbol *PropertyValueInstruction::owner(inter_tree_node *P) { +inter_symbol *PropertyValueInstruction::owner(inter_tree_node *P) { if (P == NULL) return NULL; if (P->W.instruction[ID_IFLD] != PROPERTYVALUE_IST) return NULL; return InterSymbolsTable::symbol_from_ID_at_node(P, OWNER_PVAL_IFLD); } -inter_pair PropertyValueInstruction::value(inter_tree_node *P) { +inter_pair PropertyValueInstruction::value(inter_tree_node *P) { if (P == NULL) return InterValuePairs::undef(); if (P->W.instruction[ID_IFLD] != PROPERTYVALUE_IST) return InterValuePairs::undef(); return InterValuePairs::get(P, VAL1_PVAL_IFLD); diff --git a/docs/bytecode-module/4-ttc.html b/docs/bytecode-module/4-ttc.html index 63cb26b46..d2f99714e 100644 --- a/docs/bytecode-module/4-ttc.html +++ b/docs/bytecode-module/4-ttc.html @@ -73,21 +73,28 @@ function togglePopup(material_id) {
- Home
- Inter Modules
- bytecode
- Chapter 4: Void Constructs
- The Typename Construct
Defining the typename construct.
+
- §1. Definition
- §2. Instructions
- §4. Creating from textual Inter syntax
- §5. Writing to textual Inter syntax
- §6. Access functions
- §10. Two tests
+ +§1. Definition. For what this does and why it is used, see Textual Inter (in inter). +
+void TypenameInstruction::define_construct(void) { inter_construct *IC = InterInstruction::create_construct(TYPENAME_IST, I"typename"); InterInstruction::defines_symbol_in_fields(IC, DEFN_TYPENAME_IFLD, -1); InterInstruction::specify_syntax(IC, I"typename IDENTIFIER TOKEN TOKENS"); - InterInstruction::fix_instruction_length_between(IC, - MIN_EXTENT_TYPENAME_IFR, UNLIMITED_INSTRUCTION_FRAME_LENGTH); + InterInstruction::fix_instruction_length_between(IC, 9, UNLIMITED_INSTRUCTION_FRAME_LENGTH); InterInstruction::permit(IC, INSIDE_PLAIN_PACKAGE_ICUP); - METHOD_ADD(IC, CONSTRUCT_READ_MTID, TypenameInstruction::read); + METHOD_ADD(IC, CONSTRUCT_READ_MTID, TypenameInstruction::read); METHOD_ADD(IC, CONSTRUCT_TRANSPOSE_MTID, TypenameInstruction::transpose); - METHOD_ADD(IC, CONSTRUCT_VERIFY_MTID, TypenameInstruction::verify); - METHOD_ADD(IC, CONSTRUCT_WRITE_MTID, TypenameInstruction::write); + METHOD_ADD(IC, CONSTRUCT_VERIFY_MTID, TypenameInstruction::verify); + METHOD_ADD(IC, CONSTRUCT_WRITE_MTID, TypenameInstruction::write); }- +§2. Instructions. In bytecode, the frame of a typename instruction is laid out with the two +compulsory words ID_IFLD and LEVEL_IFLD, followed by these. The eventual +length is flexible: there can be any number of operands from 0 upwards. +
define DEFN_TYPENAME_IFLD 2 define ENUM_RANGE_TYPENAME_IFLD 3 @@ -97,79 +104,71 @@ function togglePopup(material_id) { define PLIST_TYPENAME_IFLD 7 define CONSTRUCTOR_TYPENAME_IFLD 8 define OPERANDS_TYPENAME_IFLD 9 -define MIN_EXTENT_TYPENAME_IFR 9-void TypenameInstruction::read(inter_construct *IC, inter_bookmark *IBM, inter_line_parse *ilp, inter_error_location *eloc, inter_error_message **E) { - inter_symbol *symb = TextualInter::new_symbol(eloc, InterBookmark::scope(IBM), ilp->mr.exp[0], E); - if (*E) return; - - inter_semisimple_type_description parsed_description; - InterTypes::initialise_isstd(&parsed_description); - inter_symbol *super_s = NULL; - - if (Str::eq(ilp->mr.exp[1], I"<=")) { - super_s = TextualInter::find_symbol(IBM, eloc, ilp->mr.exp[2], TYPENAME_IST, E); - if ((*E == NULL) && - (InterTypes::is_enumerated(InterTypes::from_type_name(super_s)) == FALSE)) - { *E = InterErrors::quoted(I"not a type which can have subtypes", ilp->mr.exp[2], eloc); return; } - parsed_description.constructor_code = ENUM_ITCONC; - parsed_description.arity = 0; - } else if (Str::eq(ilp->mr.exp[1], I"=")) { - *E = InterTypes::parse_semisimple(ilp->mr.exp[2], InterBookmark::scope(IBM), eloc, &parsed_description); - } else { - *E = InterErrors::quoted(I"expected '=' or '<='", ilp->mr.exp[1], eloc); - } - - if (*E == NULL) - *E = TypenameInstruction::new(IBM, InterSymbolsTable::id_from_symbol_at_bookmark(IBM, symb), - parsed_description.constructor_code, - (super_s)?(InterSymbolsTable::id_from_symbol_at_bookmark(IBM, super_s)):0, - parsed_description.arity, parsed_description.operand_TIDs, (inter_ti) ilp->indent_level, eloc); - InterTypes::dispose_of_isstd(&parsed_description); -} - -inter_error_message *TypenameInstruction::new(inter_bookmark *IBM, inter_ti SID, inter_ti constructor, inter_ti SUP, +inter_error_message *TypenameInstruction::new(inter_bookmark *IBM, inter_symbol *typename_s, + inter_ti constructor, inter_symbol *super_s, int arity, inter_ti *operands, inter_ti level, inter_error_location *eloc) { - if (InterTypes::is_valid_constructor_code(constructor) == FALSE) - internal_error("constructor out of range"); - + inter_ti super_SID = 0; + if (super_s) super_SID = InterSymbolsTable::id_at_bookmark(IBM, super_s); + inter_package *pack = InterBookmark::package(IBM); inter_warehouse *warehouse = InterBookmark::warehouse(IBM); - inter_ti L1 = InterWarehouse::create_node_list(warehouse, InterBookmark::package(IBM)); - inter_ti L2 = InterWarehouse::create_node_list(warehouse, InterBookmark::package(IBM)); - inter_tree_node *P = Inode::new_with_7_data_fields(IBM, - TYPENAME_IST, SID, 0, 0, SUP, L1, L2, - constructor, eloc, level); + inter_tree_node *P = Inode::new_with_7_data_fields(IBM, TYPENAME_IST, + /* DEFN_TYPENAME_IFLD: */ InterSymbolsTable::id_at_bookmark(IBM, typename_s), + /* ENUM_RANGE_TYPENAME_IFLD: */ 0, + /* NO_INSTANCES_TYPENAME_IFLD: */ 0, + /* SUPER_TYPENAME_IFLD: */ super_SID, + /* PERM_LIST_TYPENAME_IFLD: */ InterWarehouse::create_node_list(warehouse, pack), + /* PLIST_TYPENAME_IFLD: */ InterWarehouse::create_node_list(warehouse, pack), + /* CONSTRUCTOR_TYPENAME_IFLD: */ constructor, + eloc, level); if (arity > 0) { Inode::extend_instruction_by(P, (inter_ti) arity); - for (int i=0; i<arity; i++) P->W.instruction[OPERANDS_TYPENAME_IFLD+i] = operands[i]; + for (int i=0; i<arity; i++) + P->W.instruction[OPERANDS_TYPENAME_IFLD+i] = operands[i]; } - inter_error_message *E = VerifyingInter::instruction(InterBookmark::package(IBM), P); if (E) return E; + inter_error_message *E = VerifyingInter::instruction(InterBookmark::package(IBM), P); + if (E) return E; NodePlacement::move_to_moving_bookmark(P, IBM); return NULL; } -void TypenameInstruction::transpose(inter_construct *IC, inter_tree_node *P, inter_ti *grid, inter_ti grid_extent, inter_error_message **E) { +void TypenameInstruction::transpose(inter_construct *IC, inter_tree_node *P, + inter_ti *grid, inter_ti grid_extent, inter_error_message **E) { P->W.instruction[PERM_LIST_TYPENAME_IFLD] = grid[P->W.instruction[PERM_LIST_TYPENAME_IFLD]]; P->W.instruction[PLIST_TYPENAME_IFLD] = grid[P->W.instruction[PLIST_TYPENAME_IFLD]]; } ++§3. Verification consists only of sanity checks. +
-void TypenameInstruction::verify(inter_construct *IC, inter_tree_node *P, inter_package *owner, inter_error_message **E) { - if (P->W.instruction[ENUM_RANGE_TYPENAME_IFLD] != 0) { - inter_symbol *typename_s = InterSymbolsTable::symbol_from_ID(InterPackage::scope(owner), P->W.instruction[DEFN_TYPENAME_IFLD]); - if ((typename_s == NULL) || - (InterTypes::is_enumerated(InterTypes::from_type_name(typename_s)) == FALSE)) - { *E = Inode::error(P, I"spurious extent in non-enumeration", NULL); return; } ++void TypenameInstruction::verify(inter_construct *IC, inter_tree_node *P, + inter_package *owner, inter_error_message **E) { + inter_symbol *typename_s = TypenameInstruction::typename(P); + if ((P->W.instruction[ENUM_RANGE_TYPENAME_IFLD] > 0) && + (InterTypes::is_enumerated(InterTypes::from_type_name(typename_s)) == FALSE)) { + *E = Inode::error(P, I"spurious extent in non-enumeration", NULL); + return; } if (P->W.instruction[SUPER_TYPENAME_IFLD] != 0) { - *E = VerifyingInter::SID_field(owner, P, SUPER_TYPENAME_IFLD, TYPENAME_IST); if (*E) return; - inter_symbol *super_s = InterSymbolsTable::symbol_from_ID(InterPackage::scope(owner), P->W.instruction[SUPER_TYPENAME_IFLD]); - if (InterTypes::is_enumerated(InterTypes::from_type_name(super_s)) == FALSE) - { *E = Inode::error(P, I"subtype of nonenumerated type", NULL); return; } + *E = VerifyingInter::SID_field(owner, P, SUPER_TYPENAME_IFLD, TYPENAME_IST); + if (*E) return; + inter_symbol *super_s = TypenameInstruction::super(typename_s); + if (InterTypes::is_enumerated(InterTypes::from_type_name(super_s)) == FALSE) { + *E = Inode::error(P, I"subtype of nonenumerated type", NULL); + return; + } } - *E = VerifyingInter::constructor_field(P, CONSTRUCTOR_TYPENAME_IFLD); if (*E) return; - inter_type type = InterTypes::from_constructor_code(P->W.instruction[CONSTRUCTOR_TYPENAME_IFLD]); - int arity = P->W.extent - MIN_EXTENT_TYPENAME_IFR; + *E = VerifyingInter::node_list_field(owner, P, PERM_LIST_TYPENAME_IFLD); + if (*E) return; + *E = VerifyingInter::node_list_field(owner, P, PLIST_TYPENAME_IFLD); + if (*E) return; + *E = VerifyingInter::constructor_field(P, CONSTRUCTOR_TYPENAME_IFLD); + if (*E) return; + inter_type type = + InterTypes::from_constructor_code(TypenameInstruction::constructor(typename_s)); + int arity = P->W.extent - OPERANDS_TYPENAME_IFLD; for (int i=0; i<arity; i++) { *E = VerifyingInter::TID_field(owner, P, OPERANDS_TYPENAME_IFLD + i); if (*E) return; @@ -182,43 +181,143 @@ function togglePopup(material_id) { return; } } ++§4. Creating from textual Inter syntax.
-inter_node_list *TypenameInstruction::permissions_list(inter_symbol *typename_s) { ++void TypenameInstruction::read(inter_construct *IC, inter_bookmark *IBM, + inter_line_parse *ilp, inter_error_location *eloc, inter_error_message **E) { + text_stream *typename_text = ilp->mr.exp[0]; + text_stream *operator_text = ilp->mr.exp[1]; + text_stream *defn_text = ilp->mr.exp[2]; + inter_symbol *symb = + TextualInter::new_symbol(eloc, InterBookmark::scope(IBM), typename_text, E); + if (*E) return; + + inter_semisimple_type_description parsed_description; + InterTypes::initialise_isstd(&parsed_description); + inter_symbol *super_s = NULL; + + if (Str::eq(operator_text, I"<=")) { + super_s = TextualInter::find_symbol(IBM, eloc, defn_text, TYPENAME_IST, E); + if ((*E == NULL) && + (InterTypes::is_enumerated(InterTypes::from_type_name(super_s)) == FALSE)) { + *E = InterErrors::quoted(I"not a type which can have subtypes", defn_text, eloc); + return; + } + parsed_description.constructor_code = ENUM_ITCONC; + parsed_description.arity = 0; + } else if (Str::eq(operator_text, I"=")) { + *E = InterTypes::parse_semisimple(ilp->mr.exp[2], InterBookmark::scope(IBM), + eloc, &parsed_description); + } else { + *E = InterErrors::quoted(I"expected '=' or '<='", operator_text, eloc); + } + + if (*E == NULL) + *E = TypenameInstruction::new(IBM, symb, parsed_description.constructor_code, + super_s, parsed_description.arity, parsed_description.operand_TIDs, + (inter_ti) ilp->indent_level, eloc); + InterTypes::dispose_of_isstd(&parsed_description); +} ++§5. Writing to textual Inter syntax.
+ ++void TypenameInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P, + inter_error_message **E) { + inter_symbol *typename_s = TypenameInstruction::typename(P); + WRITE("typename %S ", InterSymbol::identifier(typename_s)); + inter_symbol *super = TypenameInstruction::super(typename_s); + if (super) { + WRITE("<= %S", InterSymbol::identifier(super)); + } else { + WRITE("= "); + InterTypes::write_typename_definition(OUT, typename_s); + } + SymbolAnnotation::write_annotations(OUT, P, typename_s); +} ++ + ++inter_symbol *TypenameInstruction::typename(inter_tree_node *P) { + if (P == NULL) return NULL; + if (P->W.instruction[ID_IFLD] != TYPENAME_IST) return NULL; + return InterSymbolsTable::symbol_from_ID_at_node(P, DEFN_TYPENAME_IFLD); +} + +inter_symbol *TypenameInstruction::super(inter_symbol *typename_s) { + if (typename_s == NULL) return NULL; + inter_tree_node *D = InterSymbol::definition(typename_s); + if (D == NULL) return NULL; + return InterSymbolsTable::symbol_from_ID_at_node(D, SUPER_TYPENAME_IFLD); +} + +inter_node_list *TypenameInstruction::permissions_list(inter_symbol *typename_s) { if (typename_s == NULL) return NULL; inter_tree_node *D = InterSymbol::definition(typename_s); if (D == NULL) return NULL; return Inode::ID_to_frame_list(D, D->W.instruction[PERM_LIST_TYPENAME_IFLD]); } -inter_node_list *TypenameInstruction::properties_list(inter_symbol *inst_s) { - if (inst_s == NULL) return NULL; - inter_tree_node *D = InterSymbol::definition(inst_s); +inter_node_list *TypenameInstruction::properties_list(inter_symbol *typename_s) { + if (typename_s == NULL) return NULL; + inter_tree_node *D = InterSymbol::definition(typename_s); if (D == NULL) return NULL; return Inode::ID_to_frame_list(D, D->W.instruction[PLIST_TYPENAME_IFLD]); } ++§7. The definition of the semisimple type: +
-void TypenameInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P, inter_error_message **E) { - inter_symbol *symb = InterSymbolsTable::symbol_from_ID_at_node(P, DEFN_TYPENAME_IFLD); - if (symb) { - WRITE("typename %S ", InterSymbol::identifier(symb)); - if (P->W.instruction[SUPER_TYPENAME_IFLD]) { - inter_symbol *super = InterSymbolsTable::symbol_from_ID_at_node(P, SUPER_TYPENAME_IFLD); - WRITE("<= %S", InterSymbol::identifier(super)); - } else { - WRITE("= "); - InterTypes::write_typename_definition(OUT, symb); - } - } else { *E = Inode::error(P, I"cannot write typename", NULL); return; } - SymbolAnnotation::write_annotations(OUT, P, symb); ++inter_ti TypenameInstruction::constructor(inter_symbol *typename_s) { + if (typename_s == NULL) return UNCHECKED_ITCONC; + inter_tree_node *D = InterSymbol::definition(typename_s); + if (D == NULL) return UNCHECKED_ITCONC; + return D->W.instruction[CONSTRUCTOR_TYPENAME_IFLD]; } -void TypenameInstruction::new_instance(inter_symbol *typename_s, inter_symbol *inst_name) { +int TypenameInstruction::arity(inter_symbol *typename_s) { + if (typename_s == NULL) return 0; + inter_tree_node *D = InterSymbol::definition(typename_s); + if (D == NULL) return 0; + return D->W.extent - OPERANDS_TYPENAME_IFLD; +} + +inter_type TypenameInstruction::operand_type(inter_symbol *typename_s, int i) { + if (typename_s == NULL) return InterTypes::unchecked(); + inter_tree_node *D = InterSymbol::definition(typename_s); + if (D == NULL) return InterTypes::unchecked(); + if (i >= D->W.extent - OPERANDS_TYPENAME_IFLD) return InterTypes::unchecked(); + inter_ti TID = D->W.instruction[OPERANDS_TYPENAME_IFLD + i]; + inter_symbols_table *T = InterPackage::scope_of(D); + return InterTypes::from_TID(T, TID); +} ++§8. Enumeration counter, relevant only when the typename is enumerated: +
+ ++inter_ti TypenameInstruction::next_enumerated_value(inter_symbol *typename_s) { + if (typename_s == NULL) return 0; + inter_tree_node *D = InterSymbol::definition(typename_s); + if (D == NULL) return 0; + return ++(D->W.instruction[ENUM_RANGE_TYPENAME_IFLD]); +} ++§9. For an enumerated typename, if a new instance is created, this is called: +
+ ++void TypenameInstruction::new_instance(inter_symbol *typename_s, inter_symbol *inst_name) { if (typename_s == NULL) return; inter_tree_node *D = InterSymbol::definition(typename_s); if (D == NULL) return; D->W.instruction[NO_INSTANCES_TYPENAME_IFLD]++; - inter_symbol *S = TypenameInstruction::super(typename_s); - if (S) TypenameInstruction::new_instance(S, inst_name); + inter_symbol *S = TypenameInstruction::super(typename_s); + if (S) TypenameInstruction::new_instance(S, inst_name); } int TypenameInstruction::instance_count(inter_symbol *typename_s) { @@ -227,46 +326,11 @@ function togglePopup(material_id) { if (D == NULL) return 0; return (int) D->W.instruction[NO_INSTANCES_TYPENAME_IFLD]; } ++ -int TypenameInstruction::arity(inter_symbol *typename_s) { - if (typename_s == NULL) return 0; - inter_tree_node *D = InterSymbol::definition(typename_s); - if (D == NULL) return 0; - return D->W.extent - MIN_EXTENT_TYPENAME_IFR; -} - -inter_type TypenameInstruction::operand_type(inter_symbol *typename_s, int i) { - if (typename_s == NULL) return InterTypes::unchecked(); - inter_tree_node *D = InterSymbol::definition(typename_s); - if (D == NULL) return InterTypes::unchecked(); - if (i >= D->W.extent - MIN_EXTENT_TYPENAME_IFR) return InterTypes::unchecked(); - inter_ti TID = D->W.instruction[OPERANDS_TYPENAME_IFLD + i]; - inter_symbols_table *T = InterPackage::scope_of(D); - return InterTypes::from_TID(T, TID); -} - -inter_ti TypenameInstruction::constructor(inter_symbol *typename_s) { - if (typename_s == NULL) return UNCHECKED_ITCONC; - inter_tree_node *D = InterSymbol::definition(typename_s); - if (D == NULL) return UNCHECKED_ITCONC; - return D->W.instruction[CONSTRUCTOR_TYPENAME_IFLD]; -} - -inter_ti TypenameInstruction::next_enumerated_value(inter_symbol *typename_s) { - if (typename_s == NULL) return 0; - inter_tree_node *D = InterSymbol::definition(typename_s); - if (D == NULL) return 0; - return ++(D->W.instruction[ENUM_RANGE_TYPENAME_IFLD]); -} - -inter_symbol *TypenameInstruction::super(inter_symbol *typename_s) { - if (typename_s == NULL) return NULL; - inter_tree_node *D = InterSymbol::definition(typename_s); - if (D == NULL) return NULL; - return InterSymbolsTable::symbol_from_ID_at_node(D, SUPER_TYPENAME_IFLD); -} - -int TypenameInstruction::is(inter_symbol *typename_s) { ++int TypenameInstruction::is(inter_symbol *typename_s) { if (typename_s == NULL) return FALSE; inter_tree_node *D = InterSymbol::definition(typename_s); if (D == NULL) return FALSE; @@ -274,13 +338,14 @@ function togglePopup(material_id) { return FALSE; } -int TypenameInstruction::is_a(inter_symbol *typename1_s, inter_symbol *typename2_s) { +int TypenameInstruction::is_a(inter_symbol *typename1_s, inter_symbol *typename2_s) { inter_type type1 = InterTypes::from_type_name(typename1_s); inter_type type2 = InterTypes::from_type_name(typename2_s); - if ((InterTypes::is_unchecked(type1)) || (InterTypes::is_unchecked(type2))) return TRUE; + if ((InterTypes::is_unchecked(type1)) || (InterTypes::is_unchecked(type2))) + return TRUE; while (typename1_s) { if (typename1_s == typename2_s) return TRUE; - typename1_s = TypenameInstruction::super(typename1_s); + typename1_s = TypenameInstruction::super(typename1_s); } return FALSE; } diff --git a/docs/bytecode-module/4-tvc.html b/docs/bytecode-module/4-tvc.html index 6295c317e..414293a6d 100644 --- a/docs/bytecode-module/4-tvc.html +++ b/docs/bytecode-module/4-tvc.html @@ -73,76 +73,122 @@ function togglePopup(material_id) {
- Home
- Inter Modules
- bytecode
- Chapter 4: Void Constructs
- The Variable Construct
Defining the variable construct.
- +
- §1. Definition
- §2. Instructions
- §4. Creating from textual Inter syntax
- §5. Writing to textual Inter syntax
- §6. Access functions
+ +§1. Definition. For what this does and why it is used, see Textual Inter (in inter). +
void VariableInstruction::define_construct(void) { inter_construct *IC = InterInstruction::create_construct(VARIABLE_IST, I"variable"); - InterInstruction::defines_symbol_in_fields(IC, DEFN_VAR_IFLD, KIND_VAR_IFLD); + InterInstruction::defines_symbol_in_fields(IC, DEFN_VAR_IFLD, TYPE_VAR_IFLD); InterInstruction::specify_syntax(IC, I"variable TOKENS = TOKENS"); - InterInstruction::fix_instruction_length_between(IC, EXTENT_VAR_IFR, EXTENT_VAR_IFR); + InterInstruction::fix_instruction_length_between(IC, 6, 6); InterInstruction::permit(IC, INSIDE_PLAIN_PACKAGE_ICUP); InterInstruction::permit(IC, CAN_HAVE_ANNOTATIONS_ICUP); - METHOD_ADD(IC, CONSTRUCT_READ_MTID, VariableInstruction::read); - METHOD_ADD(IC, CONSTRUCT_VERIFY_MTID, VariableInstruction::verify); - METHOD_ADD(IC, CONSTRUCT_WRITE_MTID, VariableInstruction::write); + METHOD_ADD(IC, CONSTRUCT_READ_MTID, VariableInstruction::read); + METHOD_ADD(IC, CONSTRUCT_TRANSPOSE_MTID, VariableInstruction::transpose); + METHOD_ADD(IC, CONSTRUCT_VERIFY_MTID, VariableInstruction::verify); + METHOD_ADD(IC, CONSTRUCT_WRITE_MTID, VariableInstruction::write); }- +§2. Instructions. In bytecode, the frame of a propertyvalue instruction is laid out with the two +compulsory words ID_IFLD and LEVEL_IFLD, followed by: +
define DEFN_VAR_IFLD 2 -define KIND_VAR_IFLD 3 +define TYPE_VAR_IFLD 3 define VAL1_VAR_IFLD 4 define VAL2_VAR_IFLD 5 -define EXTENT_VAR_IFR 6-void VariableInstruction::read(inter_construct *IC, inter_bookmark *IBM, inter_line_parse *ilp, inter_error_location *eloc, inter_error_message **E) { - text_stream *kind_text = NULL, *name_text = ilp->mr.exp[0]; - match_results mr2 = Regexp::create_mr(); - if (Regexp::match(&mr2, name_text, L"%((%c+)%) (%c+)")) { - kind_text = mr2.exp[0]; - name_text = mr2.exp[1]; - } - - inter_type var_type = InterTypes::parse_simple(InterBookmark::scope(IBM), eloc, kind_text, E); - if (*E) return; - - inter_symbol *var_name = TextualInter::new_symbol(eloc, InterBookmark::scope(IBM), name_text, E); - if (*E) return; - - SymbolAnnotation::copy_set_to_symbol(&(ilp->set), var_name); - - inter_pair val = InterValuePairs::undef(); - *E = TextualInter::parse_pair(ilp->line, eloc, IBM, var_type, ilp->mr.exp[1], &val); - if (*E) return; - - *E = VariableInstruction::new(IBM, InterSymbolsTable::id_from_symbol_at_bookmark(IBM, var_name), var_type, val, (inter_ti) ilp->indent_level, eloc); -} - -inter_error_message *VariableInstruction::new(inter_bookmark *IBM, inter_ti VID, inter_type var_type, inter_pair val, inter_ti level, inter_error_location *eloc) { - inter_tree_node *P = Inode::new_with_4_data_fields(IBM, VARIABLE_IST, VID, InterTypes::to_TID_at(IBM, var_type), InterValuePairs::to_word1(val), InterValuePairs::to_word2(val), eloc, level); +inter_error_message *VariableInstruction::new(inter_bookmark *IBM, inter_symbol *var_s, + inter_type var_type, inter_pair val, inter_ti level, inter_error_location *eloc) { + inter_tree_node *P = Inode::new_with_4_data_fields(IBM, VARIABLE_IST, + /* DEFN_VAR_IFLD: */ InterSymbolsTable::id_at_bookmark(IBM, var_s), + /* TYPE_VAR_IFLD: */ InterTypes::to_TID_at(IBM, var_type), + /* VAL1_VAR_IFLD: */ InterValuePairs::to_word1(val), + /* VAL2_VAR_IFLD: */ InterValuePairs::to_word2(val), + eloc, level); inter_error_message *E = VerifyingInter::instruction(InterBookmark::package(IBM), P); if (E) return E; NodePlacement::move_to_moving_bookmark(P, IBM); return NULL; } -void VariableInstruction::verify(inter_construct *IC, inter_tree_node *P, inter_package *owner, inter_error_message **E) { - *E = VerifyingInter::TID_field(owner, P, KIND_VAR_IFLD); if (*E) return; - inter_type type = InterTypes::from_TID_in_field(P, KIND_VAR_IFLD); - *E = VerifyingInter::data_pair_fields(owner, P, VAL1_VAR_IFLD, type); if (*E) return; +void VariableInstruction::transpose(inter_construct *IC, inter_tree_node *P, + inter_ti *grid, inter_ti grid_extent, inter_error_message **E) { + InterValuePairs::set(P, VAL1_PVAL_IFLD, + InterValuePairs::transpose(InterValuePairs::get(P, VAL1_PVAL_IFLD), grid, grid_extent, E)); +} ++§3. Verification consists only of sanity checks. +
+ ++void VariableInstruction::verify(inter_construct *IC, inter_tree_node *P, + inter_package *owner, inter_error_message **E) { + *E = VerifyingInter::TID_field(owner, P, TYPE_VAR_IFLD); + if (*E) return; + inter_type type = InterTypes::from_TID_in_field(P, TYPE_VAR_IFLD); + *E = VerifyingInter::data_pair_fields(owner, P, VAL1_VAR_IFLD, type); + if (*E) return; +} ++§4. Creating from textual Inter syntax.
+ ++void VariableInstruction::read(inter_construct *IC, inter_bookmark *IBM, + inter_line_parse *ilp, inter_error_location *eloc, inter_error_message **E) { + text_stream *type_text = NULL, *name_text = ilp->mr.exp[0]; + match_results mr = Regexp::create_mr(); + if (Regexp::match(&mr, name_text, L"%((%c+)%) (%c+)")) { + type_text = mr.exp[0]; name_text = mr.exp[1]; + } + inter_type var_type = + InterTypes::parse_simple(InterBookmark::scope(IBM), eloc, type_text, E); + inter_symbol *var_s = NULL; + if (*E == NULL) + var_s = TextualInter::new_symbol(eloc, InterBookmark::scope(IBM), name_text, E); + Regexp::dispose_of(&mr); + if (*E) return; + + SymbolAnnotation::copy_set_to_symbol(&(ilp->set), var_s); + + inter_pair val = InterValuePairs::undef(); + *E = TextualInter::parse_pair(ilp->line, eloc, IBM, var_type, ilp->mr.exp[1], &val); + if (*E) return; + + *E = VariableInstruction::new(IBM, var_s, var_type, val, + (inter_ti) ilp->indent_level, eloc); +} ++§5. Writing to textual Inter syntax.
+ ++void VariableInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P, + inter_error_message **E) { + inter_symbol *var_s = VariableInstruction::variable(P); + WRITE("variable "); + TextualInter::write_optional_type_marker(OUT, P, TYPE_VAR_IFLD); + WRITE("%S = ", InterSymbol::identifier(var_s)); + TextualInter::write_pair(OUT, P, VariableInstruction::value(P), FALSE); + SymbolAnnotation::write_annotations(OUT, P, var_s); +} ++ + ++inter_symbol *VariableInstruction::variable(inter_tree_node *P) { + if (P == NULL) return NULL; + if (P->W.instruction[ID_IFLD] != VARIABLE_IST) return NULL; + return InterSymbolsTable::symbol_from_ID_at_node(P, DEFN_VAR_IFLD); } -void VariableInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P, inter_error_message **E) { - inter_symbol *var_name = InterSymbolsTable::symbol_from_ID_at_node(P, DEFN_VAR_IFLD); - if (var_name) { - WRITE("variable "); - TextualInter::write_optional_type_marker(OUT, P, KIND_VAR_IFLD); - WRITE("%S = ", InterSymbol::identifier(var_name)); - TextualInter::write_pair(OUT, P, InterValuePairs::get(P, VAL1_VAR_IFLD), FALSE); - SymbolAnnotation::write_annotations(OUT, P, var_name); - } else { *E = Inode::error(P, I"cannot write variable", NULL); return; } +inter_pair VariableInstruction::value(inter_tree_node *P) { + if (P == NULL) return InterValuePairs::undef(); + if (P->W.instruction[ID_IFLD] != VARIABLE_IST) return InterValuePairs::undef(); + return InterValuePairs::get(P, VAL1_VAR_IFLD); }The Assembly Construct - + Defining the assembly construct. diff --git a/docs/final-module/2-cg.html b/docs/final-module/2-cg.html index 358f6a43e..fd78c9394 100644 --- a/docs/final-module/2-cg.html +++ b/docs/final-module/2-cg.html @@ -202,7 +202,7 @@ object. code_generation *gen = (code_generation *) state; switch (P->W.instruction[ID_IFLD]) { case VARIABLE_IST: { - inter_symbol *var_name = InterSymbolsTable::symbol_from_ID_at_node(P, DEFN_VAR_IFLD); + inter_symbol *var_name = VariableInstruction::variable(P); ADD_TO_LINKED_LIST(var_name, inter_symbol, gen->global_variables); break; } @@ -220,7 +220,7 @@ object. break; } case TYPENAME_IST: { - inter_symbol *typename = InterSymbolsTable::symbol_from_ID_at_node(P, DEFN_TYPENAME_IFLD); + inter_symbol *typename = TypenameInstruction::typename(P); ADD_TO_LINKED_LIST(typename, inter_symbol, gen->kinds); break; } diff --git a/docs/final-module/4-i6gv.html b/docs/final-module/4-i6gv.html index 8f92ac424..ee758c699 100644 --- a/docs/final-module/4-i6gv.html +++ b/docs/final-module/4-i6gv.html @@ -96,7 +96,7 @@ of a lookup whenever we read or write them. inter_symbol *var_name; LOOP_OVER_LINKED_LIST(var_name, inter_symbol, L) { inter_tree_node *P = var_name->definition; - inter_pair val = InterValuePairs::get(P, VAL1_VAR_IFLD); + inter_pair val = VariableInstruction::value(P); if (SymbolAnnotation::get_b(var_name, ASSIMILATED_IANN) == FALSE) { if (k == 1) Begin the array2.1; Variables created by Inform 7 source text all go into the array2.2; diff --git a/docs/final-module/5-cgv.html b/docs/final-module/5-cgv.html index e850dffe0..21e090e06 100644 --- a/docs/final-module/5-cgv.html +++ b/docs/final-module/5-cgv.html @@ -186,7 +186,7 @@ but has no Inter declaration node. WRITE(", "); if (var_name->definition) { inter_tree_node *P = var_name->definition; - CodeGen::pair(gen, P, InterValuePairs::get(P, VAL1_VAR_IFLD)); + CodeGen::pair(gen, P, VariableInstruction::value(P)); } else { WRITE("0"); } diff --git a/docs/pipeline-module/2-ns.html b/docs/pipeline-module/2-ns.html index 2fc893f3c..7e8aab513 100644 --- a/docs/pipeline-module/2-ns.html +++ b/docs/pipeline-module/2-ns.html @@ -153,9 +153,8 @@ base data type matches this". unchecked_kind_symbol = InterSymbolsTable::create_with_unique_name( InterBookmark::scope(&in_generic_kinds), I"K_unchecked"); - TypenameInstruction::new(&in_generic_kinds, - InterSymbolsTable::id_from_symbol(I, generic_kinds_p, unchecked_kind_symbol), - UNCHECKED_ITCONC, 0, 0, NULL, + TypenameInstruction::new(&in_generic_kinds, unchecked_kind_symbol, + UNCHECKED_ITCONC, NULL, 0, NULL, (inter_ti) InterBookmark::baseline(&in_generic_kinds) + 1, NULL);
inter_ti operands[2]; - operands[0] = InterSymbolsTable::id_from_symbol_at_bookmark( + operands[0] = InterSymbolsTable::id_at_bookmark( &in_generic_kinds, unchecked_kind_symbol); - operands[1] = InterSymbolsTable::id_from_symbol_at_bookmark( + operands[1] = InterSymbolsTable::id_at_bookmark( &in_generic_kinds, unchecked_kind_symbol); inter_symbol *unchecked_function_symbol = InterSymbolsTable::create_with_unique_name( InterBookmark::scope(&in_generic_kinds), I"K_unchecked_function"); - TypenameInstruction::new(&in_generic_kinds, - InterSymbolsTable::id_from_symbol(I, generic_kinds_p, unchecked_function_symbol), - FUNCTION_ITCONC, 0, 2, operands, + TypenameInstruction::new(&in_generic_kinds, unchecked_function_symbol, + FUNCTION_ITCONC, NULL, 2, operands, (inter_ti) InterBookmark::baseline(&in_generic_kinds) + 1, NULL);
inter_ti operands[2]; - operands[0] = InterSymbolsTable::id_from_symbol_at_bookmark( + operands[0] = InterSymbolsTable::id_at_bookmark( &in_generic_kinds, unchecked_kind_symbol); - operands[1] = InterSymbolsTable::id_from_symbol_at_bookmark( + operands[1] = InterSymbolsTable::id_at_bookmark( &in_generic_kinds, unchecked_kind_symbol); inter_symbol *unchecked_list_symbol = InterSymbolsTable::create_with_unique_name( InterBookmark::scope(&in_generic_kinds), I"K_unchecked_list"); - TypenameInstruction::new(&in_generic_kinds, - InterSymbolsTable::id_from_symbol(I, generic_kinds_p, unchecked_list_symbol), - LIST_ITCONC, 0, 1, operands, + TypenameInstruction::new(&in_generic_kinds, unchecked_list_symbol, + LIST_ITCONC, NULL, 1, operands, (inter_ti) InterBookmark::baseline(&in_generic_kinds) + 1, NULL);
§3.1.3.1.4.2. Make a global variable in Inter3.1.3.1.4.2 =
- inter_ti MID = InterSymbolsTable::id_from_symbol(I, InterBookmark::package(IBM), made_s); inter_ti B = (inter_ti) InterBookmark::baseline(IBM) + 1; inter_pair val = InterValuePairs::undef(); Assimilate a value3.1.3.1.4.1.1; - Produce::guard(VariableInstruction::new(IBM, MID, - InterTypes::unchecked(), val, B, NULL)); + Produce::guard(VariableInstruction::new(IBM, made_s, InterTypes::unchecked(), + val, B, NULL));
§3.1.3.1.4.3. Make a general property in Inter3.1.3.1.4.3 = @@ -519,7 +518,8 @@ not already there.
inter_ti B = (inter_ti) InterBookmark::baseline(IBM) + 1; - Produce::guard(PropertyInstruction::new(IBM, made_s, InterTypes::unchecked(), B, NULL)); + Produce::guard(PropertyInstruction::new(IBM, made_s, InterTypes::unchecked(), + B, NULL));
§3.1.3.1.4.4. Make an either-or property in Inter3.1.3.1.4.4 =
@@ -1384,7 +1384,7 @@ But not really more efficient Inter.
inter_bookmark *IBM, inter_symbol *i1, inter_symbol *i2) {
inter_package *pack = InterBookmark::package(IBM);
inter_symbol *result_s = CompileSplatsStage::new_ccv_symbol(pack);
- inter_ti MID = InterSymbolsTable::id_from_symbol_at_bookmark(IBM, result_s);
+ inter_ti MID = InterSymbolsTable::id_at_bookmark(IBM, result_s);
inter_ti KID = InterTypes::to_TID(InterBookmark::scope(IBM), InterTypes::unchecked());
inter_ti B = (inter_ti) InterBookmark::baseline(IBM) + 1;
inter_tree_node *pair_list =
diff --git a/docs/pipeline-module/5-su.html b/docs/pipeline-module/5-su.html
index f1d56d07b..df0cc3fc7 100644
--- a/docs/pipeline-module/5-su.html
+++ b/docs/pipeline-module/5-su.html
@@ -169,7 +169,7 @@ does exist, it must have a definition, and we return that.
inter_ti TID = InterTypes::to_TID(InterBookmark::scope(Packaging::at(I)),
InterTypes::from_constructor_code(LIST_ITCONC));
synoptic_array_node = Inode::new_with_3_data_fields(Packaging::at(I), CONSTANT_IST,
- InterSymbolsTable::id_from_symbol_at_bookmark(Packaging::at(I), con_s),
+ InterSymbolsTable::id_at_bookmark(Packaging::at(I), con_s),
TID, CONST_LIST_FORMAT_COLLECTION, NULL,
(inter_ti) InterBookmark::baseline(Packaging::at(I)) + 1);
}
diff --git a/docs/runtime-module/2-cu.html b/docs/runtime-module/2-cu.html
index d8630c769..880ebde57 100644
--- a/docs/runtime-module/2-cu.html
+++ b/docs/runtime-module/2-cu.html
@@ -173,7 +173,7 @@ and author; together with any "extra credit" asked for by the extension.
Hierarchy::apply_metadata(M->where_found, EXT_VERSION_MD_HL, V);
DISCARD_TEXT(V)
id_iname = Hierarchy::make_iname_in(EXTENSION_ID_HL, M->where_found);
- Emit::numeric_constant(id_iname, 0);
+ Emit::numeric_constant(id_iname, 0);
TEMPORARY_TEXT(C)
WRITE_TO(C, "%S", ext->as_copy->edition->work->raw_title);
if (VersionNumbers::is_null(N) == FALSE) WRITE_TO(C, " version %v", &N);
diff --git a/docs/runtime-module/2-dv.html b/docs/runtime-module/2-dv.html
index 9e450577b..42766ad38 100644
--- a/docs/runtime-module/2-dv.html
+++ b/docs/runtime-module/2-dv.html
@@ -213,7 +213,7 @@ for example, the default value of
-inter_pair DefaultValues::to_value_pair(kind *K) {
+inter_pair DefaultValues::to_value_pair(kind *K) {
if (K == NULL) return InterValuePairs::undef();
Constructed kinds stored as block values2.1;
Base kinds stored as block values2.2;
diff --git a/docs/runtime-module/2-emt.html b/docs/runtime-module/2-emt.html
index 3bd895318..23ea09ca3 100644
--- a/docs/runtime-module/2-emt.html
+++ b/docs/runtime-module/2-emt.html
@@ -73,7 +73,7 @@ function togglePopup(material_id) {
"Emitting" is the process of generating Inter bytecode, and this section provides a comprehensive API for the runtime and imperative modules to do that. §1. The emission tree. The bytecode module can maintain multiple independent trees of Inter code
in memory, so that most calls to bytecode or building take an inter_tree
@@ -93,23 +93,23 @@ creates the main
+
-inter_pair Emit::symbol_to_value_pair(inter_symbol *S) { +inter_pair Emit::symbol_to_value_pair(inter_symbol *S) { return Emit::stvp_inner(S, InterBookmark::package(Emit::at())); } @@ -151,7 +151,7 @@ what package it belongs to, the "context" referred to below: return Emit::stvp_inner(InterNames::to_symbol(iname), InterBookmark::package(Emit::at())); } -inter_pair Emit::to_value_pair_in_context(inter_name *context, inter_name *iname) { +inter_pair Emit::to_value_pair_in_context(inter_name *context, inter_name *iname) { inter_package *pack = Packaging::incarnate(InterNames::location(context)); inter_symbol *S = InterNames::to_symbol(iname); return Emit::stvp_inner(S, pack); @@ -176,33 +176,20 @@ the other three arguments are for kind constructors. inter_ti constructor, int arity, kind **operand_kinds) { packaging_state save = Packaging::enter_home_of(iname); inter_symbol *S = InterNames::to_symbol(iname); - inter_ti SID = 0; - if (S) SID = Emit::symbol_id(S); inter_symbol *SS = (super)?InterNames::to_symbol(super):NULL; - inter_ti SUP = 0; - if (SS) SUP = Emit::symbol_id(SS); inter_ti operands[MAX_KIND_ARITY]; if (arity > MAX_KIND_ARITY) internal_error("kind arity too high"); for (int i=0; i<arity; i++) { if ((operand_kinds[i] == K_nil) || (operand_kinds[i] == K_void)) operands[i] = 0; else operands[i] = Produce::kind_to_TID(Emit::at(), operand_kinds[i]); } - Emit::kind_inner(SID, SUP, constructor, arity, operands); + Produce::guard(TypenameInstruction::new(Emit::at(), S, constructor, SS, arity, + operands, Emit::baseline(), NULL)); InterNames::to_symbol(iname); Packaging::exit(Emit::tree(), save); }- - -
-void Emit::kind_inner(inter_ti SID, inter_ti SUP, - inter_ti constructor, int arity, inter_ti *operands) { - Produce::guard(TypenameInstruction::new(Emit::at(), SID, constructor, SUP, arity, - operands, Emit::baseline(), NULL)); -} --
§6. Default values for kinds are emitted thus. This is inefficient and maybe ought +
§5. Default values for kinds are emitted thus. This is inefficient and maybe ought to be replaced by a hash, but the list is short and the function is called so little that it probably makes little difference.
@@ -210,7 +197,7 @@ so little that it probably makes little difference.linked_list *default_values_written = NULL; -void Emit::ensure_defaultvalue(kind *K) { +void Emit::ensure_defaultvalue(kind *K) { if (K == K_value) return; if (default_values_written == NULL) default_values_written = NEW_LINKED_LIST(kind); kind *L; @@ -227,42 +214,42 @@ so little that it probably makes little difference. } }-
§7. Pragmas. The Inter language allows pragmas, or code-generation hints, to be passed +
§6. Pragmas. The Inter language allows pragmas, or code-generation hints, to be passed through. These are specific to the target of compilation, and can be ignored by all other targets. Here we generate only I6-target pragmas, which are commands in I6's "Inform Control Language".
-void Emit::pragma(text_stream *text) { +void Emit::pragma(text_stream *text) { inter_tree *I = Emit::tree(); LargeScale::emit_pragma(I, I"Inform6", text); }-
§8. Constants. These functions make it easy to define a named value in Inter. If the value is +
§7. Constants. These functions make it easy to define a named value in Inter. If the value is an unsigned numeric constant, use one of these two functions — the first if it represents an actual number at run-time, the second if not:
-inter_name *Emit::numeric_constant(inter_name *con_iname, inter_ti val) { - return Emit::numeric_constant_inner(con_iname, val, INT32_ITCONC, INVALID_IANN); +inter_name *Emit::numeric_constant(inter_name *con_iname, inter_ti val) { + return Emit::numeric_constant_inner(con_iname, val, INT32_ITCONC, INVALID_IANN); } -inter_name *Emit::named_numeric_constant_hex(inter_name *con_iname, inter_ti val) { - return Emit::numeric_constant_inner(con_iname, val, INT32_ITCONC, HEX_IANN); +inter_name *Emit::named_numeric_constant_hex(inter_name *con_iname, inter_ti val) { + return Emit::numeric_constant_inner(con_iname, val, INT32_ITCONC, HEX_IANN); } inter_name *Emit::named_unchecked_constant_hex(inter_name *con_iname, inter_ti val) { - return Emit::numeric_constant_inner(con_iname, val, UNCHECKED_ITCONC, HEX_IANN); + return Emit::numeric_constant_inner(con_iname, val, UNCHECKED_ITCONC, HEX_IANN); } -inter_name *Emit::named_numeric_constant_signed(inter_name *con_iname, int val) { - return Emit::numeric_constant_inner(con_iname, (inter_ti) val, INT32_ITCONC, SIGNED_IANN); +inter_name *Emit::named_numeric_constant_signed(inter_name *con_iname, int val) { + return Emit::numeric_constant_inner(con_iname, (inter_ti) val, INT32_ITCONC, SIGNED_IANN); } -inter_name *Emit::unchecked_numeric_constant(inter_name *con_iname, inter_ti val) { - return Emit::numeric_constant_inner(con_iname, val, UNCHECKED_ITCONC, INVALID_IANN); +inter_name *Emit::unchecked_numeric_constant(inter_name *con_iname, inter_ti val) { + return Emit::numeric_constant_inner(con_iname, val, UNCHECKED_ITCONC, INVALID_IANN); } inter_name *Emit::numeric_constant_inner(inter_name *con_iname, inter_ti val, @@ -277,11 +264,11 @@ it represents an actual number at run-time, the second if not: return con_iname; }-
-void Emit::text_constant(inter_name *con_iname, text_stream *contents) { +void Emit::text_constant(inter_name *con_iname, text_stream *contents) { packaging_state save = Packaging::enter_home_of(con_iname); inter_symbol *con_s = InterNames::to_symbol(con_iname); Produce::guard(ConstantInstruction::new(Emit::at(), con_s, @@ -290,11 +277,11 @@ it represents an actual number at run-time, the second if not: Packaging::exit(Emit::tree(), save); }-
§10. And equating one constant to another named constant: +
§9. And equating one constant to another named constant:
-inter_name *Emit::iname_constant(inter_name *con_iname, kind *K, inter_name *val_iname) { +inter_name *Emit::iname_constant(inter_name *con_iname, kind *K, inter_name *val_iname) { packaging_state save = Packaging::enter_home_of(con_iname); inter_symbol *con_s = InterNames::to_symbol(con_iname); inter_symbol *val_s = (val_iname)?InterNames::to_symbol(val_iname):NULL; @@ -311,48 +298,48 @@ it represents an actual number at run-time, the second if not: return con_iname; }-
§11. These two variants are needed only for the oddball way Bibliographic Data +
§10. These two variants are needed only for the oddball way Bibliographic Data is compiled.
-void Emit::text_constant_from_wide_string(inter_name *con_iname, wchar_t *str) { +void Emit::text_constant_from_wide_string(inter_name *con_iname, wchar_t *str) { inter_name *iname = TextLiterals::to_value(Feeds::feed_C_string(str)); - Emit::named_generic_constant(con_iname, + Emit::named_generic_constant(con_iname, Emit::to_value_pair_in_context(con_iname, iname)); } -void Emit::serial_number(inter_name *con_iname, text_stream *serial) { +void Emit::serial_number(inter_name *con_iname, text_stream *serial) { packaging_state save = Packaging::enter_home_of(con_iname); inter_pair val = InterValuePairs::from_text(Emit::at(), serial); - Emit::named_generic_constant(con_iname, val); + Emit::named_generic_constant(con_iname, val); Packaging::exit(Emit::tree(), save); }-
§12. Similarly, there are just a few occasions when we need to extract the value +
§11. Similarly, there are just a few occasions when we need to extract the value of a "variable" and define it as a constant:
-void Emit::initial_value_as_constant(inter_name *con_iname, nonlocal_variable *var) { - Emit::named_generic_constant(con_iname, +void Emit::initial_value_as_constant(inter_name *con_iname, nonlocal_variable *var) { + Emit::named_generic_constant(con_iname, RTVariables::initial_value_as_pair(con_iname, var)); } -void Emit::initial_value_as_raw_text(inter_name *con_iname, nonlocal_variable *var) { +void Emit::initial_value_as_raw_text(inter_name *con_iname, nonlocal_variable *var) { wording W = NonlocalVariables::initial_value_as_plain_text(var); TEMPORARY_TEXT(CONTENT) BibliographicData::compile_bibliographic_text(CONTENT, Lexer::word_text(Wordings::first_wn(W)), XML_BIBTEXT_MODE); - Emit::text_constant(con_iname, CONTENT); + Emit::text_constant(con_iname, CONTENT); DISCARD_TEXT(CONTENT) }-
§13. The above make use of this: +
§12. The above make use of this:
-void Emit::named_generic_constant(inter_name *con_iname, inter_pair val) { +void Emit::named_generic_constant(inter_name *con_iname, inter_pair val) { packaging_state save = Packaging::enter_home_of(con_iname); inter_symbol *con_s = InterNames::to_symbol(con_iname); Produce::guard(ConstantInstruction::new(Emit::at(), con_s, @@ -360,10 +347,10 @@ of a "variable" and define it as a constant: Packaging::exit(Emit::tree(), save); }- +
-void Emit::instance(inter_name *inst_iname, kind *K, int v) { +void Emit::instance(inter_name *inst_iname, kind *K, int v) { packaging_state save = Packaging::enter_home_of(inst_iname); inter_symbol *inst_s = InterNames::to_symbol(inst_iname); inter_pair val = v ? InterValuePairs::number((inter_ti) v) : InterValuePairs::undef(); @@ -372,25 +359,25 @@ of a "variable" and define it as a constant: Packaging::exit(Emit::tree(), save); }- +
-inter_symbol *Emit::variable(inter_name *var_iname, kind *K, inter_pair val) { +inter_symbol *Emit::variable(inter_name *var_iname, kind *K, inter_pair val) { packaging_state save = Packaging::enter_home_of(var_iname); inter_symbol *var_s = InterNames::to_symbol(var_iname); inter_type type = InterTypes::unchecked(); if ((K) && (K != K_value)) type = InterTypes::from_type_name(Produce::kind_to_symbol(K)); - Produce::guard(VariableInstruction::new(Emit::at(), - Emit::symbol_id(var_s), type, val, Emit::baseline(), NULL)); + Produce::guard(VariableInstruction::new(Emit::at(), var_s, type, val, + Emit::baseline(), NULL)); Packaging::exit(Emit::tree(), save); return var_s; }-
§16. Properties and permissions.
+§15. Properties and permissions.
-void Emit::property(inter_name *prop_iname, kind *K) { +void Emit::property(inter_name *prop_iname, kind *K) { packaging_state save = Packaging::enter_home_of(prop_iname); inter_symbol *prop_s = InterNames::to_symbol(prop_iname); inter_type type = InterTypes::unchecked(); @@ -400,7 +387,7 @@ of a "variable" and define it as a constant: Packaging::exit(Emit::tree(), save); } -void Emit::permission(property *prn, inter_symbol *owner_s, inter_name *storage_iname) { +void Emit::permission(property *prn, inter_symbol *owner_s, inter_name *storage_iname) { inter_name *prop_iname = RTProperties::iname(prn); inter_symbol *store_s = (storage_iname)?InterNames::to_symbol(storage_iname):NULL; inter_symbol *prop_s = InterNames::to_symbol(prop_iname); @@ -408,17 +395,17 @@ of a "variable" and define it as a constant: Emit::baseline(), NULL)); }- +
-void Emit::propertyvalue(property *P, inter_name *owner, inter_pair val) { +void Emit::propertyvalue(property *P, inter_name *owner, inter_pair val) { inter_symbol *prop_s = InterNames::to_symbol(RTProperties::iname(P)); inter_symbol *owner_s = InterNames::to_symbol(owner); Produce::guard(PropertyValueInstruction::new(Emit::at(), prop_s, owner_s, val, Emit::baseline(), NULL)); }-
§18. Private, keep out. The following should be called only by Functions (in imperative), which provides +
§17. Private, keep out. The following should be called only by Functions (in imperative), which provides the real API for starting and ending functions.
@@ -431,7 +418,7 @@ the real API for starting and ending functions. Emit::baseline(), NULL)); } -§19. Interventions. These should be used as little as possible, and perhaps it may one day be possible +
§18. Interventions. These should be used as little as possible, and perhaps it may one day be possible to abolish them altogether. They insert direct kit material (i.e. paraphrased Inter code written out as plain text in Inform 6 notation) into bytecode; this is then assimilating during linking. Note that only the raw i6 is actually carried over @@ -440,16 +427,16 @@ about where to include the code is ignored.
-void Emit::intervention(int stage, text_stream *segment, text_stream *part, +void Emit::intervention(int stage, text_stream *segment, text_stream *part, text_stream *i6, text_stream *seg) { Produce::guard(InsertInstruction::new(Emit::at(), i6, Emit::baseline(), NULL)); }-
§20. And this is a similarly inelegant construction: +
§19. And this is a similarly inelegant construction:
-void Emit::append(inter_name *iname, text_stream *text) { +void Emit::append(inter_name *iname, text_stream *text) { LOG("Append '%S'\n", text); packaging_state save = Packaging::enter_home_of(iname); inter_symbol *symbol = InterNames::to_symbol(iname); diff --git a/docs/runtime-module/2-hrr.html b/docs/runtime-module/2-hrr.html index c9a477d35..82801799b 100644 --- a/docs/runtime-module/2-hrr.html +++ b/docs/runtime-module/2-hrr.html @@ -2229,7 +2229,7 @@ at which this array should be placed, by calling, e.g.,-inter_name *Hierarchy::find(int id) { +inter_name *Hierarchy::find(int id) { return HierarchyLocations::iname(Emit::tree(), id); }@@ -2411,17 +2411,17 @@ point system, and for those:void Hierarchy::apply_metadata(package_request *P, int id, text_stream *value) { inter_name *iname = Hierarchy::make_iname_in(id, P); - Emit::text_constant(iname, value); + Emit::text_constant(iname, value); } void Hierarchy::apply_metadata_from_number(package_request *P, int id, inter_ti N) { inter_name *iname = Hierarchy::make_iname_in(id, P); - Emit::numeric_constant(iname, N); + Emit::numeric_constant(iname, N); } void Hierarchy::apply_metadata_from_iname(package_request *P, int id, inter_name *val) { inter_name *iname = Hierarchy::make_iname_in(id, P); - Emit::iname_constant(iname, K_value, val); + Emit::iname_constant(iname, K_value, val); } void Hierarchy::apply_metadata_from_wording(package_request *P, int id, wording W) { diff --git a/docs/runtime-module/2-ic.html b/docs/runtime-module/2-ic.html index 608268a41..5cffe34ba 100644 --- a/docs/runtime-module/2-ic.html +++ b/docs/runtime-module/2-ic.html @@ -265,9 +265,9 @@ compile time. inter_name *iname = RTKindConstructors::first_instance_iname(K); instance *next = InstanceCounting::next_in_IK_sequence(NULL, K); if (next) { - Emit::iname_constant(iname, K_object, RTInstances::value_iname(next)); + Emit::iname_constant(iname, K_object, RTInstances::value_iname(next)); } else { - Emit::iname_constant(iname, K_object, NULL); + Emit::iname_constant(iname, K_object, NULL); } } } diff --git a/docs/runtime-module/2-int.html b/docs/runtime-module/2-int.html index 8c9235904..23ba2dbf2 100644 --- a/docs/runtime-module/2-int.html +++ b/docs/runtime-module/2-int.html @@ -113,7 +113,7 @@ raw I6 matter into the Inter tree. source_text_intervention *sti; LOOP_OVER(sti, source_text_intervention) if (sti->infs_to_include_with == NULL) - Emit::intervention(sti->stage, sti->segment, sti->part, + Emit::intervention(sti->stage, sti->segment, sti->part, Interventions::expand_bracket_plus(sti->matter), sti->seg); }@@ -125,7 +125,7 @@ raw I6 matter into the Inter tree. source_text_intervention *sti; LOOP_OVER(sti, source_text_intervention) if (sti->infs_to_include_with == infs) - Emit::append(iname, Interventions::expand_bracket_plus(sti->matter)); + Emit::append(iname, Interventions::expand_bracket_plus(sti->matter)); }
§3. Thirdly, from use options: @@ -133,7 +133,7 @@ raw I6 matter into the Inter tree.
void Interventions::from_use_option(text_stream *S) { - Emit::intervention(EARLY_LINK_STAGE, NULL, NULL, + Emit::intervention(EARLY_LINK_STAGE, NULL, NULL, Interventions::expand_bracket_plus(S), NULL); }diff --git a/docs/runtime-module/2-sn.html b/docs/runtime-module/2-sn.html index dce8c348a..536226c07 100644 --- a/docs/runtime-module/2-sn.html +++ b/docs/runtime-module/2-sn.html @@ -100,7 +100,7 @@ define it to be equivalent to regular short name, thus: void ShortNames::compile_cap_short_name(void) { if (P_cap_short_name == NULL) { inter_name *iname = Hierarchy::find(CAPSHORTNAME_HL); - Emit::iname_constant(iname, K_value, Hierarchy::find(SHORT_NAME_HL)); + Emit::iname_constant(iname, K_value, Hierarchy::find(SHORT_NAME_HL)); Hierarchy::make_available(iname); } } diff --git a/docs/runtime-module/2-th.html b/docs/runtime-module/2-th.html index 4fe766170..8eb7a13ea 100644 --- a/docs/runtime-module/2-th.html +++ b/docs/runtime-module/2-th.html @@ -107,9 +107,9 @@ has essentially no memory constraints compared with the Z-machine. while (max_heap < total_heap_allocation) max_heap = max_heap*2; inter_name *iname = Hierarchy::find(MEMORY_HEAP_SIZE_HL); if (TargetVMs::is_16_bit(Task::vm())) - Emit::numeric_constant(iname, (inter_ti) max_heap); + Emit::numeric_constant(iname, (inter_ti) max_heap); else - Emit::numeric_constant(iname, (inter_ti) (4*max_heap)); + Emit::numeric_constant(iname, (inter_ti) (4*max_heap)); Hierarchy::make_available(iname); LOG("Providing for a total heap of %d, given requirement of %d\n", max_heap, total_heap_allocation); diff --git a/docs/runtime-module/3-cm.html b/docs/runtime-module/3-cm.html index ef4d321c4..adc632b5a 100644 --- a/docs/runtime-module/3-cm.html +++ b/docs/runtime-module/3-cm.html @@ -99,7 +99,7 @@ function togglePopup(material_id) { TEMPORARY_TEXT(vn) WRITE_TO(vn, "[[Version Number]]"); inter_name *iname = Hierarchy::find(I7_VERSION_NUMBER_HL); - Emit::text_constant(iname, vn); + Emit::text_constant(iname, vn); Hierarchy::make_available(iname); DISCARD_TEXT(vn) @@ -111,7 +111,7 @@ function togglePopup(material_id) { TEMPORARY_TEXT(svn) WRITE_TO(svn, "[[Semantic Version Number]]"); inter_name *iname = Hierarchy::find(I7_FULL_VERSION_NUMBER_HL); - Emit::text_constant(iname, svn); + Emit::text_constant(iname, svn); Hierarchy::make_available(iname); DISCARD_TEXT(svn) @@ -127,10 +127,10 @@ function togglePopup(material_id) { ExtensionIndex::plot_icon(icon, VM); TargetVMs::write(vm, VM); inter_name *iname = Hierarchy::find(VM_MD_HL); - Emit::text_constant(iname, vm); + Emit::text_constant(iname, vm); if (Str::len(VM->VM_image) > 0) { inter_name *iname = Hierarchy::find(VM_ICON_MD_HL); - Emit::text_constant(iname, VM->VM_image); + Emit::text_constant(iname, VM->VM_image); } DISCARD_TEXT(vm) DISCARD_TEXT(icon) @@ -145,10 +145,10 @@ function togglePopup(material_id) { PluginManager::list_plugins(inc, TRUE); PluginManager::list_plugins(exc, FALSE); inter_name *iname = Hierarchy::find(LANGUAGE_ELEMENTS_USED_MD_HL); - Emit::text_constant(iname, inc); + Emit::text_constant(iname, inc); if (Str::len(exc) > 0) { inter_name *iname = Hierarchy::find(LANGUAGE_ELEMENTS_NOT_USED_MD_HL); - Emit::text_constant(iname, exc); + Emit::text_constant(iname, exc); } DISCARD_TEXT(inc) DISCARD_TEXT(exc) @@ -160,9 +160,9 @@ function togglePopup(material_id) {
inter_name *iname = Hierarchy::find(MEMORY_ECONOMY_MD_HL); if (global_compilation_settings.memory_economy_in_force) - Emit::numeric_constant(iname, 1); + Emit::numeric_constant(iname, 1); else - Emit::numeric_constant(iname, 0); + Emit::numeric_constant(iname, 0);
§1.6. Frame size1.6 = @@ -170,7 +170,7 @@ function togglePopup(material_id) {
inter_name *iname = Hierarchy::find(MAX_FRAME_SIZE_NEEDED_HL); - Emit::numeric_constant(iname, (inter_ti) SharedVariables::size_of_largest_set()); + Emit::numeric_constant(iname, (inter_ti) SharedVariables::size_of_largest_set()); Hierarchy::make_available(iname);
inter_name *iname = Hierarchy::find(RNG_SEED_AT_START_OF_PLAY_HL); - Emit::numeric_constant(iname, (inter_ti) Task::rng_seed()); + Emit::numeric_constant(iname, (inter_ti) Task::rng_seed()); Hierarchy::make_available(iname);
inter_name *iname = Hierarchy::find(MAX_INDEXED_FIGURES_HL); - Emit::numeric_constant(iname, + Emit::numeric_constant(iname, (inter_ti) global_compilation_settings.index_figure_thumbnails);
h->compilation_data.heading_package = pack; h->compilation_data.heading_ID = Hierarchy::make_iname_in(HEADING_ID_HL, pack); - Emit::numeric_constant(h->compilation_data.heading_ID, 561); + Emit::numeric_constant(h->compilation_data.heading_ID, 561); if (h->level == 0) { if (NUMBER_CREATED(contents_entry) == 1) Hierarchy::apply_metadata(pack, HEADING_TEXT_MD_HL, I"Source text"); diff --git a/docs/runtime-module/3-uo.html b/docs/runtime-module/3-uo.html index 8eac9b99c..b1a8f903c 100644 --- a/docs/runtime-module/3-uo.html +++ b/docs/runtime-module/3-uo.html @@ -93,8 +93,8 @@ work at runtime: inter_ti set = 0; if ((uo->option_used) || (uo->minimum_setting_value >= 0)) set = 1; inter_name *set_iname = Hierarchy::make_iname_in(USE_OPTION_ON_MD_HL, R); - Emit::numeric_constant(set_iname, set); - Emit::numeric_constant(uo->compilation_data.uo_value, (inter_ti) 0); + Emit::numeric_constant(set_iname, set); + Emit::numeric_constant(uo->compilation_data.uo_value, (inter_ti) 0); Hierarchy::apply_metadata_from_raw_wording(R, USE_OPTION_MD_HL, uo->name); TEMPORARY_TEXT(N) WRITE_TO(N, "%W option", uo->name); @@ -142,7 +142,7 @@ one doesn't, that's not an error; it's just a pragma we suppress.diff --git a/docs/runtime-module/4-rsp.html b/docs/runtime-module/4-rsp.html index 6c7d237dc..5166e35c4 100644 --- a/docs/runtime-module/4-rsp.html +++ b/docs/runtime-module/4-rsp.html @@ -271,14 +271,14 @@ a function defined in Ba inter_name *ts_value_iname = TextSubstitutions::value_iname(ts); inter_name *rc_iname = Responses::response_constant_iname(resp->the_rule, resp->the_marker); - Emit::numeric_constant(rc_iname, 0); + Emit::numeric_constant(rc_iname, 0); - Emit::iname_constant(resp->value_md_iname, K_value, ts_value_iname); - Emit::iname_constant(resp->rule_md_iname, K_value, RTRules::iname(resp->the_rule)); - Emit::numeric_constant(resp->marker_md_iname, (inter_ti) resp->the_marker); + Emit::iname_constant(resp->value_md_iname, K_value, ts_value_iname); + Emit::iname_constant(resp->rule_md_iname, K_value, RTRules::iname(resp->the_rule)); + Emit::numeric_constant(resp->marker_md_iname, (inter_ti) resp->the_marker); TEMPORARY_TEXT(T) WRITE_TO(T, "%+W", resp->the_ts->unsubstituted_text); - Emit::text_constant(resp->index_text_md_iname, T); + Emit::text_constant(resp->index_text_md_iname, T); DISCARD_TEXT(T) inform_extension *E = Extensions::corresponding_to( Lexer::file_of_origin(Wordings::first_wn(resp->the_rule->name))); @@ -286,7 +286,7 @@ a function defined in Ba if (E) WRITE_TO(QT, "%<X", E->as_copy->edition->work); else WRITE_TO(QT, "source text"); EmitArrays::text_entry(QT); - Emit::text_constant(resp->group_md_iname, QT); + Emit::text_constant(resp->group_md_iname, QT); DISCARD_TEXT(QT) TextLiterals::compile_value_to(resp->value_iname, resp->launcher_iname); diff --git a/docs/runtime-module/4-tl.html b/docs/runtime-module/4-tl.html index fdc65297b..79dc806a8 100644 --- a/docs/runtime-module/4-tl.html +++ b/docs/runtime-module/4-tl.html @@ -157,7 +157,7 @@ much later in the process. See -inter_name *TextLiterals::to_value(wording W) { +inter_name *TextLiterals::to_value(wording W) { return TextLiterals::to_value_inner(W, FALSE); } @@ -173,7 +173,7 @@ much later in the process. See inter_name *content_iname = Enclosures::new_iname(LITERALS_HAP, TEXT_LITERAL_HL); InterNames::annotate_b(content_iname, TEXT_LITERAL_IANN, TRUE); if (Task::wraps_existing_storyfile()) { - Emit::text_constant(content_iname, I"--"); + Emit::text_constant(content_iname, I"--"); } else { TEMPORARY_TEXT(TLT) int options = CT_DEQUOTE; @@ -185,7 +185,7 @@ much later in the process. See } } TranscodeText::from_wide_string(TLT, Lexer::word_text(w1), options); - Emit::text_constant(content_iname, TLT); + Emit::text_constant(content_iname, TLT); DISCARD_TEXT(TLT) } diff --git a/docs/runtime-module/5-act.html b/docs/runtime-module/5-act.html index dd0580e95..695ded048 100644 --- a/docs/runtime-module/5-act.html +++ b/docs/runtime-module/5-act.html @@ -169,9 +169,9 @@ write 0. activity *av = RETRIEVE_POINTER_activity(t->data); package_request *pack = av->compilation_data.av_package; inter_name *iname = Hierarchy::make_iname_in(ACTIVITY_ID_HL, pack); - Emit::numeric_constant(iname, 0); a placeholder: see above + Emit::numeric_constant(iname, 0); a placeholder: see above - Emit::iname_constant(av->compilation_data.value_iname, K_value, iname); + Emit::iname_constant(av->compilation_data.value_iname, K_value, iname); Hierarchy::apply_metadata_from_wording(pack, ACTIVITY_NAME_MD_HL, av->name); Hierarchy::apply_metadata_from_number(pack, ACTIVITY_AT_MD_HL, @@ -201,7 +201,7 @@ write 0. RTSharedVariables::compile_creator_fn(av->activity_variables, iname); Hierarchy::apply_metadata_from_iname(pack, ACTIVITY_VAR_CREATOR_MD_HL, iname); } - Emit::numeric_constant(av->compilation_data.variables_id, 0); + Emit::numeric_constant(av->compilation_data.variables_id, 0); activity_crossref *acr; for (acr = av->compilation_data.cross_references; acr; acr = acr->next) { diff --git a/docs/runtime-module/5-act2.html b/docs/runtime-module/5-act2.html index 7b27b7171..79e1184e9 100644 --- a/docs/runtime-module/5-act2.html +++ b/docs/runtime-module/5-act2.html @@ -244,7 +244,7 @@ to anyone reading the Inform 6 code we generate.- Emit::pragma(I"-s"); + Emit::pragma(I"-s"); i6_memory_setting *ms; LOOP_OVER(ms, i6_memory_setting) { if ((Str::eq_wide_string(ms->ICL_identifier, L"MAX_LOCAL_VARIABLES")) && @@ -150,7 +150,7 @@ one doesn't, that's not an error; it's just a pragma we suppress. continue; TEMPORARY_TEXT(prag) WRITE_TO(prag, "$%S=%d", ms->ICL_identifier, ms->number); - Emit::pragma(prag); + Emit::pragma(prag); DISCARD_TEXT(prag) }@@ -185,11 +185,11 @@ kits. if (global_compilation_settings.ranking_table_given) bitmap += 512; inter_name *iname = Hierarchy::find(KIT_CONFIGURATION_BITMAP_HL); - Emit::numeric_constant(iname, (inter_ti) bitmap); + Emit::numeric_constant(iname, (inter_ti) bitmap); Hierarchy::make_available(iname); iname = Hierarchy::find(KIT_CONFIGURATION_LOOKMODE_HL); - Emit::numeric_constant(iname, + Emit::numeric_constant(iname, (inter_ti) global_compilation_settings.room_description_level); Hierarchy::make_available(iname);
inter_name *iname = Hierarchy::make_iname_in(ACTION_ID_HL, pack); - Emit::numeric_constant(iname, 0); placeholder, corrected in linking + Emit::numeric_constant(iname, 0); placeholder, corrected in linking
§8.2. Compile double-sharp constant8.2 = @@ -252,7 +252,7 @@ to anyone reading the Inform 6 code we generate.
inter_name *ds_iname = RTActions::double_sharp(an); - Emit::unchecked_numeric_constant(ds_iname, (inter_ti) an->allocation_id); + Emit::unchecked_numeric_constant(ds_iname, (inter_ti) an->allocation_id); Hierarchy::make_available(ds_iname); InterNames::annotate_b(ds_iname, ACTION_IANN, 1);@@ -267,11 +267,11 @@ to anyone reading the Inform 6 code we generate. an->naming_data.past_name); Hierarchy::apply_metadata_from_number(pack, ACTION_AT_MD_HL, (inter_ti) Wordings::first_wn(an->compilation_data.metadata_name)); - Emit::numeric_constant(RTActions::variables_id(an), 0); + Emit::numeric_constant(RTActions::variables_id(an), 0); if (Str::get_first_char(RTActions::identifier(an)) == '_') Hierarchy::apply_metadata_from_number(pack, NO_CODING_MD_HL, 1); inter_name *dsc = Hierarchy::make_iname_in(ACTION_DSHARP_MD_HL, pack); - Emit::iname_constant(dsc, K_value, RTActions::double_sharp(an)); + Emit::iname_constant(dsc, K_value, RTActions::double_sharp(an)); Hierarchy::apply_metadata_from_number(pack, OUT_OF_WORLD_MD_HL, (inter_ti) ActionSemantics::is_out_of_world(an)); Hierarchy::apply_metadata_from_number(pack, @@ -360,7 +360,7 @@ to anyone reading the Inform 6 code we generate. inter_name *iname = Hierarchy::make_iname_in(ACTION_STV_CREATOR_FN_HL, pack); RTSharedVariables::compile_creator_fn(an->action_variables, iname); inter_name *vc = Hierarchy::make_iname_in(ACTION_VARC_MD_HL, pack); - Emit::iname_constant(vc, K_value, iname); + Emit::iname_constant(vc, K_value, iname);
§8.5. The "perform" function for an action, typically called something like TakeSub, diff --git a/docs/runtime-module/5-chr.html b/docs/runtime-module/5-chr.html index 7c3716fff..b3b92668f 100644 --- a/docs/runtime-module/5-chr.html +++ b/docs/runtime-module/5-chr.html @@ -198,7 +198,7 @@ past state to be maintained. ptc->ptc_package = PR; ptc->ptc_iname = NULL; id_iname = Hierarchy::make_iname_in(PTC_ID_HL, ptc->ptc_package); - Emit::numeric_constant(id_iname, 0); a placeholder: made unique in linking + Emit::numeric_constant(id_iname, 0); a placeholder: made unique in linking text_stream *desc = Str::new(); WRITE_TO(desc, "past tense condition %d", ptc->allocation_id); Sequence::queue(&Chronology::ptc_agent, @@ -254,7 +254,7 @@ then, that past state is available, and can be accessed with a simple function c } Functions::end(save); inter_name *md_iname = Hierarchy::make_iname_in(PTC_VALUE_MD_HL, ptc->ptc_package); - Emit::iname_constant(md_iname, K_value, ptc->ptc_iname); + Emit::iname_constant(md_iname, K_value, ptc->ptc_iname); }
§4.1. Compile code to set the new state of the condition, as measured in the present4.1 = @@ -379,7 +379,7 @@ taken something" would be a past tense condition: see above.) Sequence::queue(&Chronology::ahcr_agent, STORE_POINTER_action_history_condition_record(ahcr), desc); id_iname = Hierarchy::make_iname_in(AHC_ID_HL, ahcr->ahcr_package); - Emit::numeric_constant(id_iname, 0); a placeholder: made unique in linking + Emit::numeric_constant(id_iname, 0); a placeholder: made unique in linking
§7.2. The test compiled here relies entirely on a slew of arrays being correctly @@ -533,7 +533,7 @@ the pattern, and otherwise false. Functions::end(save); inter_name *md_iname = Hierarchy::make_iname_in(AHC_VALUE_MD_HL, ahcr->ahcr_package); - Emit::iname_constant(md_iname, K_value, ahcr->ahcr_iname); + Emit::iname_constant(md_iname, K_value, ahcr->ahcr_iname); }
§9. Utility. Last and very much least:
diff --git a/docs/runtime-module/5-cnj.html b/docs/runtime-module/5-cnj.html
index 204c5592b..5857e46da 100644
--- a/docs/runtime-module/5-cnj.html
+++ b/docs/runtime-module/5-cnj.html
@@ -85,10 +85,10 @@ function togglePopup(material_id) {
inter_name *CV_MODAL_INAME_iname = Hierarchy::find(CV_MODAL_HL);
inter_name *CV_MEANING_iname = Hierarchy::find(CV_MEANING_HL);
- Emit::named_numeric_constant_signed(CV_POS_iname, -1);
- Emit::named_numeric_constant_signed(CV_NEG_iname, -2);
- Emit::named_numeric_constant_signed(CV_MODAL_INAME_iname, -3);
- Emit::named_numeric_constant_signed(CV_MEANING_iname, -4);
+ Emit::named_numeric_constant_signed(CV_POS_iname, -1);
+ Emit::named_numeric_constant_signed(CV_NEG_iname, -2);
+ Emit::named_numeric_constant_signed(CV_MODAL_INAME_iname, -3);
+ Emit::named_numeric_constant_signed(CV_MEANING_iname, -4);
Hierarchy::make_available(CV_POS_iname);
Hierarchy::make_available(CV_NEG_iname);
@@ -508,9 +508,9 @@ packages occur as sub-packages of the relevant verb_form *vf = RETRIEVE_POINTER_verb_form(t->data);
package_request *P = RTVerbs::form_package(vf);
- Emit::iname_constant(Hierarchy::make_iname_in(FORM_VALUE_MD_HL, P), K_value,
+ Emit::iname_constant(Hierarchy::make_iname_in(FORM_VALUE_MD_HL, P), K_value,
RTVerbs::form_fn_iname(vf));
- Emit::numeric_constant(Hierarchy::make_iname_in(FORM_SORTING_MD_HL, P),
+ Emit::numeric_constant(Hierarchy::make_iname_in(FORM_SORTING_MD_HL, P),
(inter_ti) vf->allocation_id);
Compile ConjugateVerbForm function12.1;
diff --git a/docs/runtime-module/5-ins.html b/docs/runtime-module/5-ins.html
index d43a715b1..2f7a4c9a3 100644
--- a/docs/runtime-module/5-ins.html
+++ b/docs/runtime-module/5-ins.html
@@ -352,7 +352,7 @@ using Inter's INSTANCE_IST INST_SHOWME_MD_HL, iname);
}
- Emit::instance(RTInstances::value_iname(I), Instances::to_kind(I), I->enumeration_index);
+ Emit::instance(RTInstances::value_iname(I), Instances::to_kind(I), I->enumeration_index);
if (I->compilation_data.declaration_sequence_number >= 0)
InterNames::annotate_i(RTInstances::value_iname(I), DECLARATION_ORDER_IANN,
(inter_ti) I->compilation_data.declaration_sequence_number);
diff --git a/docs/runtime-module/5-kc.html b/docs/runtime-module/5-kc.html
index d906c7f07..d83527fd9 100644
--- a/docs/runtime-module/5-kc.html
+++ b/docs/runtime-module/5-kc.html
@@ -351,7 +351,7 @@ of the kind which the constructor makes:
if (external) {
K->construct->compilation_data.pr_iname = Hierarchy::make_iname_in(PRINT_FN_HL, R);
inter_name *actual_iname = HierarchyLocations::find_by_name(Emit::tree(), X);
- Emit::iname_constant(K->construct->compilation_data.pr_iname, K_value, actual_iname);
+ Emit::iname_constant(K->construct->compilation_data.pr_iname, K_value, actual_iname);
} else internal_error("internal but unknown kind printing routine");
} else {
if (external) K->construct->compilation_data.pr_iname = HierarchyLocations::find_by_name(Emit::tree(), X);
@@ -359,7 +359,7 @@ of the kind which the constructor makes:
}
return K->construct->compilation_data.pr_iname;
}
-package_request *RTKindConstructors::kind_package(kind *K) {
+package_request *RTKindConstructors::kind_package(kind *K) {
return RTKindConstructors::package(K->construct);
}
inter_name *RTKindConstructors::get_inc_iname(kind *K) {
@@ -539,9 +539,9 @@ parsing names of objects, but not as a grammar token in its own right.
kind *K = Kinds::base_construction(kc);
package_request *pack = RTKindConstructors::package(kc);
- Emit::numeric_constant(RTKindConstructors::xref_iname(kc), 561);
+ Emit::numeric_constant(RTKindConstructors::xref_iname(kc), 561);
- Emit::numeric_constant(RTKindConstructors::weak_ID_iname(kc), 0);
+ Emit::numeric_constant(RTKindConstructors::weak_ID_iname(kc), 0);
Hierarchy::make_available(RTKindConstructors::weak_ID_iname(kc));
TEMPORARY_TEXT(S)
@@ -717,7 +717,7 @@ parsing names of objects, but not as a grammar token in its own right.
inter_name *iname = Hierarchy::make_iname_with_specific_translation(ICOUNT_HL, InterSymbolsTable::render_identifier_unique(LargeScale::main_scope(Emit::tree()), ICN), RTKindConstructors::kind_package(K));
Hierarchy::make_available(iname);
DISCARD_TEXT(ICN)
- Emit::numeric_constant(iname, (inter_ti) Instances::count(K));
+ Emit::numeric_constant(iname, (inter_ti) Instances::count(K));
}
if (Kinds::Behaviour::is_object(K)) {
Hierarchy::apply_metadata_from_number(RTKindConstructors::kind_package(K),
diff --git a/docs/runtime-module/5-ki.html b/docs/runtime-module/5-ki.html
index 722e3ed64..ef734ac71 100644
--- a/docs/runtime-module/5-ki.html
+++ b/docs/runtime-module/5-ki.html
@@ -252,10 +252,10 @@ turns up. This means remembering everything we've seen, using a new structure:
void RTKindIDs::define_constant_as_strong_id(inter_name *iname, kind *K) {
runtime_kind_structure *rks = RTKindIDs::get_rks(K);
if (rks) {
- Emit::iname_constant(iname, K_value, rks->rks_iname);
+ Emit::iname_constant(iname, K_value, rks->rks_iname);
return;
}
- Emit::iname_constant(iname, K_value, RTKindIDs::weak_iname(K));
+ Emit::iname_constant(iname, K_value, RTKindIDs::weak_iname(K));
}
§7. Thus the following routine must return NULL if \(K\) is a kind whose weak
@@ -457,11 +457,11 @@ recursively scanned through for us, so that if we have seen a construction
inter_name *md_iname = Hierarchy::make_iname_in(DK_NEEDED_MD_HL,
rks->rks_package);
if (rks->make_default) {
- Emit::numeric_constant(md_iname, (inter_ti) 1);
+ Emit::numeric_constant(md_iname, (inter_ti) 1);
} else {
- Emit::numeric_constant(md_iname, (inter_ti) 0);
+ Emit::numeric_constant(md_iname, (inter_ti) 0);
}
- Emit::iname_constant(Hierarchy::make_iname_in(DK_STRONG_ID_HL,
+ Emit::iname_constant(Hierarchy::make_iname_in(DK_STRONG_ID_HL,
rks->rks_package), K_value, rks->rks_iname);
}
diff --git a/docs/runtime-module/5-prp.html b/docs/runtime-module/5-prp.html
index 7bc01cd61..2d7ecee67 100644
--- a/docs/runtime-module/5-prp.html
+++ b/docs/runtime-module/5-prp.html
@@ -126,7 +126,7 @@ package already supplied:
return prn->compilation_data.prop_package;
}
-inter_name *RTProperties::iname(property *prn) {
+inter_name *RTProperties::iname(property *prn) {
if (prn == NULL) internal_error("tried to find iname for null property");
if ((Properties::is_either_or(prn)) && (prn->compilation_data.store_in_negation))
return RTProperties::iname(EitherOrProperties::get_negation(prn));
@@ -259,7 +259,7 @@ kit, we'll have to use that one.
(prn->compilation_data.store_in_negation)) continue;
kind *K = Properties::kind_of_contents(prn);
if (K == NULL) internal_error("kindless property");
- Emit::ensure_defaultvalue(K);
+ Emit::ensure_defaultvalue(K);
package_request *pack = RTProperties::package(prn);
inter_name *iname = RTProperties::iname(prn);
@@ -274,7 +274,7 @@ kit, we'll have to use that one.
§7.2. Compile the property name metadata7.2 =
@@ -295,7 +295,7 @@ kit, we'll have to use that one.
§7.4. These provide hints to the code-generator, but should possibly be done as
diff --git a/docs/runtime-module/5-rlb.html b/docs/runtime-module/5-rlb.html
index ed2929b1b..40cd1386f 100644
--- a/docs/runtime-module/5-rlb.html
+++ b/docs/runtime-module/5-rlb.html
@@ -317,7 +317,7 @@ rulebook:
§7.3. Compile shared variables creator function7.3 =
@@ -342,7 +342,7 @@ rulebook:
int countup = BookingLists::length(L);
if (countup == 0) {
- Emit::iname_constant(run_fn_iname, K_value,
+ Emit::iname_constant(run_fn_iname, K_value,
Hierarchy::find(EMPTY_RULEBOOK_INAME_HL));
} else {
Compile run function for a nonempty rulebook7.4.1;
@@ -711,7 +711,7 @@ questionable arrangement, but there it is).
§7.3. Compile the metadata array7.3 =
@@ -1472,7 +1472,7 @@ above: it forces the template layer to generate the cache when first used.
SymbolAnnotation::set_b(InterNames::to_symbol(iname), EXTENT_IANN, 1);
}
} else {
- v2v_iname = Emit::numeric_constant(iname, 0);
+ v2v_iname = Emit::numeric_constant(iname, 0);
}
§3.1. Recall that ends numbered 1, 2, 3, ... are all ways for the scene to end,
@@ -630,7 +630,7 @@ what handles this for the scene in question.
Functions::end(save);
inter_name *md_iname = Hierarchy::make_iname_in(INSTANCE_SSF_MD_HL,
RTInstances::package(sc->as_instance));
- Emit::iname_constant(md_iname, K_value, iname);
+ Emit::iname_constant(md_iname, K_value, iname);
}
§7.1. Show status of this running scene7.1 =
diff --git a/docs/runtime-module/5-tbl.html b/docs/runtime-module/5-tbl.html
index d52817db6..e2dd2c681 100644
--- a/docs/runtime-module/5-tbl.html
+++ b/docs/runtime-module/5-tbl.html
@@ -279,17 +279,17 @@ the values given there.
inter_name *bits_iname = Hierarchy::make_iname_in(COLUMN_BITS_HL,
RTTables::tcu_package(&(t->columns[j])));
- Emit::numeric_constant(bits_iname, (inter_ti) bits);
+ Emit::numeric_constant(bits_iname, (inter_ti) bits);
EmitArrays::iname_entry(bits_iname);
inter_name *identity_iname = Hierarchy::make_iname_in(COLUMN_IDENTITY_HL,
RTTables::tcu_package(&(t->columns[j])));
- Emit::iname_constant(identity_iname, K_value, RTTableColumns::id_iname(tc));
+ Emit::iname_constant(identity_iname, K_value, RTTableColumns::id_iname(tc));
if (bits & TB_COLUMN_NOBLANKBITS) {
EmitArrays::null_entry();
} else {
inter_name *blanks_iname = Hierarchy::make_iname_in(COLUMN_BLANKS_HL,
RTTables::tcu_package(&(t->columns[j])));
- Emit::numeric_constant(blanks_iname, (inter_ti) blanks_array_hwm);
+ Emit::numeric_constant(blanks_iname, (inter_ti) blanks_array_hwm);
EmitArrays::iname_entry(blanks_iname);
}
words_used += 2;
@@ -415,7 +415,7 @@ case.)
Hierarchy::apply_metadata_from_wording(RTTables::package(t),
TABLE_NAME_MD_HL, t->compilation_data.name_for_metadata);
inter_name *iname = Hierarchy::make_iname_in(TABLE_ID_HL, RTTables::package(t));
- Emit::numeric_constant(iname, 0);
+ Emit::numeric_constant(iname, 0);
TEMPORARY_TEXT(S)
WRITE_TO(S, "%+W", Node::get_text(t->headline_fragment));
Hierarchy::apply_metadata(RTTables::package(t), TABLE_PNAME_MD_HL, S);
diff --git a/docs/runtime-module/5-tc.html b/docs/runtime-module/5-tc.html
index 3717527a4..987df93a5 100644
--- a/docs/runtime-module/5-tc.html
+++ b/docs/runtime-module/5-tc.html
@@ -118,7 +118,7 @@ to the column-ID constant, and let the linker choose a value for that.
table_column *tc;
LOOP_OVER(tc, table_column) {
package_request *pack = RTTableColumns::package(tc);
- Emit::numeric_constant(RTTableColumns::id_iname(tc), 0); placeholder value
+ Emit::numeric_constant(RTTableColumns::id_iname(tc), 0); placeholder value
inter_name *kind_iname = Hierarchy::make_iname_in(TABLE_COLUMN_KIND_MD_HL, pack);
RTKindIDs::define_constant_as_strong_id(kind_iname, Tables::Columns::get_kind(tc));
Hierarchy::apply_metadata_from_raw_wording(pack,
diff --git a/docs/runtime-module/5-vrb.html b/docs/runtime-module/5-vrb.html
index 813f05cd9..4f4b9f590 100644
--- a/docs/runtime-module/5-vrb.html
+++ b/docs/runtime-module/5-vrb.html
@@ -424,7 +424,7 @@ compiled code, of course.
inter_name *iname = RTVariables::iname(nlv);
if (nlv->compilation_data.nlv_name_translated == FALSE) {
inter_pair val = RTVariables::initial_value_as_pair(iname, nlv);
- Emit::variable(iname, nlv->nlv_kind, val);
+ Emit::variable(iname, nlv->nlv_kind, val);
} else {
if (nlv->compilation_data.lvalue_nve.iname_form) {
inter_symbol *S = InterNames::to_symbol(iname);
@@ -440,9 +440,9 @@ compiled code, of course.
inter_name *iname = Hierarchy::make_iname_in(INITIAL_MAX_SCORE_HL, pack);
Hierarchy::make_available(iname);
if (VariableSubjects::has_initial_value_set(max_score_VAR)) {
- Emit::initial_value_as_constant(iname, max_score_VAR);
+ Emit::initial_value_as_constant(iname, max_score_VAR);
} else {
- Emit::numeric_constant(iname, 0);
+ Emit::numeric_constant(iname, 0);
}
}
}
@@ -489,7 +489,7 @@ ways:
Holsters::unholster_to_code_val(Emit::tree(), &VH);
}
-inter_pair RTVariables::initial_value_as_pair(inter_name *iname, nonlocal_variable *nlv) {
+inter_pair RTVariables::initial_value_as_pair(inter_name *iname, nonlocal_variable *nlv) {
value_holster VH = Holsters::new(INTER_DATA_VHMODE);
packaging_state save = Packaging::enter_home_of(iname);
RTVariables::holster_initial_value(&VH, nlv);
diff --git a/docs/runtime-module/6-bd.html b/docs/runtime-module/6-bd.html
index 28a86b74e..3f1da1ca5 100644
--- a/docs/runtime-module/6-bd.html
+++ b/docs/runtime-module/6-bd.html
@@ -111,12 +111,12 @@ constants.
inter_name *iname = Hierarchy::find(STORY_HL);
if (VariableSubjects::has_initial_value_set(story_title_VAR)) {
NonlocalVariables::initial_value_as_plain_text(story_title_VAR);
- Emit::initial_value_as_constant(iname, story_title_VAR);
- Emit::initial_value_as_raw_text(Hierarchy::find(STORY_MD_HL),
+ Emit::initial_value_as_constant(iname, story_title_VAR);
+ Emit::initial_value_as_raw_text(Hierarchy::find(STORY_MD_HL),
story_title_VAR);
} else {
- Emit::text_constant_from_wide_string(iname, L"\"Welcome\"");
- Emit::text_constant(Hierarchy::find(STORY_MD_HL), I"Untitled");
+ Emit::text_constant_from_wide_string(iname, L"\"Welcome\"");
+ Emit::text_constant(Hierarchy::find(STORY_MD_HL), I"Untitled");
}
Hierarchy::make_available(iname);
@@ -131,12 +131,12 @@ constants.
inter_name *iname = Hierarchy::find(HEADLINE_HL);
if (VariableSubjects::has_initial_value_set(story_headline_VAR)) {
NonlocalVariables::initial_value_as_plain_text(story_headline_VAR);
- Emit::initial_value_as_constant(iname, story_headline_VAR);
- Emit::initial_value_as_raw_text(Hierarchy::find(HEADLINE_MD_HL),
+ Emit::initial_value_as_constant(iname, story_headline_VAR);
+ Emit::initial_value_as_raw_text(Hierarchy::find(HEADLINE_MD_HL),
story_headline_VAR);
} else {
- Emit::text_constant_from_wide_string(iname, L"\"An Interactive Fiction\"");
- Emit::text_constant(Hierarchy::find(HEADLINE_MD_HL), I"An Interactive Fiction");
+ Emit::text_constant_from_wide_string(iname, L"\"An Interactive Fiction\"");
+ Emit::text_constant(Hierarchy::find(HEADLINE_MD_HL), I"An Interactive Fiction");
}
Hierarchy::make_available(iname);
@@ -151,15 +151,15 @@ constants.
if (VariableSubjects::has_initial_value_set(story_author_VAR)) {
inter_name *iname = Hierarchy::find(STORY_AUTHOR_HL);
NonlocalVariables::initial_value_as_plain_text(story_author_VAR);
- Emit::initial_value_as_constant(iname, story_author_VAR);
+ Emit::initial_value_as_constant(iname, story_author_VAR);
Hierarchy::make_available(iname);
- Emit::initial_value_as_raw_text(Hierarchy::find(AUTHOR_MD_HL),
+ Emit::initial_value_as_raw_text(Hierarchy::find(AUTHOR_MD_HL),
story_author_VAR);
} else {
inter_name *iname = Hierarchy::find(STORY_AUTHOR_HL);
- Emit::unchecked_numeric_constant(iname, 0);
+ Emit::unchecked_numeric_constant(iname, 0);
Hierarchy::make_available(iname);
- Emit::text_constant(Hierarchy::find(AUTHOR_MD_HL), I"Anonymous");
+ Emit::text_constant(Hierarchy::find(AUTHOR_MD_HL), I"Anonymous");
}
- Emit::property(iname, K);
+ Emit::property(iname, K);
inter_name *id_iname = Hierarchy::make_iname_in(PROPERTY_ID_HL, pack);
- Emit::numeric_constant(id_iname, 0); a placeholder
+ Emit::numeric_constant(id_iname, 0); a placeholder
- Emit::numeric_constant(RTRulebooks::id_iname(B), 0); placeholder
+ Emit::numeric_constant(RTRulebooks::id_iname(B), 0); placeholder
TEMPORARY_TEXT(RV)
WRITE_TO(RV, "%+W", Nouns::nominative_singular(nro->name));
- Emit::text_constant(RTRulebooks::nro_iname(nro), RV);
+ Emit::text_constant(RTRulebooks::nro_iname(nro), RV);
DISCARD_TEXT(RV)
@@ -722,7 +722,7 @@ questionable arrangement, but there it is).
inter_name *equated_iname =
Hierarchy::make_iname_in(nro->compilation_data.equated_hl, P);
Hierarchy::make_available(equated_iname);
- Emit::iname_constant(equated_iname, K_value, RTRulebooks::nro_iname(nro));
+ Emit::iname_constant(equated_iname, K_value, RTRulebooks::nro_iname(nro));
diff --git a/docs/runtime-module/5-rls.html b/docs/runtime-module/5-rls.html
index 3438c1d02..4a66d0459 100644
--- a/docs/runtime-module/5-rls.html
+++ b/docs/runtime-module/5-rls.html
@@ -336,7 +336,7 @@ response handlers for foreign rules — see
- Emit::numeric_constant(RTRules::anchor_iname(R), 1105);
+ Emit::numeric_constant(RTRules::anchor_iname(R), 1105);
Hierarchy::apply_metadata_from_iname(P, RULE_VALUE_MD_HL, RTRules::iname(R));
applicability_constraint *acl;
LOOP_OVER_LINKED_LIST(acl, applicability_constraint, R->applicability_constraints) {
diff --git a/docs/runtime-module/5-rlt.html b/docs/runtime-module/5-rlt.html
index b45667fcb..faf7ace54 100644
--- a/docs/runtime-module/5-rlt.html
+++ b/docs/runtime-module/5-rlt.html
@@ -97,7 +97,7 @@ form a bitmap in arbitrary combinations.
void RTRelations::def_bit(int id, inter_ti val) {
inter_name *iname = Hierarchy::find(id);
Hierarchy::make_available(iname);
- Emit::named_numeric_constant_hex(iname, val);
+ Emit::named_numeric_constant_hex(iname, val);
}
void RTRelations::compile_generic_constants(void) {
@@ -250,7 +250,7 @@ therefore be forced with:
void RTRelations::compile(void) {
if (RTRelations::default_iname()) {
inter_name *iname = Hierarchy::find(MEANINGLESS_RR_HL);
- Emit::iname_constant(iname, K_value, RTRelations::default_iname());
+ Emit::iname_constant(iname, K_value, RTRelations::default_iname());
Hierarchy::make_available(iname);
}
@@ -287,10 +287,10 @@ existence at runtime, for the sake of the index.
binary_predicate *bp = RETRIEVE_POINTER_binary_predicate(t->data);
package_request *pack = RTRelations::package(bp);
inter_name *id_iname = Hierarchy::make_iname_in(RELATION_ID_HL, pack);
- Emit::numeric_constant(id_iname, 0);
+ Emit::numeric_constant(id_iname, 0);
if (bp->compilation_data.record_needed) {
inter_name *md_iname = Hierarchy::make_iname_in(RELATION_VALUE_MD_HL, pack);
- Emit::iname_constant(md_iname, K_value, RTRelations::iname(bp));
+ Emit::iname_constant(md_iname, K_value, RTRelations::iname(bp));
}
TEMPORARY_TEXT(desc)
BinaryPredicateFamilies::describe_for_index(desc, bp);
@@ -452,7 +452,7 @@ as their meanings. See the test case EmitCode::up();
Functions::end(save);
inter_name *md_iname = Hierarchy::make_iname_in(RELATION_CREATOR_MD_HL, pack);
- Emit::iname_constant(md_iname, K_value, iname);
+ Emit::iname_constant(md_iname, K_value, iname);
diff --git a/docs/runtime-module/5-si.html b/docs/runtime-module/5-si.html
index 0ceb98c68..317d2f1c0 100644
--- a/docs/runtime-module/5-si.html
+++ b/docs/runtime-module/5-si.html
@@ -175,7 +175,7 @@ occurs, and (b) act upon it.
EmitCode::rfalse();
Functions::end(save);
inter_name *md_iname = Hierarchy::make_iname_in(INSTANCE_SCF_MD_HL, pack);
- Emit::iname_constant(md_iname, K_value, iname);
+ Emit::iname_constant(md_iname, K_value, iname);
}
@@ -172,10 +172,10 @@ constants.
if (VariableSubjects::has_initial_value_set(story_release_number_VAR)) {
inter_name *iname = Hierarchy::find(RELEASE_HL);
- Emit::initial_value_as_constant(iname, story_release_number_VAR);
+ Emit::initial_value_as_constant(iname, story_release_number_VAR);
Hierarchy::make_available(iname);
}
- Emit::initial_value_as_constant(Hierarchy::find(RELEASE_MD_HL),
+ Emit::initial_value_as_constant(Hierarchy::find(RELEASE_MD_HL),
story_release_number_VAR);
@@ -193,8 +193,8 @@ should be able to fake the date-stamp with dates of their own choosing.
int year_digits = (the_present->tm_year) % 100;
WRITE_TO(SN, "%02d%02d%02d",
year_digits, (the_present->tm_mon)+1, the_present->tm_mday);
- Emit::text_constant(Hierarchy::find(SERIAL_MD_HL), BibliographicData::read_uuid());
- Emit::serial_number(iname, SN);
+ Emit::text_constant(Hierarchy::find(SERIAL_MD_HL), BibliographicData::read_uuid());
+ Emit::serial_number(iname, SN);
DISCARD_TEXT(SN)
Hierarchy::make_available(iname);
@@ -207,38 +207,38 @@ not compile to any data in the object code:
- Emit::text_constant(Hierarchy::find(IFID_MD_HL), BibliographicData::read_uuid()); + Emit::text_constant(Hierarchy::find(IFID_MD_HL), BibliographicData::read_uuid()); TEMPORARY_TEXT(lang) inform_language *L = Projects::get_language_of_play(Task::project()); if (L == NULL) WRITE_TO(lang, "English"); else WRITE_TO(lang, "%S", L->as_copy->edition->work->title); - Emit::text_constant(Hierarchy::find(LANGUAGE_MD_HL), lang); + Emit::text_constant(Hierarchy::find(LANGUAGE_MD_HL), lang); DISCARD_TEXT(lang) int E = BibliographicData::episode_number(); if (E >= 0) { - Emit::numeric_constant(Hierarchy::find(EPISODE_NUMBER_MD_HL), (inter_ti) E); + Emit::numeric_constant(Hierarchy::find(EPISODE_NUMBER_MD_HL), (inter_ti) E); TEMPORARY_TEXT(series) WRITE_TO(series, "%w", BibliographicData::series_name()); - Emit::text_constant(Hierarchy::find(SERIES_NAME_MD_HL), series); + Emit::text_constant(Hierarchy::find(SERIES_NAME_MD_HL), series); DISCARD_TEXT(series) } if (VariableSubjects::has_initial_value_set(story_description_VAR)) { - Emit::initial_value_as_raw_text(Hierarchy::find(DESCRIPTION_MD_HL), + Emit::initial_value_as_raw_text(Hierarchy::find(DESCRIPTION_MD_HL), story_description_VAR); } else { - Emit::text_constant(Hierarchy::find(DESCRIPTION_MD_HL), I"None"); + Emit::text_constant(Hierarchy::find(DESCRIPTION_MD_HL), I"None"); } if (VariableSubjects::has_initial_value_set(story_genre_VAR)) { - Emit::initial_value_as_raw_text(Hierarchy::find(GENRE_MD_HL), + Emit::initial_value_as_raw_text(Hierarchy::find(GENRE_MD_HL), story_genre_VAR); } else { - Emit::text_constant(Hierarchy::find(GENRE_MD_HL), I"Fiction"); + Emit::text_constant(Hierarchy::find(GENRE_MD_HL), I"Fiction"); } if (VariableSubjects::has_initial_value_set(story_creation_year_VAR)) { - Emit::initial_value_as_raw_text(Hierarchy::find(YEAR_MD_HL), + Emit::initial_value_as_raw_text(Hierarchy::find(YEAR_MD_HL), story_creation_year_VAR); } else { - Emit::text_constant(Hierarchy::find(YEAR_MD_HL), I"(This year)"); + Emit::text_constant(Hierarchy::find(YEAR_MD_HL), I"(This year)"); }
§5. In-table storage. Some kinds of non-object are created by table, with the table columns holding the diff --git a/docs/runtime-module/6-pv.html b/docs/runtime-module/6-pv.html index 6c181fc28..56372fa16 100644 --- a/docs/runtime-module/6-pv.html +++ b/docs/runtime-module/6-pv.html @@ -173,7 +173,7 @@ value the property will have, and compiles a clause as appropriate. value_holster VH = Holsters::new(INTER_DATA_VHMODE); Properties::compile_inferred_value(&VH, subj, prn); inter_pair val = Holsters::unholster_to_pair(&VH); - Emit::propertyvalue(prn, RTPropertyPermissions::owner(subj), val); + Emit::propertyvalue(prn, RTPropertyPermissions::owner(subj), val); Packaging::exit(Emit::tree(), save); } diff --git a/docs/runtime-module/6-tm.html b/docs/runtime-module/6-tm.html index 7ade5e7b7..ccc8066d9 100644 --- a/docs/runtime-module/6-tm.html +++ b/docs/runtime-module/6-tm.html @@ -79,7 +79,7 @@ at run-time, so we can't know now how many we will need.
int RTMap::compile_model_tables(void) { inter_name *ndi = Hierarchy::find(NO_DIRECTIONS_HL); - Emit::numeric_constant(ndi, (inter_ti) Map::number_of_directions()); + Emit::numeric_constant(ndi, (inter_ti) Map::number_of_directions()); Hierarchy::make_available(ndi); instance *I; diff --git a/docs/runtime-module/6-tp.html b/docs/runtime-module/6-tp.html index 6c3a0ca18..f71377dd5 100644 --- a/docs/runtime-module/6-tp.html +++ b/docs/runtime-module/6-tp.html @@ -101,7 +101,7 @@ function togglePopup(material_id) { void RTPlayer::InitialSituation_define(int id, int val) { inter_name *iname = Hierarchy::find(id); EmitArrays::begin_word(iname, K_value); - Emit::numeric_constant(iname, (inter_ti) val); + Emit::numeric_constant(iname, (inter_ti) val); Hierarchy::make_available(iname); }diff --git a/docs/runtime-module/7-cg.html b/docs/runtime-module/7-cg.html index 6df4039b3..9f5c873af 100644 --- a/docs/runtime-module/7-cg.html +++ b/docs/runtime-module/7-cg.html @@ -126,7 +126,7 @@ fact rewritten it, so that the whole command must be re-parsed afresh. inter_name *RTCommandGrammars::grammar_constant(int N, int V) { inter_name *iname = Hierarchy::find(N); - Emit::numeric_constant(iname, (inter_ti) V); + Emit::numeric_constant(iname, (inter_ti) V); Hierarchy::make_available(iname); return iname; } @@ -326,7 +326,7 @@ those which do, we queue compilation requests with suitable agents. EmitArrays::end(save); if (Wordings::empty(cg->command)) { - Emit::numeric_constant(Hierarchy::make_iname_in(NO_VERB_VERB_DEFINED_HL, PR), + Emit::numeric_constant(Hierarchy::make_iname_in(NO_VERB_VERB_DEFINED_HL, PR), (inter_ti) 1); } } @@ -510,7 +510,7 @@ for the name pr cgl->compilation_data.metadata_package = line; cgl->compilation_data.xref_iname = Hierarchy::make_iname_in(CG_XREF_SYMBOL_HL, line); - Emit::numeric_constant(cgl->compilation_data.xref_iname, 561); + Emit::numeric_constant(cgl->compilation_data.xref_iname, 561); if (cgl->resulting_action) { package_request *R = Hierarchy::package_within(CG_LINES_PRODUCING_HAP, diff --git a/docs/runtime-module/7-cgl.html b/docs/runtime-module/7-cgl.html index b119d04c9..cbeef0025 100644 --- a/docs/runtime-module/7-cgl.html +++ b/docs/runtime-module/7-cgl.html @@ -508,7 +508,7 @@ function to process it. Functions::end(save); inter_name *ma_iname = Hierarchy::find(MISTAKEACTION_HL); - Emit::unchecked_numeric_constant(ma_iname, 10000); + Emit::unchecked_numeric_constant(ma_iname, 10000); InterNames::annotate_b(ma_iname, ACTION_IANN, 1); Hierarchy::make_available(ma_iname); } diff --git a/inform7/Figures/memory-diagnostics.txt b/inform7/Figures/memory-diagnostics.txt index 70d0d04ca..d24239006 100644 --- a/inform7/Figures/memory-diagnostics.txt +++ b/inform7/Figures/memory-diagnostics.txt @@ -1,6 +1,6 @@ -Total memory consumption was 412266K = 403 MB +Total memory consumption was 411466K = 402 MB -66.3% was used for 2045682 objects, in 417122 frames in 342 x 800K = 273600K = 267 MB: +66.2% was used for 2045684 objects, in 417124 frames in 341 x 800K = 272800K = 266 MB: 10.4% linked_list 78564 objects, 43995840 bytes 9.9% inter_tree_node_array 58 x 8192 = 475136 objects, 41813824 bytes @@ -100,7 +100,7 @@ Total memory consumption was 412266K = 403 MB ---- property 146 objects, 19856 bytes ---- timed_rules_rfd_data 400 objects, 19200 bytes ---- pipeline_step 14 objects, 18928 bytes - ---- method 379 objects, 18192 bytes + ---- method 381 objects, 18288 bytes ---- pcalc_prop_deferral 86 objects, 17888 bytes ---- instance 167 objects, 17368 bytes ---- parse_node_tree 20 objects, 17280 bytes @@ -235,9 +235,9 @@ Total memory consumption was 412266K = 403 MB ---- kind_template_definition 1 object, 40 bytes ---- I6_generation_data 1 object, 40 bytes -33.6% was used for memory not allocated for objects: +33.7% was used for memory not allocated for objects: - 19.5% text stream storage 82731208 bytes in 495962 claims + 19.6% text stream storage 82730572 bytes in 495958 claims 1.1% dictionary storage 4871168 bytes in 7265 claims ---- sorting 736 bytes in 3 claims 1.7% source text 7200000 bytes in 3 claims @@ -255,5 +255,5 @@ Total memory consumption was 412266K = 403 MB ---- code generation workspace for objects 1336 bytes in 4 claims ---- emitter array storage 279904 bytes in 1996 claims -20.2% was overhead - 85439880 bytes = 83437K = 81 MB +20.0% was overhead - 84620584 bytes = 82637K = 80 MB diff --git a/inform7/Figures/timings-diagnostics.txt b/inform7/Figures/timings-diagnostics.txt index b552a3d82..3c770c573 100644 --- a/inform7/Figures/timings-diagnostics.txt +++ b/inform7/Figures/timings-diagnostics.txt @@ -1,34 +1,34 @@ 100.0% in inform7 run - 56.4% in compilation to Inter - 41.0% in //Sequence::undertake_queued_tasks// + 56.7% in compilation to Inter + 41.1% in //Sequence::undertake_queued_tasks// 3.6% in //MajorNodes::pre_pass// 2.6% in //MajorNodes::pass_1// - 1.5% in //RTPhrasebook::compile_entries// + 1.6% in //RTPhrasebook::compile_entries// 1.4% in //ImperativeDefinitions::assess_all// - 1.2% in //RTKindConstructors::compile// + 1.3% in //RTKindConstructors::compile// 0.4% in //ImperativeDefinitions::compile_first_block// 0.4% in //MajorNodes::pass_2// 0.4% in //Sequence::undertake_queued_tasks// + 0.4% in //Sequence::undertake_queued_tasks// 0.4% in //World::stage_V// - 0.3% in //Sequence::undertake_queued_tasks// 0.1% in //CompletionModule::compile// 0.1% in //InferenceSubjects::emit_all// 0.1% in //RTKindConstructors::compile_permissions// 0.1% in //Task::make_built_in_kind_constructors// 0.1% in //World::stages_II_and_III// - 1.9% not specifically accounted for - 41.4% in running Inter pipeline - 13.0% in step preparation - 10.2% in inter step 6/14: make-synoptic-module + 2.1% not specifically accounted for + 41.2% in running Inter pipeline + 12.6% in step preparation + 10.0% in inter step 6/14: make-synoptic-module 7.8% in inter step 14/14: generate inform6 -> auto.inf - 4.1% in inter step 5/14: load-binary-kits - 2.8% in inter step 9/14: make-identifiers-unique - 0.3% in inter step 12/14: eliminate-redundant-operations - 0.3% in inter step 4/14: compile-splats - 0.3% in inter step 7/14: shorten-wiring + 4.2% in inter step 5/14: load-binary-kits + 2.7% in inter step 9/14: make-identifiers-unique + 0.4% in inter step 12/14: eliminate-redundant-operations + 0.2% in inter step 4/14: compile-splats + 0.2% in inter step 7/14: shorten-wiring + 0.2% in inter step 8/14: detect-indirect-calls 0.1% in inter step 10/14: reconcile-verbs 0.1% in inter step 11/14: eliminate-redundant-labels - 0.1% in inter step 8/14: detect-indirect-calls - 1.9% not specifically accounted for + 2.0% not specifically accounted for 1.7% in supervisor - 0.4% not specifically accounted for + 0.3% not specifically accounted for diff --git a/inform7/runtime-module/Chapter 2/Emit.w b/inform7/runtime-module/Chapter 2/Emit.w index 5610c8ad3..f965f21ec 100644 --- a/inform7/runtime-module/Chapter 2/Emit.w +++ b/inform7/runtime-module/Chapter 2/Emit.w @@ -25,7 +25,7 @@ inter_tree *Emit::tree(void) { } inter_ti Emit::symbol_id(inter_symbol *S) { - return InterSymbolsTable::id_from_symbol_at_bookmark(Emit::at(), S); + return InterSymbolsTable::id_at_bookmark(Emit::at(), S); } inter_warehouse *Emit::warehouse(void) { @@ -102,31 +102,19 @@ void Emit::kind(inter_name *iname, inter_name *super, inter_ti constructor, int arity, kind **operand_kinds) { packaging_state save = Packaging::enter_home_of(iname); inter_symbol *S = InterNames::to_symbol(iname); - inter_ti SID = 0; - if (S) SID = Emit::symbol_id(S); inter_symbol *SS = (super)?InterNames::to_symbol(super):NULL; - inter_ti SUP = 0; - if (SS) SUP = Emit::symbol_id(SS); inter_ti operands[MAX_KIND_ARITY]; if (arity > MAX_KIND_ARITY) internal_error("kind arity too high"); for (int i=0; i