discuss-gnustep
[Top][All Lists]
Advanced

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

Automatic method generator - prototype (Was: Re: Interface parser)


From: Stefan Urbanek
Subject: Automatic method generator - prototype (Was: Re: Interface parser)
Date: Mon, 26 Jul 2004 20:58:28 +0200

Hi!

I have created an example/prototype of method generator from @interfaces in .h 
files. It takes file like this:

    http://stefan.agentfarms.net/Download/GNUstep/Test.h

and turns it into a file like this:

    http://stefan.agentfarms.net/Download/GNUstep/Test.m

Sources are here:

http://stefan.agentfarms.net/Download/GNUstep/ObjectiveCParser-20040726.tar.gz

To test it, you need StepTalk Scripting framework, as it is a quick hack.
   1. edit Test.h
   2. Run "stexec test.st"
   3. look at generated Test.m

Feel fry to modify the code. Any feedback and especially patches is more than 
welcome.

Enjoy,

Stefan Urbanek

p.s.: It would be great if it was somehow incorporated in the DevelopmentKit 
framework....

On 2004-07-26 19:20:08 +0200 Stefan Urbanek <stefan@agentfarms.net> wrote:

On 2004-07-26 17:02:33 +0200 Richard Frith-Macdonald <richard@brainstorm.co.uk> wrote:


On 26 Jul 2004, at 15:56, stefan@agentfarms.net wrote:

Hello,

There are projects parsing Objective-C header files, such as autodoc, gorm or perhaps others not known. I would like to ask, if there is one that can I use to query list of instance variables from header files? It does not have to be
idiot-proof, it just have to accept decent source code.

I want to get list of variables + their types. Best thing would be to be able to get additional information, perhaps present in comments after each variable.

Can be existing conde extracted from those projects and reused as stand-alone
parser class? Does anyone have exact pointers to where I should look?

The AGSParser class from autogsdoc (base/Tools) probably does what you want
(as well as a lot of other stuff you most likely don't want), extracting information into a property-list. You can call -parseFile:isSource: to do this, then examine the
property list returned.


Thank you! I'll try to do something with it. Perhaps I'll try to implement light-weighted Objective-C parser framework.

Stefan Urbanek


--
http://stefan.agentfarms.net

First they ignore you, then they laugh at you, then they fight you, then you 
win.
- Mahatma Gandhi






reply via email to

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