[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fwd: Re: sablecc: line/col info of node.]



Hi all


A frequent approach is to use a depth first adapter to find the first token
under the node and use it's line/column info.

how can i get the first token of a node ? I did see the methods getLine/Pos on Token; but didnot know how to get a handle to it from node.


Keep up the good work mate.

Regards
Anthos


----
Hi Etienne

I am working with SableCC tool to build a tool for PHP.

To handle the tokens I am subclassing DepthFirstAdapter and overriding the necessary functions. Here I also need to get the location information of the node like line number and column it is appearing. Any way to do this ?

Thanks in advance for your time
Anthos

--
Etienne M. Gagnon, Ph.D.             http://www.info.uqam.ca/~egagnon/
SableVM:                                       http://www.sablevm.org/
SableCC:                                       http://www.sablecc.org/