in reply to Re^4: snakes and ladders
in thread snakes and ladders

Very very like. This is what the complier folks call a "parse tree". You can, once you have the tree, "walk" it and evaluate what to do at each node. (This is what Perl does to execute a Perl program.)

Replies are listed 'Best First'.
Re^6: snakes and ladders
by Logicus (Initiate) on Aug 25, 2011 at 11:52 UTC
    I see.. I'm thinking once built I could also write that exact structure out to a .pm file to save building it again in the future until the source code changes.

      As an optimization, sure. If I were doing this, I wouldn't spend much time on it until it paid off—getting something to walk the data structure or object graph and do the right thing is much more useful.

      (The initial parsing phase probably won't be the source of performance problems or scaling, if you do it well.)