From james.f.hester at gmail.com  Wed Jul 29 18:13:57 2015
From: james.f.hester at gmail.com (Jim Hester)
Date: Wed, 29 Jul 2015 12:13:57 -0400
Subject: [Rd] Mapping parse tree elements to tokens
Message-ID: <CAD6tx97oEh1w6HcJHXhdxcraVsmkPmacQfrhrtSnvz+qapHRQA@mail.gmail.com>

I would like to map the parsed tokens obtained from utils::getParseData()
to the parse tree and elements obtained by base::parse().

It looks like back when this code was in the parser package the parse()
function annotated the elements in the tree with their id, which would
allow you to perform this mapping.  However when the code was included in R
this functionality was removed.

?getParseData states
  The ?id? values are not attached to the elements of the parse
          tree, they are only retained in the table returned by
          ?getParseData?.

Is there another way you can map between the getParseData() tokens and
elements of the parse tree that makes this additional annotation
unnecessary?  Or is this simply not possible?

	[[alternative HTML version deleted]]



[Rd] Mapping parse tree elements to tokens
Jim Hester