home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!usenet.coe.montana.edu!ogicse!das-news.harvard.edu!spdcc!iecc!compilers-sender
- From: dworkin@merlin.rootgroup.com (Dieter Muller)
- Newsgroups: comp.compilers
- Subject: Re: What kind of grammar does kermit "DEC style" parser use?
- Keywords: parse
- Message-ID: <92-08-142@comp.compilers>
- Date: 23 Aug 92 05:27:50 GMT
- References: <92-08-139@comp.compilers>
- Sender: compilers-sender@iecc.cambridge.ma.us
- Reply-To: Dieter Muller <dworkin@merlin.rootgroup.com>
- Organization: Compilers Central
- Lines: 39
- Approved: compilers@iecc.cambridge.ma.us
-
- magras@cps.msu.edu writes:
- >The subject line pretty much says it all. What kind of grammar
- >drives the so-called "DEC style" parser used by most kermit
- >programs? (e.g. "set parameter ?", info displayed, then "set
- >parameter" appears on command line with cursor after it)
- >Grammars used by particular implementation(s) would be
- >appreciated, suggestions on how to do it with less than 4K to
- >allocate to it also helpful.
-
- It is based on a stripped-down version of the CCMD library, which is a
- C implementation of the TOPS-20 COMND% JSYS call.
-
- The moderator comments:
- >I'd expect Kermit's parsers probably use a hard coded driver
- >running from hand-written tables.
-
- This is indeed the case. Basically, the program becomes a state machine,
- with all sorts of longjmp()s playing havoc with your control flow.
- Although you don't have to, what I usually end up doing is having a
- function for each element of each command. This allows joining multiple
- commands that have a common sub-grammar.
-
- Thus, the following command language implemented via CCMD could have 5
- functions defining the grammar:
-
- set <parameter> <value>
- show { <null> | <parameter> }
-
- Or you could get by with four, by matching the <null> in the function
- handling `show'.
-
- My suggestion would be to get one of the microcomputer versions of kermit
- from watsun.cc.columbia.edu and modify it as needed.
-
- Dworkin
- dworkin@rootgroup.com DoD #2525 (303) 678-5519
- --
- Send compilers articles to compilers@iecc.cambridge.ma.us or
- {ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.
-