This is the mail archive of the
kawa@sourceware.cygnus.com
mailing list for the Kawa project.
Re: Best way to interface Java?
- To: "Nic Ferrier" <nferrier at tapsellferrier dot co dot uk>
- Subject: Re: Best way to interface Java?
- From: Per Bothner <per at bothner dot com>
- Date: 21 Jun 2000 13:03:47 -0700
- Cc: kawa at sourceware dot cygnus dot com
- References: <s950fe8e.068@tapsellferrier.co.uk>
"Nic Ferrier" <nferrier@tapsellferrier.co.uk> writes:
> 3. I could pass a OO style proc to the parser
> The proc would take a symbol parameter and a list. The symbol would
> define the action and the list would be the rest of the args.
>
> As for 1. there is no type-checking which puts me off a bit.
Consider doing what SAX does: Define a DocumentHandler class
(or use the SAX version), and pass such a handler to your parser:
For example:
public class ScmDocumentHandler extends org.xml.sax.HandlerBase
{
public void text(FString str)
{ characters(...); }
...
}
(parser
(object (<org.xml.sax.HandlerBase>)
((text (arg :: <string)) <void> (print-text arg))
...))
--
--Per Bothner
per@bothner.com http://www.bothner.com/~per/