Re: Incorporating comments in syntax tree?

Charles Fiterman <cef@geodesic.com>
2 Feb 1996 09:53:43 -0500

          From comp.compilers

Related articles
Incorporating comments in syntax tree? ag129@ucs.cam.ac.uk (1996-01-30)
Re: Incorporating comments in syntax tree? Steve_Kilbane@cegelecproj.co.uk (1996-01-31)
Re: Incorporating comments in syntax tree? ok@cs.rmit.edu.au (1996-02-01)
Re: Incorporating comments in syntax tree? solution@gate.net (1996-02-01)
Re: Incorporating comments in syntax tree? synaptx!thymus!daveg@uunet.uu.net (Dave Gillespie) (1996-02-02)
Re: Incorporating comments in syntax tree? nadav@cc.huji.ac.il (Nadav Aharoni) (1996-02-02)
Re: Incorporating comments in syntax tree? cef@geodesic.com (Charles Fiterman) (1996-02-02)
Re: Incorporating comments in syntax tree? Uwe.Assmann@inria.fr (1996-02-09)
Re: Incorporating comments in syntax tree? greg.titus@attws.com (Greg Titus) (1996-02-13)
Re: Incorporating comments in syntax tree? Conor@puddle.demon.co.uk (Conor O'Neill) (1996-02-23)
| List of all articles for this month |

From: Charles Fiterman <cef@geodesic.com>
Newsgroups: comp.compilers,comp.compilers.tools.pccts
Date: 2 Feb 1996 09:53:43 -0500
Organization: Geodesic Systems
References: 96-01-121 96-02-001
Keywords: analysis, syntax

Incorporating comments to a syntax tree is clearly important since a
good debugger should be able to display or even use them. It is part
of designing a language for multiple consumers rather than just the
programmer and the compiler.


There are a few questions that need to be addressed.


If multiple successive lines have comments are those separate comments
on the individual lines or one comment on the collection of lines. The
programmer must be able to choose either.


What about comments above sections of code?


How do we attach comments to other than the top of the tree for
individual lines.


I propose the following.


x <- y # The colon attaches the comment to the operator <-
a <- b #+ This is a continuation of the previous comment.
#+ Note colon is a binary operator.


a <- (b + c # comment attaches to the + #)
a <- (b # comment attaches to b #)


#- This starts a comment but does not act as a binary operator
#+ This continues the comment
#= This continues the comment and attaches it to the next statement
a <- b


Comments start with # and continue to # or end of line.
--


Post a followup to this message

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