gnustep-dev
[Top][All Lists]
Advanced

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

Re: Line information in AGSParser


From: Adrian Robert
Subject: Re: Line information in AGSParser
Date: Wed, 4 Aug 2004 09:53:47 -0400

As I do not know internals of the AGSParser I am trying to write here to ask someone with better knowledge of it. Is it possible to add following additional information in the AGSParser?

I'm not an expert on the class but I've looked through the code before. It does a '[String withContentsOfFile] before starting the parse, so parsing from a string in the first place should be easy. Likewise recording the character range information -- the code is hierarchically structured, so you could mark the position before and after, e.g., calls to -parseInterface or -parseMethodXXX call to get a range. The code already tracks line numbers to an extent.

It shouldn't be too hard, and not invasive or performance-harming to its current functionality, to throw the additional range info into the dictionary returned by -parseFile. You could also make it optional.

If changes to serve other functionality ever do interfere with AGSParser's role in the documentation system, the thing to do is refactor out a pure parser class and then a documentation helper class. But I think this has already been done to a large extent (AGSOutput and others are the more doc-related classes) and so is not an issue for now..

Adrian


- character range for some elements, like:
        - @interface to @end
        - @implementation to @end
        - method from '-' to last '}'
        - method from '+' to last '}'
- parsing from a string instead of file only

This would allow better source browsing/indexing and in code generation it would allow methods to be replaced. I know that it was intended to be documentation helper class, however it looks like fully functional reusable parser.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]