Message-ID: <3D19B5E1.6000105@csi.com>
Date: Wed, 26 Jun 2002 08:38:57 -0400
From: John Colagioia <JColagioia@csi.com>
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.4.1) Gecko/20020314 Netscape6/6.2.2
X-Accept-Language: en-us
MIME-Version: 1.0
Newsgroups: rec.arts.int-fiction
Subject: Re: Custom parsing, or what? [Inform]
References: <3d193204$0$79555$3c090ad1@news.plethora.net>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: ool-182f30fa.dyn.optonline.net
X-Original-NNTP-Posting-Host: ool-182f30fa.dyn.optonline.net
X-Trace: excalibur.gbmtech.net 1025094753 ool-182f30fa.dyn.optonline.net (26 Jun 2002 08:32:33 -0400)
Organization: ProNet USA Inc.
Lines: 31
X-Authenticated-User: jnc
Path: news.duke.edu!newsgate.duke.edu!solaris.cc.vt.edu!news.vt.edu!iad-peer.news.verio.net!news.verio.net!news.maxwell.syr.edu!nntp.abs.net!uunet!dca.uu.net!excalibur.gbmtech.net
Xref: news.duke.edu rec.arts.int-fiction:105466

Peter Seebach wrote:
[...]

>Do I just need to make a bunch of dummy objects with the names of the months?
>

How about a single dummy object with a parse_name that internally stores
which month name you asked for?  Something like this:

Object Months
  with  name 'jan' 'feb' 'mar', ! all the other names and abbreviations
would be nice
        which  0,
        parse_name
                [ wd i ;
                 wd = NextWord ();
                 if (WordInProperty (wd, self, name))
                        for (i=0:i<self.#name:i++)
                                if (self.&name-->i == wd)
                                        {
                                          self.which = i;
                                          return (1);
                                         }
                ];

This'll only allow one word for the month, to avoid some wise-guy typing
"TURN TO MAR JANUARY DEC SEPT AUGUST" and getting a semi-viable result.

Alternatively, you can probably do something weird with "Special" scope,
I think it is (the numbers), but I don't think I know how to do it.

