GG.MPD@Forsythe.Stanford.EDU (Michael Durket) (09/02/89)
What is the current state of command language parsing? Parsers for interactive programs that I am familiar with are all ad hoc, but I suspect that things aren't done that way anymore. Does anyone have suggestions for articles I should look at? I would like to convert an old ad hoc parsing system into something a little easier to maintain and a lot more modern. Thanks, Michael Durket ARPA: gg.mpd@forsythe.stanford.edu BITNET: gg.mpd@stanford.bitnet [The yacc manual has always had examples showing how you'd do line by line parsing with some error recovery, so there's some stuff there. But I've never seen any sort of comprehensive view of how you combine things like command line editing, history, and filename completion along with the underlying syntax of the language. There may be interesting work to be done there. Also, about 10 years ago I wrote a paper in Sigplan about embedding command languages in a real programming language like Lisp. At that time it was evident to me that there is a tension between on the one hand wanting a very simple syntax with no punctuation for simple commands, and on the other hand wanting a more complex syntax to write more complicated stuff in reasonable ways. The Bourne shell is as good a compromise in this regard as I've seen, but even it has a funny two-level syntax with one syntax for the commands it executes (normal commands and flow of control stuff like if and case) and another syntax for executing those commands (monstrosities like ${foo:=`bar \`parp\``}.) I always wondered if there was a practical way to unify those two syntax levels in a usable way, but never came up with anything. -John] -- Send compilers articles to compilers@ima.isc.com or, perhaps, Levine@YALE.EDU { decvax | harvard | yale | bbn }!ima. Meta-mail to ima!compilers-request. Please send responses to the author of the message, not the poster.