Re: Editing/storing syntax trees

boggs@osage.csc.ti.com (Lowell Boggs)
Tue, 27 Jun 1995 15:04:02 GMT

          From comp.compilers

Related articles
[3 earlier articles]
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)
Re: Editing/storing syntax trees stefan.monnier@epfl.ch (Stefan Monnier) (1995-06-27)
| List of all articles for this month |
Newsgroups: comp.compilers
From: boggs@osage.csc.ti.com (Lowell Boggs)
Keywords: parse, design
Organization: Texas Instruments
References: 95-06-025
Date: Tue, 27 Jun 1995 15:04:02 GMT
Status: RO

>preston@tera.com (Preston Briggs) wrote:
>
>> > ... 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.
>
>ASCII is a terrible representation, because it has to be reparsed on
>every reading.


        I tried some experiments with the borland C pre-compiled headers and
        gave up on them. I don't know how they actually stored the internal
        representation of the headers but found that if I used a lot of
        disk caching (so that the headers stayed in memory all the time) there
        was no real difference in the time it took to compile when I precompiled
        the headers. Since disk caching is more flexible, I turned off the
        precompiled headers stuff. I was testing against programs which used
        a lot of different headers rather than code which used a small number
        of very large headers.


        In the past, I found on MS-DOS that using fscanf to parse small ascii
        files took no appreciably different amount of time that reading a
        single binary file that contained the same information.


        I suggest that actual experimentation is necessary with the real
        data is needed to know which is better.


>
>The 'bulk' problem has now been solved with new compress/decompress-on-the-fly
>disk drivers, which are highly optimized for compression, and the newer
>HW will have specialized high performance chips for doing this that
>I expect will significantly outperform any parsing routines.
>
>> If you want general access to a syntax tree, say for use by several
>> different tools, write a single scanner-parser combination that builds
>> a tree form from the source form; but please don't multiply your editors.
>
>Yes, this is usually called 'Lisp'. :-)


        Lisp is a good intermediate representation of algorithms and serves as
        an excellent platform from which to jump off into highly optimized
        assembly.


Regards,


        Lowell
--


Post a followup to this message

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