Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
/*
Copyright (c) 2012 Chris Pettitt

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/(function(){function c(a){var b={};return a.forEach(function(a,c){b[a]=c}),b}function d(a,b){Object.keys(a).forEach(function(c){b[c]=a[c]})}function e(a){return Math.min.apply(null,a)}function f(a){return Math.max.apply(null,a)}function g(a){return Array.prototype.concat.apply([],a)}function i(a){return Object.keys(a).map(function(b){return a[b]})}function j(a){var b={};for(var c=0;c<a.length;++c){var d=a[c];for(var e=0;e<d.length;++e){var f=d[e];b[f]=f}}var g=[];for(var h in b)g.push(b[h]);return g}function p(a,b,c,d){return function(e){return arguments.length?(b[c]=e,d&&d(e),a):b[c]}}function q(){function c(b){var d=a,f=2*b,g=f+1,h=b;f<d.length&&(h=d[f].pri<d[h].pri?f:h,g<d.length&&(h=d[g].pri<d[h].pri?g:h),h!==b&&(e(b,h),c(h)))}function d(b){var c=a,d=c[b].pri,f;while(b>0){f=b>>1;if(c[f].pri<d)break;e(b,f),b=f}}function e(c,d){var e=a,f=b,g=e[c];e[c]=e[d],e[d]=g,f[e[c].key]=c,f[e[d].key]=d}function f(){return a.length}function g(){return Object.keys(b)}function h(a){return a in b}function i(c){var d=b[c];if(d!==undefined)return a[d].pri}function j(c,e){if(c in b)return!1;var f={key:c,pri:e},g=a.length;return b[c]=g,a.push(f),d(g),!0}function k(){if(f()>0)return a[0].key}function l(){e(0,a.length-1);var d=a.pop();return delete b[d.key],c(0),d.key}function m(c,e){var f=b[c];if(e>a[f].pri)throw new Error("New priority is greater than current priority. Key: "+c+" Old: "+a[f].pri+" New: "+e);a[f].pri=e,d(f)}var a=[],b={};return{size:f,keys:g,has:h,priority:i,add:j,min:k,removeMin:l,decrease:m}}dagre={},dagre.version="0.0.5",dagre.graph={},dagre.graph=function(){function f(a,b,c){var d=a[b];d||(d=a[b]={count:0,edges:{}}),d.count++,d.edges[c]=!0}function k(a,b,c){var d=a[b];--d.count==0?delete a[b]:delete d.edges[c]}function l(b){var c=a[b];if(b in a)return c;throw new Error("Node '"+b+"' is not in buildGraph:\n"+e.toString())}function m(a){var b=d[a];if(!b)throw new Error("Edge '"+a+"' is not in buildGraph:\n"+e.toString());return b}var a={},b={},c={},d={},e={};return e.addNode=function(d,f){if(e.hasNode(d))throw new Error("Graph already has node '"+d+"':\n"+e.toString());a[d]={id:d,value:f},b[d]={},c[d]={}},e.delNode=function(d){l(d),e.edges(d).forEach(function(a){e.delEdge(a)}),delete b[d],delete c[d],delete a[d]},e.node=function(a){return l(a).value},e.hasNode=function(b){return b in a},e.addEdge=function(a,g,h,i){l(g),l(h);if(e.hasEdge(a))throw new Error("Graph already has edge '"+a+"':\n"+e.toString());d[a]={id:a,source:g,target:h,value:i},f(b[h],g,a),f(c[g],h,a)},e.delEdge=function(a){var e=m(a);k(b[e.target],e.source,a),k(c[e.source],e.target,a),delete d[a]},e.edge=function(a){return m(a).value},e.source=function(a){return m(a).source},e.target=function(a){return m(a).target},e.hasEdge=function(a){return a in d},e.successors=function(b){return l(b),h(c[b]).map(function(b){return a[b].id})},e.predecessors=function(c){return l(c),h(b[c]).map(function(b){return a[b].id})},e.neighbors=function(d){l(d);var e={};return h(c[d]).map(function(a){e[a]=!0}),h(b[d]).map(function(a){e[a]=!0}),h(e).map(function(b){return a[b].id})},e.nodes=function(){var a=[];return e.eachNode(function(b,c){a.push(b)}),a},e.eachNode=function(b){for(var c in a){var d=a[c];b(d.id,d.value)}},e.edges=function(a,b){var f,g;if(!arguments.length)return f=[],e.eachEdge(function(a){f.push(a)}),f;if(arguments.length===1)return j([e.inEdges(a),e.outEdges(a)]);if(arguments.length===2)return l(a),l(b),g=c[a],f=b in g?h(g[b].edges):[],f.map(function(a){return d[a].id})},e.eachEdge=function(a){for(var b in d){var c=d[b];a(c.id,c.source,c.target,c.value)}},e.inEdges=function(a){return l(a),g(i(b[a]).map(function(a){return h(a.edges)}))},e.outEdges=function(a){return l(a),g(i(c[a]).map(function(a){return h(a.edges)}))},e.subgraph=function(a){var b=dagre.graph();return a.forEach(function(a){b.addNode(a,e.node(a))}),i(d).forEach(function(a){b.hasNode(a.source)&&b.hasNode(a.target)&&b.addEdge(a.id,a.source,a.target,e.edge(a.id))}),b},e.toString=function(){var b="GRAPH:\n";return b+="    Nodes:\n",h(a).forEach(function(c){b+="        "+c+": "+JSON.stringify(a[c].value)+"\n"}),b+="    Edges:\n",h(d).forEach(function(a){var c=d[a];b+="        "+a+" ("+c.source+" -> "+c.target+"): "+JSON.stringify(d[a].value)+"\n"}),b},e},dagre.layout=function(){function h(){var b=dagre.graph(),c=0;return a.nodes.forEach(function(a){var d="id"in a?a.id:"_N"+c++;a.dagre={id:d,width:a.width,height:a.height},b.addNode(d,a.dagre)}),a.edges.forEach(function(a){var d=a.source.dagre.id;if(!b.hasNode(d))throw new Error("Source node for '"+a+"' not in node list");var e=a.target.dagre.id;if(!b.hasNode(e))throw new Error("Target node for '"+a+"' not in node list");a.dagre={points:[]};if(d!==e){var f="id"in a?a.id:"_E"+c++;a.dagre.id=f,a.dagre.minLen=a.minLen||1,a.dagre.width=a.width||0,a.dagre.height=a.height||0,b.addEdge(f,d,e,a.dagre)}}),b}function i(){var b=g.rankSep();try{if(!a.nodes.length)return;var i=h();i.eachEdge(function(a,b,c,d){d.minLen*=2}),g.rankSep(b/2),c.run(i),d.run(i),j(i),e.run(i),f.run(i),k(i),l(i),c.undo(i)}finally{g.rankSep(b)}return g}function j(a){var b=0;a.eachEdge(function(c,d,e,f){var g=a.node(d).rank,h=a.node(e).rank;if(g+1<h){for(var i=d,j=g+1,k=0;j<h;++j,++k){var l="_D"+ ++b,m={width:f.width,height:f.height,edge:{id:c,source:d,target:e,attrs:f},index:k,rank:j,dummy:!0};a.addNode(l,m),a.addEdge("_D"+ ++b,i,l,{}),i=l}a.addEdge("_D"+ ++b,i,e,{}),a.delEdge(c)}})}function k(a){var b={};a.eachNode(function(b,c){if(c.dummy){var d=c.edge;a.hasEdge(d.id)||a.addEdge(d.id,d.source,d.target,d.attrs);var e=a.edge(d.id).points;e[c.index]={x:c.x,y:c.y},a.delNode(b)}})}function l(a){a.eachEdge(function(a,b,c,d){d.reversed&&d.points.reverse()})}function m(a){return function(){return arguments.length?(a.apply(null,arguments),g):a()}}var a={nodes:[],edges:[],debugLevel:0},b=o(),c=dagre.layout.acyclic(),d=dagre.layout.rank(),e=dagre.layout.order(),f=dagre.layout.position(),g={};return g.nodes=p(g,a,"nodes"),g.edges=p(g,a,"edges"),g.orderIters=m(e.iterations),g.nodeSep=m(f.nodeSep),g.edgeSep=m(f.edgeSep),g.rankSep=m(f.rankSep),g.rankDir=m(f.rankDir),g.debugAlignment=m(f.debugAlignment),g.debugLevel=p(g,a,"debugLevel",function(a){b.enabled(a),c.debugLevel(a),d.debugLevel(a),e.debugLevel(a),f.debugLevel(a)}),g.run=b.wrap("Total layout",i),g},dagre.layout.acyclic=function(){function d(b){function f(a){if(a in d)return;d[a]=c[a]=!0,b.outEdges(a).forEach(function(d){var g=b.target(d),h;g in c?(h=b.edge(d),b.delEdge(d),h.reversed=!0,++e,b.addEdge(d,g,a,h)):f(g)}),delete c[a]}var c={},d={},e=0;b.eachNode(function(a){f(a)}),a.debugLevel>=2&&console.log("Acyclic Phase: reversed "+e+" edge(s)")}var a={debugLevel:0},b=o(),c={};return c.debugLevel=p(c,a,"debugLevel",function(a){b.enabled(a)}),c.run=b.wrap("Acyclic Phase",d),c.undo=function(a){a.eachEdge(function(b,c,d,e){e.reversed&&(delete e.reversed,a.delEdge(b),a.addEdge(b,d,c,e))})},c},dagre.layout.rank=function(){function d(a){f(a),k(a).forEach(function(b){var c=a.subgraph(b);g(c),h(c)})}function f(a){var b={},c=q();a.eachNode(function(d){c.add(d,a.inEdges(d).length),b[d]=0});while(c.size()>0){var d=c.min();if(c.priority(d)>0)throw new Error("Input buildGraph is not acyclic: "+a.toString());c.removeMin();var e=b[d];a.node(d).rank=e,a.outEdges(d).forEach(function(d){var f=a.target(d);b[f]=Math.max(b[f],e+(a.edge(d).minLen||1)),c.decrease(f,c.priority(f)-1)})}}function g(a){function e(f,g){d[f]=!0,a.node(f).rank=g,c[f].forEach(function(c){if(!(c in d)){var h=b[i(f,c)];e(c,g+(a.edges(f,c).length?h:-h))}})}var b={};a.eachEdge(function(a,c,d,e){var f=i(c,d);b[f]=Math.max(b[f]||1,e.minLen||1)});var c=dagre.util.prim(a,function(c,d){return Math.abs(a.node(c).rank-a.node(d).rank)-b[i(c,d)]}),d={};return e(a.nodes()[0],0),c}function h(a){var b=e(a.nodes().map(function(b){return a.node(b).rank}));a.eachNode(function(a,c){c.rank-=b})}function i(a,b){return a<b?a.length+":"+a+"-"+b:b.length+":"+b+"-"+a}var a={debugLevel:0},b=o(),c={};return c.debugLevel=p(c,a,"debugLevel",function(a){b.enabled(a)}),c.run=b.wrap("Rank Phase",d),c},dagre.layout.order=function(){function g(b){var c=h(b),e=l(c),f=a(b,c);d.debugLevel>=2&&console.log("Order phase start cross count: "+f);var g,j,k;for(j=0,k=0;k<4&&j<d.iterations;++j,++k)g=i(b,j,c),g<f&&(e=l(c),f=g,k=0),d.debugLevel>=3&&console.log("Order phase iter "+j+" cross count: "+f);return e.forEach(function(a){a.forEach(function(a,c){b.node(a).order=c})}),d.debugLevel>=2&&(console.log("Order iterations: "+j),console.log("Order phase best cross count: "+f)),e}function h(a){var b=[];return a.eachNode(function(a,c){var d=b[c.rank]||(b[c.rank]=[]);d.push(a)}),b}function i(a,c,d){var e=0,f;if(c%2===0)for(f=1;f<d.length;++f)j(a,d[f-1],d[f],"inEdges"),e+=b(a,d[f-1],d[f]);else for(f=d.length-2;f>=0;--f)j(a,d[f+1],d[f],"outEdges"),e+=b(a,d[f],d[f+1]);return e}function j(a,b,d,e){var f=c(d),g=k(a,b,d,e),h=d.slice(0).sort(function(a,b){return g[a]-g[b]||f[a]-f[b]});for(var i=d.length-1;i>=0;--i)g[d[i]]!==-1&&(d[i]=h.pop())}function k(a,b,d,e){var f=c(b),g={};return d.forEach(function(b){var c=-1,d=a[e](b);d.length>0&&(c=0,d.forEach(function(d){var e=a.source(d),g=e===b?a.target(d):e;c+=f[g]}),c/=d.length),g[b]=c}),g}function l(a){return a.map(function(a){return a.slice(0)})}var d={iterations:24,debugLevel:0},e=o(),f={};return f.iterations=p(f,d,"iterations"),f.debugLevel=p(f,d,"debugLevel",function(a){e.enabled(a)}),f.run=e.wrap("Order Phase",g),f};var a=dagre.layout.order.crossCount=function(a,c){var d=0,e;return c.forEach(function(c){e&&(d+=b(a,e,c)),e=c}),d},b=dagre.layout.order.bilayerCrossCount=function(a,b,d){var e=c(d),f=[];b.forEach(function(b){var c=[];a.outEdges(b).forEach(function(b){c.push(e[a.target(b)])}),c.sort(function(a,b){return a-b}),f=f.concat(c)});var g=1;while(g<d.length)g<<=1;var h=2*g-1;g-=1;var i=[];for(var j=0;j<h;++j)i[j]=0;var k=0;return f.forEach(function(a){var b=a+g;++i[b];var c=0;while(b>0)b%2&&(k+=i[b+1]),b=b-1>>1,++i[b]}),k};dagre.layout.position=function(){function d(b){var c=[];b.eachNode(function(a,b){var d=c[b.rank]||(c[b.rank]=[]);d[b.order]=a});var d=h(b,c),g={};["up","down"].forEach(function(e){e==="down"&&c.reverse(),["left","right"].forEach(function(f){f==="right"&&t(c);var h=e+"-"+f;if(!a.debugAlignment||a.debugAlignment===h){var i=j(b,c,d,e==="up"?"predecessors":"successors");g[h]=l(b,c,i.pos,i.root,i.align),f==="right"&&s(c,g[h])}f==="right"&&t(c)}),e==="down"&&c.reverse()}),a.debugAlignment?b.eachNode(function(c,d){w(b,c,g[a.debugAlignment][c])}):(r(b,c,g),b.eachNode(function(a){var c=i(g).map(function(b){return b[a]}).sort(function(a,b){return a-b});w(b,a,(c[1]+c[2])/2)}));var k=e(b.nodes().map(function(a){return w(b,a)-u(b,a)/2}));b.eachNode(function(a){w(b,a,w(b,a)-k)});var m=0;c.forEach(function(c){var d=f(c.map(function(a){return v(b,a)}));m+=d/2,c.forEach(function(a){x(b,a,m)}),m+=d/2+a.rankSep})}function h(a,b){var c={},d={};b[0].forEach(function(a,b){d[a]=b});for(var e=1;e<b.length;++e){var f=b[e],g=0,h=0;for(var i=0;i<f.length;++i){var j=f[i];d[j]=i;var k=null;a.node(j).dummy&&a.predecessors(j).some(function(b){return a.node(b).dummy?(k=d[b],!0):!1}),k===null&&i===f.length-1&&(k=b[e-1].length-1);if(k!==null){for(;h<=i;++h){var l=f[h];a.inEdges(l).forEach(function(b){var e=d[a.source(b)];if(e<g||e>k)c[b]=!0})}g=k}}}return c}function j(a,b,c,d){var e={},f={},h={};return b.forEach(function(a){a.forEach(function(a,b){f[a]=a,h[a]=a,e[a]=b})}),b.forEach(function(b){var i=-1;b.forEach(function(b){var j=a[d](b);if(j.length>0){j.sort(function(a,b){return e[a]-e[b]});var k=(j.length-1)/2;j.slice(Math.floor(k),Math.ceil(k)+1).forEach(function(d){h[b]===b&&!c[g([a.edges(b,d),a.edges(d,b)])[0]]&&i<e[d]&&(h[d]=b,h[b]=f[b]=f[d],i=e[d])})}})}),{pos:e,root:f,align:h}}function k(b,c){var d=b.node(c).dummy?a.edgeSep:a.nodeSep;return u(b,c)/2+d/2}function l(a,b,c,d,e){function l(b){if(!(b in j)){j[b]=0;var i=b;do{if(c[i]>0){var m=d[h[i]];l(m),f[b]===b&&(f[b]=f[m]);var n=k(a,h[i])+k(a,i);f[b]!==f[m]?g[f[m]]=Math.min(g[f[m]]||Number.POSITIVE_INFINITY,j[b]-j[m]-n):j[b]=Math.max(j[b],j[m]+n)}i=e[i]}while(i!==b)}}var f={},g={},h={},j={};b.forEach(function(a){a.forEach(function(b,c){f[b]=b,h[b]=c>0?a[c-1]:null})}),i(d).forEach(function(a){l(a)});var m=0;return b.forEach(function(a){var b=g[a[0]];b===undefined&&(b=0),m=g[a[0]]=b+m}),b.forEach(function(a){a.forEach(function(a){j[a]=j[d[a]];if(d[a]===a){var b=g[f[a]];b<Number.POSITIVE_INFINITY&&(j[a]+=b)}})}),j}function m(a,b,c){return e(b.map(function(b){var d=b[0];return c[d]-u(a,d)/2}))}function n(a,b,c){return f(b.map(function(b){var d=b[b.length-1];return c[d]-u(a,d)/2}))}function q(a,b){Object.keys(b).forEach(function(c){b[c]+=a})}function r(a,b,c){var d,e,f=Number.POSITIVE_INFINITY;i(c).forEach(function(c){var g=m(a,b,c),h=n(a,b,c),i=h-g;i<f&&(d=g,e=h,f=i)}),["up","down"].forEach(function(e){var f=c[e+"-left"],g=d-m(a,b,f);g&&q(g,f)}),["up","down"].forEach(function(d){var f=c[d+"-right"],g=e-n(a,b,f);g&&q(g,f)})}function s(a,b){var c=f(i(b));Object.keys(b).forEach(function(a){b[a]=c-b[a]})}function t(a){a.forEach(function(a){a.reverse()})}function u(b,c){switch(a.rankDir){case"LR":return b.node(c).height;default:return b.node(c).width}}function v(b,c){switch(a.rankDir){case"LR":return b.node(c).width;default:return b.node(c).height}}function w(b,c,d){switch(a.rankDir){case"LR":if(arguments.length<3)return b.node(c).y;b.node(c).y=d;break;default:if(arguments.length<3)return b.node(c).x;b.node(c).x=d}}function x(b,c,d){switch(a.rankDir){case"LR":if(arguments.length<3)return b.node(c).x;b.node(c).x=d;break;default:if(arguments.length<3)return b.node(c).y;b.node(c).y=d}}var a={nodeSep:50,edgeSep:10,rankSep:30,rankDir:"TB",debugAlignment:null,debugLevel:0},b=o(),c={};return c.nodeSep=p(c,a,"nodeSep"),c.edgeSep=p(c,a,"edgeSep"),c.rankSep=p(c,a,"rankSep"),c.rankDir=p(c,a,"rankDir"),c.debugAlignment=p(c,a,"debugAlignment"),c.debugLevel=p(c,a,"debugLevel",function(a){b.enabled(a)}),c.run=b.wrap("Position Phase",d),c},dagre.util={};var h=dagre.util.keys=Object.keys,k=dagre.util.components=function(a){function d(b,e){b in c||(c[b]=!0,e.push(b),a.neighbors(b).forEach(function(a){d(a,e)}))}var b=[],c={};return a.eachNode(function(a){var c=[];d(a,c),c.length>0&&b.push(c)}),b},l=dagre.util.prim=function(a,b){var c={},d={},e=q();if(a.nodes().length===0)return c;a.eachNode(function(a){e.add(a,Number.POSITIVE_INFINITY),c[a]=[]}),e.decrease(a.nodes()[0],0);var f,g=!1;while(e.size()>0){f=e.removeMin();if(f in d)c[f].push(d[f]),c[d[f]].push(f);else{if(g)throw new Error("Input buildGraph is not connected:\n"+a.toString());g=!0}a.neighbors(f).forEach(function(a){var c=e.priority(a);if(c!==undefined){var g=b(f,a);g<c&&(d[a]=f,e.decrease(a,g))}})}return c},m=dagre.util.intersectRect=function(a,b){var c=a.x,d=a.y,e=b.x-c,f=b.y-d,g=a.width/2,h=a.height/2,i,j;return Math.abs(f)*g>Math.abs(e)*h?(f<0&&(h=-h),i=f===0?0:h*e/f,j=h):(e<0&&(g=-g),i=g,j=e===0?0:g*f/e),{x:c+i,y:d+j}},n=dagre.util.pointStr=function(a){return a.x+","+a.y},o=function(){var a={},b=!1;return a.enabled=function(c){return arguments.length?(b=c,a):b},a.wrap=function(a,c){return function(){var d=b?(new Date).getTime():null;try{return c.apply(null,arguments)}finally{d&&console.log(a+" time: "+((new Date).getTime()-d)+"ms")}}},a};dagre.dot={},dagre.dot.toGraph=function(a){function f(a,b){c.hasNode(a)||c.addNode(a,{id:a,label:a}),b&&d(b,c.node(a))}function h(a,b,e){var f=a+"-"+b,h=g[f];h||(h=g[f]=0),g[f]++;var i=e.id||f+"-"+h,j={};d(e,j),d({id:i},j),c.addEdge(i,a,b,j)}function i(a){switch(a.type){case"node":f(a.id,a.attrs);break;case"edge":var b;a.elems.forEach(function(c){i(c);switch(c.type){case"node":var d=c.id;b&&(h(b,d,a.attrs),e&&h(d,b,a.attrs)),b=d;break;default:throw new Error("Unsupported type incident on edge: "+c.type)}});break;case"attr":break;default:throw new Error("Unsupported statement type: "+a.type)}}var b=dot_parser.parse(a),c=dagre.graph(),e=b.type==="buildGraph",g={};return b.stmts&&b.stmts.forEach(function(a){i(a)}),c},dagre.dot.toObjects=function(a){var b=dagre.dot.toGraph(a),c=b.nodes().map(function(a){return b.node(a)}),d=b.edges().map(function(a){var c=b.edge(a);return c.source=b.node(b.source(a)),c.target=b.node(b.target(a)),c});return{nodes:c,edges:d}},dot_parser=function(){function a(a){return'"'+a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E-\x1F\x80-\uFFFF]/g,escape)+'"'}var b={parse:function(b,c){function i(a,b,c){var d=a,e=c-a.length;for(var f=0;f<e;f++)d=b+d;return d}function j(a){var b=a.charCodeAt(0),c,d;return b<=255?(c="x",d=2):(c="u",d=4),"\\"+c+i(b.toString(16).toUpperCase(),"0",d)}function k(a){if(e<g)return;e>g&&(g=e,h=[]),h.push(a)}function l(){var a,c,d,g,h,i,j,l,n,o,p,q,r,s,t,u;s=e,t=e,a=[],c=M();while(c!==null)a.push(c),c=M();if(a!==null){u=e,c=I(),c!==null?(d=M(),d!==null?c=[c,d]:(c=null,e=u)):(c=null,e=u),c=c!==null?c:"";if(c!==null){d=J();if(d!==null){g=[],h=M();while(h!==null)g.push(h),h=M();if(g!==null){h=C(),h=h!==null?h:"";if(h!==null){i=[],j=M();while(j!==null)i.push(j),j=M();if(i!==null){b.charCodeAt(e)===123?(j="{",e++):(j=null,f===0&&k('"{"'));if(j!==null){l=[],n=M();while(n!==null)l.push(n),n=M();if(l!==null){n=m(),n=n!==null?n:"";if(n!==null){o=[],p=M();while(p!==null)o.push(p),p=M();if(o!==null){b.charCodeAt(e)===125?(p="}",e++):(p=null,f===0&&k('"}"'));if(p!==null){q=[],r=M();while(r!==null)q.push(r),r=M();q!==null?a=[a,c,d,g,h,i,j,l,n,o,p,q]:(a=null,e=t)}else a=null,e=t}else a=null,e=t}else a=null,e=t}else a=null,e=t}else a=null,e=t}else a=null,e=t}else a=null,e=t}else a=null,e=t}else a=null,e=t}else a=null,e=t}else a=null,e=t;return a!==null&&(a=function(a,b,c,d){return{type:b,id:c,stmts:d}}(s,a[2],a[4],a[8])),a===null&&(e=s),a}function m(){var a,c,d,g,h,i,j,l,m,o,p;m=e,o=e,a=n();if(a!==null){c=[],d=M();while(d!==null)c.push(d),d=M();if(c!==null){b.charCodeAt(e)===59?(d=";",e++):(d=null,f===0&&k('";"')),d=d!==null?d:"";if(d!==null){g=[],p=e,h=[],i=M();while(i!==null)h.push(i),i=M();if(h!==null){i=n();if(i!==null){j=[],l=M();while(l!==null)j.push(l),l=M();j!==null?(b.charCodeAt(e)===59?(l=";",e++):(l=null,f===0&&k('";"')),l=l!==null?l:"",l!==null?h=[h,i,j,l]:(h=null,e=p)):(h=null,e=p)}else h=null,e=p}else h=null,e=p;while(h!==null){g.push(h),p=e,h=[],i=M();while(i!==null)h.push(i),i=M();if(h!==null){i=n();if(i!==null){j=[],l=M();while(l!==null)j.push(l),l=M();j!==null?(b.charCodeAt(e)===59?(l=";",e++):(l=null,f===0&&k('";"')),l=l!==null?l:"",l!==null?h=[h,i,j,l]:(h=null,e=p)):(h=null,e=p)}else h=null,e=p}else h=null,e=p}g!==null?a=[a,c,d,g]:(a=null,e=o)}else a=null,e=o}else a=null,e=o}else a=null,e=o;return a!==null&&(a=function(a,b,c){var d=[b];for(var e=0;e<c.length;++e)d.push(c[e][1]);return d}(m,a[0],a[3])),a===null&&(e=m),a}function n(){var a;return a=o(),a===null&&(a=s(),a===null&&(a=p(),a===null&&(a=r(),a===null&&(a=q())))),a}function o(){var a,b,c,d,f;d=e,f=e,a=F(),a===null&&(a=D(),a===null&&(a=E()));if(a!==null){b=[],c=M();while(c!==null)b.push(c),c=M();b!==null?(c=t(),c!==null?a=[a,b,c]:(a=null,e=f)):(a=null,e=f)}else a=null,e=f;return a!==null&&(a=function(a,b,c){return{type:"attr",attrType:b,attrs:c||{}}}(d,a[0],a[2])),a===null&&(e=d),a}function p(){var a,c,d,g,h,i,j;i=e,j=e,a=C();if(a!==null){c=[],d=M();while(d!==null)c.push(d),d=M();if(c!==null){b.charCodeAt(e)===61?(d="=",e++):(d=null,f===0&&k('"="'));if(d!==null){g=[],h=M();while(h!==null)g.push(h),h=M();g!==null?(h=C(),h!==null?a=[a,c,d,g,h]:(a=null,e=j)):(a=null,e=j)}else a=null,e=j}else a=null,e=j}else a=null,e=j;return a!==null&&(a=function(a,b,c){var d={};return d[b]=c,{type:"inlineAttr",attrs:d}}(i,a[0],a[4])),a===null&&(e=i),a}function q(){var a,b,c,d,f;d=e,f=e,a=z();if(a!==null){b=[],c=M();while(c!==null)b.push(c),c=M();b!==null?(c=t(),c=c!==null?c:"",c!==null?a=[a,b,c]:(a=null,e=f)):(a=null,e=f)}else a=null,e=f;return a!==null&&(a=function(a,b,c){return{type:"node",id:b,attrs:c||{}}}(d,a[0],a[2])),a===null&&(e=d),a}function r(){var a,b,c,d,f,g,h;g=e,h=e,a=y();if(a!==null){b=[],c=M();while(c!==null)b.push(c),c=M();if(b!==null){c=w();if(c!==null){d=[],f=M();while(f!==null)d.push(f),f=M();d!==null?(f=t(),f=f!==null?f:"",f!==null?a=[a,b,c,d,f]:(a=null,e=h)):(a=null,e=h)}else a=null,e=h}else a=null,e=h}else a=null,e=h;return a!==null&&(a=function(a,b,c,d){var e=[b];for(var f=0;f<c.length;++f)e.push(c[f]);return{type:"edge",elems:e,attrs:d||{}}}(g,a[0],a[2],a[4])),a===null&&(e=g),a}function s(){var a,c,d,g,h,i,j,l,n,o;j=e,l=e,n=e,a=H();if(a!==null){c=[],d=M();while(d!==null)c.push(d),d=M();if(c!==null){o=e,d=C();if(d!==null){g=[],h=M();while(h!==null)g.push(h),h=M();g!==null?d=[d,g]:(d=null,e=o)}else d=null,e=o;d=d!==null?d:"",d!==null?a=[a,c,d]:(a=null,e=n)}else a=null,e=n}else a=null,e=n;a=a!==null?a:"";if(a!==null){b.charCodeAt(e)===123?(c="{",e++):(c=null,f===0&&k('"{"'));if(c!==null){d=[],g=M();while(g!==null)d.push(g),g=M();if(d!==null){g=m();if(g!==null){h=[],i=M();while(i!==null)h.push(i),i=M();h!==null?(b.charCodeAt(e)===125?(i="}",e++):(i=null,f===0&&k('"}"')),i!==null?a=[a,c,d,g,h,i]:(a=null,e=l)):(a=null,e=l)}else a=null,e=l}else a=null,e=l}else a=null,e=l}else a=null,e=l;return a!==null&&(a=function(a,b,c){return b=b[2]||[],{type:"subgraph",id:b[0],stmts:c}}(j,a[0],a[3])),a===null&&(e=j),a}function t(){var a,b,c,d,f,g,h;f=e,g=e,a=u();if(a!==null){b=[],h=e,c=[],d=M();while(d!==null)c.push(d),d=M();c!==null?(d=u(),d!==null?c=[c,d]:(c=null,e=h)):(c=null,e=h);while(c!==null){b.push(c),h=e,c=[],d=M();while(d!==null)c.push(d),d=M();c!==null?(d=u(),d!==null?c=[c,d]:(c=null,e=h)):(c=null,e=h)}b!==null?a=[a,b]:(a=null,e=g)}else a=null,e=g;return a!==null&&(a=function(a,b,c){var d=b;for(var e=0;e<c.length;++e)d=Q(d,c[e][1]);return d}(f,a[0],a[1])),a===null&&(e=f),a}function u(){var a,c,d,g,h,i,j;i=e,j=e,b.charCodeAt(e)===91?(a="[",e++):(a=null,f===0&&k('"["'));if(a!==null){c=[],d=M();while(d!==null)c.push(d),d=M();if(c!==null){d=v(),d=d!==null?d:"";if(d!==null){g=[],h=M();while(h!==null)g.push(h),h=M();g!==null?(b.charCodeAt(e)===93?(h="]",e++):(h=null,f===0&&k('"]"')),h!==null?a=[a,c,d,g,h]:(a=null,e=j)):(a=null,e=j)}else a=null,e=j}else a=null,e=j}else a=null,e=j;return a!==null&&(a=function(a,b){return b}(i,a[2])),a===null&&(e=i),a}function v(){var a,c,d,g,h,i,j,l,m;j=e,l=e,a=x();if(a!==null){c=[],m=e,d=[],g=M();while(g!==null)d.push(g),g=M();if(d!==null){b.charCodeAt(e)===44?(g=",",e++):(g=null,f===0&&k('","')),g=g!==null?g:"";if(g!==null){h=[],i=M();while(i!==null)h.push(i),i=M();h!==null?(i=x(),i!==null?d=[d,g,h,i]:(d=null,e=m)):(d=null,e=m)}else d=null,e=m}else d=null,e=m;while(d!==null){c.push(d),m=e,d=[],g=M();while(g!==null)d.push(g),g=M();if(d!==null){b.charCodeAt(e)===44?(g=",",e++):(g=null,f===0&&k('","')),g=g!==null?g:"";if(g!==null){h=[],i=M();while(i!==null)h.push(i),i=M();h!==null?(i=x(),i!==null?d=[d,g,h,i]:(d=null,e=m)):(d=null,e=m)}else d=null,e=m}else d=null,e=m}c!==null?a=[a,c]:(a=null,e=l)}else a=null,e=l;return a!==null&&(a=function(a,b,c){var d=b;for(var e=0;e<c.length;++e)d=Q(d,c[e][3]);return d}(j,a[0],a[1])),a===null&&(e=j),a}function w(){var a,c,d,g,h,i,j,l;i=e,j=e,l=e,b.substr(e,2)==="--"?(a="--",e+=2):(a=null,f===0&&k('"--"')),a!==null?(c=function(a){return P}(e)?null:"",c!==null?a=[a,c]:(a=null,e=l)):(a=null,e=l),a===null&&(l=e,b.substr(e,2)==="->"?(a="->",e+=2):(a=null,f===0&&k('"->"')),a!==null?(c=function(a){return P}(e)?"":null,c!==null?a=[a,c]:(a=null,e=l)):(a=null,e=l));if(a!==null){c=[],d=M();while(d!==null)c.push(d),d=M();if(c!==null){d=y();if(d!==null){g=[],h=M();while(h!==null)g.push(h),h=M();g!==null?(h=w(),h=h!==null?h:"",h!==null?a=[a,c,d,g,h]:(a=null,e=j)):(a=null,e=j)}else a=null,e=j}else a=null,e=j}else a=null,e=j;return a!==null&&(a=function(a,b,c){var d=[b];for(var e=0;e<c.length;++e)d.push(c[e]);return d}(i,a[2],a[4])),a===null&&(e=i),a}function x(){var a,c,d,g,h,i,j,l;i=e,j=e,a=C();if(a!==null){l=e,c=[],d=M();while(d!==null)c.push(d),d=M();if(c!==null){b.charCodeAt(e)===61?(d="=",e++):(d=null,f===0&&k('"="'));if(d!==null){g=[],h=M();while(h!==null)g.push(h),h=M();g!==null?(h=C(),h!==null?c=[c,d,g,h]:(c=null,e=l)):(c=null,e=l)}else c=null,e=l}else c=null,e=l;c=c!==null?c:"",c!==null?a=[a,c]:(a=null,e=j)}else a=null,e=j;return a!==null&&(a=function(a,b,c){var d={};return d[b]=c[3],d}(i,a[0],a[1])),a===null&&(e=i),a}function y(){var a,b;return a=s(),a===null&&(b=e,a=z(),a!==null&&(a=function(a,b){return{type:"node",id:b,attrs:{}}}(b,a)),a===null&&(e=b)),a}function z(){var a,b,c,d,f;d=e,f=e,a=C();if(a!==null){b=[],c=M();while(c!==null)b.push(c),c=M();b!==null?(c=A(),c=c!==null?c:"",c!==null?a=[a,b,c]:(a=null,e=f)):(a=null,e=f)}else a=null,e=f;return a!==null&&(a=function(a,b){return b}(d,a[0])),a===null&&(e=d),a}function A(){var a,c,d,g,h,i,j,l,m;l=e,b.charCodeAt(e)===58?(a=":",e++):(a=null,f===0&&k('":"'));if(a!==null){c=[],d=M();while(d!==null)c.push(d),d=M();if(c!==null){d=C();if(d!==null){g=[],h=M();while(h!==null)g.push(h),h=M();if(g!==null){m=e,b.charCodeAt(e)===58?(h=":",e++):(h=null,f===0&&k('":"'));if(h!==null){i=[],j=M();while(j!==null)i.push(j),j=M();i!==null?(j=B(),j!==null?h=[h,i,j]:(h=null,e=m)):(h=null,e=m)}else h=null,e=m;h=h!==null?h:"",h!==null?a=[a,c,d,g,h]:(a=null,e=l)}else a=null,e=l}else a=null,e=l}else a=null,e=l}else a=null,e=l;return a}function B(){var a;return b.charCodeAt(e)===110?(a="n",e++):(a=null,f===0&&k('"n"')),a===null&&(b.substr(e,2)==="ne"?(a="ne",e+=2):(a=null,f===0&&k('"ne"')),a===null&&(b.charCodeAt(e)===101?(a="e",e++):(a=null,f===0&&k('"e"')),a===null&&(b.substr(e,2)==="se"?(a="se",e+=2):(a=null,f===0&&k('"se"')),a===null&&(b.charCodeAt(e)===115?(a="s",e++):(a=null,f===0&&k('"s"')),a===null&&(b.substr(e,2)==="sw"?(a="sw",e+=2):(a=null,f===0&&k('"sw"')),a===null&&(b.charCodeAt(e)===119?(a="w",e++):(a=null,f===0&&k('"w"')),a===null&&(b.substr(e,2)==="nw"?(a="nw",e+=2):(a=null,f===0&&k('"nw"')),a===null&&(b.charCodeAt(e)===99?(a="c",e++):(a=null,f===0&&k('"c"')),a===null&&(b.charCodeAt(e)===95?(a="_",e++):(a=null,f===0&&k('"_"'))))))))))),a}function C(){var a,c,d,g,h,i,j,l,m;f++,i=e,j=e,/^[a-zA-Z\u0200-\u0377_]/.test(b.charAt(e))?(a=b.charAt(e),e++):(a=null,f===0&&k("[a-zA-Z\\u0200-\\u0377_]"));if(a!==null){c=[],/^[a-zA-Z\u0200-\u0377_0-9]/.test(b.charAt(e))?(d=b.charAt(e),e++):(d=null,f===0&&k("[a-zA-Z\\u0200-\\u0377_0-9]"));while(d!==null)c.push(d),/^[a-zA-Z\u0200-\u0377_0-9]/.test(b.charAt(e))?(d=b.charAt(e),e++):(d=null,f===0&&k("[a-zA-Z\\u0200-\\u0377_0-9]"));c!==null?a=[a,c]:(a=null,e=j)}else a=null,e=j;a!==null&&(a=function(a,b,c){return b+c.join("")}(i,a[0],a[1])),a===null&&(e=i);if(a===null){i=e,j=e,b.charCodeAt(e)===45?(a="-",e++):(a=null,f===0&&k('"-"')),a=a!==null?a:"";if(a!==null){b.charCodeAt(e)===46?(c=".",e++):(c=null,f===0&&k('"."'));if(c!==null){/^[0-9]/.test(b.charAt(e))?(g=b.charAt(e),e++):(g=null,f===0&&k("[0-9]"));if(g!==null){d=[];while(g!==null)d.push(g),/^[0-9]/.test(b.charAt(e))?(g=b.charAt(e),e++):(g=null,f===0&&k("[0-9]"))}else d=null;d!==null?a=[a,c,d]:(a=null,e=j)}else a=null,e=j}else a=null,e=j;a!==null&&(a=function(a,b,c,d){return b+c+d.join("")}(i,a[0],a[1],a[2])),a===null&&(e=i);if(a===null){i=e,j=e,b.charCodeAt(e)===45?(a="-",e++):(a=null,f===0&&k('"-"')),a=a!==null?a:"";if(a!==null){/^[0-9]/.test(b.charAt(e))?(d=b.charAt(e),e++):(d=null,f===0&&k("[0-9]"));if(d!==null){c=[];while(d!==null)c.push(d),/^[0-9]/.test(b.charAt(e))?(d=b.charAt(e),e++):(d=null,f===0&&k("[0-9]"))}else c=null;if(c!==null){l=e,b.charCodeAt(e)===46?(d=".",e++):(d=null,f===0&&k('"."'));if(d!==null){g=[],/^[0-9]/.test(b.charAt(e))?(h=b.charAt(e),e++):(h=null,f===0&&k("[0-9]"));while(h!==null)g.push(h),/^[0-9]/.test(b.charAt(e))?(h=b.charAt(e),e++):(h=null,f===0&&k("[0-9]"));g!==null?d=[d,g]:(d=null,e=l)}else d=null,e=l;d=d!==null?d:"",d!==null?a=[a,c,d]:(a=null,e=j)}else a=null,e=j}else a=null,e=j;a!==null&&(a=function(a,b,c,d){return b+c.join("")+(d[0]||"")+(d[1]||[]).join("")}(i,a[0],a[1],a[2])),a===null&&(e=i);if(a===null){i=e,j=e,b.charCodeAt(e)===34?(a='"',e++):(a=null,f===0&&k('"\\""'));if(a!==null){l=e,b.substr(e,2)==='\\"'?(d='\\"',e+=2):(d=null,f===0&&k('"\\\\\\""')),d!==null&&(d=function(a){return'"'}(l)),d===null&&(e=l),d===null&&(l=e,m=e,b.charCodeAt(e)===92?(d="\\",e++):(d=null,f===0&&k('"\\\\"')),d!==null?(/^[^"]/.test(b.charAt(e))?(g=b.charAt(e),e++):(g=null,f===0&&k('[^"]')),g!==null?d=[d,g]:(d=null,e=m)):(d=null,e=m),d!==null&&(d=function(a,b){return"\\"+b}(l,d[1])),d===null&&(e=l),d===null&&(/^[^"]/.test(b.charAt(e))?(d=b.charAt(e),e++):(d=null,f===0&&k('[^"]'))));if(d!==null){c=[];while(d!==null)c.push(d),l=e,b.substr(e,2)==='\\"'?(d='\\"',e+=2):(d=null,f===0&&k('"\\\\\\""')),d!==null&&(d=function(a){return'"'}(l)),d===null&&(e=l),d===null&&(l=e,m=e,b.charCodeAt(e)===92?(d="\\",e++):(d=null,f===0&&k('"\\\\"')),d!==null?(/^[^"]/.test(b.charAt(e))?(g=b.charAt(e),e++):(g=null,f===0&&k('[^"]')),g!==null?d=[d,g]:(d=null,e=m)):(d=null,e=m),d!==null&&(d=function(a,b){return"\\"+b}(l,d[1])),d===null&&(e=l),d===null&&(/^[^"]/.test(b.charAt(e))?(d=b.charAt(e),e++):(d=null,f===0&&k('[^"]'))))}else c=null;c!==null?(b.charCodeAt(e)===34?(d='"',e++):(d=null,f===0&&k('"\\""')),d!==null?a=[a,c,d]:(a=null,e=j)):(a=null,e=j)}else a=null,e=j;a!==null&&(a=function(a,b){return b.join("")}(i,a[1])),a===null&&(e=i)}}}return f--,f===0&&a===null&&k("identifier"),a}function D(){var a,c;return c=e,b.substr(e,4).toLowerCase()==="node"?(a=b.substr(e,4),e+=4):(a=null,f===0&&k('"node"')),a!==null&&(a=function(a,b){return b.toLowerCase()}(c,a)),a===null&&(e=c),a}function E(){var a,c;return c=e,b.substr(e,4).toLowerCase()==="edge"?(a=b.substr(e,4),e+=4):(a=null,f===0&&k('"edge"')),a!==null&&(a=function(a,b){return b.toLowerCase()}(c,a)),a===null&&(e=c),a}function F(){var a,c;return c=e,b.substr(e,5).toLowerCase()==="buildGraph"?(a=b.substr(e,5),e+=5):(a=null,f===0&&k('"buildGraph"')),a!==null&&(a=function(a,b){return b.toLowerCase()}(c,a)),a===null&&(e=c),a}function G(){var a,c;return c=e,b.substr(e,7).toLowerCase()==="digraph"?(a=b.substr(e,7),e+=7):(a=null,f===0&&k('"digraph"')),a!==null&&(a=function(a,b){return b.toLowerCase()}(c,a)),a===null&&(e=c),a}function H(){var a,c;return c=e,b.substr(e,8).toLowerCase()==="subgraph"?(a=b.substr(e,8),e+=8):(a=null,f===0&&k('"subgraph"')),a!==null&&(a=function(a,b){return b.toLowerCase()}(c,a)),a===null&&(e=c),a}function I(){var a,c;return c=e,b.substr(e,6).toLowerCase()==="strict"?(a=b.substr(e,6),e+=6):(a=null,f===0&&k('"strict"')),a!==null&&(a=function(a,b){return b.toLowerCase()}(c,a)),a===null&&(e=c),a}function J(){var a,b;return a=F(),a===null&&(b=e,a=G(),a!==null&&(a=function(a,b){return P=b==="digraph",b}(b,a)),a===null&&(e=b)),a}function K(){var a,c;f++,/^[ \t\r\n]/.test(b.charAt(e))?(c=b.charAt(e),e++):(c=null,f===0&&k("[ \\t\\r\\n]"));if(c!==null){a=[];while(c!==null)a.push(c),/^[ \t\r\n]/.test(b.charAt(e))?(c=b.charAt(e),e++):(c=null,f===0&&k("[ \\t\\r\\n]"))}else a=null;return f--,f===0&&a===null&&k("whitespace"),a}function L(){var a,c,d,g,h,i,j;f++,h=e,b.substr(e,2)==="//"?(a="//",e+=2):(a=null,f===0&&k('"//"'));if(a!==null){c=[],/^[^\n]/.test(b.charAt(e))?(d=b.charAt(e),e++):(d=null,f===0&&k("[^\\n]"));while(d!==null)c.push(d),/^[^\n]/.test(b.charAt(e))?(d=b.charAt(e),e++):(d=null,f===0&&k("[^\\n]"));c!==null?a=[a,c]:(a=null,e=h)}else a=null,e=h;if(a===null){h=e,b.substr(e,2)==="/*"?(a="/*",e+=2):(a=null,f===0&&k('"/*"'));if(a!==null){c=[],i=e,j=e,f++,b.substr(e,2)==="*/"?(d="*/",e+=2):(d=null,f===0&&k('"*/"')),f--,d===null?d="":(d=null,e=j),d!==null?(b.length>e?(g=b.charAt(e),e++):(g=null,f===0&&k("any character")),g!==null?d=[d,g]:(d=null,e=i)):(d=null,e=i);while(d!==null)c.push(d),i=e,j=e,f++,b.substr(e,2)==="*/"?(d="*/",e+=2):(d=null,f===0&&k('"*/"')),f--,d===null?d="":(d=null,e=j),d!==null?(b.length>e?(g=b.charAt(e),e++):(g=
null,f===0&&k("any character")),g!==null?d=[d,g]:(d=null,e=i)):(d=null,e=i);c!==null?(b.substr(e,2)==="*/"?(d="*/",e+=2):(d=null,f===0&&k('"*/"')),d!==null?a=[a,c,d]:(a=null,e=h)):(a=null,e=h)}else a=null,e=h}return f--,f===0&&a===null&&k("comment"),a}function M(){var a;return a=K(),a===null&&(a=L()),a}function N(a){a.sort();var b=null,c=[];for(var d=0;d<a.length;d++)a[d]!==b&&(c.push(a[d]),b=a[d]);return c}function O(){var a=1,c=1,d=!1;for(var f=0;f<Math.max(e,g);f++){var h=b.charAt(f);h==="\n"?(d||a++,c=1,d=!1):h==="\r"||h==="\u2028"||h==="\u2029"?(a++,c=1,d=!0):(c++,d=!1)}return{line:a,column:c}}function Q(a,b){var c={};for(var d in a)c[d]=a[d];for(var d in b)c[d]=b[d];return c}var d={start:l,stmtList:m,stmt:n,attrStmt:o,inlineAttrStmt:p,nodeStmt:q,edgeStmt:r,subgraphStmt:s,attrList:t,attrListBlock:u,aList:v,edgeRHS:w,idDef:x,nodeIdOrSubgraph:y,nodeId:z,port:A,compassPt:B,id:C,node:D,edge:E,graph:F,digraph:G,subgraph:H,strict:I,graphType:J,whitespace:K,comment:L,_:M};if(c!==undefined){if(d[c]===undefined)throw new Error("Invalid rule name: "+a(c)+".")}else c="start";var e=0,f=0,g=0,h=[],P,R=d[c]();if(R===null||e!==b.length){var S=Math.max(e,g),T=S<b.length?b.charAt(S):null,U=O();throw new this.SyntaxError(N(h),T,S,U.line,U.column)}return R},toSource:function(){return this._source}};return b.SyntaxError=function(b,c,d,e,f){function g(b,c){var d,e;switch(b.length){case 0:d="end of input";break;case 1:d=b[0];break;default:d=b.slice(0,b.length-1).join(", ")+" or "+b[b.length-1]}return e=c?a(c):"end of input","Expected "+d+" but "+e+" found."}this.name="SyntaxError",this.expected=b,this.found=c,this.message=g(b,c),this.offset=d,this.line=e,this.column=f},b.SyntaxError.prototype=Error.prototype,b}()})();
New to GrepCode? Check out our FAQ X