1

I had a look at the question but however it does not quite answer my problem.

I am trying to write a grammar to parse XML using Spirit Qi and I for every line I want to append the filename as well as the line number in that file. So if there are entity references and they are replaced by the new file in the original file, I still want to know from where they came. In order to do that I needed to know how can one maintain the position as well as the file name while parsing.

I don't want to use the Spirit classic else this could be a good solution. But I need a way to do the same without using Spirit classic and want to use only Qi if possible.

Any suggestions?

Community
  • 1
  • 1
vishal129
  • 105
  • 9
  • The chat in [link](http://boost-spirit.com/home/2010/01/05/stream-based-parsing-made-easy) says that the position iterator has still not been ported to Qi. Is it true? If not please tell me how should I approach this? Thanks. – vishal129 Jul 20 '12 at 20:26
  • Any help will be greatly appreciated as I need a solution to it urgently. – vishal129 Jul 25 '12 at 14:29

1 Answers1

0

I used the classic position iterator for my problem as I needed the file name as well but for any one else who wants to use something similar can use the line pos iterator. The link for the same is here. It just saves the line position and there is a way to extract the column position. It is a new edition to spirit(v2.5.1).

Thanks.

vishal129
  • 105
  • 9