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

Zodiac questions



Hi,

As part of a system to extract comments from Scheme
code I want to parse the code to extract summary
information such as the fields of a structure, the
parameters of a function and so on.  I am doing this
with Zodiac, but I now think Zodiac may not be the
best way to go and I'm looking for suggestions.  The
problems I've had with Zodiac are:

- the parsed code loses some information (eg units
lose signatures - they are flattened) which is
difficult to recover as links from parsed code to
source are not maintained.  I know I can recover that
information from the location fields (I realise this
is the whole point of Zodiac) but it is a pain to do
so - I have to open the file again, count lines till I
reach the correct line, then count columns etc.

- Zodiac dies when processing files that have
signatures included with require-library statements,
which is most code.  This is most code.  The only way
I see around it is to concatentate all the required
files together, and pass that to Zodiac.

I think I may be better off with a pattern-matching
system that operates on the source code rather than
its Zodiac representation.  On the other hand, I may
be missing stuff in Zodiac.  Essentially all I want to
do is transform stuff like

(define (a-function param1 param2 param3) ...)

into a structure with fields name and parameters.

Things that might useful:
- Zodiac (see above problems)
- Zodiac pattern-matching (but this is only textual
transformations? - the documentation is broken).
- Swindle pattern-matching

Suggestions/help appreciated.

Thanks,
Noel


__________________________________________________
Do You Yahoo!?
Yahoo! Messenger - Talk while you surf!  It's FREE.
http://im.yahoo.com/