home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-11-08 | 2.1 KB | 64 lines | [TEXT/MPS ] |
- #
- # MPW Startup Command Script to set up Macintosh MPW Icon
- # special menus.
- #
- # Author: Bob Alexander
- #
- Set IconMenu 'Icon' # Define menu in which to put icon menu items.
- #AddMenu "{IconMenu}" '(-' '' # Use this separator if not first item of menu.
- #
- # Do Icon -- Evaluates the Icon expressions(s) or complete program
- # selected in the active window. Of nothing is selected, the line
- # containing the insertion point is evaluated (just like "Enter").
- #
- AddMenu Icon '/IDo Icon' 'CopyExec "{Active}" | DoIcon'
- #
- # Write Empty Procedure -- Writes an empty "procedure main()" shell
- # into the active window.
- #
- AddMenu "{IconMenu}" 'Write Empty Procedure' ∂
- 'Echo "procedure main()"; ∂
- Echo " "; ∂
- Echo "end"; ∂
- Find §¡5 "{Active}"'
- #
- # Find Undeclared -- Lists the undeclared identifiers in the selected
- # Icon program text, or in the whole active window if the selection is
- # empty. Helpful in creating "local" declarations.
- #
- AddMenu "{IconMenu}" 'List Undeclared' ∂
- 'If `Count -c "{Active}.§"` == 0; ∂
- Locals "{Active}"; ∂
- Else; ∂
- Locals "{Active}.§"; ∂
- End'
- #
- # Show ucode -- Displays the ucode generated by the Icon translator for
- # the selected Icon program text. (Ucode is in human-readable text
- # format -- it can be interesting to see what kind of code is generated
- # by various source code constructs.
- #
- AddMenu "{IconMenu}" 'Show ucode' ∂
- 'icont -s -c - < "{Active}.§"; ∂
- Catenate stdin.u1; ∂
- Echo '============================='; ∂
- Catenate stdin.u2; ∂
- Delete stdin.u?'
- #
- # Mark Icon Procedures -- Creates Mark menu items for each procedure,
- # global, link, and record declaration line in the Icon program in the
- # active window.
- #
- AddMenu "{IconMenu}" 'Mark Icon Procedures' 'MarkIcon "{Active}"'
-
- #
- # Encomment or decomment the selected code.
- #
- AddMenu "{IconMenu}" 'Encomment' 'icom < "{Active}".§ | catenate > "{active}".§'
- AddMenu "{IconMenu}" 'Decomment' 'icom -d < "{Active}".§ | catenate > "{active}".§'
-
- AddMenu "{IconMenu}" 'Output option...' 'Execute SetIconSpeed'
- AddMenu "{IconMenu}" 'Trace option...' 'Execute SetIconTrace'
-
- Unset IconMenu
-