! LSE$GRAMMAR_ADJUSTMENT.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: Norman M. Chan, Technical Languages and Environments ! ! CREATION DATE: 26-April-1991 ! ! MODIFIED BY: ! ! 4.0-1 SHE 1-Jul-91 Modified some doc headers to allow the documentation ! to build successfully. ! 4.0-2 NMC 9-Jul-91 Use ERROR instead of ERROR_TEXT in error trap for ! lse_new_adjustment and lse_set_adjustment_pattern. ! This is a work around to create the same error ! messages as cli for invalid adjustments. ! 4.0-3 NMC 24-Jul-91 Redo tpu signal handling in builtins. Removed ! work around and reused ERROR_TEXT in NEW AJUST ! and SET ADJUST PATTERN routine. ! 4.0-4 NMC 30-Jul-91 Add special error trap for lse_new_adjustment to ! accomodate case for using adjustment name as default ! pattern. ! 4.0-5 NMC 20-Aug-91 Use lse$unset_curr_lang_element in lse_delete_adjust ! 4.0-6 NMC 29-Aug-91 Fix minor bug in lse_new_adjustment ! 4.0-7 NMC 30-Sep-91 Update current adjustment in lse_new_adjustment ! Add lse$compare_lang_pack_elem call to check for ! possible current adjustment being deleted. ! 4.0-8 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 ! Modified lse$extract_lang_element to ! lse$extract_lang_pack_elem ! 4.0-9 NMC 22-Oct-91 Updated some Haley Headers. ! 4.0-10 DAS 27-Oct-91 Added missing the_lang declaration ! 4.0-11 NMC 30-Dec-91 Modified lse_show_adjustment to set the current ! language. ! 4.0-12 NMC 7-Jan-92 Modified error trap for "!" new adjustment name ! 4.0-13 DEC 22-Jan-92 Fixed documention headers. ! 4.0-14 NMC 5-Feb-92 Fixed error trap for adjustdef for new adjustment. ! 4.0-15 WC3 13-Apr-92 Make NEW silently re-initialize instead of issue ! an error when the element exists ! 4.0-16 SHE 4-May-92 Set current language before adjustment ! 4.0-17 SHE 14-May-92 Removed EXECUTE BUFFER LSE as a related command ! for EXTRACT ADJUSTMENT. ! ! NOTE - FOR ADDING PROCEDURES ! ! The following is a documentation template which is used with PDF toe ! 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_adjustment_module_ident return "4.6-2"; endprocedure; procedure lse$grammar_adjustment_module_init ! Module Init ! Initialize variables used in lse_new_adjustment ! lse$$x_invalid_pattern_num := 0; endprocedure procedure lse_new_adjustment (;adjustment_name, defined_language) ! ! Creates a new adjustment associated with the specified language ! !doc_begin ! ! ONE LINE DEFINITION: ! Creates a new adjustment associated with the specified language. ! ! DESCRIPTION: ! (NEW ADJUSTMENT) ! (NEW ADJUSTMENTSee also SET ADJUSTMENT commands) ! (Adjustmentcreating a new) ! This command defines the behavior of the LSE overviewing commands on ! individual lines of a source file. You can modify the behavior of ! overviews to match your formatting conventions. !

! This command creates and establishes the characteristics of ! an adjustment for use with a particular language. LSE prompts ! you to specify an adjustment name. ! If you do not specify a language name, LSE uses the currently ! defined language. These language and adjustment names become ! the defaults for subsequent SET ADJUSTMENT commands. ! ! RELATED COMMANDS: ! SET ADJUSTMENT commands ! DELETE ADJUSTMENT ! EXTRACT ADJUSTMENT ! SHOW ADJUSTMENT ! ! CATEGORY: ! Language ! !doc_end ! local new_adjust, pattern_conflict, the_adjust_name, the_lang, the_lang_name, temp_pattern; ON_ERROR [LSE$_ADJWHITEFIRST, LSE$_ADJPREFIXFIRST, LSE$_ADJCOLMULT, LSE$_ADJCOLWITHFOR, LSE$_ADJFTNCOMMULT, LSE$_ADJNEEDVISIBLE, LSE$_ADJLINEEND, LSE$_ADJCOLAFTERTEXT, LSE$_ADJFTNCOMAFTERTEXT, LSE$_ADJPREFIXMULT, LSE$_ADJCOLVALREQ, LSE$_ADJCOLINVVAL, LSE$_ADJINCPAT]: eve$message( ERROR_TEXT ); lse$post_command_proc; RETURN FALSE; [LSE$_ADJUSTDEF]: ! We have to trap this error separately because the adjustment name ! could be "!" ! if index( ERROR_TEXT, "!" ) <> 0 then ! Handle the special case that the conflicted adjustment contains ! the "!" eve$message( ERROR, 0, substr(ERROR_TEXT, 38) ); else eve$message( ERROR_TEXT ); endif; lse$post_command_proc; RETURN FALSE; [LSE$_ADJPATCONFLICT]: ! This is a special handling of the case when we are defining an ! adjustment with the adjustment name having conflict with an existing ! adjustment pattern. If the user is defining a pattern different from ! the adjustment name, this is not necessary a real conflict because we ! first default the adjustment pattern to be the same as the adjustment ! name before we reset the adjustment pattern to what the user wants. ! - NMC 8/29/91 ! if pattern_conflict = TRUE then eve$message( ERROR, 0, the_adjust_name ); lse$post_command_proc; RETURN FALSE; else pattern_conflict := TRUE; lse$$x_invalid_pattern_num := lse$$x_invalid_pattern_num + 1; temp_pattern := "Default pattern "+ str(lse$$x_invalid_pattern_num) + " already defined"; set(lse$pattern, new_adjust, temp_pattern); set(lse$adjustment, the_lang, new_adjust, lse$add); lse$post_command_proc; RETURN TRUE; endif; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_new_adjustment"); ENDON_ERROR; lse_new_adjustment := FALSE; ! ! Get the language and the language element name parameter ! if lse$prompt_lang_pack_elem_param( adjustment_name, LSE$ADJUSTMENT, defined_language, LSE$LANGUAGE, the_adjust_name, the_lang_name ) then ! Get the language from the language name ! the_lang := get_info(the_lang_name, 'lse$language_type'); if the_lang <> tpu$k_unspecified then ! Check for already exising ! new_adjust := get_info( the_lang, 'lse$find_adjustment', the_adjust_name ); if get_info( new_adjust, 'type' ) = LSE$ADJUSTMENT_TYPE then lse$delete_adjustment( new_adjust ); endif; ! Create a new adjustment and add it to the language. ! new_adjust := lse$create_adjustment(the_adjust_name); if set(lse$adjustment, the_lang, new_adjust, lse$add) then ! Update current language and adjustment ! lse$set_curr_lang_element(the_lang); lse$set_curr_lang_element(new_adjust); lse_new_adjustment := TRUE; endif; else eve$message (lse$_langnotdef, 0, the_lang_name); endif; endif; lse$post_command_proc; endprocedure; procedure lse_set_adjustment_pattern (;adjustment_pattern, defined_adjustment, defined_language ) ! ! DESCRIPTION: ! Define the pattern of an adjustment ! !doc_begin ! ! ONE LINE DEFINITION: ! Defines the pattern of an adjustment. ! ! DESCRIPTION: ! (SET ADJUSTMENT PATTERN) ! (SET ADJUSTMENT commandsSET ADJUSTMENT PATTERN) ! (Adjustmentsetting a pattern) ! This command specifies a string that LSE compares against the source ! lines. Pattern strings match any string that can be specified ! directly on the command line. Strings with special characters ! must be enclosed in quotes (( )). Whether the string ! is quoted or not, the comparison is case-insensitive. ! You must use the ($()) convention to enclose named pattern ! elements. ! !

! Definitions with literal strings take precedence over definitions ! with predefined patterns. ! ! !

! A list of predefined patterns follows: ! ! (UNNUMBERED) ! (COLUMN=(first-column[,last-column])\BOLD)---Limits the ! column in which the text may start. !

! You can specify either the first column or both the first column and ! the last column. If you specify both the first and last columns, you ! must enclose the column values in parentheses. If you do not specify ! the last column, it takes its default from the first column. ! (IDENTIFIER\BOLD)---Matches a sequence of identifier ! characters. ! (LINE_END\BOLD)---Matches the end of a line, optionally ! preceeded by white space. ! (OPTIONAL_SPACE\BOLD)---Matches any sequence of spaces ! and tabs. ! (FORMFEED\BOLD)---Matches a form-feed character. ! (FORTRAN_COMMENT\BOLD)---Matches only FORTRAN comment lines. ! (FORTRAN_FUNCTION\BOLD)--- Matches the first line of ! any FORTRAN function subprogram that is defined to be any line ! that matches the following pattern: ! ! type [*number] FUNCTION ! !

! where ! ! type :== BYTE ! LOGICAL ! INTEGER ! REAL ! DOUBLE PRECISION ! COMPLEX ! DOUBLE COMPLEX ! CHARACTER ! ! NUMBER :== {DIGIT}... ! (*) ! ! ! (PREFIX\BOLD)---The preceding part of the pattern is a ! prefix. ! (NUMBER\BOLD)---Matches any sequence of digits. White ! space may not appear between digits. In the case of a match with ! both NUMBER and IDENTIFIER, NUMBER takes precedence. ! ! ! ! RELATED COMMANDS: ! NEW ADJUSTMENT ! SHOW ADJUSTMENT ! ! CATEGORY: ! Language ! !doc_end ! local the_adjustment, the_pattern, the_lang; ON_ERROR [LSE$_ADJWHITEFIRST, LSE$_ADJPREFIXFIRST, LSE$_ADJCOLMULT, LSE$_ADJCOLWITHFOR, LSE$_ADJFTNCOMMULT, LSE$_ADJNEEDVISIBLE, LSE$_ADJLINEEND, LSE$_ADJCOLAFTERTEXT, LSE$_ADJFTNCOMAFTERTEXT, LSE$_ADJPREFIXMULT, LSE$_ADJCOLVALREQ, LSE$_ADJCOLINVVAL, LSE$_ADJINCPAT]: eve$message( ERROR_TEXT ); lse$post_command_proc; RETURN FALSE; [LSE$_ADJPATCONFLICT]: if index( ERROR_TEXT, "!" ) <> 0 then ! Handle the special case that the conflicted adjustment contains ! the "!" eve$message( ERROR, 0, substr(ERROR_TEXT, 46) ); else eve$message( ERROR_TEXT ); endif; lse$post_command_proc; RETURN FALSE; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error(ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_adjustment_pattern"); ENDON_ERROR; lse_set_adjustment_pattern := FALSE; ! Get the pattern string ! if lse$prompt_string( adjustment_pattern, the_pattern, lse$_adjpatprompt, '', lse$get_curr_lang_element(LSE$ADJUSTMENT) ) then ! Make sure the adjustment name is associated with the language name ! specified ! if lse$get_valid_lang_pack_elem( defined_adjustment, LSE$ADJUSTMENT, defined_language, LSE$LANGUAGE, the_adjustment, the_lang ) then set(lse$pattern, the_adjustment, the_pattern); ! set the current language and adjustment ! lse$set_curr_lang_element(the_lang); lse$set_curr_lang_element(the_adjustment); lse_set_adjustment_pattern := TRUE; endif; endif; lse$post_command_proc; endprocedure; procedure lse_set_adjustment_compress (;boolean, defined_adjustment, defined_language) ! ! DESCRIPTION: ! Define the group compression attribute of an adjustment ! !doc_begin ! ! ONE LINE DEFINITION: ! Indicates whether groups of matching lines should be compressed. ! ! DESCRIPTION: ! (SET ADJUSTMENT COMPRESS) ! (SET ADJUSTMENT commandsSET ADJUSTMENT COMPRESS) ! (Adjustmentcompressing lines) ! With the parameter value set (on) by default, this tells ! LSE to avoid compressing ! groups and override indentation. The parameter value (off) ! specifies that the group is never compressed. ! ! RELATED COMMANDS: ! NEW ADJUSTMENT ! SHOW ADJUSTMENT ! ! CATEGORY: ! Language ! !doc_end ! local the_adjustment, the_lang, the_response; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error(ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_adjustment_compress"); ENDON_ERROR; lse_set_adjustment_compress := FALSE; if lse$prompt_boolean( boolean, the_response, lse$_adjcomprompt, "", lse$_adjcompdef) then ! Make sure the adjustment name is associated with the language name ! specified ! if lse$get_valid_lang_pack_elem( defined_adjustment, LSE$ADJUSTMENT, defined_language, LSE$LANGUAGE, the_adjustment, the_lang ) then set(lse$compress, the_adjustment, the_response); ! set the current language and adjustment ! lse$set_curr_lang_element(the_lang); lse$set_curr_lang_element(the_adjustment); lse_set_adjustment_compress := TRUE; endif; endif; lse$post_command_proc; endprocedure; procedure lse_set_adjustment_count (;boolean, defined_adjustment, defined_language) ! ! DESCRIPTION: ! Define the count attribute of an adjustment ! !doc_begin ! ! ONE LINE DEFINITION: ! Determines whether the adjusted line contributes to a group's line ! count. ! ! DESCRIPTION: ! (SET ADJUSTMENT COUNT) ! (SET ADJUSTMENT commandsSET ADJUSTMENT COUNT) ! When determining whether to form a group, LSE ! compares the line count with the MINIMUM_LINES value for the language. ! ! RELATED COMMANDS: ! NEW ADJUSTMENT ! SHOW ADJUSTMENT ! ! CATEGORY: ! Language ! !doc_end ! local the_adjustment, the_lang, the_response; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error(ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_adjustment_count"); ENDON_ERROR; lse_set_adjustment_count := FALSE; if lse$prompt_boolean( boolean, the_response, lse$_adjcntprompt, "", lse$_adjcntdef) then ! Make sure the adjustment name is associated with the language name ! specified ! if lse$get_valid_lang_pack_elem( defined_adjustment, LSE$ADJUSTMENT, defined_language, LSE$LANGUAGE, the_adjustment, the_lang ) then set(lse$count_lines, the_adjustment, the_response); ! set the current language and adjustment ! lse$set_curr_lang_element(the_lang); lse$set_curr_lang_element(the_adjustment); lse_set_adjustment_count := TRUE; endif; endif; lse$post_command_proc; endprocedure; procedure lse_set_adjustment_current (;current_indentation, defined_adjustment, defined_language) ! ! DESCRIPTION: ! Define the current line indentation of an adjustment ! !doc_begin ! ! ONE LINE DEFINITION: ! Adjusts the indentation of the current line. ! ! DESCRIPTION: ! (SET ADJUSTMENT CURRENT) ! (SET ADJUSTMENT commandsSET ADJUSTMENT CURRENT) ! (Adjustmentindentation) ! If a buffer line matches the adjustment named in this command, then ! LSE adjusts the indentation of the buffer line by the number of columns ! specified in the command. Negative values adjust the indentation to the ! left. ! ! RELATED COMMANDS: ! NEW ADJUSTMENT ! SHOW ADJUSTMENT ! ! CATEGORY: ! Language ! !doc_end ! local the_adjustment, the_curr_indent, the_lang; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error(ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_adjustment_current"); ENDON_ERROR; lse_set_adjustment_current := FALSE; ! Get the current line indentation value ! if lse$prompt_number( current_indentation, the_curr_indent, lse$_adjcurindprompt, '', 0 ) then ! Make sure the adjustment name is associated with the language name ! specified ! if lse$get_valid_lang_pack_elem( defined_adjustment, LSE$ADJUSTMENT, defined_language, LSE$LANGUAGE, the_adjustment, the_lang ) then set(lse$current_line, the_adjustment, the_curr_indent); ! set the current language and adjustment ! lse$set_curr_lang_element(the_lang); lse$set_curr_lang_element(the_adjustment); lse_set_adjustment_current := TRUE; endif; endif; lse$post_command_proc; endprocedure; procedure lse_set_adjustment_inherit (;inherit_keyword, defined_adjustment, defined_language) ! ! DESCRIPTION: ! ! Define the inherit keyword of an adjustment ! !doc_begin ! ! ONE LINE DEFINITION: ! Specifies that the indentation for the current line is taken from the ! adjusted indentation of another line. ! ! DESCRIPTION: ! (SET ADJUSTMENT INHERIT) ! (SET ADJUSTMENT commandsSET ADJUSTMENT INHERIT) ! (Adjustmentindentation) ! Which line's indentation is inherited is determined by the paramenter ! value. ! ! RELATED COMMANDS: ! NEW ADJUSTMENT ! SHOW ADJUSTMENT ! ! CATEGORY: ! Language ! !doc_end ! local the_adjustment, the_inherit_kwrd, the_lang; ON_ERROR [LSE$_ADJIHTPFXCONF]: eve$message( ERROR_TEXT ); lse$post_command_proc; RETURN FALSE; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error(ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_adjustment_inherit"); ENDON_ERROR; lse_set_adjustment_inherit := FALSE; ! Get the inherit keyword ! if lse$prompt_list ( inherit_keyword, the_inherit_kwrd, lse$_adjihtindprompt, lse$_adjinhdelimit, lse$_adjinhlist, false, '', lse$_adjinhdef ) then case the_inherit_kwrd [lse$$k_inherit_maximum] : the_inherit_kwrd := lse$maximum; [lse$$k_inherit_minimum] : the_inherit_kwrd := lse$minimum; [lse$$k_inherit_next] : the_inherit_kwrd := lse$next; [lse$$k_inherit_previous]: the_inherit_kwrd := lse$previous; [lse$$k_inherit_none] : the_inherit_kwrd := none; [OTHERWISE]: EVE$MESSAGE( lse$_internerr, 0, 'lse_set_adjustment_inherit' ); eve$learn_abort; lse$post_command_proc; RETURN; endcase; ! Make sure the adjustment name is associated with the language name ! specified ! if lse$get_valid_lang_pack_elem( defined_adjustment, LSE$ADJUSTMENT, defined_language, LSE$LANGUAGE, the_adjustment, the_lang ) then set(lse$inherit, the_adjustment, the_inherit_kwrd); ! set the current language and adjustment ! lse$set_curr_lang_element(the_lang); lse$set_curr_lang_element(the_adjustment); lse_set_adjustment_inherit := TRUE; endif; endif; lse$post_command_proc; endprocedure; procedure lse_set_adjustment_overview (;boolean, defined_adjustment, defined_language) ! ! DESCRIPTION: ! ! Define the overview line attribute of an adjustment ! !doc_begin ! ! ONE LINE DEFINITION: ! Indicates whether or not the text of the line is used as the overview line. ! ! DESCRIPTION: ! (SET ADJUSTMENT OVERVIEW) ! (SET ADJUSTMENT commandsSET ADJUSTMENT OVERVIEW) ! (Adjustmentoverview line) ! With the parameter value (on), LSE uses the text of a line as ! the overview line. The parameter value (off) specifies that ! the text cannot be used; text from a later line is used instead. ! ! RELATED COMMANDS: ! NEW ADJUSTMENT ! SHOW ADJUSTMENT ! ! CATEGORY: ! Language ! !doc_end ! local the_adjustment, the_lang, the_response; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error(ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_adjustment_overview"); ENDON_ERROR; lse_set_adjustment_overview := FALSE; if lse$prompt_boolean( boolean, the_response, lse$_adjovwprompt, "", lse$_adjovwdef ) then ! Make sure the adjustment name is associated with the language name ! specified ! if lse$get_valid_lang_pack_elem( defined_adjustment, LSE$ADJUSTMENT, defined_language, LSE$LANGUAGE, the_adjustment, the_lang ) then set(lse$overviews, the_adjustment, the_response); ! set the current language and adjustment ! lse$set_curr_lang_element(the_lang); lse$set_curr_lang_element(the_adjustment); lse_set_adjustment_overview := TRUE; endif; endif; lse$post_command_proc; endprocedure; procedure lse_set_adjustment_prefix_indentation (;indentation_value, defined_adjustment, defined_language) ! ! DESCRIPTION: ! Define the prefix indentation value of an adjustment. ! !doc_begin ! ! ONE LINE DEFINITION: ! Lets you skip a pattern at the beginning of a line to determine ! the indentation value. ! ! DESCRIPTION: ! (SET ADJUSTMENT PREFIX INDENTATION) ! (SET ADJUSTMENT commandsSET ADJUSTMENT PREFIX INDENTATION) ! (Adjustmentdefining prefix indentation values) ! ! RELATED COMMANDS: ! NEW ADJUSTMENT ! SHOW ADJUSTMENT ! ! CATEGORY: ! Language ! !doc_end ! local the_adjustment, the_indent_value, the_lang; ON_ERROR [LSE$_ADJSETPFXCONF]: eve$message( ERROR_TEXT ); lse$post_command_proc; RETURN FALSE; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error(ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_adjustment_prefix_indentation"); ENDON_ERROR; lse_set_adjustment_prefix_indentation := FALSE; ! Get the prefix indentation value ! if lse$prompt_list ( indentation_value, the_indent_value, lse$_adjpfxindprompt, lse$_adjpfxdelimit, lse$_adjpfxlist, false, '', lse$_adjpfxdef) then case the_indent_value [lse$$k_prefix_current] : the_indent_value := lse$current; [lse$$k_prefix_following]: the_indent_value := lse$following; [OTHERWISE]: EVE$MESSAGE( lse$_internerr, 0, 'lse_set_adjustment_prefix_indentation' ); eve$learn_abort; lse$post_command_proc; RETURN; endcase; ! Make sure the adjustment name is associated with the language name ! specified ! if lse$get_valid_lang_pack_elem( defined_adjustment, LSE$ADJUSTMENT, defined_language, LSE$LANGUAGE, the_adjustment, the_lang ) then set(lse$prefix_indent, the_adjustment, the_indent_value); ! set the current language and adjustment ! lse$set_curr_lang_element(the_lang); lse$set_curr_lang_element(the_adjustment); lse_set_adjustment_prefix_indentation := TRUE; endif; endif; lse$post_command_proc; endprocedure; procedure lse_set_adjustment_prefix_adjustment (;adjustment_value, defined_adjustment, defined_language) ! ! DESCRIPTION: ! ! Define the prefix adjustment value of an adjustment ! !doc_begin ! ! ONE LINE DEFINITION: ! Lets you skip a pattern at the beginning of a line to determine ! the adjustment. ! ! DESCRIPTION: ! (SET ADJUSTMENT PREFIX ADJUSTMENT) ! (SET ADJUSTMENT commandsSET ADJUSTMENT PREFIX ADJUSTMENT) ! (Adjustmentsetting prefix adjustments) ! There are two adjustment values: ! ! (unnumbered) ! ! CURRENT -- Tells LSE to use the adjustment of the current definition. ! ! FOLLOWING -- Tells LSE to use the adjustment for the definition that ! matches the text after the prefix. If there is no text after the ! prefix, LSE uses the adjustment for a blank line. If the text after ! the prefix has the adjustment value FOLLOWING, LSE ignores other ! action commands on the definition. ! ! ! RELATED COMMANDS: ! SET ADJUSTMENT commands ! DELETE ADJUSTMENT ! EXTRACT ADJUSTMENT ! SHOW ADJUSTMENT ! ! CATEGORY: ! Tailor ! !doc_end ! local the_adjustment, the_adjust_value, the_lang; ON_ERROR [LSE$_ADJSETPFXCONF]: eve$message( ERROR, 0, get_info( the_adjustment, "lse$name" ) ); lse$post_command_proc; RETURN FALSE; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error(ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_adjustment_prefix_adjustment"); ENDON_ERROR; lse_set_adjustment_prefix_adjustment := FALSE; ! Get the prefix adjustment value ! if lse$prompt_list ( adjustment_value, the_adjust_value, lse$_adjpfxadjprompt, lse$_adjpfxdelimit, lse$_adjpfxlist, false, '', lse$_adjpfxdef ) then case the_adjust_value [lse$$k_prefix_current] : the_adjust_value := lse$current; [lse$$k_prefix_following]: the_adjust_value := lse$following; [OTHERWISE]: EVE$MESSAGE( lse$_internerr, 0, 'lse_set_adjustment_prefix_adjustment' ); eve$learn_abort; lse$post_command_proc; RETURN; endcase; ! Make sure the adjustment name is associated with the language name ! specified ! if lse$get_valid_lang_pack_elem( defined_adjustment, LSE$ADJUSTMENT, defined_language, LSE$LANGUAGE, the_adjustment, the_lang ) then set(lse$prefix_adjust, the_adjustment, the_adjust_value); ! set the current language and adjustment ! lse$set_curr_lang_element(the_lang); lse$set_curr_lang_element(the_adjustment); lse_set_adjustment_prefix_adjustment := TRUE; endif; endif; lse$post_command_proc; endprocedure; procedure lse_set_adjustment_subsequent (;subsequent_indentation, defined_adjustment, defined_language) ! ! DESCRIPTION: ! ! Define the subsequent line indentation of an adjustment ! !doc_begin ! ! ONE LINE DEFINITION: ! Adjusts the indentation of lines after the current line. ! ! DESCRIPTION: ! (SET ADJUSTMENT SUBSEQUENT) ! (SET ADJUSTMENT commandsSET ADJUSTMENT SUBSEQUENT) ! (Adjustmentindentation) ! If a buffer line matches an adjustment defined with this command, ! LSE adjusts the indentation of all lines after that line by the number ! of columns given in the command. Negative values move the indentation ! to the left. You cannot use this command after the SET ADJUSTMENT ! INHERIT command. ! ! RELATED COMMANDS: ! NEW ADJUSTMENT ! SHOW ADJUSTMENT ! ! CATEGORY: ! Language ! !doc_end ! local the_adjustment, the_subseq_indent, the_lang; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error(ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_adjustment_subsequent"); ENDON_ERROR; lse_set_adjustment_subsequent := FALSE; ! Get the subsequent line indentation value ! if lse$prompt_number( subsequent_indentation, the_subseq_indent, lse$_adjssqindprompt, '', 0 ) then ! Make sure the adjustment name is associated with the language name ! specified ! if lse$get_valid_lang_pack_elem( defined_adjustment, LSE$ADJUSTMENT, defined_language, LSE$LANGUAGE, the_adjustment, the_lang ) then set(lse$subsequent_line, the_adjustment, the_subseq_indent); ! set the current language and adjustment ! lse$set_curr_lang_element(the_lang); lse$set_curr_lang_element(the_adjustment); lse_set_adjustment_subsequent := TRUE; endif; endif; lse$post_command_proc; endprocedure; procedure lse_set_adjustment_unit (;boolean, defined_adjustment, defined_language) ! ! DESCRIPTION: ! ! Define the unit attribute of an adjustment ! !doc_begin ! ! ONE LINE DEFINITION: ! Tells LSE to treat consecutive lines as a single unit. ! ! DESCRIPTION: ! (SET ADJUSTMENT UNIT) ! (SET ADJUSTMENT commandsSET ADJUSTMENT UNIT) ! If consecutive lines in a buffer match adjustments defined in this ! command and have the same indentation, then the sequence of lines ! is treated as one group with the first line serving as an overview line. ! Note that all the lines do not have to match the same adjustment ! definition; you only need to use this command on all definitions. ! ! RELATED COMMANDS: ! NEW ADJUSTMENT ! SHOW ADJUSTMENT ! ! CATEGORY: ! Language ! !doc_end ! local the_adjustment, the_lang, the_response; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error(ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_adjustment_unit"); ENDON_ERROR; lse_set_adjustment_unit := FALSE; if lse$prompt_boolean( boolean, the_response, lse$_adjunitprompt, "", lse$_adjunitdef) then ! Make sure the adjustment name is associated with the language name ! specified ! if lse$get_valid_lang_pack_elem( defined_adjustment, LSE$ADJUSTMENT, defined_language, LSE$LANGUAGE, the_adjustment, the_lang ) then set(lse$unit, the_adjustment, the_response); ! set the current language and adjustment ! lse$set_curr_lang_element(the_lang); lse$set_curr_lang_element(the_adjustment); lse_set_adjustment_unit := TRUE; endif; endif; lse$post_command_proc; endprocedure; procedure lse_delete_adjustment(;adjustment_name_wild, language_name_wild) ! ! Deletes the indicated adjustment(s) for the specified language(s). ! Wildcards are accepted for both adjustment and language names. ! !doc_begin ! ! ONE LINE DEFINITION: ! Deletes the definition of one or more adjustments associated with the ! specified lannguage(s). ! ! DESCRIPTION: ! (DELETE ADJUSTMENT) ! (Adjustmentdeleting) ! Wildcards are accepted for both adjustment and language names. ! If you do not specify an adjustment or language name, LSE uses the ! current adjustment and language. ! If the adjustment you are deleting is the current adjustment, ! then the current adjustment element is set to UNSPECIFIED. ! Otherwise, neither the current adjustment nor the current language ! are set as a result of this command. ! ! RELATED COMMANDS: ! NEW ADJUSTMENT ! SHOW ADJUSTMENT ! ! CATEGORY: ! Language ! !doc_end ! local adjust_name_pattern, lang_name_pattern; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_delete_adjustment"); ENDON_ERROR; lse_delete_adjustment := FALSE; ! Make sure the adjustment name is associated with the language name specified ! if lse$prompt_lang_pack_elem_param( adjustment_name_wild, LSE$ADJUSTMENT, language_name_wild, LSE$LANGUAGE, adjust_name_pattern, lang_name_pattern ) then lse_delete_adjustment := lse$delete_lang_pack_elem( adjust_name_pattern, LSE$ADJUSTMENT, lang_name_pattern, LSE$LANGUAGE ); endif; lse$post_command_proc; endprocedure; procedure lse_show_adjustment(;adjustment_name_wild, defined_language) ! !doc_begin ! ! ONE LINE DEFINITION: ! Displays the definitions and characteristics of the indicated adjustments. ! ! DESCRIPTION: ! (SHOW ADJUSTMENT) ! (Adjustmentshowing) ! If you specify an adjustment name, LSE displays all the attributes ! associated with that adjustment. If you specify a wildcard adjustment ! name, LSE displays a list with brief information about each matching ! adjustment. If no name is specified, LSE displays brief information ! about all the adjustments defined for the language. !

! 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 adjustment. The ! COLLAPSE command reverts back to the brief display. ! ! RELATED COMMANDS: ! SET ADJUSTMENT commands ! NEW ADJUSTMENT ! EXTRACT ADJUSTMENT ! ! CATEGORY: ! Help ! !doc_end ! local saved_lang, adjust_name_pattern, the_lang_name, the_lang; 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_adjustment"); ENDON_ERROR; lse_show_adjustment := FALSE; if lse$prompt_lang_pack_elem_param( adjustment_name_wild, LSE$ADJUSTMENT, defined_language, LSE$LANGUAGE, adjust_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( adjust_name_pattern, LSE$ADJUSTMENT_LIST ) then lse_show_adjustment := TRUE; else ! Restore the current language ! lse_show_adjustment := 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; procedure lse_extract_adjustment(;adjustment_name_wild, language_name_wild) ! ! Extracts the definition of an adjustment and formats it as portable ! commands. Wildcarded names are accepted for both adjustment and language ! name. In the lattar case, all adjustment(s) definition associated with ! one or more languages are extracted. ! Extracts the definition of an adjustment(s). ! !doc_begin ! ! ONE LINE DEFINITION: ! Extracts the definition of an adjustment and formats it as portable ! commands. ! ! DESCRIPTION: ! (EXTRACT ADJUSTMENT) ! (Adjustmentextracting) ! 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: ! SET ADJUSTMENT commands ! DELETE ADJUSTMENT ! EXTRACT NEW ADJUSTMENT ! SHOW ADJUSTMENT ! NEW ADJUSTMENT ! ! CATEGORY: ! Language ! !doc_end ! LOCAL adjust_name_pattern, lang_name_pattern, status; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_extract_adjustment"); ENDON_ERROR; lse_extract_adjustment := FALSE; ! Get the adjustment and language wildcard name ! if lse$prompt_lang_pack_elem_param( adjustment_name_wild, LSE$ADJUSTMENT, language_name_wild, LSE$LANGUAGE, adjust_name_pattern, lang_name_pattern ) then lse_extract_adjustment := lse$extract_lang_pack_elem( adjust_name_pattern, LSE$ADJUSTMENT, lang_name_pattern, LSE$LANGUAGE, FALSE) endif; lse$post_command_proc; endprocedure; ! lse_extract_adjustment procedure lse_extract_new_adjustment(;adjustment_name_wild, language_name_wild) ! ! DESCRIPTION: ! ! Extracts the definition of an adjustment and formats it as portable ! commands. Only definitions created in the current editing session will be ! extracted. In the lattar case, all adjustment(s) definition associated with ! one or more languages are extracted. ! «TBS» ! !doc_begin ! ! ONE LINE DEFINITION: ! Extracts the definition of the specified adjustment defined during the ! current editing session. ! ! DESCRIPTION: ! (EXTRACT NEW ADJUSTMENT) ! (Adjustmentextracting) ! 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: ! SET ADJUSTMENT commands ! DELETE ADJUSTMENT ! EXTRACT ADJUSTMENT ! SHOW ADJUSTMENT ! NEW ADJUSTMENT ! ! CATEGORY: ! Language ! !doc_end ! LOCAL adjust_name_pattern, lang_name_pattern; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_extract_new_adjustment"); ENDON_ERROR; lse_extract_new_adjustment := FALSE; ! Get the adjustment and language wildcard name ! if lse$prompt_lang_pack_elem_param( adjustment_name_wild, LSE$ADJUSTMENT, language_name_wild, LSE$LANGUAGE, adjust_name_pattern, lang_name_pattern ) then lse_extract_new_adjustment := lse$extract_lang_pack_elem(adjust_name_pattern, LSE$ADJUSTMENT, lang_name_pattern, LSE$LANGUAGE, TRUE); endif; lse$post_command_proc; endprocedure; ! lse_extract_new_adjustment