This is the mail archive of the kawa@sourceware.cygnus.com mailing list for the Kawa project. See the Kawa home page for more information.


[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index] [Subject Index] [Author Index] [Thread Index]

Re: Lexing & Parsing



> I'm interested in Kawa as a language implementation framework (a direction
> in which I believe it is evolving).

Yep.

> I've started by examining the ECMAScript stuff, and it seems
> clear enough (given my Java skills ;),

Also look at gnu.expr in recent Kawa snapshots.

> but what *wasn't* clear to me is whether there was a straightforward
> way to incorporate the results of parser generating tools (like ANLTR).

There is no magic hook.  Does ANTLR generate its own tree representation?
In any case, you basically have to build Expression trees, which should
not be diffiult from any parser framework.

> Is this currently feasible or in the plans?

There is no specific support current or planned, but I don't see
why there should be a problem.

> Or is hand rolling the way to go?

Personally, I like hard-written recursive-descent parsers.  They may
be slightly more verbose, but they are more flexible, usually
more efficient (especially compared to ANTLR, which seemed rather
heavy-duty to me), and much easier to understand and debug.

> Or, perhaps more interestingly, would it be worthwhile to try to use a
> Scheme based parsing tool?

Well, there are some Scheme dialects that have syntactic forms
that make it relatively easy to do lexers or parsers.  (I think
bigloo is one;  mzscheme may be another.)  It might be worth
trying to port those features.

	--Per Bothner
Cygnus Solutions     bothner@cygnus.com     http://www.cygnus.com/~bothner