comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: about OpenToken
Date: Mon, 12 Dec 2005 14:18:09 +0100
Date: 2005-12-12T14:18:09+01:00	[thread overview]
Message-ID: <incjws5sp4m4.crn2zmie5jp4$.dlg@40tude.net> (raw)
In-Reply-To: 439cafc6$0$29626$636a15ce@news.free.fr

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



  reply	other threads:[~2005-12-12 13:18 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-10 23:54 about OpenToken Lionel Draghi
2005-12-11 11:00 ` Dmitry A. Kazakov
2005-12-11 18:23   ` Lionel Draghi
2005-12-11 19:01     ` Dmitry A. Kazakov
2005-12-11 20:35       ` Stephen Leake
2005-12-11 23:01       ` Lionel Draghi
2005-12-12 13:18         ` Dmitry A. Kazakov [this message]
2005-12-12 14:39         ` Marc A. Criley
2005-12-12 23:25           ` Lionel Draghi
2005-12-11 13:14 ` Stephen Leake
2005-12-11 18:11   ` about OpenToken example compilation error Lionel Draghi
2005-12-11 20:56     ` Stephen Leake
2005-12-11 23:04       ` Lionel Draghi
2005-12-11 18:41   ` about OpenToken Lionel Draghi
2005-12-11 20:49     ` Stephen Leake
2005-12-12 19:04       ` Martin Krischik
2005-12-12 21:35       ` qun-ying
2005-12-12 22:39         ` Ludovic Brenta
2005-12-13  6:19         ` christoph.grein
2005-12-13  0:01     ` Lionel Draghi
2005-12-13  2:58       ` Georg Bauhaus
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox