I've cleaned up the code a bit, and created a github repository for it:

https://github.com/rdm/nifty

Let's say that the "ty" in that name stands for "thank you" (actually,
"nifty" was the first thing that came to mind when I needed to name the
repository).

This version is considerably faster than the version I posted on the 16th,
mostly because I am only parsing the xml file once (instead of once per
definition). Parsing xml to extract a single value is a great strategy for
small xml files but for something as big and complex as nif.xml it makes
more sense to parse the whole thing and stash the result.

This version also has has some structural changes aimed at making my coding
time more efficient. When dealing with a large sprawling code base, errors
are a great way of focusing your attention on something that needs
attention, so I've broken things out into more files to force me to pay
attention to the couplings between the various conceptual modules.

Music I am listening to at the moment is
http://www.youtube.com/watch?v=c6Rvde1YeLE

Thanks,

-- 
Raul



On Sun, Feb 16, 2014 at 4:59 PM, Raul Miller <[email protected]> wrote:

> Here's an update of my little venture into nif parsing. Earlier parts were:
>
> 3.  http://jsoftware.com/pipermail/programming/2014-February/035047.html
> 2.  http://jsoftware.com/pipermail/programming/2014-February/035007.html
> 1.  http://jsoftware.com/pipermail/programming/2014-February/034926.html
>
> Also, just for fun, here's my current music:
> http://www.youtube.com/watch?v=iWjRsd4kk9w
>
> Also, since the code is starting to get big, I've stashed it off in a gist:
>
> https://gist.github.com/rdm/9041044
>
> When run, nif.ijs currently generates a variable named DATANIF which
> represents a game object (in this case it's the 3d geometry of a table).
> It's not particularly efficient yet, or anything, but it's good enough for
> me to move on (and I can make it radically more efficient by pasting more
> of the generated code back into the script).
>
> At this point, it illustrates several concepts:
>
> XML Parsing
> Binary file parsing
> Code generation
>
> I've a bit more ground work, to ensure basic data integrity (I want to be
> able to generate an exact copy of the file I read from the parsed data).
> Then I can move on to rendering (which represents the start of a user
> interface, gives me another view on the underlying data model and gives me
> another way of verifying the integrity of the system). Then I can get going
> on the really interesting stuff.
>
> And, yes, in a sense all I am doing so far is treading over ground that
> other people have already walked on. But that has important educational
> value, and I need a little infrastructure before I can move on to the next
> stages.
>
> Thanks,
>
> --
> Raul
>
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to