rem: function AMparseExpr(str,rightbracket) { var symbol, node, result, i, nodeList = [], newFrag = document.createDocumentFragment(); do { str = AMremoveCharsAndBlanks(str,0); result = AMparseIexpr(str); node = result[0]; str = result[1]; symbol = AMgetSymbol(str); if (symbol.ttype == INFIX && symbol.input == "/") { str = AMremoveCharsAndBlanks(str,symbol.input.length); result = AMparseIexpr(str); if (result[0] == null) result[0] = AMcreateMmlNode("mo",document.createTextNode("\u25A1")); else AMremoveBrackets(result[0]); str = result[1]; AMremoveBrackets(node); node = AMcreateMmlNode(symbol.tag,node); node.appendChild(result[0]); newFrag.appendChild(node); symbol = AMgetSymbol(str); } else if (node!=undefined) newFrag.appendChild(node); } while ((symbol.ttype != RIGHTBRACKET && (symbol.ttype != LEFTRIGHT || rightbracket) || AMnestingDepth == 0) && symbol!=null && symbol.output!=""); if (symbol.ttype == RIGHTBRACKET || symbol.ttype == LEFTRIGHT) {  var len = newFrag.childNodes.length; if (len>0 && newFrag.childNodes[len-1].nodeName == "mrow" && len>1 && newFrag.childNodes[len-2].nodeName == "mo" && newFrag.childNodes[len-2].firstChild.nodeValue == ",") { var right = newFrag.childNodes[len-1].lastChild.firstChild.nodeValue; if (right==")" || right=="]") { var left = newFrag.childNodes[len-1].firstChild.firstChild.nodeValue; if (left=="(" && right==")" && symbol.output != "}" || left=="[" && right=="]") { var pos = []; var matrix = true; var m = newFrag.childNodes.length; for (i=0; matrix && i<m; i=i+2) { pos[i] = []; node = newFrag.childNodes[i]; if (matrix) matrix = node.nodeName=="mrow" && (i==m-1 || node.nextSibling.nodeName=="mo" && node.nextSibling.firstChild.nodeValue==",")&& node.firstChild.firstChild.nodeValue==left && node.lastChild.firstChild.nodeValue==right; if (matrix) for (var j=0; j<node.childNodes.length; j++) if (node.childNodes[j].firstChild.nodeValue==",") pos[i][pos[i].length]=j; if (matrix && i>1) matrix = pos[i].length == pos[i-2].length; } if (matrix) { var row, frag, n, k, table = document.createDocumentFragment(); for (i=0; i<m; i=i+2) { row = document.createDocumentFragment(); frag = document.createDocumentFragment(); node = newFrag.firstChild; n = node.childNodes.length; k = 0; node.removeChild(node.firstChild); for (j=1; j<n-1; j++) { if (typeof pos[i][k] != "undefined" && j==pos[i][k]){ node.removeChild(node.firstChild); row.appendChild(AMcreateMmlNode("mtd",frag)); k++; } else frag.appendChild(node.firstChild); } row.appendChild(AMcreateMmlNode("mtd",frag)); if (newFrag.childNodes.length>2) { newFrag.removeChild(newFrag.firstChild); newFrag.removeChild(newFrag.firstChild); } table.appendChild(AMcreateMmlNode("mtr",row)); } node = AMcreateMmlNode("mtable",table); if (typeof symbol.invisible == "boolean" && symbol.invisible) node.setAttribute("columnalign","left"); newFrag.replaceChild(node,newFrag.firstChild); } } } } str = AMremoveCharsAndBlanks(str,symbol.input.length); if (typeof symbol.invisible != "boolean" || !symbol.invisible) { node = AMcreateMmlNode("mo",document.createTextNode(symbol.output)); newFrag.appendChild(node); } } return [newFrag,str]; 
add: function AMparseExpr(str,_2d){ var _2e,node,result,i,nodeList=[],newFrag=document.createDocumentFragment(); do{ str=AMremoveCharsAndBlanks(str,0); result=AMparseIexpr(str); node=result[0]; str=result[1]; _2e=AMgetSymbol(str); if(_2e.ttype==INFIX&&_2e.input=="/"){ str=AMremoveCharsAndBlanks(str,_2e.input.length); result=AMparseIexpr(str); if(result[0]==null){ result[0]=AMcreateMmlNode("mo",document.createTextNode("\u25a1")); }else{ AMremoveBrackets(result[0]); 
context: function AMparseExpr(str,rightbracket) {  var symbol, node, result, i, nodeList = [],  newFrag = document.createDocumentFragment();  do {    str = AMremoveCharsAndBlanks(str,0);    result = AMparseIexpr(str);    node = result[0];    str = result[1];    symbol = AMgetSymbol(str);    if (symbol.ttype == INFIX && symbol.input == "/") {      str = AMremoveCharsAndBlanks(str,symbol.input.length);      result = AMparseIexpr(str);      if (result[0] == null) // show box in place of missing argument        result[0] = AMcreateMmlNode("mo",document.createTextNode("\u25A1"));      else AMremoveBrackets(result[0]);      str = result[1];      AMremoveBrackets(node);      node = AMcreateMmlNode(symbol.tag,node);      node.appendChild(result[0]);      newFrag.appendChild(node);      symbol = AMgetSymbol(str);    }     else if (node!=undefined) newFrag.appendChild(node);  } while ((symbol.ttype != RIGHTBRACKET &&            (symbol.ttype != LEFTRIGHT || rightbracket)           || AMnestingDepth == 0) && symbol!=null && symbol.output!="");  if (symbol.ttype == RIGHTBRACKET || symbol.ttype == LEFTRIGHT) {//    if (AMnestingDepth > 0) AMnestingDepth--;    var len = newFrag.childNodes.length;    if (len>0 && newFrag.childNodes[len-1].nodeName == "mrow" && len>1 &&      newFrag.childNodes[len-2].nodeName == "mo" &&      newFrag.childNodes[len-2].firstChild.nodeValue == ",") { //matrix      var right = newFrag.childNodes[len-1].lastChild.firstChild.nodeValue;      if (right==")" || right=="]") {        var left = newFrag.childNodes[len-1].firstChild.firstChild.nodeValue;        if (left=="(" && right==")" && symbol.output != "}" ||             left=="[" && right=="]") {        var pos = []; // positions of commas        var matrix = true;        var m = newFrag.childNodes.length;        for (i=0; matrix && i<m; i=i+2) {          pos[i] = [];          node = newFrag.childNodes[i];          if (matrix) matrix = node.nodeName=="mrow" &&             (i==m-1 || node.nextSibling.nodeName=="mo" &&             node.nextSibling.firstChild.nodeValue==",")&&            node.firstChild.firstChild.nodeValue==left &&            node.lastChild.firstChild.nodeValue==right;          if (matrix)             for (var j=0; j<node.childNodes.length; j++)              if (node.childNodes[j].firstChild.nodeValue==",")                pos[i][pos[i].length]=j;          if (matrix && i>1) matrix = pos[i].length == pos[i-2].length;        }        if (matrix) {          var row, frag, n, k, table = document.createDocumentFragment();          for (i=0; i<m; i=i+2) {            row = document.createDocumentFragment();            frag = document.createDocumentFragment();            node = newFrag.firstChild; // <mrow>(-,-,...,-,-)</mrow>            n = node.childNodes.length;            k = 0;            node.removeChild(node.firstChild); //remove (            for (j=1; j<n-1; j++) {              if (typeof pos[i][k] != "undefined" && j==pos[i][k]){                node.removeChild(node.firstChild); //remove ,                row.appendChild(AMcreateMmlNode("mtd",frag));                k++;              } else frag.appendChild(node.firstChild);            }            row.appendChild(AMcreateMmlNode("mtd",frag));            if (newFrag.childNodes.length>2) {              newFrag.removeChild(newFrag.firstChild); //remove <mrow>)</mrow>              newFrag.removeChild(newFrag.firstChild); //remove <mo>,</mo>            }            table.appendChild(AMcreateMmlNode("mtr",row));          }          node = AMcreateMmlNode("mtable",table);          if (typeof symbol.invisible == "boolean" && symbol.invisible) node.setAttribute("columnalign","left");          newFrag.replaceChild(node,newFrag.firstChild);        }       }      }    }    str = AMremoveCharsAndBlanks(str,symbol.input.length);    if (typeof symbol.invisible != "boolean" || !symbol.invisible) {      node = AMcreateMmlNode("mo",document.createTextNode(symbol.output));      newFrag.appendChild(node);    }  }  return [newFrag,str];}
meta: 6015	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/6015/d8776708e0e10dfa0ab6ee1d0fa9e512d8d16348/ASCIIMathML.js/clean/packages/acs-templating/www/resources/xinha-nightly/plugins/Equation/ASCIIMathML.js