.TITLE VTPARS - VTM TABLE PARSER .IDENT /03.8/ .ENABL LC ;+ ; ; Free software BY ; Project Software & Development, Inc. ; ; This software is furnished for free and may be used and copied as ; desired. This software or any other copies thereof may be provided or ; otherwise made available to any other person. No title to and ; ownership of the software is hereby transferred or allowed. ; ; The information in this software is subject to change without notice ; and should not be construed as a commitment by PROJECT SOFTWARE ; AND DEVELOPMENT, INC. ; ; PROJECT SOFTWARE assumes no responsibility for the use or reliability ; of this software on any equipment whatsoever. ; ; Project Software & Development, Inc. ; 14 Story St. ; Cambridge, Ma. 02138 ; 617-661-1444 ; ; ; Title: VTPARS.MAC ; Author: Robin Miller ; Date: June 16, 1982 ; ; Description: ; ; Table parser for VTM program. ; ; ; Modification History: ; ;- .ENABL AMA .NLIST BEX .MCALL DIR$, ISTAT$, STATE$, TRAN$ ;+ ; ; ; Description: ; ; VTM is a program used to format messages for a VT100 terminal. ; Various options are available and are listed below. If no options are ; specified, the default is to clear the screen and and write the message ; in double height characters centered in the middle of the screen. ; ; There are three methods of starting VTM; they are: ; ; 1. $ VTM ; VTM> ; ; This is the interactive mode. VTM continues to prompt for ; input until you type CTRL/Z to exit. ; ; 2. $ VTM message_text ; ; Clears the screen, writes the message in the middle of the ; screen, and then exits. ; ; 3. $ VTM @command_file ; ; Using this method, command lines are read from the specified ; command file. The length of the command lines can be up to a ; maximum of 132 characters. The continuation character "-" is ; allowed at the end of a line. If the extension isn't specified ; the default is .VTM. ; ; Command lines are of the form: ; ; {option, option, ...} message_text {option, option, ...} etc. ; ; Where options are: ; ; ALL ; Turns on all attributes except underscore. ; The attributes turned on are BOLD, BLINK, and REVERSE. ; ; ACSET ; Selects the alternate character set. Our terminals do not ; have alternate character sets but they are useful for special ; affects such a boxing a message. ; ; AGSET ; Selects the alternate graphics character set. ; *** Currently disabled. *** ; ; ANSI ; Sets the ANSI mode. The VT100 MUST be in this mode for VTM ; to work properly. ; ; BLINE=n ; Specifies the bottom line number. This is the line number ; where wraparound to the top line occurs. The default bottom ; line number is 24. ; BELL ; Inserts a bell in the message. Multiply bells can be inserted ; in each message by using the command: {BELL, BELL} ; ; BLINK ; Turns on the blink attribute. ; ; BOLD ; Turns on the bold attribute. ; ; BOX=top_line:bottom_line[:left_column:right_column] ; Draws a box on the screen using special graphics. The ; default line and column numbers are {BOX=1:22:1:80} for ; VAX/VMS and {BOX=1:23:1:80} for RSX-11M. If just {BOX} ; is specified, the previous parameters are used. ; ; [-] CLEAR ; Clears the entire screen. On the first message output by ; VTM, the screen is cleared unless {-CLEAR} is specified. ; ; COLUMN=n ; Use column number 'n' for the next message. ; ; [-] CENTER ; Centers messages in the middle of the screen. This is ; the default when VTM is started. ; ; CBOL ; Clear to the beginning of the line. ; ; CEOL ; Clear to the end of the line. ; ; CLIN ; Clear the entire line. ; ; CBOS ; Clear to the beginning of the screen ; ; CEOS ; Clear to the end of the screen. ; ; CSCR ; Clear the entire screen (cursor doesn't move). ; *** Currently disabled. *** ; ; DELAY=n ; Delays for 'n' seconds. The delay is immediate. If it ; is specified on a line with a message, the message is ; displayed after the delay. The delay has no effect on ; output to a file. It's useful only in VTM command files. ; ; DATE ; Output the current date in the format DD-MMM-YY. ; ; [-] DHEIGHT ; Write the next and subsequent message in double height. ; ; [-] DWIDTH ; Write the next and subsequent messages in double width. ; ; JUMP ; Sets the jump scroll mode. ; ; HOME ; Writes the message starting in the top left corner of the ; This is equivalent to command {L=1, C=1}. The screen is ; not cleared, ; ; ITERATION=n ; Specifies an iteration count for the next or current command ; line. If you specify a count of 65535, you will loop infinitly ; and you must type CTRL/C to exit from VTM. ; ; KEYPAD=ON ; The ON state is known as the application mode. In this ; mode, the keys on the keypad transmit an escape sequence. ; ; KEYPAD=OFF ; The OFF state is known as the numeric mode. In this mode, ; the keys on the keypad transmit the number on the key. Your ; keypad is normally in the numeric mode. ; ; LINE=nn ; Specifies the line number for the next message. On startup, ; the default line number is 12. ; ; [-] LED=n ; Turns on the specified LED (L1 - L4) on the terminal. The ; The range of 'n' is 1-4. If 'n' isn't specified, all the ; the LEDs are turned on. A {-LED} command turns all LEDS off. ; ; LJUSTIFY ; Left justify the next message. Same as the command {C=1}. ; ; LMARGIN=n ; Sets the left margin to 'n'. The default is 1. ; ; NARROW ; Sets the screen to 80 column mode. The VT100 automatically ; clears the screen when changing column modes. ; ; OUTPUT=file.ext ; Outputs to the specified file. If running interactive, ; messages are output to both the terminal and the file. ; The -TTY command will inhibit output to the terminal. If ; no output file is specified (i.e., {OUT=}), the default ; file name of VTM.DAT is used. If a second {OUT=...} is ; specified, the current file is closed and the new file ; is openned. ; ; OFF ; Turns off all the attributes (BLINK/BOLD/REVERSE/UNDERSCORE). ; All attributes are turned off because the VT100 does not have ; the capability to turn off a single attribute. This command ; is executed automatically at the end of each message output ; if you havn't turned the attributes off. ; ; PLINE=n or .+n or .-n ; Specifies the prompt line number. The default prompt line ; is 24 for RSX-11M and line 23 for VAX/VMS. This is also ; the last line output to a file when the file is closed. ; The ".+n" format allows you to specify a relative line number. ; Using a relative line number, the prompt is displayed "+n" ; or "-n" lines after/before the last line on the screen. ; ; REVERSE ; Turns on the reverse video attribute. ; ; [-] REGION=top_line:bottom_line ; Specifies the scrolling region. The top line must be ; greater than the bottom line. To disable the scroll ; region, use {-REGION} or {REGION=1:24}. ; ; RESET ; This does a power-up reset. It is useful in command files ; being aborted by CTRL/C or CTRL/Y when the state of the ; VT100 is unknown. ; ; RJUSTIFY ; Right justify the next message. The message will be output ; so the last character lines up with right margin. ; ; RMARGIN=n ; Sets the right margin to 'n'. The default is 80. ; ; RULER=n ; Write a ruler on the VT100 to aid in message formatting. ; The default line number (n) is 1. ; ; TLINE=n ; Specifies the top line number. This is the line started at ; after wrapping around from the bottom. The default top line ; number is 1. ; ; SKIP=n ; Skips 'n' lines on the screen. After displaying a message, ; VTM automatically adjusts the line number to the next line. ; This option is used for additional spacing. ; ; SCREEN=BLACK or WHITE ; The BLACK state causes the screen to be black with white ; characters. The WHITE state causes the screen to be white ; with black characters. ; ; SGRAPHICS ; Turns on special graphics. In this mode, the lowercase ; character set is used to display special graphic characters. ; Use either {UKSET} or {USSET} to exit special graphics mode. ; ; SMOOTH ; Sets smooth scroll mode. ; ; [-] TTY ; Enable or disable output to the local terminal. The default ; is to always output to the local terminal. On RSX-11M, the ; output device is TI0:. On VAX/VMS, the output device is ; wherever SYS$OUTPUT is directed (normally the terminal). ; ; TIME ; Output the current time in the format HH:MM:SS. ; ; TEST ; Fills the screen with "Es". ; ; TERMINAL=ddnn: ; Specifies the terminal to write the message to. On VAX/VMS, ; you can only write to terminals which are not logged on. ; Logical names are permitted of the form ddnn: (RSX standard). ; ; UNDERSCORE ; Turns the underscore attribute on. ; ; UKSET ; Selects the United Kingdom character set. ; ; USSET ; Selects the USASCII character set. ; ; WIDE ; Sets the screen to 132 column mode. The VT100 automatically ; clears the screen when changing column modes. ; ; *********************************************************** ; * The braces MUST be specified around the options. * ; * Multiple options must be separated with commas. * ; * * ; * The [-] means the option can be negated. For example, * ; * -DHeight outputs the message in single width. * ; *********************************************************** ; ; and, ; message_text is the text to display. If contained in a command ; file, upper and lowercase characters are accepted. The command ; line interpreters (MCR and DCL) convert lowercase to uppercase. ; The message is truncated if the length is too long. ; ; The order of the options listed above is the order in which they are ; parsed. This means if you specify a single character for an option, ; i.e., {R}, the first option listed {REVERSE} is matched. ; ; A CTRL/C can be typed to abort VTM when it is delaying or outputting. ; ;- ; Define start of state and keyword tables. ISTAT$ STATE, KEYWRD ; Now define the actual state table. .GLOBL START ; Next is a possible option or text of the message. STATE$ START TRAN$ '{,SOPT,IBLANK TRAN$ $ANY,START,SCHAR TRAN$ $EOS,$EXIT ;********************************************************************** ; Found the start of an option. Table count = 63. STATE$ SOPT TRAN$ '-,NOPT TRAN$ "ALL",EOPT,ALLATT,B.ATTR,STATUS TRAN$ "ACSET",EOPT,ACSET ; TRAN$ "AGSET",EOPT,AGSET TRAN$ "ANSI",EOPT,ANSI TRAN$ "BLINE",BOTTOM TRAN$ "BELL",EOPT,MBELL TRAN$ "BLINK",EOPT,BLINK,B.ATTR,STATUS TRAN$ "BOLD",EOPT,BOLD,B.ATTR,STATUS TRAN$ "BOX",BOXS TRAN$ "COLUMN",COL TRAN$ "CLEAR",EOPT,,B.CLR,STATUS TRAN$ "CENTER",EOPT,,B.CENT,STATUS TRAN$ "CBOL",EOPT,CBOL,B.DOIT,STATUS TRAN$ "CEOL",EOPT,CEOL,B.DOIT,STATUS TRAN$ "CLIN",EOPT,CLIN,B.DOIT,STATUS TRAN$ "CBOS",EOPT,CBOS,B.DOIT,STATUS TRAN$ "CEOS",EOPT,CEOS,B.DOIT,STATUS ; TRAN$ "CSCR",EOPT,CSCR,B.DOIT,STATUS TRAN$ "DELAY",DCNT TRAN$ "DATE",EOPT,DATE TRAN$ "DHEIGHT",EOPT,NODW,B.DBLH,STATUS TRAN$ "DWIDTH",EOPT,NODH,B.DBLW,STATUS TRAN$ "JUMP",EOPT,JUMP TRAN$ "HOME",EOPT,HOME,B.COL,STATUS TRAN$ "ITERATION",ITER TRAN$ "KEYPAD",KEYPAD TRAN$ "LINE",LIN TRAN$ "LJUSTIFY",EOPT,,B.LJUS,STATUS TRAN$ "LMARGIN",LMARG TRAN$ "LEDS",LED TRAN$ "NARROW",EOPT,NARROW TRAN$ "OUTPUT",FILE TRAN$ "OFF",EOPT,ATTOFF TRAN$ "PLINE",PLIN TRAN$ "REVERSE",EOPT,REVERSE,B.ATTR,STATUS TRAN$ "REGION",SCREG TRAN$ "RESET",EOPT,VRESET TRAN$ "RJUSTIFY",EOPT,,B.RJUS,STATUS TRAN$ "RMARGIN",RMARG TRAN$ "RULER",RULERS TRAN$ "SKIP",SCNT TRAN$ "SCREEN",SCREEN TRAN$ "SGRAPHICS",EOPT,SGRAPH TRAN$ "SMOOTH",EOPT,SMOOTH TRAN$ "SWIDTH",EOPT,SWIDTH TRAN$ "TLINE",TOP TRAN$ "TEST",EOPT,TEST TRAN$ "TIME",EOPT,TIME TRAN$ "TTY",EOPT,TTYON TRAN$ "TERMINAL",TTY TRAN$ "UNDERSCORE",EOPT,UNDER,B.ATTR,STATUS TRAN$ "UKSET",EOPT,UKSET TRAN$ "USSET",EOPT,USSET ; TRAN$ "VT52",EOPT,VT52 TRAN$ "WIDE",EOPT,WIDE,B.WIDE,STATUS ;********************************************************************** ; Check for next "," or end "}" of options. STATE$ EOPT TRAN$ <',>,SOPT,IBLANK TRAN$ '},START,PBLANK ;********************************************************************** ; Negation of an option. STATE$ NOPT TRAN$ "CLEAR",EOPT,NOCLR TRAN$ "CENTER",EOPT,NOCENT TRAN$ "DHEIGHT",EOPT,NODH TRAN$ "DWIDTH",EOPT,NODW TRAN$ "LEDS",EOPT,LED0 TRAN$ "REGION",EOPT,NOREG TRAN$ "TTY",EOPT,NOTTY ;********************************************************************** ; Specifying a box. STATE$ BOXS TRAN$ '=,BOXN TRAN$ $LAMDA,EOPT,BOX STATE$ BOXN TRAN$ $DNUMB,,BOXT STATE$ TRAN$ ': STATE$ TRAN$ $DNUMB,,BOXB STATE$ TRAN$ ':,BOXLR TRAN$ $LAMDA,EOPT,BOX STATE$ BOXLR TRAN$ $DNUMB,,BOXL STATE$ TRAN$ ': STATE$ TRAN$ $DNUMB,EOPT,BOXR ;********************************************************************** ; Specifing the starting column number. ; If not and equals sign, presume Clear wanted. STATE$ COL TRAN$ '=,COLN TRAN$ $LAMDA,EOPT,,B.CLR,STATUS STATE$ COLN TRAN$ $DNUMB,EOPT,SCOL,B.COL,STATUS ;********************************************************************** ; Specifying a delay count. STATE$ DCNT TRAN$ '= STATE$ TRAN$ $DNUMB,EOPT,SDELAY ;********************************************************************** ; Turn the keypad ON (application) or OFF (numeric). STATE$ KEYPAD TRAN$ '= STATE$ TRAN$ "ON",EOPT,APPKEY ; TRAN$ "APPLICATION",EOPT,APPKEY TRAN$ "OFF",EOPT,NUMKEY ; TRAN$ "NUMERIC",EOPT,NUMKEY ;********************************************************************** ; Specifying an iteration count. STATE$ ITER TRAN$ '= STATE$ TRAN$ $DNUMB,EOPT,SITER ;********************************************************************** ; Specifying the starting line number. STATE$ LIN TRAN$ '= STATE$ TRAN$ $DNUMB,EOPT,SLINE ;********************************************************************** ; Specifying the left margin. STATE$ LMARG TRAN$ '= STATE$ TRAN$ $DNUMB,EOPT,SLMARG ; Specifying the right margin. STATE$ RMARG TRAN$ '= STATE$ TRAN$ $DNUMB,EOPT,SRMARG ;********************************************************************** ; Specifying all or a single LED. STATE$ LED TRAN$ '=,NLED TRAN$ $LAMDA,EOPT,LEDS STATE$ NLED TRAN$ '0,EOPT,LED0 TRAN$ '1,EOPT,LED1 TRAN$ '2,EOPT,LED2 TRAN$ '3,EOPT,LED3 TRAN$ '4,EOPT,LED4 TRAN$ $LAMDA,EOPT,LEDS ;********************************************************************** ; Specify the top line number. STATE$ TOP TRAN$ '= STATE$ TRAN$ $DNUMB,EOPT,TLINE ;********************************************************************** ; Specify the bottom line number. STATE$ BOTTOM TRAN$ '= STATE$ TRAN$ $DNUMB,EOPT,BLINE ;********************************************************************** ; Specify a new prompt line. STATE$ PLIN TRAN$ '= STATE$ TRAN$ '.,RPLIN,,B.REL,STAT1 TRAN$ $LAMDA,PLINC STATE$ RPLIN TRAN$ '+,PLINC,PPLIN TRAN$ '-,PLINC,NPLIN TRAN$ $LAMDA,,PPLIN STATE$ PLINC TRAN$ $DNUMB,EOPT,PLINE ;********************************************************************** ; Specifying a ruler, check for optional line number. STATE$ RULERS TRAN$ '=,RULERN TRAN$ $LAMDA,EOPT,RULER STATE$ RULERN TRAN$ $DNUMB,EOPT,RULLIN ;********************************************************************** ; Specifying the number of lines to skip. STATE$ SCNT TRAN$ '= STATE$ TRAN$ $DNUMB,EOPT,SKIP ;********************************************************************** ; Specifying an output file. STATE$ FILE TRAN$ '= STATE$ FLOOP TRAN$ <',>,SOPT,OFILE TRAN$ '},START,OFILE TRAN$ $ANY,FLOOP,SFILE TRAN$ $EOS,$EXIT ;********************************************************************** ; Change the screen to BLACK or WHITE. STATE$ SCREEN TRAN$ '= STATE$ TRAN$ "BLACK",EOPT,BLACK TRAN$ "WHITE",EOPT,WHITE ;********************************************************************** ; Specify the scrolling region. STATE$ SCREG TRAN$ '= STATE$ TRAN$ $DNUMB,,REGT STATE$ TRAN$ ': STATE$ TRAN$ $DNUMB,EOPT,REGB ;********************************************************************** ; Specifying a terminal name to send the message to. STATE$ TTY TRAN$ '= ; Skip underscore characters... for VAX/VMS. STATE$ TTY1 TRAN$ '_,TTY1 TRAN$ $LAMDA STATE$ TRAN$ $ALPHA,,STTY1 STATE$ TRAN$ $ALPHA,,STTY2 ; Check for VAX/VMS controller letter. STATE$ TRAN$ $ALPHA,TTYN,STTYC TRAN$ $LAMDA STATE$ TTYN TRAN$ $NUMBR,ETTY,STTYN TRAN$ $LAMDA STATE$ ETTY TRAN$ ':,EOPT,TTYA TRAN$ $LAMDA,EOPT,TTYA ; The next STATE$ is needed for the end of the table. STATE$ .END