"use strict"; // Autogenerated by cport.py on 2013-09-17 14:37 var ListOfMatchExpression = module.exports = function (/*type*/){ this._expressions = []; }, klass = ListOfMatchExpression, base = Object , proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}}); // File: expression_tree.h lines: 56-56 proto._expressions = undefined; /** * * Print the debug info from each expression in the list * @method _debugList * @param level * */ proto._debugList = function _debugList(level){ // File: expression_tree.cpp lines: 40-42 for (var i = 0; i < this._expressions.length; i++ ) this._expressions[i].debugString(level + 1); // debug only takes level now }; /** * * Append a new expression to our list * @method add * @param Expression * */ proto.add = function add(Expression){ // File: expression_tree.cpp lines: 34-36 // verify(expression) if(!Expression) throw new Error(Expression + " failed verify on ListOfMatchExpression:34"); this._expressions.push(Expression); }; /** * * Empty us out * @method clearAndRelease * */ proto.clearAndRelease = function clearAndRelease(){ // File: expression_tree.h lines: 45-44 this._expressions = []; // empty the expressions }; /** * * Check if the input list is considered the same as this one * @method equivalent * @param other * */ proto.equivalent = function equivalent(other){ // File: expression_tree.cpp lines: 45-59 if (matchType() != other.matchType()) return false; var realOther = new ListOfMatchExpression(other); if (this._expressions.length != realOther._expressions.length) return false; // TODO: order doesn't matter for (var i = 0; i < this._expressions.length; i++ ) if (!this._expressions[i].equivalent(realOther._expressions[i])) return false; return true; }; /** * * Get an item from the expressions * @method getChild * @param * */ proto.getChild = function getChild(i){ // File: expression_tree.h lines: 48-47 return this._expressions[i]; }; /** * * Get the length of the list * @method numChildren * @param * */ proto.numChildren = function numChildren(){ // File: expression_tree.h lines: 47-46 return this._expressions.length; };