home *** CD-ROM | disk | FTP | other *** search
Text File | 1988-05-03 | 46.1 KB | 1,585 lines |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ALED - Ada Line Editor
-
- A Line-Oriented File Editor written in Ada
-
-
- by Richard Conn
- Texas Instruments
- Advanced Computer Systems Lab
- Ada Technology Branch
-
- 10 December 1984
-
-
- Version 2.0
- 21 January 1985
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- C O N T E N T S
-
- 1. INTRODUCTION...............................................1
-
- 2. USING ALED.................................................2
- 2.1. PRELIMINARIES.........................................4
- 2.1.1. LINE RANGES....................................4
- 2.1.2. LINE REFERENCES................................5
- 2.1.3. STRINGS and LINES..............................5
- 2.1.4. INPUT LINE EDITOR..............................6
- 2.1.5. ABORTING COMMANDS..............................6
- 2.2. COMMANDS..............................................6
-
- 3. SYNOPSIS and COMMENTS......................................9
-
-
-
- APPENDICES
-
- A. SAMPLE SESSION............................................10
-
- Index.....................................................20
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ALED - A Line-Oriented File Editor Written in Ada
-
-
-
-
- ALED - Ada Line Editor
-
- A Line-Oriented File Editor written in Ada
-
-
- by Richard Conn
- Texas Instruments
- Advanced Computer Systems Lab
- Ada Technology Branch
-
- 10 December 1984
-
- Version 2.0
- 21 January 1985
-
-
- 1. I N T R O D U C T I O N
-
- ALED is a relatively simple line-oriented file editor which
- is written in the Ada (trademark, United States Department of
- Defense) programming language. It was written to satisfy the
- following needs:
-
- (1) to help the author learn the Ada language by
- writing a useful program whose scope (at a few thousand
- lines) is reasonable
-
- (2) to help others wanting to learn Ada by
- providing a "living example" of an editor written in Ada
-
- (3) to make a transportable editor, written in
- Ada, available for use on a variety of machines; efforts
- were made to isolate any system dependencies to the
- package SYSDEP, so the code should be transportable
- between all machines that have a validated Ada compiler
- and have the routines GET and PUT in the package SYSDEP
- implemented
-
-
- This document is divided into two parts: (1) an overview on
- the operation of the editor from the user's perspective and (2) a
- synopsis of what was learned during its design and comments on
- the design in general.
-
- Version 1.0 of ALED which has been released to the Ada
- Repository is the Engineering Development Model (EDM) of ALED.
- An Advanced Development Model, which was completed some time ago
- and will never be released, was written to learn the basics of
- the problem and to prove that the problem could be solved.
- Version 2.x is the production model of ALED.
-
-
-
-
-
- Page 1
-
-
-
-
-
- ALED - A Line-Oriented File Editor Written in Ada
-
-
-
- 2. U S I N G A L E D
-
- ALED was designed and implemented on a Data General MV10000
- under the ROLM Ada Development Environment. It is invoked on
- this system by typing
-
- X EDITOR
-
- where EDITOR.PR is the name of the file containing the object of
- ALED after compilation and linking. This invocation results in
- the following banner being displayed:
-
- ALED - Ada Line Editor by Richard Conn, Version 2.0
- File Name?
-
- The user is expected to enter the name of the file to be edited
- at this time. A file name must be specified, and one will be
- created if the file does not exist. If the indicated text file
- exists, its contents will be read into a doubly-linked list
- created by ALED and made ready for editing. Input line editing
- (see the following section on the Input Line Editor) is allowed,
- so the user can correct any errors he makes while typing the file
- name.
-
- After the indicated file is read in or created, ALED prompts
- the user with
-
- n>
-
- where "n" is 0 if there are no lines in the file (the file is
- empty) or 1 if there are lines in the file. The number in front
- of the ">" character is the number of the current line. As the
- user moves through the file, this number will be updated each
- time the prompt appears.
-
- Once this prompt appears, ALED uses single-character
- commands with command completion and prompting to interface to
- the user. In response to any one of the single-character
- commands recognized by ALED, the ALED editor will complete the
- text of the command, prompt the user for input parameters
- (allowing him to abort by providing no input in most cases), and
- then perform the function of the command. ALED is interactive in
- nature, and the learning curve for ALED is quite short. Built-in
- summary documentation is provided by means of the H (Help)
- Summary command; to illustrate, when the letter "h" is typed
- (case is not significant on letter commands) and the summary
- option is selected, the following display is presented:
-
-
-
-
-
-
-
-
-
- Page 2
-
-
-
-
-
- ALED - A Line-Oriented File Editor Written in Ada
-
-
-
-
- --- Movement Commands --- ----- Enter Lines -----
- + Advance N Lines A Append after <line>
- - Back Up N Lines I Insert before <line>
- F Find <string> in <range>
- J Jump to <line> ----- Print Lines -----
- N Find Next <string> . Print Current Line
- ----- Delete Command ----- < Print Next Line
- D Delete lines in <range> > Print Next Line
- L List over <range>
- ---- Help and Exits ----
- H This Help Text ---- Substitution ----
- Q Quit without Updating S String Substitute
- X Exit and Update over <range>
-
- ---- File Get/Put ---- -- Miscellaneous --
- G Get <file> after <line> ? Print Statistics
- P Put <file> over <range>
-
- <Range>: % %,%
- First or Second Entries --
- #-Number, .-Current, C-Current, F-First, L-Last
- Singular Entries --
- A-All, P-Page
-
-
- -- Figure 1: ALED Help Command and Display --
-
- To reiterate, the above display was generated as follows:
-
- 1) the prompt "0>" was printed by ALED
- 2) the user typed the letter "h" followed by the
- letter "s" to select the summary
- 3) the command summary was printed by ALED
- command
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Page 3
-
-
-
-
-
- ALED - A Line-Oriented File Editor Written in Ada
-
-
-
- 2.1. PRELIMINARIES
-
- 2.1.1. LINE RANGES
- Several of the ALED commands, such as List and Find, perform
- their operations over a range of lines. They prompt the user for
- this line range with the herald "<range>". Examples of this
- prompt are:
-
- 1) list lines in <range>
- 2) find <string>
- over <range>
- 3) substitute for old <string>
- new <string>
- over <range>
-
- Whenever the range prompt ("<range>") is presented, the user
- may enter any of the following responses:
-
- Response Meaning
- -------- -------
- A or a All Lines
- P or p Current Page (next 20 lines)
- . or C or c Current Line
- F or f First Line
- L or l Last Line
-
- #,# A pair of line numbers, like "5,8",
- or relative line references, like
- "-5,+10" for 5 lines before the
- current line to 10 lines after the
- current line, or any combination,
- like "5,+10" for line 5 to 10 lines
- after the current line; the only
- restriction is that the first number
- must evaluate to be less than the
- second number
-
- s,s A mixture of the symbols for Current
- Line, First Line, Last Line, and
- a line number or relative line
- reference, like ".,L" for current
- line to the last line, "1,." for line
- 1 to the current line, "F,." for first
- line to the current line, "-5,." for
- five lines before the current line to
- the current line, etc.
-
-
-
-
-
-
-
-
-
-
- Page 4
-
-
-
-
-
- ALED - A Line-Oriented File Editor Written in Ada
-
-
-
- Examples:
-
- list lines in <range> A <-- all lines
- list lines in <range> .,L <-- current to last
- list lines in <range> 1,5 <-- lines 1 to 5
- list lines in <range> -5,+6 <-- 5 lines before the
- current line to 6
- lines after the
- current line
- list lines in <range> P <-- next 20 lines
- list lines in <range> F,L <-- same as All lines
-
-
- 2.1.2. LINE REFERENCES
- Some commands operate only on a specific line, such as the
- Append and Insert commands. The user is to indicate a specific
- line, as opposed to a range of lines, in response to the "<line>"
- herald printed by these commands; for example:
-
- append after <line>
- insert before <line>
-
- Any of the forms indicated above may be used to define this
- line reference, and the indicated line becomes the first line of
- the range. For instance, if "A" (all lines) is the response to
- the herald, then line 1 is the indicated line since all lines
- references line 1 to the last line. It is usually safer to
- reference only one line in response to the "<line>" herald (like,
- "5" or ".") rather than to use a range specification.
-
-
- 2.1.3. STRINGS and LINES
- Some commands accept a string or a line as input, such as
- the Substitute and Insert commands. In both cases, the text
- which is input by the user is simply a group of characters. No
- quotes or other delimiters are necessary. A blank line is input
- by simply striking the RETURN key or entering any number of space
- characters followed by the RETURN key.
-
- When inputting a group of lines via the Append or Insert
- commands, the lines are prompted for with the herald:
-
- n:
-
- where "n" is the number of the line that is about to be input.
- The user may enter characters as he desires in response to this
- prompt; blank lines may be entered by simply striking the RETURN
- key. To terminate input, the user enters a single dot (".")
- followed by RETURN. See the sample session below and experiment
- with the editor itself for clarification.
-
-
-
-
-
-
- Page 5
-
-
-
-
-
- ALED - A Line-Oriented File Editor Written in Ada
-
-
-
- 2.1.4. INPUT LINE EDITOR
- The user has the ability to edit his string or line inputs
- as he enters each character. This is done by striking any one of
- the three input line editor command characters. The following
- table summarizes these characters, giving their default values
- and the functions they perform.
-
- Default
- Value Function
- ------- --------
- <DEL> Delete previous character
- ^U Delete all previous characters and restart input
- ^R Retype the line or string entered so far
-
- These default values may be changed to some other values by
- editing the source code and changing three constants.
-
- 2.1.5. ABORTING COMMANDS
- If the user strikes a command by accident, most commands may
- be aborted by simply doing the following:
-
- 1) not specifying a range of lines (enter a RETURN in
- response to the <range> herald)
- 2) not specifying a line (enter a RETURN in response to
- the <line> herald)
- 3) not specifying a file name for the Get and Put
- commands (enter a RETURN)
-
-
-
-
- 2.2. COMMANDS
- The following presents the various commands of ALED. The
- sample session illustrates their use.
-
- COMMAND: .
- FUNCTION: Print the current line
- The "." command prints the current line.
-
- COMMAND: <
- FUNCTION: Back up to the last line and print it
- The "<" command backs up to the last line and prints it.
-
- COMMAND: >
- FUNCTION: Advance to the next line and print it
- The ">" command advances to the next line and prints it.
-
-
-
-
-
-
-
-
-
-
- Page 6
-
-
-
-
-
- ALED - A Line-Oriented File Editor Written in Ada
-
-
- COMMAND: +
- FUNCTION: Advance n lines from the current line
- The "+" command moves the user an indicated number of lines
- forward from his current position.
-
- COMMAND: -
- FUNCTION: Back up n lines from the current line
- The "-" command moves the user an indicated number of lines
- backward from his current position.
-
- COMMAND: ?
- FUNCTION: Print statistics
- The "?" command prints the name of the file being edited and
- the number of lines in the edit buffer.
-
- COMMAND: A
- FUNCTION: Append lines
- The A command allows the user to enter a group of lines
- after the indicated line. Lines are entered until the user types
- a line containing a single dot (".") in the first column followed
- by a RETURN. The Insert command is like the Append command
- except that it inserts lines BEFORE the indicated line, where
- Append appends lines AFTER the indicated line.
-
- COMMAND: D
- FUNCTION: Delete lines
- The D command deletes all lines over the indicated range of
- lines. There is no recovery from this command.
-
- COMMAND: F
- FUNCTION: Find the first occurance of a string
- The F command searches for the indicated string over the
- indicated range of lines. The first line in the range which
- contains the string is positioned to and the line is printed.
-
- COMMAND: G
- FUNCTION: Get a File
- The G command loads the indicated file into the editor
- buffer after the indicated line. This command can be used to
- read in a file to be included in the edit buffer for paste
- operations, where the Put command is the complementary cut
- operation.
-
- COMMAND: H
- FUNCTION: Print Help Information
- The H command prints a summary of the ALED commands, just
- the names of the ALED commands, or a summary of numeric input
- options to the user.
-
-
-
-
-
-
-
-
-
- Page 7
-
-
-
-
-
- ALED - A Line-Oriented File Editor Written in Ada
-
-
-
- COMMAND: I
- FUNCTION: Insert lines
- The I command allows the user to enter a group of lines
- before the indicated line. Lines are entered until the user
- types a line containing a single dot (".") in the first column
- followed by a RETURN. The Append command is like the Insert
- command except that it appends lines AFTER the indicated line,
- where Insert inserts lines BEFORE the indicated line.
-
- COMMAND: J
- FUNCTION: Jump to the indicated line
- The J command positions the user at the indicated line. The
- line is not printed.
-
- COMMAND: L
- FUNCTION: List lines over a range
- The L command lists all lines over the indicated range of
- lines.
-
- COMMAND: N
- FUNCTION: Find Next occurance of indicated string
- The N command searches for the indicated string starting at
- the next line in the file and proceeding to the end of the file.
- If the user inputs a blank line (a simple RETURN), the last
- string referenced by an F or N command is searched for again.
-
- COMMAND: P
- FUNCTION: Put a range of lines into a file
- The P command writes a group of lines from the edit buffer
- out to a file on disk. This may be used to create desired
- external files or it may be used to cut a section out of the edit
- buffer and paste it in (via the Get command) elsewhere.
-
- COMMAND: Q
- FUNCTION: Quit editor and do not update file
- The Q command allows the user to exit the editor without
- changing the original file on the disk.
-
- COMMAND: S
- FUNCTION: Substitute strings
- The S command substitutes one string for another over the
- indicated range of lines. All occurrances of the old string are
- replaced by the new string over this range.
-
- COMMAND: X
- FUNCTION: Exit the editor and update the file
- The X command exits the editor and updates the file on the
- disk.
-
-
-
-
-
-
-
-
- Page 8
-
-
-
-
-
- ALED - A Line-Oriented File Editor Written in Ada
-
-
-
- 3. S Y N O P S I S a n d C O M M E N T S
-
- In summary, the following items were learned from this
- experience:
-
- 1. Ada is feasible; the editor ran with reasonable
- speed
-
- 2. The Ada code was fairly efficient; EDITOR used
- only TEXT_IO for support, and, after a 58K
- initial overhead, the growth of code was
- approximately 9 words/line of code
-
- 3. Standardization under TEXT_IO needs some work;
- some simple, fundamental items, such as an
- input line editor available under GET_LINE,
- are missing (this is why I had to write my
- own input line editor) and GET does not return
- or pass every possible character (the DEL
- character does not pass thru the GET routine
- in my TEXT_IO package, for instance); do all
- GET routines allow single-character input?
-
- 4. Generics are useful and work well; software
- components libraries will be quite beneficial
- in reducing programming overhead once they
- have been developed
-
- 5. Exceptions are very, very useful; note their
- use throughout the code and how they are
- fundamental to the design (note the BEGIN/END
- in the main loop)
-
- 6. Ada code can be written to be quite readable
- and maintainable; I feel that I have successfully
- done this with ALED (assuming that knowledge
- of the generic package in LIST.ADA is known)
-
- 7. In version 2.0 of ALED, the System Dependencies
- were effectively isolated in the package SYSDEP.
- SYSDEP provided only two required routines,
- GET (which input the next character without
- interpretation of any kind) and PUT (which output
- a character without interpretation). This made
- a much more friendly user interface possible.
-
-
-
-
-
-
-
-
-
-
-
- Page 9
-
-
-
-
-
- ALED - A Line-Oriented File Editor Written in Ada
-
-
-
- A. S A M P L E S E S S I O N
- The following is a sample session which illustrates the
- operation of ALED. Comments are placed out to the side, prefixed
- by "<--".
-
-
- ALED - Ada Line Editor by Richard Conn, Version 1.0
- File Name? t.txt <-- File name is selected
- New File <-- File does not already exist
- 0 Lines in File
- Type H for Help
- 0> append after <line> . <-- Append Lines into buffer
- Enter Lines (.<RETURN> to Stop)
- 1: This is a test and demonstration of ALED
- 2: This is a very short test, but all commands
- 3: should be exercised by it
- 4: Note that all commands are single characters;
- 5: the editor fills in the prompt with each
- 6: single character input at the command prompt "n>"
- 7: A single dot in a line terminates input
- 8: . <-- Input is complete
-
- 7> list lines in <range> all <-- List all lines
- 1: This is a test and demonstration of ALED
- 2: This is a very short test, but all commands
- 3: should be exercised by it
- 4: Note that all commands are single characters;
- 5: the editor fills in the prompt with each
- 6: single character input at the command prompt "n>"
- 7: A single dot in a line terminates input
-
- 7> list lines in <range> 1,4 <-- List range of lines
- 1: This is a test and demonstration of ALED
- 2: This is a very short test, but all commands
- 3: should be exercised by it
- 4: Note that all commands are single characters;
-
- 4> list lines in <range> -1,+2 <-- List range of lines
- 3: should be exercised by it
- 4: Note that all commands are single characters;
- 5: the editor fills in the prompt with each
- 6: single character input at the command prompt "n>"
-
- 6> list lines in <range> 1 <-- List first line
- 1: This is a test and demonstration of ALED
-
-
-
-
-
-
-
-
-
-
-
- Page 10
-
-
-
-
-
- ALED - A Line-Oriented File Editor Written in Ada
-
-
- 1> list lines in <range> p <-- List current page
- 1: This is a test and demonstration of ALED
- 2: This is a very short test, but all commands
- 3: should be exercised by it
- 4: Note that all commands are single characters;
- 5: the editor fills in the prompt with each
- 6: single character input at the command prompt "n>"
- 7: A single dot in a line terminates input
-
- 7> list lines in <range> a <-- List all lines
- 1: This is a test and demonstration of ALED
- 2: This is a very short test, but all commands
- 3: should be exercised by it
- 4: Note that all commands are single characters;
- 5: the editor fills in the prompt with each
- 6: single character input at the command prompt "n>"
- 7: A single dot in a line terminates input
-
- 7> Error <-- Invalid Commands
- 7> Error
-
- 7> - back up N lines <line count> 3 <-- Backup 3 lines
- 4> . <-- Print current line
- 4: Note that all commands are single characters;
- 4> + advance N lines <line count> 1 <-- Advance 1 line
- 5> . <-- Print current line
- 5: the editor fills in the prompt with each
-
- 5> substitute for old <string> test <-- substitute
- new <string> xx
- over <range> a
- 1: This is a xx and demonstration of ALED <-- affected
- 2: This is a very short xx, but all commands <-- lines
-
- 7> substitute for old <string> xx <-- change back
- new <string> test
- over <range> 2
- 2: This is a very short test, but all commands
-
- 3> find <string> xx <-- look for "xx"
- over <range> a
- 1: This is a xx and demonstration of ALED
-
- 1> substitute for old <string> xx <-- change it
- new <string> test
- over <range> .
- 1: This is a test and demonstration of ALED
-
- 2> find <string> test <-- look for first
- over <range> a
- 1: This is a test and demonstration of ALED
-
- 1> next Occurrance of <string> <-- look for next
- 2: This is a very short test, but all commands
-
-
-
- Page 11
-
-
-
-
-
- ALED - A Line-Oriented File Editor Written in Ada
-
-
-
- 2> list lines in <range> L <-- look at last line
- 7: A single dot in a line terminates input
-
- 7> append after <line> L <-- append lines
- Enter Lines (.<RETURN> to Stop)
- 8: This is yet another test
- 9: These lines are being appended to the
- 10: end of the file.
- 11: I am inserting several instances of
- 12: the word test
- 13: so that there will be something to search for
- 14: in further tests of the Next Occurrance command
- 15: . <-- end input
-
- 14> find <string> test <-- search for "test"
- over <range> a
- 1: This is a test and demonstration of ALED
-
- 1> next Occurrance of <string> <-- search again
- 2: This is a very short test, but all commands
-
- 2> next Occurrance of <string> <-- and again
- 8: This is yet another test
-
- 8> next Occurrance of <string> <-- and again
- 12: the word test
-
- 12> next Occurrance of <string> <-- and again
- 14: in further tests of the Next Occurrance command
-
- 14> next Occurrance of <string> <-- and again
- 14: in further tests of the Next Occurrance command
-
- 14> substitute for old <string> test <-- change string
- new <string> xxxxxxx
- over <range> a
- 1: This is a xxxxxxx and demonstration of ALED
- 2: This is a very short xxxxxxx, but all commands
- 8: This is yet another xxxxxxx
- 12: the word xxxxxxx
- 14: in further xxxxxxxs of the Next Occurrance command
-
- 14> substitute for old <string> xxxxxxx <-- change back
- new <string> test
- over <range> a
- 1: This is a test and demonstration of ALED
- 2: This is a very short test, but all commands
- 8: This is yet another test
- 12: the word test
- 14: in further tests of the Next Occurrance command
-
-
-
-
-
-
- Page 12
-
-
-
-
-
- ALED - A Line-Oriented File Editor Written in Ada
-
-
-
- 14> substitute for old <string> test
- new <string> "test"
- over <range> 12
- 12: the word "test"
-
- 13> jump to <line> 1 <-- Jump command
-
- 1> jump to <line> L <-- Jump to last line
-
- 14> jump to <line> 1 <-- Jump to first line
-
- 1> list lines in <range> p
- 1: This is a test and demonstration of ALED
- 2: This is a very short test, but all commands
- 3: should be exercised by it
- 4: Note that all commands are single characters;
- 5: the editor fills in the prompt with each
- 6: single character input at the command prompt "n>"
- 7: A single dot in a line terminates input
- 8: This is yet another test
- 9: These lines are being appended to the
- 10: end of the file.
- 11: I am inserting several instances of
- 12: the word "test"
- 13: so that there will be something to search for
- 14: in further tests of the Next Occurrance command
-
- 14> put <file> q.txt <-- Write lines out
- over <range> 11,L <-- Limit range
- 14> get <file> q.txt <-- Read back in after line 1
- after <line> 1
- 1> list lines in <range> a <-- look at results
- 1: This is a test and demonstration of ALED
- 2: I am inserting several instances of
- 3: the word "test"
- 4: so that there will be something to search for
- 5: in further tests of the Next Occurrance command
- 6: This is a very short test, but all commands
- 7: should be exercised by it
- 8: Note that all commands are single characters;
- 9: the editor fills in the prompt with each
- 10: single character input at the command prompt "n>"
- 11: A single dot in a line terminates input
- 12: This is yet another test
- 13: These lines are being appended to the
- 14: end of the file.
- 15: I am inserting several instances of
- 16: the word "test"
- 17: so that there will be something to search for
- 18: in further tests of the Next Occurrance command
-
- 18> get <file> q.txt <-- read lines back in
- after <line> 7
-
-
-
- Page 13
-
-
-
-
-
- ALED - A Line-Oriented File Editor Written in Ada
-
-
-
- 7> list lines in <range> p <-- list page of lines
- 7: should be exercised by it
- 8: I am inserting several instances of
- 9: the word "test"
- 10: so that there will be something to search for
- 11: in further tests of the Next Occurrance command
- 12: Note that all commands are single characters;
- 13: the editor fills in the prompt with each
- 14: single character input at the command prompt "n>"
- 15: A single dot in a line terminates input
- 16: This is yet another test
- 17: These lines are being appended to the
- 18: end of the file.
- 19: I am inserting several instances of
- 20: the word "test"
- 21: so that there will be something to search for
- 22: in further tests of the Next Occurrance command
-
- 22> insert before <line> 16 <-- insert line
- Enter Lines (.<RETURN> to Stop)
- 16: testtesttesttest
- 17: . <-- end input
-
- 17> < <-- backup
- 16: testtesttesttest
-
- 16> <
- 15: A single dot in a line terminates input
-
- 15> >
- 16: testtesttesttest
-
- 16> >
- 17: This is yet another test
-
- 17> <
- 16: testtesttesttest
-
- 16> .
- 16: testtesttesttest
-
- 16> substitute for old <string> test <-- substitute
- new <string> xxxx
- over <range> .
- 16: xxxxtesttesttest <-- observe progress of
- 16: xxxxxxxxtesttest <-- substitute command
- 16: xxxxxxxxxxxxtest
- 16: xxxxxxxxxxxxxxxx
-
- 17> <
- 16: xxxxxxxxxxxxxxxx
-
-
-
-
-
- Page 14
-
-
-
-
-
- ALED - A Line-Oriented File Editor Written in Ada
-
-
-
- 16> substitute for old <string> xxxx <-- and again
- new <string> test
- over <range> .
- 16: testxxxxxxxxxxxx
- 16: testtestxxxxxxxx
- 16: testtesttestxxxx
- 16: testtesttesttest
-
- 17> jump to <line> 1
-
- 1> ? <-- statistics
- Edit File Name: t.txt
- 23 Lines in File
- 1> jump to <line> L <-- verify line count
-
- 23> jump to <line> 1
-
- 1> list lines in <range> .
- 1: This is a test and demonstration of ALED
-
- 1> .
- 1: This is a test and demonstration of ALED
-
- 1> list lines in <range> p
- 1: This is a test and demonstration of ALED
- 2: I am inserting several instances of
- 3: the word "test"
- 4: so that there will be something to search for
- 5: in further tests of the Next Occurrance command
- 6: This is a very short test, but all commands
- 7: should be exercised by it
- 8: I am inserting several instances of
- 9: the word "test"
- 10: so that there will be something to search for
- 11: in further tests of the Next Occurrance command
- 12: Note that all commands are single characters;
- 13: the editor fills in the prompt with each
- 14: single character input at the command prompt "n>"
- 15: A single dot in a line terminates input
- 16: testtesttesttest
- 17: This is yet another test
- 18: These lines are being appended to the
- 19: end of the file.
- 20: I am inserting several instances of
- 21: the word "test"
-
- 21> delete lines in <range> 8,11 <-- delete lines
-
- 8> jump to <line> 1
-
-
-
-
-
-
-
- Page 15
-
-
-
-
-
- ALED - A Line-Oriented File Editor Written in Ada
-
-
-
- 1> list lines in <range> p
- 1: This is a test and demonstration of ALED
- 2: I am inserting several instances of
- 3: the word "test"
- 4: so that there will be something to search for
- 5: in further tests of the Next Occurrance command
- 6: This is a very short test, but all commands
- 7: should be exercised by it
- 8: Note that all commands are single characters;
- 9: the editor fills in the prompt with each
- 10: single character input at the command prompt "n>"
- 11: A single dot in a line terminates input
- 12: testtesttesttest
- 13: This is yet another test
- 14: These lines are being appended to the
- 15: end of the file.
- 16: I am inserting several instances of
- 17: the word "test"
- 18: so that there will be something to search for
- 19: in further tests of the Next Occurrance command
-
- 19> delete lines in <range> 2,5 <-- delete more lines
-
- 2> list lines in <range> a
- 1: This is a test and demonstration of ALED
- 2: This is a very short test, but all commands
- 3: should be exercised by it
- 4: Note that all commands are single characters;
- 5: the editor fills in the prompt with each
- 6: single character input at the command prompt "n>"
- 7: A single dot in a line terminates input
- 8: testtesttesttest
- 9: This is yet another test
- 10: These lines are being appended to the
- 11: end of the file.
- 12: I am inserting several instances of
- 13: the word "test"
- 14: so that there will be something to search for
- 15: in further tests of the Next Occurrance command
-
- 15> Exit and update file (Y/N)? n
-
- 15> quit without File Update (Y/N)? n
-
- 15> Exit and update file (Y/N)? y
-
-
-
-
-
-
-
-
-
-
-
- Page 16
-
-
-
-
-
- ALED - A Line-Oriented File Editor Written in Ada
-
-
-
- -) type t.txt <-- final file
- This is a test and demonstration of ALED
- This is a very short test, but all commands
- should be exercised by it
- Note that all commands are single characters;
- the editor fills in the prompt with each
- single character input at the command prompt "n>"
- A single dot in a line terminates input
- testtesttesttest
- This is yet another test
- These lines are being appended to the
- end of the file.
- I am inserting several instances of
- the word "test"
- so that there will be something to search for
- in further tests of the Next Occurrance command
-
- -) type q.txt <-- Q.TXT file
- I am inserting several instances of
- the word "test"
- so that there will be something to search for
- in further tests of the Next Occurrance command
-
- -) delete q.txt
-
- -) x editor
- ALED - Ada Line Editor by Richard Conn, Version 1.0
- File Name? t.txt <-- reedit file
- 15 Lines in File
- Type H for Help
- 1> list lines in <range> a
- 1: This is a test and demonstration of ALED
- 2: This is a very short test, but all commands
- 3: should be exercised by it
- 4: Note that all commands are single characters;
- 5: the editor fills in the prompt with each
- 6: single character input at the command prompt "n>"
- 7: A single dot in a line terminates input
- 8: testtesttesttest
- 9: This is yet another test
- 10: These lines are being appended to the
- 11: end of the file.
- 12: I am inserting several instances of
- 13: the word "test"
- 14: so that there will be something to search for
- 15: in further tests of the Next Occurrance command
-
- 15> delete lines in <range> 8
-
- 8> quit without File Update (Y/N)? y <-- demo QUIT
-
-
-
-
-
-
- Page 17
-
-
-
-
-
- ALED - A Line-Oriented File Editor Written in Ada
-
-
-
-
- -) x editor
- ALED - Ada Line Editor by Richard Conn, Version 1.0
- File Name? t.txt <-- reedit file
- 15 Lines in File
- Type H for Help
- 1> list lines in <range> a
- 1: This is a test and demonstration of ALED
- 2: This is a very short test, but all commands
- 3: should be exercised by it
- 4: Note that all commands are single characters;
- 5: the editor fills in the prompt with each
- 6: single character input at the command prompt "n>"
- 7: A single dot in a line terminates input
- 8: testtesttesttest
- 9: This is yet another test
- 10: These lines are being appended to the
- 11: end of the file.
- 12: I am inserting several instances of
- 13: the word "test"
- 14: so that there will be something to search for
- 15: in further tests of the Next Occurrance command
-
- 15> delete lines in <range> 8 <-- remove line from file
-
- 8> Exit and update file (Y/N)? y <-- demo EXIT
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Page 18
-
-
-
-
-
- ALED - A Line-Oriented File Editor Written in Ada
-
-
-
- -) type t.txt <-- show result
- This is a test and demonstration of ALED
- This is a very short test, but all commands
- should be exercised by it
- Note that all commands are single characters;
- the editor fills in the prompt with each
- single character input at the command prompt "n>"
- A single dot in a line terminates input
- This is yet another test
- These lines are being appended to the
- end of the file.
- I am inserting several instances of
- the word "test"
- so that there will be something to search for
- in further tests of the Next Occurrance command
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Page 19
-
-
-
-
-
- ALED - A Line-Oriented File Editor Written in Ada
-
-
-
- I n d e x
-
-
- +
- + Command, 7
-
- -
- - Command, 7
-
- <
- < Command, 6
-
- >
- > Command, 6
-
- ?
- ? Command, 7
-
- A
- A Command, 7
- Aborting Commands, 6
- Ada, 1
- Advance Line, 6
- Advance N Lines, 7
- Advanced Development Model, 1
- ALED
- Aborting Commands, 6
- ADM, 1
- Advanced Development Model, 1
- EDM, 1
- Engineering Development Model, 1
- Help Command, 3
- Input Line Editor, 6
- Line Input, 5
- Line Ranges, 4
- Line References, 5
- Prompt, 2
- Purpose, 1
- String Input, 5
- Append Lines, 7
-
- B
- Back Up Line, 6
- Back Up N Lines, 7
-
- C
- Command
- +, 7
- -, 7
- ., 6
- <, 6
- >, 6
- ?, 7
- A, 7
-
-
- Page 20
-
-
-
-
-
- ALED - A Line-Oriented File Editor Written in Ada
-
-
- D, 7
- F, 7
- G, 7
- H, 7
- I, 8
- J, 8
- L, 8
- N, 8
- P, 8
- Q, 8
- S, 8
- X, 8
- COMMANDS, 6
-
- D
- D Command, 7
- Delete Lines, 7
- Dot Command, 6
-
- E
- Engineering Development Model, 1
- Exit, 8
-
- F
- F Command, 7
- File
- Get, 7
- Put, 8
- Find Next String, 8
- Find String, 7
-
- G
- G Command, 7
- Get File, 7
-
- H
- H Command, 7
- Help, 3, 7
-
- I
- I Command, 8
- Input Line Editor, 6
- Insert Lines, 8
- INTRODUCTION, 1
-
- J
- J Command, 8
- Jump to Line, 8
-
- L
- L Command, 8
- Line Range Specification, 4
- Line Reference Specification, 5
- List Lines, 8
-
-
-
- Page 21
-
-
-
-
-
- ALED - A Line-Oriented File Editor Written in Ada
-
-
- N
- N Command, 8
- Next String, 8
-
- P
- P Command, 8
- PRELIMINARIES, 4
- Print Current Line, 6
- Print Statistics, 7
- Put File, 8
-
- Q
- Q Command, 8
- Quit, 8
-
- S
- S Command, 8
- SAMPLE SESSION, 10
- Substitute Strings, 8
- SYNOPSIS and COMMENTS, 9
-
- U
- USING ALED, 2
-
- X
- X Command, 8
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Page 22
-
-
-
-
-
-