! LSE$GRAMMAR_LANGUAGE.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 language-related grammar syntax. ! ! ENVIRONMENT: ! Portable/LSE ! ! Author: Diana E. Carroll ! ! CREATION DATE: 01-March-1991 ! ! MODIFIED BY: ! ! X3.2 DEC 01-Mar-91 New module ! X3.2-1 DEC 01-Mar-91 Added language definition/set routines ! X3.2-2 DAS 23-Mar-91 Changed call to LSE$POST_COMMAND to have _PROC ! X4.0 DEC 26-Mar-91 Removed default tag terminators from lse_new_language ! X4.0-1 DEC 01-Apr-91 Add show_language and show_language_list ! and extract_language ! X4.0-2 NMC 16-Apr-91 Convert lse$$current_language to ! lse$get_curr_lang_element and ! lse$$set_current_language to lse$set_curr_lang_element ! X4.0-3 DEC 23-Apr-91 Make extract position to beginning of extract text ! X4.0-4 WC3 29-Apr-91 Add lse$_langdefined as an expected error in ! lse_new_language ! Make SHOW LANGAUGE a show list ! X4.0-5 WC3 15-May-91 Portable language consistency ! X4.0-6 SHE 1-Jul-91 Modified some doc headers to allow the documentation ! to build successfully. ! X4.0-7 WC3 11-Jul-91 Add missing local ! X4.0-8 SHE 26-Aug-91 Removed space before doc_begin for ! lse_set_language_tag_terminators ! X4.0-9 NMC 13-Sep-91 Modify lse_extract_language to use ! lse$extract_lang_pack ! Added lse_extract_new_language ! X4.0-10 NMC 30-Sep-91 Modified error trap for lse_new_language to use ! ERROR_TEXT. ! Add lse$compare_lang_pack_elem call to check for ! possible current language being deleted. ! X4.0-11 NMC 11-Oct-91 Changed all lse$prompt_language to ! lse$prompt_lang_pack ! X4.0-12 NMC 21-Oct-91 Modified lse_delete_language to accept wildcard name ! X4.0-13 SHE 22-Oct-91 Deactivate doc header for lse_set_language_diagnostics ! X4.0-14 WC3 15-Nov-91 Make lse_delete_langauge accept type ! lse$language_type ! X4.0-15 SHE 21-Nov-91 Unexpected errors in language margin procedures. ! X4.0-16 DEC 18-Feb-92 Documentation and parameter cleanup ! X4.0-17 WC3 22-Feb-22 Doc build fixes ! X4.0-18 WC3 13-Apr-92 Make NEW silently re-initialize instead of issue ! an error when the element exists ! X4.0-19 SHE 14-May-92 Modified related commands ! X4.0-20 SHE 02-Oct-92 Replaced uses of message_text with ! lse$get_message_text ! X4.3 RAM 11-JuL-94 Added lse_set_language_book, ! lse_set_language_reference ! X4.3-1 RAM 05-Dec-94 Update Haley Headers and Ident ! X4.3-2 RAM 22-Feb-95 Commented out set language book 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. ! ! 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. ! !doc_begin ! ! ONE LINE DEFINITION: ! «TBS» ! ! DESCRIPTION: ! «TBS» ! ! RELATED COMMANDS: ! «TBS» ! ! EXAMPLE: ! «TBS» ! ! CATEGORY: ! «TBS» ! !doc_end ! procedure lse$grammar_language_module_ident return "4.7-1"; endprocedure; procedure lse_new_language(;language_name) !doc_begin ! ! ONE LINE DEFINITION: ! Creates a new language. ! ! DESCRIPTION: ! (NEW LANGUAGE) ! (NEW LANGUAGESee also SET LANGUAGE commands) ! (Languagecreating a new) ! This command specifies a language so that LSE can properly recognize ! language-specific constructs in the text. Specific characteristics ! can be set for the language with the SET LANGUAGE commands. Also, ! tokens, placeholders, and other language objects can be created ! within the language. ! ! RELATED COMMANDS: ! DELETE LANGUAGE ! EXTRACT LANGUAGE ! SET LANGUAGE commands ! SHOW LANGUAGE ! ! CATEGORY: ! Language ! !doc_end ! LOCAL local_language, local_name, req_delim, reql_delim, opt_delim, optl_delim; ON_ERROR [lse$_langdefined]: 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_language"); ENDON_ERROR; if lse$prompt_string( language_name, local_name, lse$_setbuflngprompt ) then ! Check for already exising ! local_language := get_info(lse$system, 'lse$find_language', local_name); if get_info( local_language, 'type' ) = LSE$LANGUAGE_TYPE then lse$delete_language( local_language ); endif; ! create the language local_language := lse$create_language(local_name); lse$set_curr_lang_element(local_language); !+ ! set some default values - fiels that *must* have values are ! set by the create_language builtin. Here we set values to ! make the language friendly by default. !- ! identifier characters set(lse$identifier_char, local_language, lse$get_message_text(lse$_langdefidentchar)); ! required and required list delimiters req_delim := lse$create_delimit(); set(lse$leading_text, req_delim, lse$get_message_text(lse$_langdefreql)); set(lse$trailing_text, req_delim, lse$get_message_text(lse$_langdefreqr)); set(lse$required_delimit, local_language, req_delim); reql_delim := lse$create_delimit(); set(lse$leading_text, reql_delim, lse$get_message_text(lse$_langdefreqll)); set(lse$trailing_text, reql_delim, lse$get_message_text(lse$_langdefreqlr)); set(lse$required_list_delimit, local_language, reql_delim); ! optional and optional list delimiters opt_delim := lse$create_delimit(); set(lse$leading_text, opt_delim, lse$get_message_text(lse$_langdefoptl)); set(lse$trailing_text, opt_delim, lse$get_message_text(lse$_langdefoptr)); set(lse$optional_delimit, local_language, opt_delim); optl_delim := lse$create_delimit(); set(lse$leading_text, optl_delim, lse$get_message_text(lse$_langdefoptll)); set(lse$trailing_text, optl_delim, lse$get_message_text(lse$_langdefoptlr)); set(lse$optional_list_delimit, local_language, optl_delim); set(lse$punctuation_char, local_language, lse$get_message_text(lse$_langdefpunchar)); set(lse$expand_case, local_language, lse$case_as_is); lse_new_language := true; else lse_new_language := false; endif; lse$post_command_proc; endprocedure; procedure lse_delete_language( ;language_name_wild ) !doc_begin ! ! ONE LINE DEFINITION: ! Deletes the indicated language definition(s). ! ! DESCRIPTION: ! (DELETE LANGUAGE) ! (Languagedeleting) ! LSE does not actually delete the tokens, ! placeholders, and aliases associated with the language, but it ! makes them unavailable for use. If you subsequently enter a ! NEW LANGUAGE command for the same language name, ! then LSE reassociates all of the previously defined tokens, placeholders, ! and aliases with the new language definition. Thus, you can use ! this command as a step in modifying the properties ! of a language definition. ! ! RELATED COMMANDS: ! NEW LANGUAGE ! SET LANGUAGE commands ! EXTRACT LANGUAGE ! SHOW LANGUAGE ! ! CATEGORY: ! Language ! !doc_end ! LOCAL lang_name_pattern, local_input_language; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_delete_language"); ENDON_ERROR; lse_delete_language := FALSE; ! Convert type lse$language_type to a string ! local_input_language := language_name_wild; IF get_info(local_input_language, "type") = lse$language_type THEN local_input_language := GET_INFO( language_name_wild, 'lse$name' ); ENDIF; if lse$prompt_string( local_input_language, lang_name_pattern, lse$_setbuflngprompt, lse$_langnoval, lse$get_curr_lang_element(LSE$LANGUAGE) ) then lse_delete_language := lse$delete_lang_pack( lang_name_pattern, LSE$LANGUAGE ); endif; lse$post_command_proc; endprocedure; !lse_delete_language procedure lse_set_language_diagnostics( ;boolean, defined_language) !nodoc_begin ! ! ONE LINE DEFINITION: ! Specifies whether the compiler can generate diagnostic files. ! ! DESCRIPTION: ! (SET LANGUAGE DIAGNOSTICS) ! (SET LANGUAGE commandsSET LANGUAGE DIAGNOSTICS) ! (Languagesetting diagnostics) ! ! RELATED COMMANDS: ! NEW LANGUAGE ! SET LANGUAGE commands ! DELETE LANGUAGE ! EXTRACT LANGUAGE ! COMPILE ! ! CATEGORY: ! Language ! !nodoc_end LOCAL the_response, language; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_language_diagnostics"); ENDON_ERROR; if NOT lse$prompt_boolean( boolean, the_response, lse$_langdiagprompt, "", lse$_langdefdiag) then lse$post_command_proc; return FALSE; endif; if lse$prompt_lang_pack ( defined_language, language, '', LSE$LANGUAGE, '', lse$get_curr_lang_element(LSE$LANGUAGE) ) then ! set the current language lse$set_curr_lang_element(language); ! set diagnostics on or off set(lse$diagnostics, language, the_response); lse_set_language_diagnostics := true; else lse_set_language_diagnostics := false; endif; lse$post_command_proc; endprocedure; !lse_set_language_diagnostics procedure lse_set_language_compile_command (;compile_command, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Specifies the default command string for the COMPILE command. ! ! DESCRIPTION: ! (SET LANGUAGE COMPILE COMMAND) ! (SET LANGUAGE commandsSET LANGUAGE COMPILE COMMAND) ! (Languagesetting a compilation string) ! This string is the command used to compile a buffer when the COMPILE ! command is used. If the language has diagnostic capability, and you ! want a diagnostics file created for use with the REVIEW command, you ! must specify the diagnostics switch in the command. For example, on ! OpenVMS systems: !

! ! SET LANGUAGE COMPILE COMMAND "CC/DIA" ! ! ! RELATED COMMANDS: ! EXTRACT LANGUAGE ! NEW LANGUAGE ! SET LANGUAGE commands ! SHOW LANGUAGE ! COMPILE ! ! CATEGORY: ! Language ! !doc_end ! LOCAL local_string, language; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_language_compile_command"); ENDON_ERROR; ! get the string if lse$prompt_string ( compile_command, local_string, lse$_langcompileprompt, "", "" ) <> true then lse$post_command_proc; return FALSE; endif; ! get the language if lse$prompt_lang_pack ( defined_language, language, '', LSE$LANGUAGE, '', lse$get_curr_lang_element(LSE$LANGUAGE) ) then ! set the current language lse$set_curr_lang_element(language); ! set the version string set(lse$compile_command, language, local_string); lse_set_language_compile_command := true; else lse_set_language_compile_command := false; endif; lse$post_command_proc; endprocedure; !lse_set_language_compile_command procedure lse_set_language_comment_association ( ; comment_association, defined_language ) !doc_begin ! ! ONE LINE DEFINITION: ! Specifies whether comments are associated with the next or previous ! identifier. ! ! DESCRIPTION: ! (SET LANGUAGE COMMENT ASSOCIATION) ! (SET LANGUAGE commandsSET LANGUAGE COMMENT ASSOCIATION) ! (Languageassociating comments) ! ! RELATED COMMANDS: ! EXTRACT LANGUAGE ! NEW LANGUAGE ! SET LANGUAGE commands ! SHOW LANGUAGE ! ! CATEGORY: ! Language ! !doc_end ! LOCAL the_response, language; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_language_comment_association"); ENDON_ERROR; ! get PREVIOUS or NEXT if NOT lse$prompt_list ( comment_association, the_response, lse$_langassocprompt, lse$_assocdelimit, lse$_assoclist, false, '', lse$_langdefassoc) then lse$post_command_proc; return FALSE; endif; case the_response from 1 to 2 [1]: the_response := lse$next; [2]: the_response := lse$previous; endcase; ! get the language if lse$prompt_lang_pack ( defined_language, language, '', LSE$LANGUAGE, '', lse$get_curr_lang_element(LSE$LANGUAGE) ) then lse$set_curr_lang_element(language); set(lse$comment_association, language, the_response ); lse_set_language_comment_association := true; else lse_set_language_comment_association := false; endif; lse$post_command_proc; return TRUE; endprocedure; procedure lse_set_language_bracketed_comments ( ;begin_string, end_string, add_remove, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Specifies the character sequences of comments in the language. ! ! DESCRIPTION: ! (SET LANGUAGE BRACKETED COMMENTS) ! (SET LANGUAGE commandsSET LANGUAGE BRACKETED COMMENTS) ! (Languagespecifying bracketed comments) ! This command defines the character sequences that start and end ! bracketed comments. A bracketed comment begins and ends with explicit ! comment delimiters. (Note that the beginning and ending comment ! delimiters can be the same but need not be.) !

! Bracketed comments are recognized by the formatting commands (see the ! ALIGN and FILL commands) and placeholder operations (see the ERASE ! PLACEHOLDER command and the SET PLACEHOLDER DUPLICATION command). ! ! RELATED COMMANDS: ! SHOW LANGUAGE ! EXTRACT LANGUAGE ! NEW LANGUAGE ! SET LANGUAGE commands ! ! CATEGORY: ! Language ! !doc_end ! LOCAL delim, add_flag, local_begin_str, local_end_str, language; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_bracketed_comments"); ENDON_ERROR; ! get the beginning string if lse$prompt_string ( begin_string, local_begin_str, lse$_langbeginprompt ) <> true then lse$post_command_proc; return FALSE; endif; ! get the trailing string if lse$prompt_string ( end_string, local_end_str, lse$_langendprompt ) <> true then lse$post_command_proc; return 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 language if lse$prompt_lang_pack ( defined_language, language, '', LSE$LANGUAGE, '', lse$get_curr_lang_element(LSE$LANGUAGE) ) then ! set the current language lse$set_curr_lang_element(language); ! set up the delimiter delim := lse$create_delimit(); set(lse$leading_text, delim, local_begin_str); set(lse$trailing_text, delim, local_end_str); ! add or delete the delimiter lse_set_language_bracketed_comments := set(lse$bracketed_comments, language, delim, add_flag); else lse_set_language_bracketed_comments := false; endif; lse$post_command_proc; endprocedure; ! lse_set_bracketed_comments procedure lse_set_language_trailing_comments(;text_string, add_remove, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Specifies the character sequences of trailing commment delimiters in ! the language. ! ! DESCRIPTION: ! (SET LANGUAGE TRAILING COMMENTS) ! (SET LANGUAGE commandsSET LANGUAGE TRAILING COMMENTS) ! (Languagespecifying trailing comments) ! A trailing comment begins with a special character sequence ! and ends at the end of the line. ! ! RELATED COMMANDS: ! EXTRACT LANGUAGE ! NEW LANGUAGE ! SHOW LANGUAGE ! ! CATEGORY: ! Language ! !doc_end ! LOCAL local_string, add_flag, language; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_language_trailing_coments"); ENDON_ERROR; ! get the string if lse$prompt_string ( text_string, local_string, lse$_langtrailprompt) <> true then lse$post_command_proc; return 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 language if lse$prompt_lang_pack ( defined_language, language, '', LSE$LANGUAGE, '', lse$get_curr_lang_element(LSE$LANGUAGE) ) then ! set the current language lse$set_curr_lang_element(language); ! add the string to the list lse_set_language_trailing_comments := set (lse$trailing_comments, language, local_string, add_flag); else lse_set_language_trailing_comments := false; endif; lse$post_command_proc; endprocedure; ! lse_set_language_trailing_comments procedure lse_set_language_line_comments(; text_string, add_remove, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Specifies the character sequences of the line comment delimiter in the language. ! ! DESCRIPTION: ! (SET LANGUAGE LINE COMMENTS) ! (SET LANGUAGE commandsSET LANGUAGE LINE COMMENTS) ! (Languagespecifying line comments) ! Line comments require that the comment delimiter be the first character that is not ! blank on the line. Trailing and line comments are recognized by the ! formatting commands and placeholder operations just as bracketed ! comments are. ! ! RELATED COMMANDS: ! NEW LANGUAGE ! SET LANGUAGE commands ! SHOW LANGUAGE ! ! CATEGORY: ! Language ! !doc_end ! ! This example has been moved outside the header because C block comments ! cause trouble with the documentation generation. ! ! EXAMPLE: ! ! /* ! ** Here is the inside of a comment ! ** which has LINE="**" specified ! */ ! ! LOCAL local_string, add_flag, language; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_language_line_comments"); ENDON_ERROR; ! get the string if lse$prompt_string ( text_string, local_string, lse$_langlineprompt ) <> true then lse$post_command_proc; return FALSE; endif; ! get the add_remove flag if lse$prompt_add_remove ( add_remove, add_flag, "", "", lse$_langdefaddrmv) <> true then lse$post_command_proc; return FALSE; endif; if lse$prompt_lang_pack ( defined_language, language, '', LSE$LANGUAGE, '', lse$get_curr_lang_element(LSE$LANGUAGE) ) then ! set the current language lse$set_curr_lang_element(language); ! add the string to the list lse_set_language_line_comments := set (lse$line_comments, language, local_string, add_flag); else lse_set_language_line_comments := false; endif; lse$post_command_proc; endprocedure; ! lse_set_language_line_comments procedure lse_set_language_fixed_comments(; text_string, column, add_remove, defined_language) ! define language language_name/comment=fixed=string,# !doc_begin ! ! ONE LINE DEFINITION: ! Specifies the character sequences of fixed comment delimiters in the language. ! ! DESCRIPTION: ! (SET LANGUAGE FIXED COMMENTS) ! (SET LANGUAGE commandsSET LANGUAGE FIXED COMMENTS) ! (Languagespecifying fixed comments) ! This command is used for languages requiring that a specific comment ! delimiter be placed in a specific column, such as ! SET LANGUAGE FIXED COMMENTS "*" 1 ADD COBOL, since COBOL requires ! comment delimiters to be in column 1. ! ! RELATED COMMANDS: ! EXTRACT LANGUAGE ! NEW LANGUAGE ! SET LANGUAGE commands ! SHOW LANGUAGE ! ! CATEGORY: ! Language ! !doc_end ! LOCAL delim, local_number, add_flag, local_string, language; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_language_fixed_comments"); ENDON_ERROR; if lse$prompt_string ( text_string, local_string, lse$_langfixstrprompt ) <> true then lse$post_command_proc; return FALSE; endif; if lse$prompt_number ( column, local_number, lse$_langfixcolprompt ) <> true then lse$post_command_proc; return FALSE; endif; if lse$prompt_add_remove ( add_remove, add_flag, "", "", lse$_langdefaddrmv ) <> true then lse$post_command_proc; return FALSE; endif; if lse$prompt_lang_pack ( defined_language, language, '', LSE$LANGUAGE, '', lse$get_curr_lang_element(LSE$LANGUAGE) ) then ! set the current language lse$set_curr_lang_element(language); ! set up the delimiter delim := lse$create_fixed_delimit(); set(lse$fixed_delimit, delim, local_string); set(lse$column, delim, local_number); ! add or delete the delimiter lse_set_language_fixed_comments := set(lse$fixed_comments, language, delim, add_flag); else lse_set_language_fixed_comments := false; endif; lse$post_command_proc; endprocedure; !lse_set_language_fixed_comments procedure lse_set_language_expand_case(;case_type, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Specifies the case of expanded text of inserted templates. ! ! DESCRIPTION: ! (SET LANGUAGE EXPAND CASE) ! (SET LANGUAGE commandsSET LANGUAGE EXPAND CASE) ! (Languageexpanding case) ! ! RELATED COMMANDS: ! EXTRACT LANGUAGE ! NEW LANGUAGE ! SET LANGUAGE commands ! SHOW LANGUAGE ! ! CATEGORY: ! Language ! !doc_end ! LOCAL the_response, language; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_language_expand_case"); ENDON_ERROR; if lse$prompt_list ( case_type, the_response, lse$_langcaseprompt, lse$_casedelimit, lse$_caselist, false, '', lse$_langdefcase) <> true then lse$post_command_proc; return FALSE; endif; case the_response from 1 to 3 [1] : the_response := lse$uppercase; [2] : the_response := lse$lowercase; [3] : the_response := lse$case_as_is; endcase; if lse$prompt_lang_pack ( defined_language, language, '', LSE$LANGUAGE, '', lse$get_curr_lang_element(LSE$LANGUAGE) ) then ! set the current language lse$set_curr_lang_element(language); ! set the case set(lse$expand_case, language, the_response); lse_set_language_expand_case := true; else lse_set_language_expand_case := false; endif; lse$post_command_proc; endprocedure; !lse_set_language_expand_case procedure lse_set_language_file_types(;text_string, add_remove, defined_language) !doc_begin ! define lang/file_types=(string,...) ! ! ONE LINE DEFINITION: ! Specifies a file type that is valid for the language being ! defined. ! ! DESCRIPTION: ! (SET LANGUAGE FILE TYPES) ! (SET LANGUAGE commandsSET LANGUAGE FILE TYPES) ! (Languagespecifying valid file types) ! When LSE reads a file ! into a buffer, it sets the language for that buffer automatically if it ! recognizes the file type. For example, a Fortran file type (.FOR) sets the ! language to Fortran. Note that the period character must be included ! with the file type. ! ! RELATED COMMANDS: ! EXTRACT LANGUAGE ! NEW LANGUAGE ! SHOW LANGUAGE ! ! CATEGORY: ! Language ! !doc_end ! LOCAL add_flag, local_string, language; ON_ERROR [LSE$_STRINGNOTFOUND]: EVE$MESSAGE('File Type ' + ERROR_TEXT ); lse$post_command_proc; eve$learn_abort; RETURN FALSE; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_language_file_types"); ENDON_ERROR; ! get the string if NOT lse$prompt_string ( text_string, local_string, lse$_langfileprompt, '', '') then lse$post_command_proc; return FALSE; endif; ! get the add or remove parameter if NOT lse$prompt_add_remove( add_remove, add_flag, "", "", lse$_langdefaddrmv) then lse$post_command_proc; return FALSE; endif; ! get the language if lse$prompt_lang_pack ( defined_language, language, '', LSE$LANGUAGE, '', lse$get_curr_lang_element(LSE$LANGUAGE) ) then ! set the current language lse$set_curr_lang_element(language); ! add or delete the delimiter set(lse$file_types, language, local_string, add_flag ); lse_set_language_file_types := true; else lse_set_language_file_types := false; endif; lse$post_command_proc; endprocedure; !lse_set_language_file_types procedure lse_set_language_ansi_fortran( ;boolean, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Specifies special processing for ANSI Fortran. ! ! DESCRIPTION: ! (SET LANGUAGE ANSI FORTRAN) ! (SET LANGUAGE commandsSET LANGUAGE ANSI FORTRAN) ! (LanguageANSI FORTRAN) ! Note that some commands behave differently when you use this command. ! Specifying (off), the default, causes LSE to insert templates ! in non-ANSI (tab) format. ! ! RELATED COMMANDS: ! NEW LANGUAGE ! SHOW LANGUAGE ! SET LANGUAGE FORTRAN ! ! CATEGORY: ! Language ! !doc_end ! LOCAL the_response, language; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_language_ansi_fortran"); ENDON_ERROR; if NOT lse$prompt_boolean( boolean, the_response, lse$_langansiprompt, '', lse$_langdefansi) then lse$post_command_proc; return FALSE; endif; if lse$prompt_lang_pack ( defined_language, language, '', LSE$LANGUAGE, '', lse$get_curr_lang_element(LSE$LANGUAGE) ) then ! set the current language lse$set_curr_lang_element(language); ! set ansi fortran on or off set(lse$ansi_fortran, language, the_response); lse_set_language_ansi_fortran := true; else lse_set_language_ansi_fortran := false; endif; lse$post_command_proc; endprocedure; ! set_language_ansi_fortran procedure lse_set_language_help_library( ;file_spec, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Specifies the HELP library where you can find help text for ! placeholders and tokens defined in this language. ! ! DESCRIPTION: ! (SET LANGUAGE HELP LIBRARY) ! (SET LANGUAGE commandsSET LANGUAGE HELP LIBRARY) ! (Languagespecifying a help library) ! On OpenVMS systems, LSE uses the default file specification SYS$HELP:HELPLIB.HLB. ! On Ultrix, it uses /usr/lib/lse/env/(language_name).hlp. ! If you want to access some other HELP library, you ! must supply an explicit device name. ! ! RELATED COMMANDS: ! EXTRACT LANGUAGE ! NEW LANGUAGE ! SHOW LANGUAGE ! HELP INDICATED ! ! CATEGORY: ! Language ! !doc_end ! LOCAL the_file_spec, language; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_language_help_library"); ENDON_ERROR; IF NOT lse$prompt_existing_file ( file_spec, the_file_spec, lse$_langhelpprompt, '', '') then lse$post_command_proc; return FALSE; endif; if lse$prompt_lang_pack ( defined_language, language, '', LSE$LANGUAGE, '', lse$get_curr_lang_element(LSE$LANGUAGE) ) then ! set the current language lse$set_curr_lang_element(language); ! set the help library set(lse$help_library, language, the_file_spec); lse_set_language_help_library := true; else lse_set_language_help_library := false; endif; lse$post_command_proc; endprocedure; ! lse_set_language_help_library procedure lse_set_language_identifier_characters (;identifier_characters, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Specifies the characters that may appear in token and alias names in the ! language. ! ! DESCRIPTION: ! (SET LANGUAGE IDENTIFIER CHARACTERS) ! (SET LANGUAGE commandsSET LANGUAGE IDENTIFIER CHARACTERS) ! (Languagespecifying identifier characters) ! The list of identifier characters also determines what LSE considers to ! be a word. A word is a sequence of identifier characters, possibly followed ! by one or more blanks, tabs, or nonidentifier characters. All ! nonblank, nonidentifier characters are considered to be distinct words. ! ! RELATED COMMANDS: ! EXTRACT LANGUAGE ! NEW LANGUAGE ! SHOW LANGUAGE ! ! CATEGORY: ! Language ! !doc_end ! LOCAL local_string, language; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_language_identifier_characters"); ENDON_ERROR; ! get the string if lse$prompt_string ( identifier_characters, local_string, lse$_langidprompt, '', '' ) <> true then lse$post_command_proc; return FALSE; endif; ! get the language if lse$prompt_lang_pack ( defined_language, language, '', LSE$LANGUAGE, '', lse$get_curr_lang_element(LSE$LANGUAGE) ) then ! set the current language lse$set_curr_lang_element(language); ! set the identider character string set(lse$identifier_char, language, local_string); lse_set_language_identifier_characters := true; else lse_set_language_identifier_characters := false; endif; lse$post_command_proc; endprocedure; !lse_set_language_identifier_characters procedure lse_set_language_initial_string (;text_string, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Specifies the initial text that is to appear in a newly created ! buffer. ! ! DESCRIPTION: ! (SET LANGUAGE INITIAL STRING) ! (SET LANGUAGE commandsSET LANGUAGE INITIAL STRING) ! (Languageinitial text for a buffer) ! ! RELATED COMMANDS: ! EXTRACT LANGUAGE ! NEW LANGUAGE ! SHOW LANGUAGE ! ! CATEGORY: ! Language ! !doc_end ! LOCAL local_string, language; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_language_initial_string"); ENDON_ERROR; ! get the string if lse$prompt_string ( text_string, local_string, lse$_langinitprompt, '', '') <> true then lse$post_command_proc; return FALSE; endif; ! get the language if lse$prompt_lang_pack ( defined_language, language, '', LSE$LANGUAGE, '', lse$get_curr_lang_element(LSE$LANGUAGE) ) then ! set the current language lse$set_curr_lang_element(language); ! set the initial string set(lse$initial_string, language, local_string); lse_set_language_initial_string := true; else lse_set_language_initial_string := false; endif; lse$post_command_proc; endprocedure; !lse_set_language_initial_string procedure lse_set_language_left_margin (;column, defined_language) ! ! DESCRIPTION: ! If you specify zero as the column number, then LSE uses the ! indentation of the current line to determine the left margin when you set ! the wrapping on with the SET LANGUAGE WRAP ON command. ! When you use the FILL command, LSE uses the indentation of the first ! line of each selected paragraph to determine the left margin. ! !doc_begin ! ! ONE LINE DEFINITION: ! Specifies the default left margin setting to be used for buffers ! associated with language. ! ! DESCRIPTION: ! (SET LANGUAGE LEFT MARGIN) ! (SET LANGUAGE commandsSET LANGUAGE LEFT MARGIN) ! (Languagesetting default left margins) ! By default the left margin is set at column 1. ! ! RELATED COMMANDS: ! EXTRACT LANGUAGE ! NEW LANGUAGE ! SHOW LANGUAGE ! FILL ! SET BUFFER LEFT MARGIN ! ! CATEGORY: ! Language ! !doc_end ! LOCAL local_value, language; ON_ERROR [LSE$_ILLEGMARGINS]: eve$message (ERROR_TEXT); lse$post_command_proc; eve$learn_abort; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_language_left_margin"); ENDON_ERROR; ! get the number if NOT lse$prompt_number ( column, local_value, lse$_langmarginprompt, '', 0) then lse$post_command_proc; return FALSE; endif; ! get the language if lse$prompt_lang_pack ( defined_language, language, '', LSE$LANGUAGE, '', lse$get_curr_lang_element(LSE$LANGUAGE) ) then ! set the current language lse$set_curr_lang_element(language); ! set left margin set(lse$left_margin, language, local_value); lse_set_language_left_margin := true; else lse_set_language_left_margin := false; endif; lse$post_command_proc; endprocedure; !lse_set_language_left_margin procedure lse_set_language_right_margin (;column, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Specifies the default right margin setting that is to be used for ! buffers associated with the language. ! ! DESCRIPTION: ! (SET LANGUAGE RIGHT MARGIN) ! (SET LANGUAGE commandsSET LANGUAGE RIGHT MARGIN) ! (Languagesetting default right margins) ! By default, the right margin is set at column 80. ! ! RELATED COMMANDS: ! EXTRACT LANGUAGE ! NEW LANGUAGE ! SHOW LANGUAGE ! FILL ! ENTER SPACE ! SET BUFFER LEFT MARGIN ! ! CATEGORY: ! Language ! !doc_end ! LOCAL local_value, language; ON_ERROR [LSE$_ILLEGMARGINS]: eve$message (ERROR_TEXT); lse$post_command_proc; eve$learn_abort; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_language_right_margin"); ENDON_ERROR; ! get the number if NOT lse$prompt_number ( column, local_value, lse$_langmarginprompt, '', 80) then lse$post_command_proc; return FALSE; endif; ! get the language if lse$prompt_lang_pack ( defined_language, language, '', LSE$LANGUAGE, '', lse$get_curr_lang_element(LSE$LANGUAGE) ) then ! set the current language lse$set_curr_lang_element(language); ! set right margin set(lse$right_margin, language, local_value); lse_set_language_right_margin := true; else lse_set_language_right_margin := false; endif; lse$post_command_proc; endprocedure; !lse_set_language_right_margin procedure lse_set_language_overview_minimum_lines(;number, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Specifies the minimum number of lines an overview line must hide ! ! DESCRIPTION: ! (SET LANGUAGE OVERVIEW MINIMUM LINES) ! (SET LANGUAGE commandsSET LANGUAGE OVERVIEW MINIMUM LINES) ! (Languagesetting minimum overview lines) ! For example, if the value is 5, then a line hides other lines only if ! there are at least five lines to hide. This command helps you to avoid ! having very small source-line groups, which avoids many expansion ! levels. The default minimum lines to hide is 1. ! ! RELATED COMMANDS: ! EXTRACT LANGUAGE ! NEW LANGUAGE ! SHOW LANGUAGE ! VIEW SOURCE ! ! CATEGORY: ! Language ! !doc_end ! LOCAL local_value, language; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_overview_minimum_lines"); ENDON_ERROR; ! get the number if NOT lse$prompt_number ( number, local_value, lse$_langminprompt, '', 1) then lse$post_command_proc; return FALSE; endif; ! get the language if lse$prompt_lang_pack ( defined_language, language, '', LSE$LANGUAGE, '', lse$get_curr_lang_element(LSE$LANGUAGE) ) then ! set the current language lse$set_curr_lang_element(language); ! set minimum overview lines set(lse$min_overview_lines, language, local_value); lse_set_language_overview_minimum_lines := true; else lse_set_language_overview_minimum_lines := false; endif; lse$post_command_proc; endprocedure; !lse_set_language_minimum_overview_lines procedure lse_set_language_overview_tab_range(;min_value, max_value, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Indicates the range of tab values for which the adjustment definitions ! are valid. ! ! DESCRIPTION: ! (SET LANGUAGE OVERVIEW TAB RANGE) ! (SET LANGUAGE commandsSET LANGUAGE OVERVIEW TAB RANGE) ! (Languagetab value range) ! The default is (4,8). The second value must be at least twice the ! first value; both values must be positive. For example, if the tab ! range is (4,8), then LSE assumes that the adjustment definitions will ! work for any SET LANGUAGE TAB value from 4 to 8 ! inclusive. If you specify a (tab increment) value outside the tab ! range, then LSE recomputes indentation to make the adjustments work. !

! For best performance, it is recommended that you avoid ! (recomputation) by choosing a range that covers reasonable ! values. The numbers specified for the SET ADJUSTMENT CURRENT ! and NEW GRAMMAR commands must work for any tab ! increment value in the tab range. ! ! RELATED COMMANDS: ! EXTRACT LANGUAGE ! NEW LANGUAGE ! SET ADJUSTMENT ! ! CATEGORY: ! Language ! !doc_end ! LOCAL local_max_value, local_min_value, language; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_language_overview_tab_range"); ENDON_ERROR; ! get the first number if NOT lse$prompt_number ( min_value, local_min_value, lse$_langmintabprompt, '', 4) then lse$post_command_proc; return FALSE; endif; ! get the second number if NOT lse$prompt_number ( max_value, local_max_value, lse$_langmaxtabprompt, '', 8) then lse$post_command_proc; return FALSE; endif; ! get the language if lse$prompt_lang_pack ( defined_language, language, '', LSE$LANGUAGE, '', lse$get_curr_lang_element(LSE$LANGUAGE) ) then ! set the current language lse$set_curr_lang_element(language); ! first, set the min value to 1, and the max value to 2*the min_value ! + 2, so that we won't have any trouble with the old values ! conflicting with the new values. The set the new values. set(lse$overview_min_tab_rng, language, 1); set(lse$overview_max_tab_rng, language, 2*local_min_value+2); set(lse$overview_min_tab_rng, language, local_min_value); set(lse$overview_max_tab_rng, language, local_max_value); lse_set_language_overview_tab_range := true; else lse_set_language_overview_tab_range := false; endif; lse$post_command_proc; endprocedure; !lse_set_language_overview_tab_range procedure lse_set_language_required_delimit( ;begin_string, end_string, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Specifies starting and ending strings that delimit required placeholders. ! ! DESCRIPTION: ! (SET LANGUAGE REQUIRED DELIMIT) ! (SET LANGUAGE commandsSET LANGUAGE REQUIRED DELIMIT) ! (Languagedelimiting placeholders) ! Note that you cannot use any character that you used as a comment ! delimiter. ! ! RELATED COMMANDS: ! EXTRACT LANGUAGE ! NEW LANGUAGE ! SHOW LANGUAGE ! ! CATEGORY: ! Language ! !doc_end ! LOCAL delim, local_begin_str, local_end_str, language; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_language_required_delimit"); ENDON_ERROR; ! get the beginning string if lse$prompt_string ( begin_string, local_begin_str, lse$_langbeginprompt, '', '' ) <> true then lse$post_command_proc; return FALSE; endif; ! get the trailing string if lse$prompt_string ( end_string, local_end_str, lse$_langendprompt, '', '' ) <> true then lse$post_command_proc; return FALSE; endif; ! get the language if lse$prompt_lang_pack ( defined_language, language, '', LSE$LANGUAGE, '', lse$get_curr_lang_element(LSE$LANGUAGE) ) then ! set the current language lse$set_curr_lang_element(language); ! set up the delimiter delim := lse$create_delimit(); set(lse$leading_text, delim, begin_string); set(lse$trailing_text, delim, end_string); ! add or delete the delimiter set(lse$required_delimit, language, delim); lse_set_language_required_delimit := true; else lse_set_language_required_delimit := false; endif; lse$post_command_proc; endprocedure; ! lse_set_required_delimit procedure lse_set_language_required_list_delimit( ;begin_string, end_string, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Specifies starting and ending strings that delimit required list placeholders. ! ! DESCRIPTION: ! (SET LANGUAGE REQUIRED LIST DELIMIT) ! (SET LANGUAGE commandsSET LANGUAGE REQUIRED LIST DELIMIT) ! (Languagedelimiting placeholders) ! Note that you cannot use any character that you used as a comment ! delimiter. ! ! RELATED COMMANDS: ! EXTRACT LANGUAGE ! NEW LANGUAGE ! SHOW LANGUAGE ! ! CATEGORY: ! Language ! !doc_end ! LOCAL delim, local_begin_str, local_end_str, language; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_language_required_list_delimit"); ENDON_ERROR; ! get the beginning string if lse$prompt_string ( begin_string, local_begin_str, lse$_langbeginprompt, '', '' ) <> true then lse$post_command_proc; return FALSE; endif; ! get the trailing string if lse$prompt_string ( end_string, local_end_str, lse$_langendprompt, '', '' ) <> true then lse$post_command_proc; return FALSE; endif; ! get the language if lse$prompt_lang_pack ( defined_language, language, '', LSE$LANGUAGE, '', lse$get_curr_lang_element(LSE$LANGUAGE) ) then ! set the current language lse$set_curr_lang_element(language); ! set up the delimiter delim := lse$create_delimit(); set(lse$leading_text, delim, begin_string); set(lse$trailing_text, delim, end_string); ! add or delete the delimiter set(lse$required_list_delimit, language, delim); lse_set_language_required_list_delimit := true; else lse_set_language_required_list_delimit := false; endif; lse$post_command_proc; endprocedure; ! lse_set_required_list_delimit procedure lse_set_language_optional_delimit( ;begin_string, end_string, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Specifies starting and ending strings that delimit optional placeholders. ! ! DESCRIPTION: ! (SET LANGUAGE OPTIONAL DELIMIT) ! (SET LANGUAGE commandsSET LANGUAGE OPTIONAL DELIMIT) ! (Languagedelimiting placeholders) ! Note that you cannot use any character that you used as a comment ! delimiter. ! ! RELATED COMMANDS: ! EXTRACT LANGUAGE ! NEW LANGUAGE ! SHOW LANGUAGE ! ! CATEGORY: ! Language ! !doc_end ! LOCAL delim, local_begin_str, local_end_str, language; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_language_optional_delimit"); ENDON_ERROR; ! get the beginning string if lse$prompt_string ( begin_string, local_begin_str, lse$_langbeginprompt, '', '' ) <> true then lse$post_command_proc; return FALSE; endif; ! get the trailing string if lse$prompt_string ( end_string, local_end_str, lse$_langendprompt, '', '' ) <> true then lse$post_command_proc; return FALSE; endif; ! get the language if lse$prompt_lang_pack ( defined_language, language, '', LSE$LANGUAGE, '', lse$get_curr_lang_element(LSE$LANGUAGE) ) then ! set the current language lse$set_curr_lang_element(language); ! set up the delimiter delim := lse$create_delimit(); set(lse$leading_text, delim, begin_string); set(lse$trailing_text, delim, end_string); ! add or delete the delimiter set(lse$optional_delimit, language, delim); lse_set_language_optional_delimit := true; else lse_set_language_optional_delimit := false; endif; lse$post_command_proc; endprocedure; ! lse_set_optional_delimit procedure lse_set_language_optional_list_delimit( ;begin_string, end_string, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Specifies starting and ending strings that delimit optional list placeholders. ! ! DESCRIPTION: ! (SET LANGUAGE OPTIONAL LIST DELIMIT) ! (SET LANGUAGE commandsSET LANGUAGE OPTIONAL LIST DELIMIT) ! (Languagedelimiting placeholders) ! Note that you cannot use any character that you used as a comment ! delimiter. ! ! RELATED COMMANDS: ! EXTRACT LANGUAGE ! NEW LANGUAGE ! SHOW LANGUAGE ! ! CATEGORY: ! Language ! !doc_end ! LOCAL delim, local_begin_str, local_end_str, language; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_language_optional_list_delimit"); ENDON_ERROR; ! get the beginning string if lse$prompt_string ( begin_string, local_begin_str, lse$_langbeginprompt, '', '' ) <> true then lse$post_command_proc; return FALSE; endif; ! get the trailing string if lse$prompt_string ( end_string, local_end_str, lse$_langendprompt, '', '' ) <> true then lse$post_command_proc; return FALSE; endif; ! get the language if lse$prompt_lang_pack ( defined_language, language, '', LSE$LANGUAGE, '', lse$get_curr_lang_element(LSE$LANGUAGE) ) then ! set the current language lse$set_curr_lang_element(language); ! set up the delimiter delim := lse$create_delimit(); set(lse$leading_text, delim, begin_string); set(lse$trailing_text, delim, end_string); ! add or delete the delimiter set(lse$optional_list_delimit, language, delim); lse_set_language_optional_list_delimit := true; else lse_set_language_optional_list_delimit := false; endif; lse$post_command_proc; endprocedure; ! lse_set_optional_list_delimit procedure lse_set_language_pseudocode_delimit( ;begin_string, end_string, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Specifies starting and ending strings that delimit pseudocode placeholders. ! ! DESCRIPTION: ! (SET LANGUAGE PSEUDOCODE DELIMIT) ! (SET LANGUAGE commandsSET LANGUAGE PSEUDOCODE DELIMIT) ! (Languagedelimiting placeholders) ! Note that you cannot use any characters that you used as a comment ! delimiter. ! ! RELATED COMMANDS: ! EXTRACT LANGUAGE ! NEW LANGUAGE ! SHOW LANGUAGE ! ! CATEGORY: ! Language ! !doc_end ! LOCAL delim, local_begin_str, local_end_str, language; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_language_pseudocode_delimit"); ENDON_ERROR; ! get the beginning string if lse$prompt_string ( begin_string, local_begin_str, lse$_langbeginprompt, '', '' ) <> true then lse$post_command_proc; return FALSE; endif; ! get the trailing string if lse$prompt_string ( end_string, local_end_str, lse$_langendprompt, '', '' ) <> true then lse$post_command_proc; return FALSE; endif; ! get the language if lse$prompt_lang_pack ( defined_language, language, '', LSE$LANGUAGE, '', lse$get_curr_lang_element(LSE$LANGUAGE) ) then ! set the current language lse$set_curr_lang_element(language); ! set up the delimiter delim := lse$create_delimit(); set(lse$leading_text, delim, local_begin_str); set(lse$trailing_text, delim, local_end_str); ! add or delete the delimiter set(lse$pseudocode_delimit, language, delim); lse_set_language_pseudocode_delimit := true; else lse_set_language_pseudocode_delimit := false; endif; lse$post_command_proc; endprocedure; ! lse_set_pseudocode_delimit procedure lse_set_language_punctuation_characters (;character_string, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Specifies the characters that are considered punctuation marks, or ! delimiters, in the language. ! ! DESCRIPTION: ! (SET LANGUAGE PUNCTUATION CHARACTERS) ! (SET LANGUAGE commandsSET LANGUAGE PUNCTUATION CHARACTERS) ! (Languagesetting punctuation characters) ! When a placeholder name and its enclosing brackets are ! deleted, the preceding white space is also deleted if there are punctuation ! characters to delimit the program constructs. ! ! RELATED COMMANDS: ! EXTRACT LANGUAGE ! NEW LANGUAGE ! SHOW LANGUAGE ! ! CATEGORY: ! Language ! !doc_end ! LOCAL local_string, language; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_language_punctuation_characters"); ENDON_ERROR; ! get the string if lse$prompt_string ( character_string, local_string, lse$_langpuncprompt, '', '' ) <> true then lse$post_command_proc; return FALSE; endif; ! get the language if lse$prompt_lang_pack ( defined_language, language, '', LSE$LANGUAGE, '', lse$get_curr_lang_element(LSE$LANGUAGE) ) then ! set the current language lse$set_curr_lang_element(language); ! set the identider character string set(lse$punctuation_char, language, local_string); lse_set_language_punctuation_characters := true; else lse_set_language_punctuation_characters := false; endif; lse$post_command_proc; endprocedure; !lse_set_language_punctuation_characters procedure lse_set_language_quotes (;character_string, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Describes the syntax of certain language elements, such as strings, ! that require special handling for proper text formatting. ! ! DESCRIPTION: ! (SET LANGUAGE QUOTES) ! (SET LANGUAGE commandsSET LANGUAGE QUOTES) ! (Languagesetting quotes) ! LSE uses this command to detect comments properly. LSE does not ! recognize comment strings that occur within quoted items, nor ! does it recognize quoted elements that occur within comments. !

! The value must be a string denoting all of the quote characters ! in the language. LSE assumses that quoted items begin and end with ! the same character. ! ! RELATED COMMANDS: ! EXTRACT LANGUAGE ! NEW LANGUAGE ! SHOW LANGUAGE ! ! CATEGORY: ! Language ! !doc_end ! LOCAL local_string, language; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_language_quotes"); ENDON_ERROR; ! get the string if lse$prompt_string ( character_string, local_string, lse$_langquoteprompt, '', '' ) <> true then lse$post_command_proc; return FALSE; endif; ! get the language if lse$prompt_lang_pack ( defined_language, language, '', LSE$LANGUAGE, '', lse$get_curr_lang_element(LSE$LANGUAGE) ) then ! set the current language lse$set_curr_lang_element(language); ! set the identider character string set(lse$quoting_char, language, local_string); lse_set_language_quotes := true; else lse_set_language_quotes := false; endif; lse$post_command_proc; endprocedure; !lse_set_language_quotes procedure lse_set_language_escapes (;character_string, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Describes the syntax of certain language elements, such as strings, ! that require special handling for proper text formatting. ! ! DESCRIPTION: ! (SET LANGUAGE ESCAPES) ! (SET LANGUAGE commandsSET LANGUAGE ESCAPES) ! (Languagesetting language escapes) ! The value must be a quoted string containing the escape characters for ! quoted items. Some languages use escape characters to insert quote ! characters into strings. For example, C uses the backslash ! () as an escape character. If you ! do not supply an escape, then LSE assumes that the language inserts quote ! characters into strings by doubling them. ! ! RELATED COMMANDS: ! EXTRACT LANGUAGE ! NEW LANGUAGE ! SET LANGUAGE commands ! SHOW LANGUAGE ! ! CATEGORY: ! Language ! !doc_end ! LOCAL local_string, language; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_language_escapes"); ENDON_ERROR; ! get the string if lse$prompt_string ( character_string, local_string, lse$_langescapeprompt, '', '') <> true then lse$post_command_proc; return FALSE; endif; ! get the language if lse$prompt_lang_pack ( defined_language, language, '', LSE$LANGUAGE, '', lse$get_curr_lang_element(LSE$LANGUAGE) ) then ! set the current language lse$set_curr_lang_element(language); ! set the identider character string set(lse$quoting_escape_char, language, local_string); lse_set_language_escapes := true; else lse_set_language_escapes := false; endif; lse$post_command_proc; endprocedure; !lse_set_language_excapes procedure lse_set_language_tab_increment (;number, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Specifies the increment of tab stops to be used for buffers ! associated with the language. ! ! DESCRIPTION: ! (SET LANGUAGE TAB INCREMENT) ! (SET LANGUAGE commandsSET LANGUAGE TAB INCREMENT) ! (Languagesetting tab increments) ! The default tab increment is 4. ! ! RELATED COMMANDS: ! EXTRACT LANGUAGE ! NEW LANGUAGE ! SHOW LANGUAGE ! ENTER TAB ! SET BUFFER TAB ! ! CATEGORY: ! Language ! !doc_end ! LOCAL local_value, language; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_language_tab_increment"); ENDON_ERROR; ! get the number if NOT lse$prompt_number ( number, local_value, lse$_langtabprompt, '', 4) then lse$post_command_proc; return FALSE; endif; ! get the language if lse$prompt_lang_pack ( defined_language, language, '', LSE$LANGUAGE, '', lse$get_curr_lang_element(LSE$LANGUAGE) ) then ! set the current language lse$set_curr_lang_element(language); ! set tab increment set(lse$tab_increment, language, local_value); lse_set_language_tab_increment := true; else lse_set_language_tab_increment := false; endif; lse$post_command_proc; endprocedure; !lse_set_language_tab_increment procedure lse_set_language_help_topic (;text_string, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Specifies a prefix string to be concatenated ! in a placeholder or token definition before LSE looks up ! the help text for that placeholder or token. ! ! DESCRIPTION: ! (SET LANGUAGE HELP TOPIC) ! (SET LANGUAGE commandsSET LANGUAGE HELP TOPIC) ! (Languagesetting help topics) ! (Help topic) ! ! RELATED COMMANDS: ! EXTRACT LANGUAGE ! NEW LANGUAGE ! SHOW LANGUAGE ! HELP INDICATED ! ! CATEGORY: ! Language ! !doc_end ! LOCAL local_string, language; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_language_help_topic"); ENDON_ERROR; ! get the string if lse$prompt_string ( text_string, local_string, lse$_langtopicprompt, '', '' ) <> true then lse$post_command_proc; return FALSE; endif; ! get the language if lse$prompt_lang_pack ( defined_language, language, '', LSE$LANGUAGE, '', lse$get_curr_lang_element(LSE$LANGUAGE) ) then ! set the current language lse$set_curr_lang_element(language); ! set the help topic prefix string set(lse$help_prefix, language, local_string); lse_set_language_help_topic := true; else lse_set_language_help_topic := false; endif; lse$post_command_proc; endprocedure; !lse_set_language_help_topic procedure lse_set_language_version (;text_string, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Specifies a string that represents the version number of the language. ! ! DESCRIPTION: ! (SET LANGUAGE VERSION) ! (SET LANGUAGE commandsSET LANGUAGE VERSION) ! (Languagesetting version) ! ! RELATED COMMANDS: ! EXTRACT LANGUAGE ! NEW LANGUAGE ! SHOW LANGUAGE ! ! CATEGORY: ! Language ! !doc_end ! LOCAL local_string, language; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_language_version"); ENDON_ERROR; ! get the string if lse$prompt_string ( text_string, local_string, lse$_langversionprompt, '', '' ) <> true then lse$post_command_proc; return FALSE; endif; ! get the language if lse$prompt_lang_pack ( defined_language, language, '', LSE$LANGUAGE, '', lse$get_curr_lang_element(LSE$LANGUAGE) ) then ! set the current language lse$set_curr_lang_element(language); ! set the version string set(lse$version_string, language, local_string); lse_set_language_version := true; else lse_set_language_version := false; endif; lse$post_command_proc; endprocedure; !lse_set_language_version procedure lse_set_language_wrap ( ;boolean, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Specifies whether text should be wrapped to a new line when you are ! typing beyond the right margin of the current line in any buffer ! associated with the language. ! ! DESCRIPTION: ! (SET LANGUAGE WRAP) ! (SET LANGUAGE commandsSET LANGUAGE WRAP) ! (Languagesetting wrapping) ! ! RELATED COMMANDS: ! EXTRACT LANGUAGE ! NEW LANGUAGE ! SHOW LANGUAGE ! SET BUFFER WRAP ! ! CATEGORY: ! Language ! !doc_end ! LOCAL the_response, language; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_language_wrap"); ENDON_ERROR; if NOT lse$prompt_boolean( boolean, the_response, lse$_langwrapprompt, '', lse$_langdefwrap ) then lse$post_command_proc; return FALSE; endif; if lse$prompt_lang_pack ( defined_language, language, '', LSE$LANGUAGE, '', lse$get_curr_lang_element(LSE$LANGUAGE) ) then ! set the current language lse$set_curr_lang_element(language); ! set wrap on or off set(lse$wrap, language, the_response); lse_set_language_wrap := true; else lse_set_language_wrap := false; endif; lse$post_command_proc; endprocedure; ! lse_set_language_wrap procedure lse_set_language_tag_terminators (;character_string, add_remove, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Specifies a list of characters that you can use to terminate a ! comment tag. ! ! DESCRIPTION: ! (SET LANGUAGE TAG TERMINATORS) ! (SET LANGUAGE commandsSET LANGUAGE TAG TERMINATORS) ! (Languagesetting tag terminators) ! The default tag terminator is ":". ! ! RELATED COMMANDS: ! EXTRACT LANGUAGE ! NEW LANGUAGE ! SHOW LANGUAGE ! ! CATEGORY: ! Language ! !doc_end ! LOCAL add_flag, local_string, language; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_language_tag_terminators"); ENDON_ERROR; ! get the string if NOT lse$prompt_string ( character_string, local_string, lse$_langtagtermprompt, '', lse$_langdeftagterm) then lse$post_command_proc; return FALSE; endif; ! get the add or remove parameter if NOT lse$prompt_add_remove( add_remove, add_flag, "", "", lse$_langdefaddrmv) then lse$post_command_proc; return FALSE; endif; ! get the language if lse$prompt_lang_pack ( defined_language, language, '', LSE$LANGUAGE, '', lse$get_curr_lang_element(LSE$LANGUAGE) ) then ! set the current language lse$set_curr_lang_element(language); ! add or delete the tag terminators set(lse$tag_terminators, language, local_string, add_flag ); lse_set_language_tag_terminators := true; else lse_set_language_tag_terminators := false; endif; lse$post_command_proc; endprocedure; !lse_set_language_tag_terminators procedure lse_set_language_fortran( ;boolean, defined_language) !doc_begin ! ! ONE LINE DEFINITION: ! Specifies special processing for Fortran. ! ! DESCRIPTION: ! (SET LANGUAGE FORTRAN) ! (SET LANGUAGE commandsSET LANGUAGE FORTRAN) ! Note that some commands behave differently when you use this ! command. ! ! RELATED COMMANDS: ! EXTRACT LANGUAGE ! NEW LANGUAGE ! SET LANGUAGE ANSI FORTRAN ! SHOW LANGUAGE ! ! CATEGORY: ! Language ! !doc_end ! LOCAL the_response, language; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_language_fortran"); ENDON_ERROR; if NOT lse$prompt_boolean( boolean, the_response, lse$_langfortranprompt, '', lse$_langdeffortran) then lse$post_command_proc; return FALSE; endif; if lse$prompt_lang_pack ( defined_language, language, '', LSE$LANGUAGE, '', lse$get_curr_lang_element(LSE$LANGUAGE) ) then ! set the current language lse$set_curr_lang_element(language); ! set ansi fortran on or off set(lse$fortran, language, the_response); lse_set_language_fortran := true; else lse_set_language_fortran := false; endif; lse$post_command_proc; endprocedure; ! set_language_fortran procedure lse_show_language(;language_name_wild) !doc_begin ! ! ONE LINE DEFINITION: ! Displays the characteristics of the specified language(s). ! ! DESCRIPTION: ! (SHOW LANGUAGE) ! (Languageshowing) ! If you specify a language name, LSE displays all the attributes ! associated with that language. If you specify a wildcard ! language name, ! LSE displays brief information about each matching language. !

! You can navigate through the language list using Ctrl/F (forward) ! and Ctrl/B (reverse). Ctrl/E (expand) lets you ! display full information on the indicated language. The COLLAPSE command ! reverts back to the brief display. ! ! RELATED COMMANDS: ! SET LANGUAGE commands ! ! CATEGORY: ! Help ! !doc_end ! local default_language, response; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_show_language"); ENDON_ERROR; ! Make response a name ! IF GET_INFO( language_name_wild, 'type' ) = LSE$LANGUAGE_TYPE THEN response := GET_INFO( language_name_wild, 'name' ); ELSE default_language := GET_INFO( CURRENT_BUFFER, 'LSE$LANGUAGE' ); IF default_language = 0 THEN default_language := lse$get_curr_lang_element(lse$language); ENDIF; if not lse$prompt_string ( language_name_wild, response, lse$_setbuflngprompt, "", default_language ) then lse$post_command_proc; RETURN false; endif; ENDIF; lse_show_language := lse$shlst_process( response, lse$language_list ); lse$post_command_proc; endprocedure; ! lse_show_language procedure lse_extract_language (;language_name_wild) !doc_begin ! ! ONE LINE DEFINITION: ! Extracts the definition of the specified language(s). ! ! DESCRIPTION: ! (EXTRACT LANGUAGE) ! (Languageextracting) ! 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 LANGUAGE ! DELETE LANGUAGE ! SET LANGUAGE commands ! SHOW LANGUAGE ! NEW LANGUAGE ! ! CATEGORY: ! Language ! !doc_end ! LOCAL lang_name_pattern; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_extract_language"); ENDON_ERROR; lse_extract_language := FALSE; ! Get the language wildcard name ! if lse$prompt_string ( language_name_wild, lang_name_pattern, lse$_langnamprompt, "", lse$get_curr_lang_element(LSE$LANGUAGE)) then lse_extract_language := lse$extract_lang_pack(lang_name_pattern, LSE$LANGUAGE, FALSE) endif; lse$post_command_proc; endprocedure; ! lse_extract_language; procedure lse_extract_new_language(;language_name_wild) ! ! DESCRIPTION: ! ! Extracts the definition of an language and formats it as portable ! commands. Only definitions created in the current editing session will be ! extracted. ! !doc_begin ! ! ONE LINE DEFINITION: ! Extracts the definition of the specified language(s) defined during ! the current editing session. ! ! DESCRIPTION: ! (EXTRACT NEW LANGUAGE) ! (Languageextracting) ! 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 LANGUAGE ! DELETE LANGUAGE ! SET LANGUAGE commands ! SHOW LANGUAGE ! NEW LANGUAGE ! ! CATEGORY: ! Language ! !doc_end ! LOCAL lang_name_pattern; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_extract_new_language"); ENDON_ERROR; lse_extract_new_language := FALSE; ! Get the language and language wildcard name ! if lse$prompt_string ( language_name_wild, lang_name_pattern, lse$_langnamprompt, "", lse$get_curr_lang_element(LSE$LANGUAGE)) then lse_extract_new_language := lse$extract_lang_pack( lang_name_pattern, LSE$LANGUAGE, TRUE); endif; lse$post_command_proc; endprocedure; ! lse_extract_new_language !-Hyperhelp !procedure lse_set_language_book( ;file_spec, defined_language) ! !doc_begin ! ! ONE LINE DEFINITION: ! Specifies the default online book file name, defining the book ! LSE uses to retrieve online text for a placeholder or token ! whose book is undefined. ! ! DESCRIPTION: ! (SET LANGUAGE book) ! (SET LANGUAGE commandsSET LANGUAGE book) ! (Languagespecifying a book) ! ! RELATED COMMANDS: ! EXTRACT LANGUAGE ! NEW LANGUAGE ! SET LANGUAGE BOOK ! SHOW LANGUAGE ! ! CATEGORY: ! ! Language ! !doc_end ! ! ! LOCAL ! the_file_spec, ! language; ! ! ON_ERROR ! [OTHERWISE]: ! lse$post_command_proc; ! lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, ! "lse_set_language_book"); ! ENDON_ERROR; ! ! IF NOT lse$prompt_existing_file ( file_spec, ! the_file_spec, ! lse$_bookprompt, ! '', ! '') ! then ! lse$post_command_proc; ! return FALSE; ! endif; ! ! if lse$prompt_lang_pack ( defined_language, ! language, ! '', ! LSE$LANGUAGE, ! '', ! lse$get_curr_lang_element(LSE$LANGUAGE) ) ! then ! ! set the current language ! lse$set_curr_lang_element(language); ! ! ! set the book ! set(LSE$BOOK, language, the_file_spec); ! lse_set_language_book := true; ! else ! lse_set_language_book := false; ! endif; ! ! lse$post_command_proc; !endprocedure; ! lse_set_language_book !-Hyperhelp !-Hyperhelp !procedure lse_set_language_reference (;book_reference, defined_language) ! !doc_begin ! ! ONE LINE DEFINITION: ! Sets the default reference tag string for the language. ! ! DESCRIPTION: ! (SET LANGUAGE REFERENCE) ! (SET LANGUAGE commandsSET LANGUAGE REFERENCE) ! (Help reference) ! (Languagesetting book reference tag strings) ! Uses a VAX DOCUMENT reference tag string to define the default ! section of the online book to retrieve for a placeholder or token whose ! reference tag is undefined. ! ! RELATED COMMANDS: ! EXTRACT LANGUAGE ! NEW LANGUAGE ! SET LANGUAGE REFERENCE ! SHOW LANGUAGE ! CATEGORY: ! Language ! !doc_end ! ! ! LOCAL ! local_string, ! language; ! ! ON_ERROR ! [OTHERWISE]: ! lse$post_command_proc; ! lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, ! "lse_set_language_reference"); ! ENDON_ERROR; ! ! ! get the string ! if lse$prompt_string ( book_reference, ! local_string, ! lse$_bookrefprompt, ! '', ! '' ) <> true ! then ! lse$post_command_proc; ! return FALSE; ! endif; ! ! ! get the language ! if lse$prompt_lang_pack ( defined_language, ! language, ! '', ! LSE$LANGUAGE, ! '', ! lse$get_curr_lang_element(LSE$LANGUAGE) ) ! then ! ! set the current language ! lse$set_curr_lang_element(language); ! ! ! set the book reference prefix string ! set(LSE$BOOKREFERENCE, language, local_string); ! lse_set_language_reference := true; ! else ! lse_set_language_reference := false; ! endif; ! ! lse$post_command_proc; ! !endprocedure; !lse_set_language_reference !-Hyperhelp