On Tue, Jan 1, 2013 at 1:41 PM, David A. Wheeler <dwhee...@dwheeler.com> wrote:
> The nice thing about ANTLR is that we can be sure that the grammar is LL(1), 
> and it has some nice tools for rapid prototyping.  Sadly, ANTLR doesn't 
> generate Scheme.
>
> But it does generate Java.  I'm seriously thinking about adding *real* 
> actions in Java to the ANTLR grammar.  That way, we can test that the actions 
> are correct.  That way we can test it before translating it by hand into 
> Scheme.  I'm interested in generating Javascript eventually, but the 
> Javascript generator isn't as well documented and there are hints of 
> bugginess.  So let's start with Java, and we can switch to Javascript later 
> if appropriate.

It should be trivial to create a Scheme interpreter in Java.
Actually, you don't even need a scheme interpreter: you just need a
set of classes to represent common Scheme types, and a virtual member
function on the base class to print out an s-expression.  That way we
can use its output directly into a Scheme script that executes the
Java code on the t-expr input, slurps its s-expr output, and compares
it to the reference s-expr.

Not having actually studied Java, though, means that I can't actually
do it, LOL.  But ANTLR has C++, right?  That I could write.

------------------------------------------------------------------------------
Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
and much more. Keep your Java skills current with LearnJavaNow -
200+ hours of step-by-step video tutorials by Java experts.
SALE $49.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122612 
_______________________________________________
Readable-discuss mailing list
Readable-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/readable-discuss

Reply via email to