Date: 14 Apr 04 23:06:54 GMT
From: visser@cs.uu.nl (Eelco Visser)
Subject: Re: [Stratego] Count newlines
Message-ID: <1081984014.18236.140.camel@localhost.localdomain>
References: <Pine.LNX.4.44.0404141001340.28969-100000@lxbill>
MIME-Version: 1.0

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:visser@cs.uu.nl    Universiteit Utrecht
  or:visser@acm.org     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
stratego@cs.uu.nl
https://mail.cs.uu.nl/mailman/listinfo/stratego


