|Syntax directed program editing email@example.com (1992-02-05)|
|Re: Syntax directed program editing firstname.lastname@example.org (1992-02-06)|
|Re: Syntax directed program editing email@example.com (1992-02-15)|
|Re: Syntax directed program editing nickh@CS.CMU.EDU (1992-02-07)|
|Re: Syntax directed program editing firstname.lastname@example.org (1992-02-07)|
|Re: Syntax directed program editing email@example.com (1992-02-07)|
|Re: Syntax directed program editing firstname.lastname@example.org (1992-02-11)|
|From:||email@example.com (Conrad Hermann)|
|Date:||Fri, 7 Feb 1992 22:51:49 GMT|
In article 92-02-024 firstname.lastname@example.org (Richard Brooksby) writes:
>Why aren't there more editors which operate directly on the parse trees of
>languages? Are there fundamental problems with this approach?
I have two references:
1) There is/was a project at UC Berkeley to do a multilanguage,
emacs-like, syntax-sensitive editor for Pascal, MODULA-2, and other
similar languages (called Pan, I think, under Prof. Graham). One problem
they found was that trying to do syntax-directed editing (or incremental
compilation) on a C file with preprocessor statements is not really a good
idea. It seems that a C preprocessor destroys whatever syntactic
structure your program text has, since anything can be redefined to mean
anything else with #define, and you can arbitrarily include or exclude
pieces of code with #if.
2) In '84, a company called ITC released a Modula-2 compiler with a
syntax-directed editor. It wasn't very popular, but it was really fast
because it stored pre-tokenized files on disk instead of raw text.
My thoughts are that your editor could be turned into a precompiler to
save both the text file and a tokenized file (if there are no syntax
errors) when you save the file. Then your compiler should read the
tokenized/parsed file in a lot less time than doing real parsing. Of
course, if the tokenized file is not present, the compiler could parse the
text file directly.
I figure that reparsing every time you save a file shouldn't upset users
much, since computers are so fast nowadays that can tokenize the file in a
-- Conrad Herrmann
Return to the
Search the comp.compilers archives again.