Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ucbvax!sdcsvax!thor.ucsd.edu!hayes From: hayes@thor.ucsd.edu (James Hayes) Newsgroups: comp.sys.apple Subject: VT100/VT52 Bashing (Was: Re: Vt100) Summary: DCOM 3.3 Available via anonymous FTP Keywords: Shareware Message-ID: <4469@sdcsvax.UCSD.EDU> Date: 11 Jan 88 10:47:29 GMT Sender: nobody@sdcsvax.UCSD.EDU Reply-To: hayes@thor.ucsd.edu (James Hayes) Organization: UC San Diego [Home of the lying tour guides.] Lines: 54 Sorry folks, If the parser is written correctly, vt100 escape sequence parsing is *trivial*. You can implement a simple vt100/ANSI parser in a (excuse the horrid jargon) 4 state finite automata. (State machine). (3 states if you want vt52) State Action ----- ------ 1 No escape sequence in progress, echo characters. Goto state 1. If goto state 2. 2 Escape sequence started. (ESC received) Get next char. If "[" goto state 4. Otherwise goto state 3. 3 interpret single character escape code, goto state 1. 4 [ received, collect parameters until a non-numeric character is received (other than ";"), and act on command character. Goto state 1. [ Format: [n;n;n;...;nx where n=numeric, x=letter, with an optional "?" after the "[" ] for vt52: 1 No escape sequence in progress, echo characters. Goto state 1. If goto state 2. 2 vt52 escape sequence started, if cursor position, goto state 3, otherwise this current character will end the code sequence. Goto state 1. 3 vt52 cursor positioning sequence is on it's way. read two characters in this mode and position cursor. Goto state 1. Vt100 state 4 is the most difficult, but even in 6502 assembly language it is 62 lines of code-- trivial. (Sorry folks it really is; DCOM has done this since day one. DCOM sits in a loop waiting for characters. When it gets one, it looks at the current parsing state and branches to the appropriate handler.) [ If this is the wrong place to be complainin', sorry, but you guys were driving me crazy. ] DCOM 3.3 (the shareware vt100 emulator) is available via ftp (ARPAnet users only) from net1.ucsd.edu [128.54.0.10] using the login: anonymous password: your_org. The password doesn't really matter, it's just for accounting and curiosity. Oh yeah, once you get in, change directory to "info/apple2/dcom". DO NOT ASK ME TO MAIL YOU A COPY. Find a friend on the ARPAnet. Most clubs/user's groups have a copy, so check there. Some BBS's have it also. [ Will Sean Kamath perk up and tell the folks how to get the AppleCat modem driver for the folks needing it? ] Jim Hayes, University of California at San Diego. BITNET: hayes@ucsd.bitnet ARPA: hayes@ucsd.ucsd.edu UUCP: {pick one close to berkeley}!sdcsvax!hayes