This part's taking longer than I thought!by (no login)
Luckily I'm 90% percent done and happy with the way it works. There are a number of steps in interpreting a sub's syntax and applying it to the user's code. Here's a sneak peek of the first step. I like to work using visual models because they help me identify loopholes in my logic and see patterns.
This is the format of the line statement.
The light gray numbers are the level to which the option is indwelled in optional . The blue numbers show the MINIMUM level from which you can enter the option from the previous position (nm if you don't get this!). The RED X and GREEN P indicate whether the item's value should be passed to the sub. An X means there is no point passing a value for the item because it can be assumed based on the existence/omition of another value or it is always there.
The second step is to trace the user's code from left to right one word at a time and check whether that word (or group of words) matches any future item (very non-trivial! but almost implemented).
I'll share this piece code with anyone interested after I get it working properly because it was a nightmare to work out how to code and could have a myriad of different uses.