Namespace T T is the main namespace of all TapperWare libraries. Each namespace given hereafter is actually a sub-namespace of T: e.g. Classes is actually T.Classes Namespace Classes Contains everything related to classes and inheritence Public: Static: {function} create ( {object} proto [ , {function} parent ] ) Creates a constructor function that inherits from an (optional) given parent constructor. All properties of the given prototype are transfered to that constructor's prototype. The returned constructor will run the ctor method when invoked. If a parent constructor is to be run it has to be invoked manually with ParentConstructor.prototype.ctor.call( this [, ...] ) The state of the object passed as argument proto is not defined after create has finished, so no references to that object should be used after it has been passed to create. If the proto object does not specify a ctor method the parent constructor will be invoked. Specify ctor:null if this is undesired. Example: var Foo = Classes.create ( { foo : 0 , ctor : function( aFoo ){ this.foo = aFoo; } } ); var Bar = Classes.create ( { bar : 0 , ctor : function( aBar ){ this.bar = bar; Foo.prototype.constructor.call( this, aBar ); } }, Foo ); Namespace Trees Contains everything related to tree-like data structures Public: Classes: {object} Node ( [{object} data] ) Creates a new Node object with the given data Properties: Public: [rw] {object} data Custom data attached to the node [r] {number} level Gets the number of steps from current to topmost parent node [rw] {Node} parentNode Pointer to parent node Detaches node from current parent and attaches to new on set [r] {Node} previousSibling Previous child of parent node, null if current is first [r] {Node} nextSibling Next child of parent node, null if current is last [r] {Node} firstChild First child of node, null if no childnodes exist [r] {Node} lastChild Last child of node, null if no childnodes exist [r] {Node} firstLeaf First child of first child of first .... node [r] {Node} lastLeaf Last child of last child of last .... node Private: {number} __position [:NaN] The index of the Node in a childNodes array {object}__parentNode [:null] Pointer to the parent node {Array}__childNodes [:null] Array of child nodes Methods: Public: {void} appendChild ( {Node} newChild ) Appends the element, removing it from former parent {void} removeChild ( {Node} formerChild ) Removes child from current node {void} remove ( ) Removes self from parent {void} traverse ( { function {Node|void} ( {Node} currentNode ) } forEach, {Bool} reverse ) Traverses through all nodes, starting at the root and diving down from there If the callback returns a node, that node is assumed to be the last processed one {void} traverseFromLeafs ( {function {Node|void} ( {Node} currentNode ) } forEach, {Bool} reverse ) Traverses through all nodes, starting at the first Leaf and bubbling up from there If the callback returns a node, that node is assumed to be the last processed one {void} traverseWithStack ( {function( {Array} nodeStack , {number} direction ) } forEach ) Traverses through all nodes, starting at the root and diving down from there. If a node is encountered while going up as well as going down the callback will run twice for tha node. The direction argument can be used as a bitmask: If the node is encountered while diving down &1 is set. If it is encountered bubbling up &2 is set. If it's a leaf &1 and &2 are both set (==3) {void} void prettyPrint( ) alerts the JSON serialization of each node's data in a list with indention Namespace Expressions Contains everything related to expressions Public: Classes: {object} Compiler ( ) Insances can be used to compile an expression to a function which uses only explicit function calls instead of operators. Note that feeding incorrect expressions WILL result in undefined behaviour. Example: 4+3*foo becomes M.Add(4,M.Mult(3,D.get("foo"))) Methods: Public: {string} compileToSrc( {string} codeString ) {function( {object} operators, {object} data ) } compileToFunction( {string} codeString ) Private: {void} __parseFlatTree( {string} codeString ) {void} __nestBrackets( ) {void} __nestConditions( ) {void} __nestNamed( ) {void} __nestSingleOperands( ) {void} __nestDualsOperands( ) {void} __resolveOperatorNames( ) {void} __compile( ) {function( {object} operators, {object} data ) } __toFunction( ) Properties: Private: {static RegExp} __atomRX {static Array} __atomWeight {static Object} __operatorNames {Node} __codeTree {string} __codeSrc {string} __codeCompiled