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) |
From: | Uwe.Assmann@inria.fr (Uwe Assmann) |
Newsgroups: | comp.compilers,comp.compilers.tools.pccts |
Date: | 9 Feb 1996 12:18:11 -0500 |
Organization: | I.N.R.I.A Rocquencourt |
References: | 96-01-121 96-02-021 |
Keywords: | analysis, syntax |
I just read a nice article on a tool called A* for language specific
tools. It is based on pattern matching and first-order tree
traversal. It has a nice method to handle comments, reminding me on a
b* tree with linear chaining of leaves:
- link all tokens in a linear list
- intertwine comments in this list in souce order
- compose non-terminals by pointers of the terminal tokens to elements of the
token list
Thus comments can be reached from normal tokens by previous/next-
operations, but not from non-terminals. Thus the grammar is not
complicated at all, but all comments can be reached starting from
terminal tokens. Example:
expr
|
-----------------------------------------
| | |
a <--> + <--> /* comment */ <--> b
@Article{ladd.95a,
author = "Ladd, David A. and Ramming, J. Christopher",
title = "A*: A Language for Implementing Language Processors",
journal = "IEEE Transactions on Software Engineering",
year = 1995,
volume = 21,
number = 11,
pages = "894--901",
month = "nov"
}
Can anyone comment on experiences with that?
--------------------------------------------------------------
Uwe Assmann
INRIA Rocquencourt, Bat. 13
Domaine de Voluceau BP 105
78153 Le Chesnay Cedex, France
email: Uwe.Assmann@inria.fr fax: +33/39 63 53 30 tel: +33/1/39 63 53 84
http://www-rocq.inria.fr/~assmann
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.