Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!usc!snorkelwacker!spdcc!esegue!compilers-sender From: mod@westford.ccur.com (508) Newsgroups: comp.compilers Subject: Re: Intermediate Representation Summary: A comment and some questions Keywords: code,optimize Message-ID: <1990Aug09.180337.18649@esegue.segue.boston.ma.us> Date: 9 Aug 90 18:03:37 GMT Sender: compilers-sender@esegue.segue.boston.ma.us Reply-To: Michael O'Donnell (508)392-2915 Organization: Concurrent Computer Corp. - Westford, Ma Lines: 38 Approved: compilers@esegue.segue.boston.ma.us In-Reply-To: <1990Aug07.153407.8877@esegue.segue.boston.ma.us> 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? Thanks, Michael O'Donnell (508)392-2915 home(508)251-7576 fax(508)692-8307 ...!{harvard,uunet,petsd}!masscomp!mod, mod@westford.ccur.com Concurrent Computer Corporation, 1 Technology Way, Westford, MA 01886 -- Send compilers articles to compilers@esegue.segue.boston.ma.us {spdcc | ima | lotus| world}!esegue. Meta-mail to compilers-request@esegue.