Subject: Re: [Stratego] Count newlines
From: [email-masked] (Eelco Visser)
Date: 14 Apr 04 23:06:54 GMT

Hi Bill,

> I want to be able to relate parts of my
> parsed structure (tree) to the original
> file.
> 
> I would like to count newlines (currently
> just skipped as LAYOUT), and then store
> the value of this counter when important
> bits of the grammar are parsed.

This would amount to writing an alternative of 
implode-asfix that would attach line counts of
LAYOUT nodes to the parent. Instead of throwing
away LAYOUT you'd count the number of newlines 
(for instance using the occurrences strategy
from the SSL). Then attach the line count to
the node. If useful this could be made into an
option of implode-asfix.

-- Eelco

------------------------------------------------------------------------
Eelco Visser            Institute of Information and Computing Sciences
mail:[email-masked]    Universiteit Utrecht
  or:[email-masked]     P.O. Box 80089, 3508 TB Utrecht, The Netherlands
http://www.cs.uu.nl/~visser/ Phone: +31-30-253 4592 Fax: +31-30-251 3791
------------------------------------------------------------------------

_______________________________________________
stratego mailing list
[email-masked]
https://mail.cs.uu.nl/mailman/listinfo/stratego