The fifth concept to grasp is that of interpreting.
This is where you send a stream of Words into a listener and it is
read and executed as it reads it, or when this script has told it
to be executed.
Imagine that the interpreter simply holds the current 'this' and that
the stream of Words is being Performed on the current 'this'.
Each 'this' has a Type attribute, and now we simply lookup the
'this's Class Xml node and see if the Command given is available to
this Class, if it's not then fall back through Parent Class nodes
to check for the existence of super functions.
If a function is NOT found AT ALL, simply return a node of Type
'/iXml/Container/Error'??? else you have a 'this' that has requested
a new function be run on it.
Next look at the function that the interpreter found, and see what parameters are required ( SHOULD BE INTERACTIVE HERE. but it's not ).
Read in the next required parameters.. ( dont worry about nested
parameters yet.. this is very simple once you get it ).
CASTING of parameters is done RIGHT HERE. As a parameter is GOTTEN,
it is cast to what is required for the current asked of function.
This allows auto casting between String, Number, Boolean and others
right here, and More Complex, Nested DataTypes use the Class Templates
to drop data to bring it down to what is required for this function.
( At present, I do not strip Nodes, as they are all references to the
real datastructure with real content!, so stripping is bad. I use
a schema where extended datatypes only add nodes, or change the
existing nodes contents, so super functions still just work :).
super functions will ignore new extra nodes in the current 'this' when
treating it as a Super Type.
-- rambling please make cohesive.. :(.
Once you have the required parameters, if this is a native function,
the Defintion Node in the ClassType is the Native args.. so we
simply run the native function through reflection or JNI to a dll
with the new args. passing the current 'this' into the native function
so it has an actual XML node context to do ACTUAL WORK with :).
and it is simply passed parameters to do work with :).
If it is not a native function, then the Defintion Node in the
ClassType is just another script to run.
simply run the interpret function again passing the current 'this'
through once again as it's starting reference point :).
Parameters can be of two forms.
Direct Strings.. which are read in as a String in memory and past
into the /iXml/String or /iXml/String/Number.. 'new' function to
create the required parameter, OR OR OR, a parameter can be a ()
a set of round brackets is interpreted as just another script, but
here it is returning just the required parameter.
Nested ()'s are fine and are just more interpret's passing through
the 'this' each time.
This creates the appearence of a wrapdown scripting interpreter.