! LSE$GRAMMAR_PLACEHOLDER.TPU ! !************************************************************************* ! * ! © Copyright 2005 Hewlett-Packard Development Company, L.P. * ! * ! Confidential computer software. Valid license from HP required for * ! possession, use or copying. Consistent with FAR 12.211 and 12.212, * ! Commercial Computer Software, Computer Software Documentation, and * ! Technical Data for Commercial Items are licensed to the U.S. * ! Government under vendor's standard commercial license. * ! * !************************************************************************* ! !++ ! FACILITY: ! VAX Language-Sensitive Editor ! ! ABSTRACT: ! This file contains the Portable/LSE placeholder-related grammar syntax. ! ! ENVIRONMENT: ! Portable/LSE ! ! Author: Diana E. Carroll ! ! CREATION DATE: 10-June-1991 ! ! MODIFIED BY: ! ! X4.0 DEC 10-Jun-91 New module ! X4.0-1 DAS 25-Jun-91 StreamLf this file ! X4.0-2 DEC 08-Aug-91 Implement grammar routines ! X4.0-3 DEC 15-Aug-91 Implement show_placeholder; fix bugs ! X4.0-4 DEC 26-Aug-91 Fixed tabs/spaces in lse_set_body_line ! 05-Sep-91 Added documentation of commands (Mark Metcalfe) ! X4.0-5 ch 7-Sep-91 Added missing local decl for LANG. ! X4.0-6 NMC 9-Sep-91 Use lse$add in add_remove builtins. ! X4.0-7 DAS 23-Sep-91 StreamLf this file ! X4.0-8 SHE 25-Sep-91 Modify indentation of lse_set_placeholder_body_line ! procedure declaration for documentation filters ! X4.0-9 NMC 30-Sep-91 Added error trap for lse_new_placeholder for ! redefined placeholder. ! Ensure no update of current placeholder if add ! operation fails in lse_new_placeholder ! Add lse$compare_lang_pack_elem call to check for ! X4.0-10 DEC 09-Oct-91 Standardize parameter names ! X4.0-11 NMC 10-Oct-91 Modified lse$prompt_lang_elem_param to ! lse$prompt_lang_pack_elem_param ! Modified lse$get_valid_lang_elem to ! lse$get_valid_lang_pack_elem ! X4.0-12 NMC 21-Oct-91 Modified lse_delete_placeholder to take wildcard name ! Fix bug in lse_show_placeholder to make sure we have a ! valid language before the show operation. ! X4.0-13 NMC 22-Oct-91 Updated some Haley Headers. ! X4.0-14 SHE 05-Nov-91 Changed lse_set_placeholder_menu_line's parameter ! ` to be "description" instead of "description_string". ! X4.0-15 DEC 11-Nov-91 Added same-line/next line capability to body lines ! X4.0-16 SHE 18-Dec-91 Added space to description of lse_set_placeholder_ ! menu_line. ! X4.0-17 DEC 08-Jan-92 Changed set placeholder placeholder to set ! placeholder identifier ! X4.0-18 DEC 22-Jan-92 Fixed documention for all commands ! X4.0-19 DEC 18-Feb-92 Parameter and documentation cleanup ! X4.0-20 WC3 22-Feb-92 Doc build fixes ! X4.0-21 WC3 13-Apr-92 Make NEW silently re-initialize instead of issue ! an error when the element exists ! X4.0-22 SHE 4-May-92 Set current language before placeholder ! X4.0-23 SHE 13-May-92 Modified documentation for set_placeholder_inherit ! X4.0-24 SHE 14-May-92 Modified various related commands. ! X4.2 RAM 08-Aug-94 Added lse_set_placeholder_book and ! lse_set_placeholder_reference ! X4.3-1 RAM 22-Feb-95 Comment out Hyperhelp commands. ! ! NOTE - FOR ADDING PROCEDURES ! ! The following is a documentation template which is used with PDF to ! create documentation. When creating a new procedure, copy the template ! above the procedure. The information will be supplied by the documentation ! group. !! ! ONE LINE DEFINITION: ! «TBS» ! ! DESCRIPTION: ! «TBS» ! ! RELATED COMMANDS: ! «TBS» ! ! EXAMPLE: ! «TBS» ! ! CATEGORY: ! «TBS» ! !doc_end ! procedure lse$grammar_placeholder_module_ident return "4.6-2"; endprocedure; procedure lse_new_placeholder (; placeholder_name, placeholder_type, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Creates a placeholder for use with the specified language. ! ! DESCRIPTION: ! (NEW PLACEHOLDER) ! (NEW PLACEHOLDERSee also SET PLACEHOLDER commands) ! (Placeholdercreating a new) ! This command creates and establishes the characteristics of ! a placeholder for use with a particular language. LSE prompts ! you to specify a placeholder name and placeholder type. ! If you do not specify a language name, LSE uses the currently ! defined language. These language and placeholder names become ! the defaults for subsequent SET PLACEHOLDER commands. ! ! RELATED COMMANDS: ! DELETE PLACEHOLDER ! EXTRACT NEW PLACEHOLDER ! EXPAND ! EXTRACT PLACEHOLDER ! HELP INDICATED ! NEW TOKEN ! SET PLACEHOLDER commands ! SHOW PLACEHOLDER ! ! CATEGORY: ! Language ! !doc_end ! local temp_val, plac_type, lang, lang_name, plac_name, plac; ON_ERROR [LSE$_PLCHDEFINED]: eve$message( ERROR_TEXT ); lse$post_command_proc; RETURN FALSE; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_new_placeholder"); ENDON_ERROR; lse_new_placeholder := FALSE; ! ! get the placeholder name and language name ! if NOT lse$prompt_lang_pack_elem_param( placeholder_name, LSE$PLACEHOLDER, defined_language, LSE$LANGUAGE, plac_name, lang_name) then lse$post_command_proc; return; endif; ! ! get the language from the name ! lang := get_info(lang_name, 'lse$language_type'); if lang = tpu$k_unspecified then eve$message (lse$_langnotdef, 0, lang_name); lse$post_command_proc; return; endif; ! ! get the placeholder type ! if lse$prompt_list (placeholder_type, plac_type, lse$_plactypeprompt, lse$_placdelimit, lse$_plactypelist, false, '', lse$_placdeftype) then case plac_type from 1 to 4 [1]: plac_type := lse$terminal; [2]: plac_type := lse$nonterminal; [3]: plac_type := lse$menu; [4]: plac_type := lse$alias; endcase; ! Check for already exising ! plac := get_info( lang, 'lse$find_placeholder', plac_name ); if get_info( plac, 'type' ) = LSE$PLACEHOLDER_TYPE then lse$delete_placeholder( plac ); endif; ! ! create the placeholder ! plac := lse$create_placeholder(plac_name, plac_type); ! associated the placeholder with the language ! if set(lse$placeholder, lang, plac, lse$add) then ! set the current language and placeholder ! lse$set_curr_lang_element(lang); lse$set_curr_lang_element(plac); lse_new_placeholder := TRUE; endif; endif; lse$post_command_proc; endprocedure; ! lse_new_placeholder procedure lse_set_placeholder_auto_substitute (; boolean, defined_placeholder, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Specifies whether to replace the next occurrence of this placeholder ! with the text typed over the current one. ! ! DESCRIPTION: ! (SET PLACEHOLDER AUTO SUBSTITUTE) ! (SET PLACEHOLDER commandsSET PLACEHOLDER AUTO SUBSTITUTE) ! (Placeholderautomatically substituting) ! ! RELATED COMMANDS: ! EXTRACT PLACEHOLDER ! NEW PLACEHOLDER ! SET PLACEHOLDER commands ! SHOW PLACEHOLDER ! ! CATEGORY: ! Language ! !doc_end ! local plac, language, local_boolean; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_placeholder_auto_substitute"); ENDON_ERROR; if NOT lse$prompt_boolean( boolean, local_boolean, lse$_placautoprompt, "", lse$_placdefauto) then lse$post_command_proc; return FALSE; endif; ! get the placeholder if NOT lse$get_valid_lang_pack_elem ( defined_placeholder, LSE$PLACEHOLDER, defined_language, LSE$LANGUAGE, plac, language ) then lse$post_command_proc; return FALSE; endif; set( lse$auto_substitute, plac, local_boolean ); lse$set_curr_lang_element(language); lse$set_curr_lang_element(plac); lse$post_command_proc; return TRUE; endprocedure; ! lse_set_placeholder_auto_substitute procedure lse_set_placeholder_pseudocode (; boolean, defined_placeholder, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Specifies whether you can enter pseudocode at this placeholder. ! ! DESCRIPTION: ! (SET PLACEHOLDER PSEUDOCODE) ! (SET PLACEHOLDER commandsSET PLACEHOLDER PSEUDOCODE) ! (Placeholderentering pseudocode) ! ! RELATED COMMANDS: ! ENTER PSEUDOCODE ! EXTRACT PLACEHOLDER ! NEW PLACEHOLDER ! SHOW PLACEHOLDER ! ! CATEGORY: ! Language ! !doc_end ! local plac, language, local_boolean; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_placeholder_pseudocode"); ENDON_ERROR; if NOT lse$prompt_boolean( boolean, local_boolean, lse$_placpseudoprompt, "", lse$_placdefpseudo) then lse$post_command_proc; return FALSE; endif; ! get the placeholder if NOT lse$get_valid_lang_pack_elem ( defined_placeholder, LSE$PLACEHOLDER, defined_language, LSE$LANGUAGE, plac, language ) then lse$post_command_proc; return FALSE; endif; set( lse$pseudocode_allowed, plac, local_boolean); lse$set_curr_lang_element(language); lse$set_curr_lang_element(plac); lse$post_command_proc; return true; endprocedure; ! lse_set_placeholder_pseudocode procedure lse_set_placeholder_description (; description, defined_placeholder, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Specifies text for a placeholder description. ! ! DESCRIPTION: ! (SET PLACEHOLDER DESCRIPTION) ! (SET PLACEHOLDER commandsSET PLACEHOLDER DESCRIPTION) ! (Placeholdersetting descriptions) ! Specifies a single line of text to be displayed along with the ! placeholder name when the placeholder name appears in a menu during ! expansion of a menu type placeholder. ! ! RELATED COMMANDS: ! EXTRACT PLACEHOLDER ! NEW PLACEHOLDER ! SHOW PLACEHOLDER ! ! CATEGORY: ! Language ! !doc_end ! local plac, language, local_string; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_placeholder_description"); ENDON_ERROR; ! get the string if NOT lse$prompt_string ( description, local_string, lse$_placdescprompt ) then lse$post_command_proc; return FALSE; endif; ! get the placeholder if NOT lse$get_valid_lang_pack_elem ( defined_placeholder, LSE$PLACEHOLDER, defined_language, LSE$LANGUAGE, plac, language ) then lse$post_command_proc; return FALSE; endif; set(lse$description, plac, local_string); lse$set_curr_lang_element(language); lse$set_curr_lang_element(plac); lse$post_command_proc; return TRUE; endprocedure; ! lse_set_placeholder_description procedure lse_set_placeholder_duplication (; duplication, defined_placeholder, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Specifies whether a list placeholder is duplicated horizontally or ! vertically. ! ! DESCRIPTION: ! (SET PLACEHOLDER DUPLICATION) ! (SET PLACEHOLDER commandsSET PLACEHOLDER DUPLICATION) ! (Placeholdercontrolling duplication) ! A list placeholder is duplicated when you type over it. This command ! specifies whether the duplicated placeholder appears on the same line ! as the current one, the next line, or either depending on context. ! ! RELATED COMMANDS: ! EXTRACT PLACEHOLDER ! NEW PLACEHOLDER ! SET PLACEHOLDER commands ! SHOW PLACEHOLDER ! ! CATEGORY: ! Language ! !doc_end ! local the_response, plac, language; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_placeholder_duplication"); ENDON_ERROR; ! get duplication keyword if lse$prompt_list (duplication, the_response, lse$_placduplprompt, lse$_placdelimit, lse$_placduplist, false, '', lse$_placdefdupl) then case the_response from 1 to 3 [1]: the_response := lse$context_dependent; [2]: the_response := lse$horizontal; [3]: the_response := lse$vertical; endcase; else lse$post_command_proc; return false; endif; ! get the placeholder if NOT lse$get_valid_lang_pack_elem ( defined_placeholder, LSE$PLACEHOLDER, defined_language, LSE$LANGUAGE, plac, language ) then lse$post_command_proc; return FALSE; endif; set( lse$duplication, plac, the_response ); lse$set_curr_lang_element(language); lse$set_curr_lang_element(plac); lse$post_command_proc; return true; endprocedure; ! lse_set_placeholder_duplication procedure lse_set_placeholder_leading (; text_string, defined_placeholder, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Identifies leading text to be associated with a placeholder. ! ! DESCRIPTION: ! (SET PLACEHOLDER LEADING) ! (SET PLACEHOLDER commandsSET PLACEHOLDER LEADING) ! LSE recognizes this text and erases it when the associated placeholder ! is erased. ! The leading text must not have any trailing blank spaces ! because the ERASE PLACEHOLDER command always skips over such spaces. ! ! RELATED COMMANDS: ! EXTRACT PLACEHOLDER ! NEW PLACEHOLDER ! SHOW PLACEHOLDER ! ! CATEGORY: ! Language ! !doc_end ! local plac, language, local_string; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_placeholder_leading"); ENDON_ERROR; ! get the string if NOT lse$prompt_string ( text_string, local_string, lse$_langbeginprompt) then lse$post_command_proc; return FALSE; endif; ! get the placeholder if NOT lse$get_valid_lang_pack_elem ( defined_placeholder, LSE$PLACEHOLDER, defined_language, LSE$LANGUAGE, plac, language ) then lse$post_command_proc; return FALSE; endif; set(lse$leading_text, plac, local_string); lse$set_curr_lang_element(language); lse$set_curr_lang_element(plac); lse$post_command_proc; return TRUE; endprocedure; ! lse_set_placeholder_leading procedure lse_set_placeholder_inherit (; placeholder_name, defined_placeholder, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Causes a placeholder to inherit the definition of another placeholder. ! ! DESCRIPTION: ! (SET PLACEHOLDER INHERIT) ! (SET PLACEHOLDER commandsSET PLACEHOLDER INHERIT) ! (Placeholderinheriting definitions) ! The placeholder specified for the (defined_placeholder) ! parameter will inherit the definition of the placeholder ! specified for the (placeholder_name) parameter. ! This command is valid only on alias-type placeholders. Since ! placeholders of this type inherit all their attributes from ! the specified defined placeholder, no other attributes can be ! set on them. A placeholder defined with this ! command may not be used to define any other placeholder. ! ! RELATED COMMANDS: ! EXTRACT PLACEHOLDER ! NEW PLACEHOLDER ! SHOW PLACEHOLDER ! ! CATEGORY: ! Language ! !doc_end ! local local_string, plac, language; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_placeholder_inherit"); ENDON_ERROR; ! get the placeholder name string if NOT lse$prompt_string ( placeholder_name, local_string, lse$_placnamprompt ) then lse$post_command_proc; return FALSE; endif; ! get the placeholder if NOT lse$get_valid_lang_pack_elem ( defined_placeholder, LSE$PLACEHOLDER, defined_language, LSE$LANGUAGE, plac, language ) then lse$post_command_proc; return FALSE; endif; set(lse$placeholder, plac, local_string); lse$set_curr_lang_element(language); lse$set_curr_lang_element(plac); lse$post_command_proc; return TRUE; endprocedure; ! lse_set_placeholder_inherit procedure lse_set_placeholder_separator (; text_string, defined_placeholder, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Specifies the string that separates each duplication of the placeholder. ! ! DESCRIPTION: ! (SET PLACEHOLDER SEPARATOR) ! (SET PLACEHOLDER commandsSET PLACEHOLDER SEPARATOR) ! LSE recognizes this text and erases it when the placeholder is ! erased, as it does with leading and trailing text. ! ! RELATED COMMANDS: ! EXTRACT PLACEHOLDER ! NEW PLACEHOLDER ! SHOW PLACEHOLDER ! ! CATEGORY: ! Language ! !doc_end ! local plac, language, local_string; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_placeholder_separator"); ENDON_ERROR; ! get the string if NOT lse$prompt_string ( text_string, local_string, lse$_placsepprompt ) then lse$post_command_proc; return FALSE; endif; ! get the placeholder if NOT lse$get_valid_lang_pack_elem ( defined_placeholder, LSE$PLACEHOLDER, defined_language, LSE$LANGUAGE, plac, language ) then lse$post_command_proc; return FALSE; endif; set(lse$separator_text, plac, local_string); lse$set_curr_lang_element(language); lse$set_curr_lang_element(plac); lse$post_command_proc; return TRUE; endprocedure; ! lse_set_placeholder_separator procedure lse_set_placeholder_help_topic (; help_topic, defined_placeholder, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Sets the help topic string for the given placeholder. ! ! DESCRIPTION: ! (SET PLACEHOLDER HELP TOPIC) ! (SET PLACEHOLDER commandsSET PLACEHOLDER HELP TOPIC) ! (Help topic) ! (Placeholdersetting help topics) ! This command specifies a string that LSE uses to to retrieve ! help text for a placeholder. ! The help topic string is appended to the string you specify with the SET ! LANGUAGE HELP TOPIC command to form the complete string of topics that LSE ! uses for looking up the help text for this placeholder. ! ! RELATED COMMANDS: ! EXTRACT PLACEHOLDER ! NEW PLACEHOLDER ! SET LANGUAGE HELP TOPIC ! SHOW PLACEHOLDER ! ! CATEGORY: ! Language ! !doc_end ! local plac, language, local_string; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_placeholder_help_topic"); ENDON_ERROR; ! get the string if NOT lse$prompt_string ( help_topic, local_string, lse$_langtopicprompt ) then lse$post_command_proc; return FALSE; endif; ! get the placeholder if NOT lse$get_valid_lang_pack_elem ( defined_placeholder, LSE$PLACEHOLDER, defined_language, LSE$LANGUAGE, plac, language ) then lse$post_command_proc; return FALSE; endif; set(lse$help_topic, plac, local_string); lse$set_curr_lang_element(language); lse$set_curr_lang_element(plac); lse$post_command_proc; return TRUE; endprocedure; ! lse_set_placeholder_help_topic procedure lse_set_placeholder_trailing (; text_string, defined_placeholder, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Specifies any trailing text to be associated with the placeholder. ! ! DESCRIPTION: ! (SET PLACEHOLDER TRAILING) ! (SET PLACEHOLDER commandsSET PLACEHOLDER TRAILING) ! (Placeholdersetting trailing text) ! This command recognizes this text and erases it along with the ! placeholder. The trailing text must not have any leading blank spaces ! or tabs because the ERASE PLACEHOLDER command always skips over such spaces. ! ! RELATED COMMANDS: ! EXTRACT PLACEHOLDER ! NEW PLACEHOLDER ! SET PLACEHOLDER commands ! SHOW PLACEHOLDER ! ! CATEGORY: ! Language ! !doc_end ! local plac, language, local_string; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_placeholder_trailing"); ENDON_ERROR; ! get the string if NOT lse$prompt_string ( text_string, local_string, lse$_langtrailprompt ) then lse$post_command_proc; return FALSE; endif; ! get the placeholder if NOT lse$get_valid_lang_pack_elem ( defined_placeholder, LSE$PLACEHOLDER, defined_language, LSE$LANGUAGE, plac, language ) then lse$post_command_proc; return FALSE; endif; set(lse$trailing_text, plac, local_string); lse$set_curr_lang_element(language); lse$set_curr_lang_element(plac); lse$post_command_proc; return TRUE; endprocedure; ! lse_set_placeholder_trailing procedure lse_set_placeholder_body_line (; body_string, indent_type, indent_column, tab_or_space, same_next_line, add_remove, defined_placeholder, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Specifies a body line of a nonterminal type placeholder. ! ! DESCRIPTION: ! (SET PLACEHOLDER BODY LINE) ! (SET PLACEHOLDER commandsSET PLACEHOLDER BODY LINE) ! (Placeholderspecifying a body line) ! (Placeholdernonterminal) ! (Nonterminal placeholder) ! The body of a nonterminal placeholder is the text of the placeholder ! expansion; when a nonterminal placeholder is expanded, the placeholder ! name and enclosing delimiters are replaced with the text of the ! placeholder body. This command is valid only for nonterminal type ! placeholders. !

! The parameters for this command allow you to specify the format ! of the body when it is expanded. See the parameter glossary for ! a detailed explanation of how these work. ! ! RELATED COMMANDS: ! EXTRACT PLACEHOLDER ! NEW PLACEHOLDER ! SHOW PLACEHOLDER ! ! CATEGORY: ! Language ! !doc_end ! local same_line, plac, language, local_keyword, local_int, local_type, local_string, tok_line, add_flag; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_placeholder_body_line"); ENDON_ERROR; ! get the string (allowed to be "") if body_string = '' then local_string := ''; else if NOT lse$prompt_string ( body_string, local_string, lse$_placbodyprompt ) then lse$post_command_proc; return FALSE; endif; endif; ! get keyword if NOT lse$prompt_list ( indent_type, local_keyword, lse$_placindkeyprompt, lse$_placdelimit, lse$_plackwrdlist, false, '', lse$_placdefindkwrd) then lse$post_command_proc; return FALSE; endif; case local_keyword from 1 to 5 [1] : local_keyword := lse$expand; [2] : local_keyword := lse$current; [3] : local_keyword := lse$previous; [4] : local_keyword := lse$fixed; endcase; ! get integer if NOT lse$prompt_number ( indent_column, local_int, lse$_placindnumprompt, '', lse$_placdefindnum ) then lse$post_command_proc; return FALSE; endif; ! get type if NOT lse$prompt_list ( tab_or_space, local_type, lse$_placindtypeprompt, lse$_placdelimit, lse$_placindtypelist, false, '', lse$_placdefindtype ) then lse$post_command_proc; return false; endif; case local_type from 1 to 2 [1] : local_type := lse$space; [2] : local_type := lse$tab; endcase; ! get add_remove if NOT lse$prompt_add_remove( add_remove, add_flag, '', '', lse$_langdefaddrmv ) then lse$post_command_proc; return FALSE; endif; ! get same/next line if NOT lse$prompt_list ( same_next_line, same_line, lse$_placlineprompt, lse$_placdelimit, lse$_placlinelist, false, '', lse$_placdefline) then lse$post_command_proc; return FALSE; endif; case same_line from 1 to 2 [1] : same_line := false; [2] : same_line := true; endcase; ! get the placeholder if NOT lse$get_valid_lang_pack_elem ( defined_placeholder, LSE$PLACEHOLDER, defined_language, LSE$LANGUAGE, plac, language ) then lse$post_command_proc; return FALSE; endif; ! create a token line with associated values tok_line := lse$create_token_line(); set(lse$lines_string, tok_line, local_string); set(lse$lines_indent, tok_line, local_keyword); set(lse$lines_integer, tok_line, local_int); set(lse$lines_indent_type, tok_line, local_type); set(lse$same_line, tok_line, same_line); ! set the token line into the placeholder lse_set_placeholder_body_line := set(lse$token_line, plac, tok_line, add_flag); lse$set_curr_lang_element(language); lse$set_curr_lang_element(plac); lse$post_command_proc; endprocedure; ! lse_set_placeholder_body procedure lse_set_placeholder_menu_line (; body_string, description, menu_line_type, list_boolean, add_remove, defined_placeholder, defined_language ) !doc_begin ! ! ONE LINE DEFINITION: ! Specifies a line of menu that is displayed when a menu-type placeholder ! is expanded. ! ! DESCRIPTION: ! (SET PLACEHOLDER MENU LINE) ! (SET PLACEHOLDER commandsSET PLACEHOLDER MENU LINE) ! (Placeholdersetting menu lines) ! Each line of the body of a menu placeholder represents one option in the ! menu. When you expand a menu-type placeholder, you can select one option ! from the menu. An option can be a string of text, a token, or a ! placeholder name. If a text option is selected, the placeholder will ! be replaced by that text. If a placeholder option is selected, the ! selected name, enclosed in placeholder delimiters, will be ! substituted. If a token is selected, the token name will be substituted. !

! If the menu option given is a placeholder, then you can indicate ! whether it should be expanded as a list placeholder or not. ! ! RELATED COMMANDS: ! EXTRACT PLACEHOLDER ! NEW PLACEHOLDER ! SHOW PLACEHOLDER ! ! CATEGORY: ! Language ! !doc_end ! local lang_menu, local_kwrd, plac, language, local_body_string, local_desc_string, add_flag, local_boolean, local_keyword; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_placeholder_menu_line"); ENDON_ERROR; ! get the body (allowed to be '') if body_string = '' then local_body_string := ''; else if NOT lse$prompt_string ( body_string, local_body_string, lse$_placbodyprompt ) then lse$post_command_proc; return FALSE; endif; endif; ! get the description string ! (this parameter is optional, so allow it to be '') if description <> '' then if NOT lse$prompt_string ( description, local_desc_string, lse$_placdescprompt ) then lse$post_command_proc; return FALSE; endif; else local_desc_string := ''; endif; ! get the indent type keyword if NOT lse$prompt_list ( menu_line_type, local_keyword, lse$_toklinetypeprompt, lse$_toklinedelimit, lse$_toklinetypelist, false, '', lse$_toklinedeftype) then lse$post_command_proc; return FALSE; endif; case local_keyword from 1 to 3 [1] : local_keyword := lse$token; [2] : local_keyword := lse$placeholder; [3] : local_keyword := lse$text; endcase; ! get the boolean value for whether it is a list placeholder or not if local_keyword = lse$placeholder then if NOT lse$prompt_boolean( list_boolean, local_boolean, lse$_placlistprompt, "", lse$_placdeflist) then lse$post_command_proc; return FALSE; endif; else local_boolean := false; endif; ! get the add or remove parameter if lse$prompt_add_remove( add_remove, add_flag, '', '', lse$_langdefaddrmv ) <> true then lse$post_command_proc; return FALSE; endif; ! get the placeholder if NOT lse$get_valid_lang_pack_elem ( defined_placeholder, LSE$PLACEHOLDER, defined_language, LSE$LANGUAGE, plac, language ) then lse$post_command_proc; return FALSE; endif; ! create a language menu entry lang_menu := lse$create_language_menu(); set(lse$placeholder_or_token, lang_menu, local_keyword); set(lse$description, lang_menu, local_desc_string); set(lse$list_delimit, lang_menu, local_boolean); set(lse$menu_string, lang_menu, local_body_string); ! add or delete lang_menu to list in placeholder lse_set_placeholder_menu_line := set(lse$menu_entries, plac, lang_menu, add_flag); lse$set_curr_lang_element(language); lse$set_curr_lang_element(plac); lse$post_command_proc; endprocedure; ! lse_set_placeholder_menu_line procedure lse_set_placeholder_terminal_line (; body_string, add_remove, defined_placeholder, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Specifies a line of a terminal-type placeholder. ! ! DESCRIPTION: ! (SET PLACEHOLDER TERMINAL LINE) ! (SET PLACEHOLDER commandsSET PLACEHOLDER TERMINAL LINE) ! (Placeholderterminal placeholder) ! (Terminal placeholder) ! This body of a terminal placeholder appears in a separate ! temporary buffer when the placeholder is expanded. The placeholder ! is not replaced in the current buffer. This command is valid ! only for terminal-type placeholders. ! ! RELATED COMMANDS: ! EXTRACT PLACEHOLDER ! NEW PLACEHOLDER ! SHOW PLACEHOLDER ! ! CATEGORY: ! Language ! !doc_end ! local plac, language, add_flag, local_string; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_placeholder_terminal_line"); ENDON_ERROR; lse_set_placeholder_terminal_line := FALSE; ! get the string (allowed to be null) if body_string = '' then local_string := ''; else if NOT lse$prompt_string ( body_string, local_string, lse$_placbodyprompt) then lse$post_command_proc; return FALSE; endif; endif; ! get the add or remove parameter if lse$prompt_add_remove( add_remove, add_flag, '', '', lse$_langdefaddrmv ) <> true then lse$post_command_proc; return FALSE; endif; ! get the placeholder if lse$get_valid_lang_pack_elem ( defined_placeholder, LSE$PLACEHOLDER, defined_language, LSE$LANGUAGE, plac, language ) then lse_set_placeholder_terminal_line := set( lse$terminal_text, plac, local_string, add_flag); endif; lse$post_command_proc; endprocedure; ! lse_set_placeholder_terminal_line procedure lse_show_placeholder (; placeholder_name_wild, defined_language) ! Displays complete information about the indicated placeholders in the ! language specified. Wildcard is accepted for the placeholder name only. ! If a single placeholder is input, all attributes associated with the ! placeholder is displayed. If wildcarded placeholder names are input, brief ! information for each placeholder is displayed. ! !doc_begin ! ! ONE LINE DEFINITION: ! Displays the definitions and characteristics ! of one or more placeholders. ! ! DESCRIPTION: ! (SHOW PLACEHOLDER) ! (Placeholdershowing) ! If you specify a placeholder name, LSE displays all the attributes ! associated with that placeholder. If you specify a wildcard ! placeholder name, ! LSE displays brief information about each matching placeholder. !

! You can navigate through the list using Ctrl/F (forward) ! and Ctrl/B (reverse). Ctrl/E (expand) lets you ! display full information about the indicated placeholder. ! The COLLAPSE command reverts back to the brief display. ! ! RELATED COMMANDS: ! EXTRACT PLACEHOLDER ! NEW PLACEHOLDER ! SET PLACEHOLDER commands ! ! CATEGORY: ! Language ! !doc_end ! local saved_lang, the_lang, plac_name_pattern, the_lang_name; ON_ERROR [OTHERWISE]: if saved_lang <> 0 then lse$set_curr_lang_element(saved_lang); endif; lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_show_placeholder"); ENDON_ERROR; lse_show_placeholder := FALSE; ! Get the placeholder ! if lse$prompt_lang_pack_elem_param ( placeholder_name_wild, LSE$PLACEHOLDER, defined_language, LSE$LANGUAGE, plac_name_pattern, the_lang_name ) then the_lang := get_info(the_lang_name, 'lse$language_type'); if the_lang <> tpu$k_unspecified then ! Saved the current language ! saved_lang := lse$get_curr_lang_element(LSE$LANGUAGE); lse$set_curr_lang_element(the_lang); ! Do the show ! if lse$shlst_process( plac_name_pattern, lse$placeholder_list ) then lse_show_placeholder := TRUE; else ! Restore the current language ! lse_show_placeholder := FALSE; lse$set_curr_lang_element(saved_lang); endif; else eve$message (lse$_langnotdef, 0, the_lang_name); endif; endif; lse$post_command_proc; endprocedure; ! lse_show_placeholder procedure lse_extract_placeholder( ; placeholder_name_wild, language_name_wild ) ! DESCRIPTION: ! ! Extracts the definition of an placeholder and formats it as portable ! commands. Wildcarded names are accepted for both placeholder and language ! name. In the lattar case, all placeholder(s) definition associated with one ! or more languages are extracted. ! «TBS» ! !doc_begin ! ! ONE LINE DEFINITION: ! Extracts the definition of the specified placeholder(s). ! ! DESCRIPTION: ! (EXTRACT PLACEHOLDER) ! (Placeholderextracting) ! LSE inserts the indicated definitions at the end of the current ! buffer in a form that lets them be executed with the EXECUTE ! BUFFER PLSE command. ! ! RELATED COMMANDS: ! EXTRACT NEW PLACEHOLDER ! NEW PLACEHOLDER ! SET PLACEHOLDER commands ! SHOW PLACEHOLDER ! ! CATEGORY: ! Language ! !doc_end ! local plac_name_pattern, lang_name_pattern; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_extract_placeholder"); ENDON_ERROR; lse_extract_placeholder := FALSE; ! make sure the buffer we are extracting into is modifiable ! if get_info(current_buffer, "modifiable") <> true then eve$message(lse$_unmodifiable, 0, 'EXTRACT LANGUAGE'); lse$post_command_proc; return false; endif; ! ! go to the bottom of the buffer, and start inserting. ! save the position so we can return to the point we started ! inserting at. ! lse_bottom; copy_text(" "); position(line_begin); lse$$push_position; position(line_end); if lse$prompt_lang_pack_elem_param( placeholder_name_wild, LSE$PLACEHOLDER, language_name_wild, LSE$LANGUAGE, plac_name_pattern, lang_name_pattern ) then lse_extract_placeholder := lse$extract_lang_pack_elem(plac_name_pattern, lse$placeholder, lang_name_pattern, lse$language, FALSE) endif; lse$post_command_proc; endprocedure; !lse_extract_placeholder procedure lse_extract_new_placeholder( ; placeholder_name_wild, language_name_wild ) ! ! Extracts the definition of an placeholder and formats it as portable ! commands. Only definitions created in the current editing session will be ! extracted. Wildcarded names are accepted for both placeholder and language ! name. In the lattar case, all placeholder(s) definition associated with one ! or more languages are extracted. ! !doc_begin ! ! ONE LINE DEFINITION: ! Extracts the definition of the specified placeholder(s) defined during ! this editing session. ! ! DESCRIPTION: ! (EXTRACT NEW PLACEHOLDER) ! (Placeholderextracting) ! LSE inserts the indicated definitions at the end of the current ! buffer in a form that lets them be executed with the EXECUTE ! BUFFER PLSE command. ! ! RELATED COMMANDS: ! EXTRACT PLACEHOLDER ! NEW PLACEHOLDER ! SET PLACEHOLDER commands ! SHOW PLACEHOLDER ! ! CATEGORY: ! Language ! !doc_end ! local plac_name_pattern, lang_name_pattern; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_extract_new_placeholder"); ENDON_ERROR; lse_extract_new_placeholder := FALSE; if lse$prompt_lang_pack_elem_param( placeholder_name_wild, LSE$PLACEHOLDER, language_name_wild, LSE$LANGUAGE, plac_name_pattern, lang_name_pattern ) then lse_extract_new_placeholder := lse$extract_lang_pack_elem(plac_name_pattern, LSE$PLACEHOLDER, lang_name_pattern, LSE$LANGUAGE, TRUE) endif; lse$post_command_proc; endprocedure; !lse_extract_new_placeholder procedure lse_delete_placeholder (; placeholder_name_wild, language_name_wild) ! ! Deletes the indicated placeholder(s) for the specified language(s). ! Wildcards are accepted for both placeholder and language names. ! !doc_begin ! ! ONE LINE DEFINITION: ! Deletes the definition of one or more placeholders associated with the ! specified language. ! ! DESCRIPTION: ! (DELETE PLACEHOLDER) ! (Placeholderdeleting) ! Wildcards are accepted for both placeholder and language names. ! If you do not specify a placeholder or language name, LSE uses the ! current placeholder and language. ! If the placeholder you are deleting is the current placeholder, ! then the current placeholder element is set to UNSPECIFIED. ! Otherwise, neither the current placeholder nor the current language ! are set as a result of this command. ! ! RELATED COMMANDS: ! EXTRACT NEW PLACEHOLDER ! EXTRACT PLACEHOLDER ! NEW PLACEHOLDER ! SET PLACEHOLDER commands ! SHOW PLACEHOLDER ! ! CATEGORY: ! Language ! !doc_end ! local lang_name_pattern, plac_name_pattern; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_delete_placeholder"); ENDON_ERROR; lse_delete_placeholder := FALSE; ! Get the placeholder ! if lse$prompt_lang_pack_elem_param( placeholder_name_wild, LSE$PLACEHOLDER, language_name_wild, LSE$LANGUAGE, plac_name_pattern, lang_name_pattern ) then lse_delete_placeholder := lse$delete_lang_pack_elem( plac_name_pattern, LSE$PLACEHOLDER, lang_name_pattern, LSE$LANGUAGE ); endif; lse$post_command_proc; endprocedure; ! lse_delete_placeholder !-Hyperhelp !procedure lse_set_placeholder_reference (; book_reference, defined_placeholder, ! defined_language) !-Hyperhelp - added comments surrounding doc_begin and doc_end ! !doc_begin ! ! ONE LINE DEFINITION: ! Specifies a book reference tag string, defining the section of an ! online book to display for a placeholder. ! ! DESCRIPTION: ! (SET PLACEHOLDER REFERENCE) ! (SET PLACEHOLDER commandsSET PLACEHOLDER REFERENCE) ! (Help reference) ! (Placeholdersetting book reference tag strings) ! ! LSE uses a VAX DOCUMENT reference tag string to retrieve online ! text for a placeholder. If you do not specify a ! reference with SET PLACEHOLDER REFERENCE, LSE defaults to the book ! section referenced in the SET LANGUAGE REFERENCE command. ! ! RELATED COMMANDS: ! EXTRACT PLACEHOLDER ! NEW PLACEHOLDER ! SET LANGUAGE REFERENCE ! SHOW PLACEHOLDER ! ! CATEGORY: ! Language ! !doc_end ! ! ! local ! plac, ! language, ! local_string; ! ! ON_ERROR ! [OTHERWISE]: ! lse$post_command_proc; ! lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, ! "lse_set_placeholder_reference"); ! ENDON_ERROR; ! ! ! get the string ! if NOT lse$prompt_string ( book_reference, ! local_string, ! lse$_bookrefprompt ) ! then ! lse$post_command_proc; ! return FALSE; ! endif; ! ! ! get the placeholder ! if NOT lse$get_valid_lang_pack_elem ( defined_placeholder, ! LSE$PLACEHOLDER, ! defined_language, ! LSE$LANGUAGE, ! plac, ! language ) ! then ! lse$post_command_proc; ! return FALSE; ! endif; ! ! set(LSE$BOOKREFERENCE, plac, local_string); ! lse$set_curr_lang_element(language); ! lse$set_curr_lang_element(plac); ! ! lse$post_command_proc; ! return TRUE; ! !endprocedure; ! lse_set_placeholder_reference !-Hyperhelp !-Hyperhelp !procedure lse_set_placeholder_book (; file_spec, defined_placeholder, ! defined_language) !-Hyperhelp - added comments surrounding doc_begin and doc_end ! !doc_begin ! ! ONE LINE DEFINITION: ! Specifies an online book file name that LSE uses ! to retrieve the online text for a placeholder. ! ! DESCRIPTION: ! (SET PLACEHOLDER BOOK) ! (SET PLACEHOLDER commandsSET PLACEHOLDER BOOK) ! (Help book) ! (Placeholdersetting book file name strings) ! ! If you do not specify a book with the SET PLACEHOLDER BOOK command, ! LSE defaults to the book section defined in the SET LANGUAGE BOOK command. ! ! RELATED COMMANDS: ! EXTRACT PLACEHOLDER ! NEW PLACEHOLDER ! SET LANGUAGE BOOK ! SHOW PLACEHOLDER ! ! CATEGORY: ! Language ! !doc_end ! ! ! local ! plac, ! language, ! the_file_spec; ! ! ON_ERROR ! [OTHERWISE]: ! lse$post_command_proc; ! lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, ! "lse_set_placeholder_book"); ! ENDON_ERROR; ! ! ! get the book file name ! IF NOT lse$prompt_existing_file ( file_spec, ! the_file_spec, ! lse$_bookprompt, ! '', ! '') ! then ! lse$post_command_proc; ! return FALSE; ! endif; ! ! ! get the placeholder ! if NOT lse$get_valid_lang_pack_elem ( defined_placeholder, ! LSE$PLACEHOLDER, ! defined_language, ! LSE$LANGUAGE, ! plac, ! language ) ! then ! lse$post_command_proc; ! return FALSE; ! endif; ! ! set(LSE$BOOK, plac, the_file_spec); ! lse$set_curr_lang_element(language); ! lse$set_curr_lang_element(plac); ! ! lse$post_command_proc; ! return TRUE; !endprocedure; ! lse_set_placeholder_book !-Hyperhelp