Hello.<br><br>I use standard module Compiler to build ASTs of Python code. <br><br>Given AST subtree I want to restore coordinates of substring in the input, which is covered by the subtree.<br><br>Example:<br>Suppose, the input is 'a+(b+c)'. It is parsed to the tree  ADD(a, ADD(b,c)) by module Compiler.<br>
I want to have a function, which given ADD(b,c) will return the coordinates of the substring '(b+c)'.<br><br>Module Compiler provides only line numbers  for each node. But even this information is incorrect: only the first line of multi-lined statements is stored.<br>
<br>What is the easiest way of doing what I want?<br>As I understand, module Compiler is automatically generated by some parser generator. Maybe I can modify it?<br><br>-- <br>Best regards,<br>   Peter Bulychev.