Jonathan S. Shapiro wrote:
> At this point, BitC is far enough along that we can and should start
> self-hosting the compiler. For purely selfish reasons, there is one
> remaining issue that I would like to resolve before we do that, which is the
> final decision(s) about surface syntax. It is time to abandon parenthesis.
> The surface syntax is mostly simple; I just need a brief block of time to
> address it, and there is one particular issue that I will solicit opinions
> about here.
> 
> The main things that we need in order to self-host the BitC compiler are:
> 
> 1. An interface module for the libicu components that we rely on.
> 2. A parser generator that can handle actions written in BitC.
> 3. A final choice of surface syntax.
> 4. An AST compiler similar to ASTmaker that emits BitC code.

For 2 and 4, I thoroughly recommend ANTLR (version 3.1, which supports
tree->tree rewriting grammars). It is BSD-licensed. The reference manual is
<http://www.pragprog.com/titles/tpantlr/the-definitive-antlr-reference>.

ANTLR itself is written in Java, but adaptation to new target languages
seems to be fairly easy; I was able to make a target based on the Java
one, but with interesting modifications, in only an hour or so. For that,
start at
<http://www.antlr.org/wiki/display/ANTLR3/How+to+build+an+ANTLR+code+generation+target>.

-- 
David-Sarah Hopwood ⚥

_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to