Related articles |
---|
Command Line Interpreter bernfarr@my-deja.com (2000-07-23) |
Re: Command Line Interpreter jimbo@radiks.net (2000-07-27) |
Re: Command Line Interpreter jkahrs@castor.atlas.de (Juergen Kahrs) (2000-07-27) |
Re: Command Line Interpreter bernfarr@my-deja.com (2000-07-27) |
Re: Command Line Interpreter adamo@dblab.ece.ntua.gr (2000-07-29) |
Re: Command Line Interpreter sdm7g@elvis.med.virginia.edu (Steven D. Majewski) (2000-07-29) |
Re: Command Line Interpreter bernfarr@my-deja.com (2000-07-31) |
Re: Command Line Interpreter gnb@hellcat.itga.com.au (Gregory Bond) (2000-08-04) |
Re: Command Line Interpreter cfc@world.std.com (Chris F Clark) (2000-08-04) |
[3 later articles] |
From: | Juergen Kahrs <jkahrs@castor.atlas.de> |
Newsgroups: | comp.compilers |
Date: | 27 Jul 2000 21:33:55 -0400 |
Organization: | STN Atlas Elektronik GmbH SLE1 |
References: | 00-07-055 |
Keywords: | interpreter |
> What I need is a way to implement an interpreter that will read actions
> from a command line and process them. The actions never run over
> several lines.
> [Sounds like another job for TCL. -John]
Indeed. Sounds like you are more interested in getting the job done
than in learning parsing techniques. If this assumption is correct,
you might also think about implementing the interpreter as an AWK
script:
/^command1/ { process_cmd1() }
/^command2/ { process_cmd2() }
# ...
function process_cmd1() {
# $0 contains the whole line to be processed.
# $1 contains the first token.
# $n contains the nth token.
}
function process_cmd2() {
# ...
}
+---------------------------------------------------------------------+
| Juergen Kahrs, STN Atlas Elektronik GmbH, D-28305 Bremen |
| Simulation Division Sebaldsbruecker Heerstr. 235 +49/421/457-2819 |
+----------- http://home.t-online.de/home/Juergen.Kahrs/ -------------+
Return to the
comp.compilers page.
Search the
comp.compilers archives again.