Re: Editing/storing syntax trees

bevan@cs.man.ac.uk (Stephen J Bevan)
Fri, 23 Jun 1995 04:06:36 GMT

          From comp.compilers

Related articles
Re: Q: Definition of a scripting lang. lwall@netlabs.com (1995-03-27)
Editing/storing syntax trees preston@tera.com (1995-05-28)
Re: Editing/storing syntax trees stefan.monnier@epfl.ch (Stefan Monnier) (1995-06-05)
Re: Editing/storing syntax trees hbaker@netcom.com (1995-06-23)
Re: Editing/storing syntax trees daniels@cse.ogi.edu (1995-06-23)
Re: Editing/storing syntax trees bevan@cs.man.ac.uk (1995-06-23)
Re: Editing/storing syntax trees frode@news2.deltanet.com (Frode Odegard) (1995-06-24)
Re: Editing/storing syntax trees hagerman@ece.cmu.edu (1995-06-24)
Re: Editing/storing syntax trees preston@tera.com (1995-06-24)
Re: Editing/storing syntax trees jhallen@world.std.com (1995-06-27)
Re: Editing/storing syntax trees boggs@osage.csc.ti.com (1995-06-27)
Re: Editing/storing syntax trees stefan.monnier@epfl.ch (Stefan Monnier) (1995-06-27)
[1 later articles]
| List of all articles for this month |

Newsgroups: comp.compilers
From: bevan@cs.man.ac.uk (Stephen J Bevan)
Keywords: syntax, design
Organization: Department of Computer Science; University of Manchester
References: 95-04-013 95-05-131
Date: Fri, 23 Jun 1995 04:06:36 GMT
Status: RO

preston@tera.com (Preston Briggs) writes:
      > ... Wouldn't it be so much easier to store your source as a syntax-tree?
      >In theory I agree, ...


      I disagree. ASCII source is actually a fine representation, small and
      convenient. Syntax trees, on disk, are bulky and inconvenient. ...


Doesn't this depend on the language and the storage layout? For
example, the syntax trees I generate for EDIF are roughtly the same
size (within a few K for Mb size files) as the ASCII from which they
are derived, whereas ones I produce for Oberon-2 are considerably
larger than the ASCII.




      ... Separate your concerns. Use a single, good editor for all your
      programming languages, and individual compilers for each language.
      Otherwise, you get stuck using/writing a new editor for each new
      language. ...


As I understood it the suggestion was to store the program as a syntax
tree. IMHO whether you edit it with a special editor or use
parsers/unparsers to convert between ASCII<->syntax-tree to allow you
to use an ASCII editor is a separate issue. Personally I've tended to
go with the parser/unparser approach.
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.