From 5be06d74819e09b697d8e6ac7bf994f64b5420e5 Mon Sep 17 00:00:00 2001 From: frese Date: Thu, 15 Jul 2004 17:34:52 +0000 Subject: [PATCH] *** empty log message *** --- COPYING | 2 + README | 2 + doc/chat.doc | 15 ++ doc/expect.doc | 166 ++++++++++++++++++++++ scheme/chat.scm | 165 ++++++++++++++++++++++ scheme/expect-syntax.scm | 288 +++++++++++++++++++++++++++++++++++++++ scheme/expect.scm | 267 ++++++++++++++++++++++++++++++++++++ scheme/let-match.scm | 99 ++++++++++++++ scheme/packages.scm | 74 ++++++++++ 9 files changed, 1078 insertions(+) create mode 100644 COPYING create mode 100644 README create mode 100644 doc/chat.doc create mode 100644 doc/expect.doc create mode 100644 scheme/chat.scm create mode 100644 scheme/expect-syntax.scm create mode 100644 scheme/expect.scm create mode 100644 scheme/let-match.scm create mode 100644 scheme/packages.scm diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..1976793 --- /dev/null +++ b/COPYING @@ -0,0 +1,2 @@ +Designed and implemented by David Fisher and Olin Shivers. +Copyright (C) 1998 by the Scheme Underground. diff --git a/README b/README new file mode 100644 index 0000000..1976793 --- /dev/null +++ b/README @@ -0,0 +1,2 @@ +Designed and implemented by David Fisher and Olin Shivers. +Copyright (C) 1998 by the Scheme Underground. diff --git a/doc/chat.doc b/doc/chat.doc new file mode 100644 index 0000000..0d100de --- /dev/null +++ b/doc/chat.doc @@ -0,0 +1,15 @@ +(chat ...) + +dynvars: $task $chat-cont $chat-abort-re $chat-timeout + +(look-for* re [on-timeout]) +(look-for re [on-timeout ...]) + +(send fmt arg ...) +(send/cr fmt arg ...) + +logging output funs? + +side-effecting option setting + (chat-abort ) + (chat-timeout ) diff --git a/doc/expect.doc b/doc/expect.doc new file mode 100644 index 0000000..ab5b7f4 --- /dev/null +++ b/doc/expect.doc @@ -0,0 +1,166 @@ +The Scheme Underground Expect package +Designed and implemented by David Fisher and Olin Shivers + +(spawn* THUNK) -> task procedure + +Spawn* forks a process to execute THUNK, and returns a task data-structure +that contains all of the information that expect-package elements need in +order to interact with that process. + +(spawn . EPF) -> task procedure + +This is syntactic sugar for (spawn* (lambda () (exec-epf EPF))). +Spawns the epf. + +(ports->task INPUT-PORT OUTPUT-PORT) -> task procedure + +This procedure constructs a task from a pair of ports. + +(task:in TASK) -> output-port procedure +(task:out TASK) -> input-port procedure +(task:process TASK) -> process procedure + +These three procedures return, in order, the input port that can be used to +get data from the task, the output port that can be used to send data to the +task, and the process that the task is running. + +(task:pre-match TASK) -> string procedure +(task:buf TASK) -> string procedure + +When an EXPECT pattern matches some input, the task:pre-match field is set to +the string preceding the matched data, and the task:buf field is set to the +string coming after the matched data, that is, it saves input that hasn't +yet been processed. When EXPECT starts, it first considers any data stored +in the task:buf field. + +(set-task:pre-match TASK STR) +(set-task:buf TASK STR) +... + +------------------------------------------------------------------------------- +(EXPECT [ ] ...) -> values syntax + + ::= ( ...) [Task clause.] + | + | (ON-TIMEOUT ...) [Do on timeout.] + +Action clauses: + ::= (ON-EOF ...) [Do on EOF.] + | ( ...) [Do if pattern matches.] + | (TEST . ) + + ::= () [No match info] + | () [Match struct only] + | ( ...) [...also submatch strings.] + + ::= (OPTION