Excellent start Staffan.

--
Mark Miesfeld

On Mon, Dec 10, 2012 at 7:06 AM, Staffan Tylen <staffan.ty...@gmail.com> wrote:
> Art, I quickly put together the following little program that creates an
> sqlite database with some basic information. The code is meant to be a
> possible starting point for creating something more robust, nothing else
> (I'm sure it's full of discrepancies but it produces a database with some
> data). Hope it can be of some help.
>
> Staffan
>
> fileSuffix = "cls"   -- file suffix of files to search
> dir = directory()   -- search current directory only
> db = .ooSQLiteConnection~new("xref.db")
> db~exec("BEGIN;")
> db~exec("CREATE TABLE XREF (FILE, CLASS, OBJECT, METHOD);")
> files = SysFileTree(dir||.File~separator||"*."||fileSuffix,"stem.","FO")
> do i = 1 to stem.0
>    file = .stream~new(stem.i)
>    fileName = .File~new(stem.i)~name
>    cls=""; object=""; method=""
>    do while file~lines > 0
>       line = file~linein
>       line0 = space(line,0)
>       p = pos("=.",line0)
>       if p > 0 then do
>          cls = substr(line0,p+2)
>          parse var cls cls "~" .
>          parse var line0 s1 "=" s2
>          s1 = translate(s1," ","()=.,'")
>          obj = word(s1,words(s1))
>          sql = "INSERT INTO XREF (FILE, CLASS, OBJECT)
> VALUES('"fileName"','"cls~upper"','"obj~upper"');"
>          db~exec(sql)
>       end
>       parse var line s1 "~" s2 .
>       do while s2 <> ""
>          s1 = translate(s1," ","()=.,'")
>          obj = word(s1,words(s1))
>          parse var s2 meth "(" .
>          sql = "INSERT INTO XREF (FILE, CLASS, OBJECT, METHOD)
> VALUES('"fileName"','"cls~upper"','"obj~upper"','"meth~upper"');"
>          db~exec(sql)
>          parse var s2 s1 "~" s2 .
>       end
>    end
> end
> db~exec("COMMIT;")
> ::requires "oosqlite.cls"
>
>
>
>
>
> On Mon, Dec 10, 2012 at 2:29 PM, Staffan Tylen <staffan.ty...@gmail.com>
> wrote:
>>
>> I guess in that case you could scan the sources for things like
>> "someobject =.someclass" to find which classes are used and
>> "someobject~somemethod" to get the methods and objects, which then can be
>> associated with to the class in question. This could be written to a csv
>> file for example or directly to an sqlite database using ooSQLite. Not sure
>> if this helps.
>>
>> Staffan
>>
>>
>>
>> On Mon, Dec 10, 2012 at 2:14 PM, Art Heimsoth <artst...@artheimsoth.com>
>> wrote:
>>>
>>> Thanks Staffan,  I agree, but was still hoping for at least a partial aid
>>> leaving out the dynamic entries.
>>>
>>> > I'm not aware of any and I find this hard to do. If I understand
>>> > you correctly you want to be able to see where a specific method
>>> > and routine is used in? In your own code? The problem I see is to
>>> > safely determine the class to which a specific method belongs. And
>>> > also, method/routine names might be dynamically built and executed
>>> > using INTERPRET so there is no way to determine the name of the
>>> > method from the source code. Tough task to solve.
>>> >
>>> > Staffan
>>> >
>>> >
>>> > On Mon, Dec 10, 2012 at 2:33 AM, Art Heimsoth
>>> > <artst...@artheimsoth.com> wrote:
>>> >
>>> >> Is there a cross reference tool available somewhere that will
>>> >> identify all
>>> >>
>>> > the methods and functions in an ooRexx program in a cross reference
>>> > format? Â Did not find any with a quick google search, but did not
>>> > look at all the rexx places either. Â Thanks if anyone is aware of
>>> > one.
>>> >
>>> > --
>>> > Â  Art Heimsoth - artst...@artheimsoth.com
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
>>> Remotely access PCs and mobile devices and provide instant support
>>> Improve your efficiency, and focus on delivering more value-add services
>>> Discover what IT Professionals Know. Rescue delivers
>>> http://p.sf.net/sfu/logmein_12329d2d
>>> _______________________________________________
>>> Oorexx-users mailing list
>>> Oorexx-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/oorexx-users
>>>
>>
>
>
> ------------------------------------------------------------------------------
> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
> Remotely access PCs and mobile devices and provide instant support
> Improve your efficiency, and focus on delivering more value-add services
> Discover what IT Professionals Know. Rescue delivers
> http://p.sf.net/sfu/logmein_12329d2d
> _______________________________________________
> Oorexx-users mailing list
> Oorexx-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/oorexx-users
>

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users

Reply via email to