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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f384032a8c47ef0d X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!newsread.com!news-xfer.newsread.com!nntp.abs.net!news.abs.net!not-for-mail Newsgroups: comp.lang.ada Subject: Re: about OpenToken References: <439b6ac7$0$20862$636a55ce@news.free.fr> <439c6eab$0$20191$636a15ce@news.free.fr> <163minks9ygxl$.tww5gn7kaioj.dlg@40tude.net> From: Stephen Leake Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt) Cancel-Lock: sha1:WuTXtghbA/uwE++HA0fAap5svW4= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 11 Dec 2005 15:35:08 -0500 NNTP-Posting-Host: 66.159.65.1 X-Complaints-To: abuse@toad.net X-Trace: news.abs.net 1134333310 66.159.65.1 (Sun, 11 Dec 2005 15:35:10 EST) NNTP-Posting-Date: Sun, 11 Dec 2005 15:35:10 EST Xref: g2news1.google.com comp.lang.ada:6837 Date: 2005-12-11T15:35:08-05:00 List-Id: "Dmitry A. Kazakov" writes: > On Sun, 11 Dec 2005 19:23:38 +0100, Lionel Draghi wrote: > >> I expect the code representing the grammar to be almost as simple as the >> BNF expression. > > Well, that depends. Consider comments and line feeds allowed between the > keywords. To represent this in BNF, I don't think it will be such simple > expression. OpenToken does comments and white space in the lexer level, not the grammar level. I don't think you can define a keyword as whitespace, but it's an interesting idea. >> If an optionnal word requires a bunch of code, I would say that there's >> something to improve. > > 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. Yes, you can. -- -- Stephe