home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / alpha / alpha2.hlp (.txt) < prev    next >
Encoding:
OS/2 Help File  |  1993-12-14  |  23.9 KB  |  482 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. Description ΓòÉΓòÉΓòÉ
  3.  
  4. *******************************************************************
  5. *                                                                 *
  6. * (C) Copyright International Business Machines Corporation 1993. *
  7. *                 All rights Reserved.                            *
  8. *                                                                 *
  9. *******************************************************************
  10.  
  11.  
  12.           Lionel de Lambert - Augustus MMDCCXLV AUC
  13.  
  14.  
  15.               IBM United Kingdom Laboratories Ltd.
  16.  
  17. A simple 32 bit multi-document browse version of the Alpha code analysis 
  18. programme has been written using C Set/2 and MASM V6.0. The programme 'ALPHA2 
  19. EXEBIN' should be copied to an OS/2 V2.0 directory as ALPHA2.EXE. The Alpha 
  20. Fonts. may be used if the file 'ALPHA.FONBIN' is copied to an OS/2 V2.0 
  21. directory as ALPHA.FON. 
  22.  
  23. This is a simple multiple document file browse with highlighting of keywords 
  24. for language types :- A37,ASM,PAS,PLS,C,FOR,.. 
  25.  
  26. The syntax of Alpha2 is :- 
  27.  
  28.  START ALPHA2 [file] [/p [profile name - default ALPHA.PRF]]
  29.  
  30. A file may be opened from the Allocate menu or by dragging mouse button 2 with 
  31. the Ctrl key pressed from a Drives window on to the Alpha window. The mouse 
  32. buttons may be used to isolate a string and to search for the string within the 
  33. file. Browse commands may also be entered from the command window. 
  34.  
  35. The Language_colour, Language_operator, Precedent_C, File_type, Comment_start, 
  36. Comment_end, Transfer_pgm and Window keywords are the only ones which are 
  37. recognized from the Profile. 
  38.  
  39.  
  40. ΓòÉΓòÉΓòÉ 2. Installation ΓòÉΓòÉΓòÉ
  41.  
  42. The minimum requirement is to transfer the binary file 'ALPHA2 EXEBIN' to a 
  43. directory on your PS/2 as 'ALPHA2.EXE'. 
  44.  
  45. If you want different highlight colours etc. you can copy the text file 'ALPHA 
  46. PRF' to the PS/2 as 'ALPHA.PRF' and edit the file. You can also install the 
  47. 'Alpha' fonts by transferring the binary file 'ALPHA FONBIN' to the PS/2 as 
  48. 'ALPHA.FON' and selecting 'System Setup' from 'OS/2 System' and use 'Add' in 
  49. the 'Edit font' of the 'Font Palette'. 
  50.  
  51. If you wish to access files from the host then you should also install a 
  52. Transfer_pgm such as ALMCOPY from the OS2TOOLS disk. 
  53.  
  54. If you wish to access the OS/2 help file, ALPHA2.HLP, it must be installed in 
  55. the HELP path. 
  56.  
  57.  
  58. ΓòÉΓòÉΓòÉ 3. Menu ΓòÉΓòÉΓòÉ
  59.  
  60. The Allocate item will invoke the Allocate. dialogue box which may be used to 
  61. allocate a file or invoke the Transfer programme. 
  62.  
  63. The Command dialogue box may be used to issue a search command. 
  64.  
  65. The Options menue may be used to set the following options :- Statement No., 
  66. Tab, Keyword, Include, Grid. 
  67.  
  68. The Font item will invoke the Font dialogue box. 
  69.  
  70. The Colour item will invoke the Colour dialogue box. 
  71.  
  72. The Print item will invoke the print dialogue box. 
  73.  
  74. The Window item will invoke the window selection dialogue box. 
  75.  
  76. The Help item will invoke the About dialogue box, the Help window, and the OS/2 
  77. extended help function. 
  78.  
  79.  
  80. ΓòÉΓòÉΓòÉ 3.1. Allocate ΓòÉΓòÉΓòÉ
  81.  
  82. The Allocate dialogue box is used to request a file to be read. If the drive 
  83. letter is changed then the OK button should be used to refresh the List boxes. 
  84. {The maximum number of child windows is 16.} The Profile button will remember 
  85. the file name entered in the Entry box as the profile for subsequent 
  86. invocations. {This will obviate the need for the '/p' parameter and enable a 
  87. file to be dropped on to the unstarted programme.} The Transfer button will 
  88. pass the contents of the Combo box to the Transfer_pgm. {The data is passed to 
  89. the Transfer_pgm unmodified.} 
  90.  
  91.  
  92. ΓòÉΓòÉΓòÉ 3.2. Command ΓòÉΓòÉΓòÉ
  93.  
  94. The Command dialogue box may be used to issue a search command e.g. 
  95.  
  96. o Case sensitive search for a string. 
  97.  
  98. o Case sensitive search for a string in column one. 
  99.  
  100. o A non-case sensitive search for a string, { Normal }. 
  101.  
  102. o Move to a given line number. 
  103.  
  104. The search starts from the current line number +1. 
  105.  
  106. The COMBO box will hold the previous three search strings which were 
  107. successfully entered. 
  108.  
  109.  
  110. ΓòÉΓòÉΓòÉ 3.3. Options ΓòÉΓòÉΓòÉ
  111.  
  112. The Options menue may be used to set the following options :- 
  113.  
  114. o Statement No. - display the statement number in the TITLE bar followed by the 
  115.   last character position from mouse button 1. 
  116.  
  117. o Tab - expand the record by using X'09' characters to round to columns n*8. 
  118.  
  119. o Keyword - highlight the keywords. 
  120.  
  121. o Include - For the files MASM, PAS, PLS, C read the include files specified by 
  122.   :- include file_name, {$INCLUDE : 'file_name' }, %INCLUDE 
  123.   first_part_of_file_name;, #include <file_name>, respectively when expanding a 
  124.   call etc. {The current directory together with the paths defined by the 
  125.   INCLUDE environment variable will be searched. The total number of open 
  126.   files/windows is limited to 16 so the include nesting can not exceed 16-the 
  127.   number of open windows. For language 4, PL/S, the file extension is appended 
  128.   to the first_part_of_file_name. } 
  129.  
  130. o Grid - Draw vertical grid lines through every tenth character in Grid colour. 
  131.  
  132.  
  133. ΓòÉΓòÉΓòÉ 3.4. Font ΓòÉΓòÉΓòÉ
  134.  
  135. The Font dialogue box may be used to change and remember the font. 
  136.  
  137.  
  138. ΓòÉΓòÉΓòÉ 3.4.1. Fonts ΓòÉΓòÉΓòÉ
  139.  
  140. A monospaced font with point sizes 8,9,10,11,16 & 20 is supplied with the ALPHA 
  141. PACKAGE, which may also be used. The Alpha font will be selected by default or 
  142. may be chosen from the font menu . On OS/2 V2.0 select 'System Setup' from 
  143. 'OS/2 System' and use 'Add' in the 'Edit font' of  the 'Font Palette'. The font 
  144. point sizes (1/72") are :- Courier (8,10,12), Roman (8,10,12,14,18,24), 
  145. Helvetica (8,10,12,14,18,24), System (8,10,12, {8x8, 8x16, 9x20}), "Alpha" 
  146. (8{8x12}, 9{9x10}, 10{8x14}, 11{11x12}, 16{12x16}, 20{12x20}). 
  147.  
  148.  
  149. ΓòÉΓòÉΓòÉ 3.5. Colours ΓòÉΓòÉΓòÉ
  150.  
  151. The colours of the text, comments etc. may be changed and remembered by using 
  152. this window. The following colours may be changed with this dialog box :- 
  153.  
  154.  1. Text - The main text colour. 
  155.  
  156.  2. Highlight - The mouse button 1 isolate keyword. 
  157.  
  158.  3. Locate/Position - The mouse button 2 locate string, the character position 
  159.     of the last mouse button 1 click and the Structure List box procedures. 
  160.  
  161.  4. Comment/statement# - The Comment colour, statement number and Structure 
  162.     List box calls. 
  163.  
  164.  5. Background - The background colour. 
  165.  
  166.  6. Branch - The Branch/Jump instruction colour. 
  167.  
  168.  7. Grid - The vertical grid line colour. 
  169.  
  170.  8. Select area - The mouse button 1 drag area. 
  171.  
  172.  
  173. ΓòÉΓòÉΓòÉ 3.6. Print ΓòÉΓòÉΓòÉ
  174.  
  175. The Print dialogue box will allow you to print the specified record range or 
  176. the highlighted area in the active window to one of :- 
  177. LPT1, LPT2, LPT3. 
  178. The default record range is the whole file. 
  179.  
  180.  
  181. ΓòÉΓòÉΓòÉ 3.7. Window ΓòÉΓòÉΓòÉ
  182.  
  183. The Window menu may be used to close all child windows or to arrange them so 
  184. that the title text is visible, Cascade, or so that a partial view of each 
  185. child may be seen, Tile. The Select window option will show the selected 
  186. window. {If the window title is selected from the List box then that child 
  187. window will become the active/visilble one.} 
  188.  
  189.  
  190. ΓòÉΓòÉΓòÉ 3.8. Help ΓòÉΓòÉΓòÉ
  191.  
  192. The Help menu will display the About, box the Help summary window or access the 
  193. OS/2 help file ALPHA2.HLP via Extended. 
  194.  
  195.  
  196. ΓòÉΓòÉΓòÉ 3.8.1. Help window ΓòÉΓòÉΓòÉ
  197.  
  198. This window may be invoked by the F1 key or by selecting the Help item from the 
  199. Help menu item. The window may be scrolled by :- 
  200.  
  201.  1. Page_up - scroll up 1 screen 
  202.  
  203.  2. Page_down - scroll down 1 screen 
  204.  
  205.  3. Home - scroll to the top of the Help data 
  206.  
  207.  4. End - scroll to the end of the Help data 
  208.  
  209.  5.  - scroll down one line 
  210.  
  211.  6.  - scroll up one line 
  212.  
  213. The Extended help data may be accessed from the Extended item of the Help menu. 
  214.  
  215.  
  216. ΓòÉΓòÉΓòÉ 4. Function keys ΓòÉΓòÉΓòÉ
  217.  
  218. The mouse button 1 will highlight a string and mouse button 2 will cause a 
  219. search for this string from the current line +1. If mouse button 1 is clicked 
  220. twice on a label then a search from the top of the file is made for the label 
  221. definition or procedure entry and a secondary window is opened, Expand. {The 
  222. language structure tables are searched first so if you have specified some 
  223. structure keywords via Language_operator then you will have to record the 
  224. structure first, Ctrl+s.} 
  225.  
  226. If mouse button 1 is clicked twice on a  BEGIN for PASCAL, DO for PLS or { for 
  227. C then the code up to the following END etc. will not be displayed. These lines 
  228. may be restored by double clicking on the suppressed line, or by F12. 
  229.  
  230. If button 1 is clicked twice on an Include statement when the Include option is 
  231. selected then a second window will be created with the include file. 
  232.  
  233. The mouse button 1 may be used to scroll and select a section of the file. 
  234.  
  235. F1 will open the Help window. 
  236.  
  237. F2 will open the Font dialogue box. 
  238.  
  239. F3 will terminate the programme. 
  240.  
  241. F4 will open the Allocate or file dialogue box. 
  242.  
  243. F5 will repeat the previous command. 
  244.  
  245. F6 will open the Command dialogue box. 
  246.  
  247. F7 will scroll the window up 1/2 a screen. 
  248.  
  249. F8 will scroll the window down 1/2 a screen. 
  250.  
  251. F12 will reset the Collapse of BEGIN/END pairs etc. 
  252.  
  253. F14 (F2+Shift) will open the Colour dialogue box. 
  254.  
  255. Page_Up will scroll up 1 screen. 
  256.  
  257. Page_Down will scroll down 1 screen. 
  258.  
  259. Home will scroll to the top of the file. 
  260.  
  261. End will scroll to the end of the file. 
  262.  
  263.  - will scroll down one line 
  264.  
  265.  - will scroll up one line 
  266.  
  267.  - will scroll right one column 
  268.  
  269.  - will scroll left one column 
  270.  
  271. The Insert+Ctrl keys will copy the lines highlighted by the button 1 drag area 
  272. to the Clipboard. 
  273.  
  274. The Delete+Ctrl keys will suppress the lines highlighted by the button 1 drag 
  275. area from the display. 
  276.  
  277. The Delete+Shift keys will restore the lines previously hidden. 
  278.  
  279. The S+Ctrl keys will record and display the programme structure. 
  280.  
  281. The n+Ctrl keys will move to a recorded a bookmark in the file. {Where "n" is 
  282. one of the numeric keys 0-9.} 
  283.  
  284. The n+Alt keys will record a bookmark in the file. 
  285.  
  286.  
  287. ΓòÉΓòÉΓòÉ 5. Profile ΓòÉΓòÉΓòÉ
  288.  
  289. The following keywords may be specified in the profile :- 
  290.  
  291. Language_colour defines the highlight colours for key words. Up to 128 entries 
  292. may be defined as follows :- 
  293.  
  294.  file_type,key_word,colour,scan_length
  295.  
  296. and are terminated by .END, invalid entries are ignored. The key words must be 
  297. =<12 characters. 
  298.  
  299. Comment_start specifies the first two characters of the start of a comment. The 
  300. string must be =<12 characters.  The 6 pairs are used for :- 
  301.  
  302.   1 370 assembler
  303.   2 386 assembler
  304.   3 PASCAL, for Ada specify Comment_start="* ; --/*/*C "
  305.   4 PL/S, PL/AS etc.
  306.   5 C
  307.   6 FORTRAN
  308.  
  309. Comment_end specifies the last two characters of the end of a comment. The 
  310. string must be =<12 characters.  The 6 pairs are as in Comment_start. 
  311.  
  312. File_type specifies the File types to be recognized. The string must be =<64 
  313. characters and terminated by a comma. The first 6 types are used for :- 
  314.  
  315.   1 370 assembler
  316.   2 386 assembler
  317.   3 PASCAL, (Ada)
  318.   4 PL/S, PL/AS, PL/I  etc., (REXX)
  319.   5 C
  320.   6 FORTRAN
  321.  For REXX files use :- "A37,ASM,PAS,CMD,C,FOR," and replace the PLS entries
  322.  For Ada  files use :- "A37,ASM,ADA,PLS,C,FOR," and replace the PAS entries
  323.  
  324. Language_operator defines the operator keywords for each language. The second 
  325. value indicates how to process the keyword, viz. '<' or '>' indicate the scan 
  326. direction from the keyword to locate the label 'P' or 'C' indicates that the 
  327. keyword specifies an entry point or call, ':' indicates that the label will be 
  328. followed by a colon, '2' indicates that the second label following a , is to be 
  329. used. Up to 32 entries may be defined as follows :- 
  330.  
  331. file_type,<|>C|P[:][2],keyword
  332.  
  333. and are terminated by '.END', invalid entries are ignored. The keywords must be 
  334. <=12 characters. {The C-language procedure values are supplied on the 
  335. Precedent_C keyword.} 
  336.  
  337. Precedent_C specifies the C language procedure keywords. The string must be 
  338. <=64 characters and terminated by a comma. 
  339.  
  340. Window specifies the initial window position. If no profile is specified then 
  341. Window=(0,4h,63.5w,26h) {(0,120,1020,650) - for 8515/8516 screens} is assumed 
  342. where w and h are the Default_chr width & height. 
  343.  
  344. If the window is resized then its position will be remembered. 
  345.  
  346. Transfer_pgm specifies the programme name to be invoked from the Allocate menu 
  347. when the Transfer button is pressed. 
  348.  
  349.  
  350. ΓòÉΓòÉΓòÉ 5.1. Specifying a language ΓòÉΓòÉΓòÉ
  351.  
  352. Alpha2 has within it (hard coded) routines which understand certain language 
  353. features e.g. 370 Assembler labels start in start in column 1, procedures are 
  354. invoked by BAL, BAS etc. and PASCAL procedures are preceded by FUNCTION or 
  355. PROCEDURE etc.. There are 6 languages understood by Alpha, viz. :- 
  356.  
  357.  
  358.  1 370 Assembler
  359.  2 386 Assembler
  360.  3 PASCAL (Ada)
  361.  4 PL/AS (PL/I, REXX)
  362.  5 C
  363.  6 FORTRAN
  364.  
  365. Because Ada is similar to PASCAL and PL/I & REXX are similar to PL/AS, in 
  366. respect to procedure calls etc., you can also analyse these languages by 
  367. pretending they are type 3 & 4 respectively. 
  368.  
  369.  
  370. However, you can interpret any language/file type (use the highlighting 
  371. facility) by suppling extra definitions in a profile which is specified as a 
  372. parameter to Alpha e.g. 
  373.  
  374.  
  375.  START ALPHA2 /p profile_name
  376.  
  377. A sample profile (ALPHA.PRF) is provided in the package, which includes 
  378. comments explaining the use of the keywords. This may be edited to change/add a 
  379. file extension, highlighting and programme structure by modifying the following 
  380. keywords :- 
  381.  
  382.  
  383.  File_type - list of file extensions up to 64 characters
  384.  Comment_start - list of comment start character pairs
  385.               (blank is ignored) up to 12 characters
  386.  Comment_end - list of comment end character pairs
  387.               (blank is ignored) up to 12 characters
  388.  Language_colour - list of keyword definitions
  389.           file_type,keyword,colour,maximum scan length
  390.  Language_operator - list of operator definitions
  391.           file_type,attributes,keyword
  392.  
  393. e.g. to add language XYZ with a routine call 'ICALL routine_name' with a 
  394. structure similar to PLS. 
  395.  
  396.  
  397. File_type="A37,ASM,PAS,XYZ,C,FOR," 
  398. Language_colour 
  399. XYZ,ICALL,GREEN,72 
  400. XYZ,Next_key ,RED,72 
  401.  
  402. Language_operator 
  403. XYZ,>C,ICALL 
  404.  
  405. Only the first 6 language types will allow the Expand and Structure operations 
  406. to be effective. This implies that you could not use all the features of Alpha 
  407. for a new language which did not have the call/label syntax of one of the 
  408. existing languages. 
  409.  
  410. The Alpha programme scans the keyword table in the order specified in the 
  411. profile to the comment start in the record. 
  412.  
  413.  
  414. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  415.  
  416. The C language keywords may be specified by the Precedent_C keyword in the 
  417. profile, and the operators for the other languages by the Language_operator 
  418. keyword. 
  419.  
  420.  
  421. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  422.  
  423. The colours may take the values :- BLUE, DARKCYAN, BLACK, DARKBLUE, DARKPINK, 
  424. DARKGRAY, DARKRED, DARKGREEN, BROWN, CYAN, RED, GREEN ,PINK, YELLOW, PALEGRAY, 
  425. DEFAULT, WHITE, ORANGE, PURPLE, PALEGREEN, PALEBLUE. 
  426.  
  427. The colours following WHITE will not be available on VGA screens. 
  428.  
  429.  
  430. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  431.  
  432. The Help file ALPHA2.HLP must be installed in the HELP path. 
  433.  
  434.  
  435. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  436.  
  437. If mouse button 1 is held down whilst the mouse is dragged to the bottom or top 
  438. of the window the area will be shaded in the Select area colour. If the mouse 
  439. pointer is held at the bottom or top of the screen then the window will scroll 
  440. until the mouse button is released or the pointer moved back within the window. 
  441.  
  442.  
  443. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  444.  
  445. The Structure dialog box will display the call structure for 370, 386 
  446. assembler, PASCAL, PL/AS, C and FORTRAN programmes based on the 
  447. Language_operator, Precedent_C, and File_type keywords from the profile. The 
  448. Procedure entry names are displayed in the "Locate" colour and and the calls in 
  449. the "Comment" colour. If an entry is selected from the Structure List Box then 
  450. the last active window is scrolled to that line. The Print button may be used 
  451. to print the contents of the List box on LPT1. 
  452.  
  453.  
  454. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  455.  
  456. The colours may take the values :- BLUE, DARKCYAN, BLACK, DARKBLUE, DARKPINK, 
  457. DARKGRAY, DARKRED, DARKGREEN, BROWN, CYAN, RED, GREEN ,PINK, YELLOW, PALEGRAY, 
  458. DEFAULT, WHITE. For XGA screens etc. the colours :- ORANGE, PURPLE, PALEGREEN, 
  459. PALEBLUE; may also be used. 
  460.  
  461.  
  462. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  463.  
  464. Because PL/I is similar to PL/AS you can use this file type for PL/I files. For 
  465. REXX files, extension ".CMD", replace PLS by CMD in the File_type and replace 
  466. the PLS entries in the Language_colour by the CMD entries. {Only "CALL" or 
  467. "call" subroutine calls will be recognized.} For Ada files, extension ".ADA", 
  468. replace PAS by ADA in the File_type and replace the PAS entries by the ADA 
  469. entries in the profile. Also specify Comment_start="* ; --/*/*C " for the Ada 
  470. comment start characters. 
  471.  
  472.  
  473. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  474.  
  475. If you wish to access files from the host then you should also install a 
  476. programme such as ALMCOPY. The programme name may be specified in the Profile. 
  477.  
  478. The data from the COMBO box is passed unmodified to the Transfer Programme, 
  479. e.g. 
  480.  
  481. H:ALPHA SCRIPT A ALPHA.SCR
  482.