From: Peter H. <pe...@ex...> - 2004-11-20 21:04:53
|
Hi, A while ago I mentioned that I was using JScheme together with Antlr = (http://www.antlr.org). My current code is a bit of a fudge, using Antlr = to generate a Scheme 'String', which I evalute. However I'm looking to = generate a class extending jsint.Pair and implementing = antlr.collections.AST (the Abstract Syntax Tree interface) which should = make a very powerful tool for language implementation. My question is, what does my class (call it ASTPair) need to do to = convince the Scheme interpreter that it is really a 'Pair'? The main = issue is, how does the Pair relate to a Symbol - as with an AST every = element is of the AST class, so for the 'first()' and 'getFirst()' = methods of 'Pair' would I sometimes need to cast to a 'Symbol'? thanks Peter |