[comp.sys.apple] VT100/VT52 Bashing

hayes@thor.ucsd.edu (James Hayes) (01/11/88)

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 <ESC> 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       <ESC> [ received, collect parameters until a non-numeric character
        is received (other than ";"), and act on command character. Goto
        state 1.  [ Format: <ESC>[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 <ESC> 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

kamath@reed.UUCP (Sean Kamath) (01/14/88)

Hi Jim!  I was going to post a note, and I'm glad you are still around! :-)
Actually, I came here to read my news today (by "came here" I mean called up
the vax:-) and found 176 messages ready and waiting. . .So I've been out of
touch. . .

In article <4469@sdcsvax.UCSD.EDU> hayes@thor.ucsd.edu (James Hayes) writes:
> [info on how to "parse" vt100/vt52 commands. . .]
>
>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.)
I'll have to check that. . .

>[ If this is the wrong place to be complainin', sorry, but you guys were
>  driving me crazy. ] {me too!}
>
>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.

I have everything for the DOS 3.3 version.  Whilst I have the source, and
can manage bug fixes (if I have my thinking done right, Jim is devoting his
time to the ProDOS version, and I have agreed to more or less support the
DOS 3.3 version.  I will *not* sell the source.  That you must buy from Jim
directly, and I will try to make sure that Jim has the latest version I've
put out.), it it *not* my program (just covering my tush).  It belongs in
all it's glory to Jim Hayes.  I can give out the execables, and two or three
source files, including Jim's somewhat convoluted explanation of how to
write drivers for it.  DCOM is *the* software to use if you are a funtime
hacker, not into pirating etc.

I can somewhat reliable e-mail to ARPA, as well as BITNET, so send me a note
if you want it.  You'll get Jim's original package, plus one or two minor
fixes.  You will also get my Novation AppleCat drivers, with source.  No
guarantee on turnover time.  Probably on the neighborhood of two weeks.
>
>[ Will Sean Kamath perk up and tell the folks how to get the AppleCat modem
> driver for the folks needing it? ]

Perk up? And, like, where have you been? :-)

>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

Sean Kamath, nowhere but in the rain, it seems.

-- 
UUCP:  {decvax allegra ucbcad ucbvax hplabs ihnp4}!tektronix!reed!kamath
CSNET: reed!kamath@Tektronix.CSNET  ||  BITNET:  reed!kamath@Berkeley.BITNET
ARPA:  tektronix!reed!kamath@Berkeley <or> reed!kamath@hplabs
US Snail: 3934 SE Boise, Portland, OR  97202 (I hate 4 line .sigs!)