In article <1990Aug07.153407.8877@esegue.segue.boston.ma.us> napi@rangkom.MY (Mo
hd Hanafiah b. Abdullah) writes:>I would like know what people think is the best Intermediate Representation
...>(1) Abstract-syntax-tree (looks like Scheme code)
...>I'm more leaning towards "abstract-syntax-tree" since it is portable (machine>independent), readable, visibility of high-level structures (eg. loops) for>effective optimizations, language independent most of the time.
...

I'm just a beginner at this and I recently built a "student" compiler in a
university Compiler Construction class. The text and the instructor were
both presenting an LR(1)/tuple implementation coded in Pascal. I pushed hard
for (and obtained) permission to instead use a Lex/Yacc/AST approach written
in C. My amateur's opinion is probably not worth much here, but it seems
apparent to me that AST's are the easiest IR to manipulate, especially
considering the amount of information they can contain. I didn't use DAG's
(they seem like an inspired twist on the notion of an AST) because I found
their (perceived) complexity a bit daunting. Well, enough noise - now for my
question:

Why do you make several references to the "visual" attributes of an AST? My
instructor and textbook (Fischer/LeBlanc) only touched lightly on AST's and I
had to infer a lot from that little bit. Is there a standard textual
representation of AST's? Mine only existed as data structures in memory,
although the Dragon book mentioned that there is a kind of postfix
representation. Is that it?