Shop OBEX P1 Docs P2 Docs Learn Events
PropForth V5.0 word index — Parallax Forums

PropForth V5.0 word index

mindrobotsmindrobots Posts: 6,506
edited 2012-05-03 20:22 in Propeller 1
When I'm writing forth, I tend to do a lot of looking at other forth words to see how they are implemented and sometimes copying snippets of code. Trying to find where words are defined sometimes drives me crazier than usual, so I take all the .f files and copy them to one directory. Ok, this is better but still not a solution since it would still be nice to know in which of those files a word is defined.

The attached text file is an index of all the forth words, their stack effects (if documented) in the PropForth 5.0 release and which .f files they are defined in. It also has the line numbers but those are for later.

I need to add constants and variable (and immediate words) but at least now, I can find where a word is until I learn its location which with my memory doesn't always work!

This is the intermediate output from a Python program I'm working on which is destined for bigger and better things but this output was useful so I thought I'd share.

Yes, I'll put this out on the Wiki and keep it up to date when I regenerate it.:smile:

Go Forth and be HAPPY!

Comments

  • prof_brainoprof_braino Posts: 4,313
    edited 2012-05-03 19:50
    So, do you point your python program at the propforth directory, and it parses all the files generates the listing?

    How ever you do it, it looks like a good idea. Perhaps we should suggest to Sal that this be included when he spins a new version, and include this index at the end of the user guide propforth.htm ?

    Eventually, the debugger and disassembler might include an option to fetch the forth code from the source file for any word referenced; this looks like a good start to that end.
  • mindrobotsmindrobots Posts: 6,506
    edited 2012-05-03 20:22
    With each release, I've always made copies of all the .f files that come with it and put them in a single directory, forthfiles or some such, so I don't need to look all over the place for the .f files - with the v5.0 release, "all over the place" seemed to grow to monumental proportions.

    The python program currently just scoops up the .f files in whatever directory it is in when it starts and parses them for stack effects and word definitions. As long as you are good about putting the stack effects before the colon definition, it does pretty good and just rips through all the files and spits out the index to stdio.

    The next step is an IDE like interface but I wouldn't hold my breath on that one.....I got a lot of python and QTPY learning to do in my spare time....of course, now that I think about it, an IDE in go using go routines and channels could be interesting.
Sign In or Register to comment.