From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f384032a8c47ef0d X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!npeer.de.kpn-eurorings.net!noris.net!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: about OpenToken Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <439b6ac7$0$20862$636a55ce@news.free.fr> <439c6eab$0$20191$636a15ce@news.free.fr> <163minks9ygxl$.tww5gn7kaioj.dlg@40tude.net> <439cafc6$0$29626$636a15ce@news.free.fr> Date: Mon, 12 Dec 2005 14:18:09 +0100 Message-ID: NNTP-Posting-Date: 12 Dec 2005 14:18:09 MET NNTP-Posting-Host: 9c5c1479.newsread4.arcor-online.net X-Trace: DXC= On Mon, 12 Dec 2005 00:01:25 +0100, Lionel Draghi wrote: > Dmitry A. Kazakov a �crit : > .. >> There are many approaches to parsing. I am using table driven parsers. For >> a descent recursive parser I just change the table to match the source >> against depending on the context. I presume that something similar can be >> done with OpenToken as well. > > I have no special preferences. I have a simple grammar to implement, and > my main criteria is simplicity. > When reading OpenToken's doc, I had the impression that a descent > recursive parser was easier to write (even if beta). > That's probably wrong. For example, my grammar is not LL1, and this > cause an extra work when using descent parser in OpenToken. You know, what humans count as simple is not necessarily grammatically simple. The parser in our heads works differently. Consider Ada's "and", "and then", "then". Simple? For things like that I'm using "modifiers", which change the operation stack before firing the actions stored there. So "then" could look around and decide whether it should modify "and" to "and then" or else shift. To me it is simple, at least simpler that writing BNF standing on my head... Another variant is to use patterns as tokens. I used this approach too, but I feel uncomfortable with patterns. They aren't simple! (:-)) -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de