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

How to obtain the line number of AST node?



Howdy!

I'm a bit puzzled as I could not find a way to get the line number of the AST nodes. The token classes have getLine() since they derive from Token, but after AST translation some AST nodes do not contain any tokens. AST node classes are derived from Node, which does not have getLine() so the line number seems to be forgotten in the translatation. What to do now? There are nodes which can span multiple lines, but it would be enough to get the starting line. This seems a bit strange since I'm not the only one with this need, so it's possible I have missed something.

--
// Antti Virtanen -//- http://lokori.iki.fi/ -//- 050-4004278