diff --git a/gulpfile.js b/gulpfile.js index 17c3015fd..4c5509cdf 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -28,6 +28,7 @@ gulp.task('jison', shell.task([ 'jison src/diagrams/flowchart/parser/dot.jison -o src/diagrams/flowchart/parser/dot.js', 'jison src/diagrams/sequenceDiagram/parser/sequenceDiagram.jison -o src/diagrams/sequenceDiagram/parser/sequenceDiagram.js', 'jison src/diagrams/example/parser/example.jison -o src/diagrams/example/parser/example.js', + 'jison src/diagrams/gantt/parser/gantt.jison -o src/diagrams/gantt/parser/gantt.js', //'jison src/diagrams/sequenceDiagram/parser/sequenceDiagram.jison -o src/diagrams/sequenceDiagram/parser/sequenceDiagram.js' ])); diff --git a/package.json b/package.json index a78ef13e3..7b50e9029 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "he": "^0.5.0", "minimist": "^1.1.0", "mkdirp": "^0.5.0", + "moment": "^2.9.0", "semver": "^4.1.1", "which": "^1.0.8" }, diff --git a/src/diagrams/example/parser/example.jison b/src/diagrams/example/parser/example.jison index d9c55345c..45f949c8a 100644 --- a/src/diagrams/example/parser/example.jison +++ b/src/diagrams/example/parser/example.jison @@ -1,7 +1,7 @@ -/** js sequence diagrams - * http://bramp.github.io/js-sequence-diagrams/ - * (c) 2012-2013 Andrew Brampton (bramp.net) - * Simplified BSD license. +/** mermaid + * http://knsv.github.io/mermaid/ + * (c) 2015 Knut Sveidqvist + * MIT license. */ %lex diff --git a/src/diagrams/flowchart/parser/flow.jison b/src/diagrams/flowchart/parser/flow.jison index b7d554cee..01c746c06 100644 --- a/src/diagrams/flowchart/parser/flow.jison +++ b/src/diagrams/flowchart/parser/flow.jison @@ -1,4 +1,8 @@ -/* description: Parses end executes mathematical expressions. */ +/** mermaid + * http://knsv.github.io/mermaid/ + * (c) 2015 Knut Sveidqvist + * MIT license. + */ /* lexical grammar */ %lex @@ -261,7 +265,9 @@ alphaNum ; alphaNumStatement - : alphaNumToken + : DIR + {$$=$1;} + | alphaNumToken {$$=$1;} | alphaNumToken MINUS alphaNumToken {$$=$1+'-'+$3;} diff --git a/src/diagrams/flowchart/parser/flow.js b/src/diagrams/flowchart/parser/flow.js index 81629350f..6b476c6b4 100644 --- a/src/diagrams/flowchart/parser/flow.js +++ b/src/diagrams/flowchart/parser/flow.js @@ -72,12 +72,12 @@ } */ var parser = (function(){ -var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,9,10,12,19,29,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],$V1=[2,2],$V2=[1,9],$V3=[1,10],$V4=[1,11],$V5=[1,12],$V6=[1,20],$V7=[1,23],$V8=[1,24],$V9=[1,25],$Va=[1,26],$Vb=[1,27],$Vc=[1,32],$Vd=[1,21],$Ve=[1,34],$Vf=[1,31],$Vg=[1,33],$Vh=[1,39],$Vi=[1,38],$Vj=[1,35],$Vk=[1,36],$Vl=[1,37],$Vm=[1,9,10,12,19,29,32,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],$Vn=[29,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],$Vo=[2,19],$Vp=[1,51],$Vq=[1,52],$Vr=[1,50],$Vs=[1,76],$Vt=[1,68],$Vu=[1,77],$Vv=[1,63],$Vw=[1,62],$Vx=[1,81],$Vy=[1,80],$Vz=[1,78],$VA=[1,79],$VB=[1,69],$VC=[1,65],$VD=[1,64],$VE=[1,71],$VF=[1,72],$VG=[1,73],$VH=[1,74],$VI=[1,75],$VJ=[1,66],$VK=[9,10,19],$VL=[1,88],$VM=[1,89],$VN=[1,90],$VO=[1,91],$VP=[1,92],$VQ=[1,93],$VR=[1,94],$VS=[1,95],$VT=[1,96],$VU=[1,97],$VV=[1,98],$VW=[1,99],$VX=[9,10,19,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61],$VY=[9,10,12,15,19,36,38,40,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,76,79,81,82,84,85,87,88,89],$VZ=[9,10,11,12,13,15,16,17,18,19,29,32,36,37,38,39,40,41,44,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89,90,91,92],$V_=[1,113],$V$=[1,116],$V01=[1,114],$V11=[9,10,12,19,29,32,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],$V21=[9,10,11,12,13,15,16,17,18,19,29,32,37,39,41,44,47,49,62,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],$V31=[9,10,11,12,13,15,16,17,18,19,29,32,36,37,38,39,40,41,44,47,49,50,51,52,53,62,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89,90,91,92],$V41=[2,125],$V51=[1,142],$V61=[1,131],$V71=[1,132],$V81=[1,129],$V91=[1,130],$Va1=[1,133],$Vb1=[1,134],$Vc1=[1,138],$Vd1=[1,139],$Ve1=[1,137],$Vf1=[1,140],$Vg1=[1,128],$Vh1=[1,135],$Vi1=[1,136],$Vj1=[1,141],$Vk1=[76,79,81,82,84,85,87,88,89],$Vl1=[12,62,76,79,81,82,84,85,87,88,89],$Vm1=[1,167],$Vn1=[1,166],$Vo1=[9,11,12,13,15,16,17,18,19,29,32,36,37,38,39,40,41,44,47,49,50,51,52,53,62,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89,90,91,92],$Vp1=[1,200],$Vq1=[1,197],$Vr1=[1,204],$Vs1=[1,201],$Vt1=[1,198],$Vu1=[1,205],$Vv1=[1,195],$Vw1=[1,196],$Vx1=[1,199],$Vy1=[1,202],$Vz1=[1,203],$VA1=[11,12,13,15,16,17,18,29,32,44,47,49,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],$VB1=[1,220],$VC1=[9,10,19,79],$VD1=[9,10,12,19,44,67,75,76,77,79,81,82,83,84,85]; +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,9,10,12,13,19,29,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],$V1=[2,2],$V2=[1,9],$V3=[1,10],$V4=[1,11],$V5=[1,30],$V6=[1,12],$V7=[1,20],$V8=[1,23],$V9=[1,24],$Va=[1,25],$Vb=[1,26],$Vc=[1,27],$Vd=[1,33],$Ve=[1,21],$Vf=[1,35],$Vg=[1,32],$Vh=[1,34],$Vi=[1,40],$Vj=[1,39],$Vk=[1,36],$Vl=[1,37],$Vm=[1,38],$Vn=[1,9,10,12,13,19,29,32,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],$Vo=[13,29,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],$Vp=[2,19],$Vq=[1,52],$Vr=[1,53],$Vs=[1,51],$Vt=[1,77],$Vu=[1,69],$Vv=[1,78],$Vw=[1,64],$Vx=[1,63],$Vy=[1,82],$Vz=[1,81],$VA=[1,79],$VB=[1,80],$VC=[1,70],$VD=[1,66],$VE=[1,65],$VF=[1,72],$VG=[1,73],$VH=[1,74],$VI=[1,75],$VJ=[1,76],$VK=[1,67],$VL=[9,10,19],$VM=[1,89],$VN=[1,90],$VO=[1,91],$VP=[1,92],$VQ=[1,93],$VR=[1,94],$VS=[1,95],$VT=[1,96],$VU=[1,97],$VV=[1,98],$VW=[1,99],$VX=[1,100],$VY=[9,10,19,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61],$VZ=[9,10,12,13,15,19,36,38,40,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,76,79,81,82,84,85,87,88,89],$V_=[9,10,11,12,13,15,16,17,18,19,29,32,36,37,38,39,40,41,44,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89,90,91,92],$V$=[1,114],$V01=[1,117],$V11=[1,115],$V21=[9,10,12,13,19,29,32,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],$V31=[9,10,11,12,13,15,16,17,18,19,29,32,37,39,41,44,47,49,62,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],$V41=[9,10,11,12,13,15,16,17,18,19,29,32,36,37,38,39,40,41,44,47,49,50,51,52,53,62,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89,90,91,92],$V51=[2,126],$V61=[1,143],$V71=[1,132],$V81=[1,133],$V91=[1,130],$Va1=[1,131],$Vb1=[1,134],$Vc1=[1,135],$Vd1=[1,139],$Ve1=[1,140],$Vf1=[1,138],$Vg1=[1,141],$Vh1=[1,129],$Vi1=[1,136],$Vj1=[1,137],$Vk1=[1,142],$Vl1=[13,76,79,81,82,84,85,87,88,89],$Vm1=[12,13,62,76,79,81,82,84,85,87,88,89],$Vn1=[1,168],$Vo1=[1,167],$Vp1=[9,11,12,13,15,16,17,18,19,29,32,36,37,38,39,40,41,44,47,49,50,51,52,53,62,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89,90,91,92],$Vq1=[1,201],$Vr1=[1,198],$Vs1=[1,205],$Vt1=[1,202],$Vu1=[1,199],$Vv1=[1,206],$Vw1=[1,196],$Vx1=[1,197],$Vy1=[1,200],$Vz1=[1,203],$VA1=[1,204],$VB1=[11,12,13,15,16,17,18,29,32,44,47,49,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],$VC1=[1,221],$VD1=[9,10,19,79],$VE1=[9,10,12,19,44,67,75,76,77,79,81,82,83,84,85]; var parser = {trace: function trace() { }, yy: {}, symbols_: {"error":2,"mermaidDoc":3,"graphConfig":4,"document":5,"line":6,"spaceListNewline":7,"statement":8,"SEMI":9,"EOF":10,"GRAPH":11,"SPACE":12,"DIR":13,"FirstStmtSeperator":14,"TAGEND":15,"TAGSTART":16,"UP":17,"DOWN":18,"NEWLINE":19,"spaceList":20,"commentStatement":21,"verticeStatement":22,"separator":23,"styleStatement":24,"linkStyleStatement":25,"classDefStatement":26,"classStatement":27,"clickStatement":28,"subgraph":29,"text":30,"endStatement":31,"end":32,"vertex":33,"link":34,"alphaNum":35,"SQS":36,"SQE":37,"PS":38,"PE":39,"DIAMOND_START":40,"DIAMOND_STOP":41,"alphaNumStatement":42,"alphaNumToken":43,"MINUS":44,"linkStatement":45,"arrowText":46,"--":47,"-.":48,"==":49,"ARROW_POINT":50,"ARROW_CIRCLE":51,"ARROW_CROSS":52,"ARROW_OPEN":53,"DOTTED_ARROW_POINT":54,"DOTTED_ARROW_CIRCLE":55,"DOTTED_ARROW_CROSS":56,"DOTTED_ARROW_OPEN":57,"THICK_ARROW_POINT":58,"THICK_ARROW_CIRCLE":59,"THICK_ARROW_CROSS":60,"THICK_ARROW_OPEN":61,"PIPE":62,"textToken":63,"commentText":64,"commentToken":65,"keywords":66,"STYLE":67,"LINKSTYLE":68,"CLASSDEF":69,"CLASS":70,"CLICK":71,"textNoTags":72,"textNoTagsToken":73,"stylesOpt":74,"HEX":75,"NUM":76,"PCT":77,"style":78,"COMMA":79,"styleComponent":80,"ALPHA":81,"COLON":82,"UNIT":83,"BRKT":84,"DOT":85,"graphCodeTokens":86,"PLUS":87,"EQUALS":88,"MULT":89,"TAG_START":90,"TAG_END":91,"QUOTE":92,"$accept":0,"$end":1}, terminals_: {2:"error",9:"SEMI",10:"EOF",11:"GRAPH",12:"SPACE",13:"DIR",15:"TAGEND",16:"TAGSTART",17:"UP",18:"DOWN",19:"NEWLINE",29:"subgraph",32:"end",36:"SQS",37:"SQE",38:"PS",39:"PE",40:"DIAMOND_START",41:"DIAMOND_STOP",44:"MINUS",47:"--",48:"-.",49:"==",50:"ARROW_POINT",51:"ARROW_CIRCLE",52:"ARROW_CROSS",53:"ARROW_OPEN",54:"DOTTED_ARROW_POINT",55:"DOTTED_ARROW_CIRCLE",56:"DOTTED_ARROW_CROSS",57:"DOTTED_ARROW_OPEN",58:"THICK_ARROW_POINT",59:"THICK_ARROW_CIRCLE",60:"THICK_ARROW_CROSS",61:"THICK_ARROW_OPEN",62:"PIPE",67:"STYLE",68:"LINKSTYLE",69:"CLASSDEF",70:"CLASS",71:"CLICK",75:"HEX",76:"NUM",77:"PCT",79:"COMMA",81:"ALPHA",82:"COLON",83:"UNIT",84:"BRKT",85:"DOT",87:"PLUS",88:"EQUALS",89:"MULT",90:"TAG_START",91:"TAG_END",92:"QUOTE"}, -productions_: [0,[3,2],[5,0],[5,2],[6,2],[6,1],[6,1],[6,1],[4,4],[4,4],[4,4],[4,4],[4,4],[14,1],[14,1],[14,2],[7,2],[7,2],[7,1],[7,1],[20,2],[20,1],[8,2],[8,2],[8,2],[8,2],[8,2],[8,2],[8,2],[8,6],[8,5],[31,1],[31,2],[23,1],[23,1],[23,1],[22,3],[22,1],[33,4],[33,5],[33,6],[33,7],[33,4],[33,5],[33,4],[33,5],[33,4],[33,5],[33,1],[33,2],[35,1],[35,2],[42,1],[42,3],[34,2],[34,3],[34,1],[34,2],[34,5],[34,6],[34,5],[34,6],[34,5],[34,6],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[46,3],[30,1],[30,2],[64,1],[64,2],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[72,1],[72,2],[26,5],[27,5],[28,5],[24,5],[24,5],[25,5],[21,3],[74,1],[74,3],[78,1],[78,2],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[65,1],[65,1],[63,1],[63,1],[63,1],[63,1],[63,1],[63,1],[73,1],[73,1],[73,1],[73,1],[43,1],[43,1],[43,1],[43,1],[43,1],[43,1],[43,1],[43,1],[43,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1]], +productions_: [0,[3,2],[5,0],[5,2],[6,2],[6,1],[6,1],[6,1],[4,4],[4,4],[4,4],[4,4],[4,4],[14,1],[14,1],[14,2],[7,2],[7,2],[7,1],[7,1],[20,2],[20,1],[8,2],[8,2],[8,2],[8,2],[8,2],[8,2],[8,2],[8,6],[8,5],[31,1],[31,2],[23,1],[23,1],[23,1],[22,3],[22,1],[33,4],[33,5],[33,6],[33,7],[33,4],[33,5],[33,4],[33,5],[33,4],[33,5],[33,1],[33,2],[35,1],[35,2],[42,1],[42,1],[42,3],[34,2],[34,3],[34,1],[34,2],[34,5],[34,6],[34,5],[34,6],[34,5],[34,6],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[46,3],[30,1],[30,2],[64,1],[64,2],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[72,1],[72,2],[26,5],[27,5],[28,5],[24,5],[24,5],[25,5],[21,3],[74,1],[74,3],[78,1],[78,2],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[65,1],[65,1],[63,1],[63,1],[63,1],[63,1],[63,1],[63,1],[73,1],[73,1],[73,1],[73,1],[43,1],[43,1],[43,1],[43,1],[43,1],[43,1],[43,1],[43,1],[43,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { /* this == yyval */ @@ -93,7 +93,7 @@ case 3: } this.$=$$[$0-1]; break; -case 4: case 5: case 50: case 52: case 77: case 79: case 92: +case 4: case 5: case 50: case 52: case 53: case 78: case 80: case 93: this.$=$$[$0]; break; case 8: @@ -165,94 +165,94 @@ break; case 49: this.$ = $$[$0-1];yy.addVertex($$[$0-1]); break; -case 51: case 78: case 80: case 93: +case 51: case 79: case 81: case 94: this.$=$$[$0-1]+''+$$[$0]; break; -case 53: +case 54: this.$=$$[$0-2]+'-'+$$[$0]; break; -case 54: +case 55: $$[$0-1].text = $$[$0];this.$ = $$[$0-1]; break; -case 55: +case 56: $$[$0-2].text = $$[$0-1];this.$ = $$[$0-2]; break; -case 56: +case 57: this.$ = $$[$0]; break; -case 57: case 76: +case 58: case 77: this.$ = $$[$0-1]; break; -case 58: case 60: case 62: +case 59: case 61: case 63: $$[$0].text = $$[$0-2];this.$ = $$[$0]; break; -case 59: case 61: case 63: +case 60: case 62: case 64: $$[$0-1].text = $$[$0-3];this.$ = $$[$0-1]; break; -case 64: +case 65: this.$ = {"type":"arrow","stroke":"normal"}; break; -case 65: +case 66: this.$ = {"type":"arrow_circle","stroke":"normal"}; break; -case 66: +case 67: this.$ = {"type":"arrow_cross","stroke":"normal"}; break; -case 67: +case 68: this.$ = {"type":"arrow_open","stroke":"normal"}; break; -case 68: +case 69: this.$ = {"type":"arrow","stroke":"dotted"}; break; -case 69: +case 70: this.$ = {"type":"arrow_circle","stroke":"dotted"}; break; -case 70: +case 71: this.$ = {"type":"arrow_cross","stroke":"dotted"}; break; -case 71: +case 72: this.$ = {"type":"arrow_open","stroke":"dotted"}; break; -case 72: +case 73: this.$ = {"type":"arrow","stroke":"thick"}; break; -case 73: +case 74: this.$ = {"type":"arrow_circle","stroke":"thick"}; break; -case 74: +case 75: this.$ = {"type":"arrow_cross","stroke":"thick"}; break; -case 75: +case 76: this.$ = {"type":"arrow_open","stroke":"thick"}; break; -case 94: +case 95: this.$ = $$[$0-4];yy.addClass($$[$0-2],$$[$0]); break; -case 95: +case 96: this.$ = $$[$0-4];yy.setClass($$[$0-2], $$[$0]); break; -case 96: +case 97: this.$ = $$[$0-4];yy.setClickEvent($$[$0-2], $$[$0]); break; -case 97: +case 98: this.$ = $$[$0-4];yy.addVertex($$[$0-2],undefined,undefined,$$[$0]); break; -case 98: case 99: +case 99: case 100: this.$ = $$[$0-4];yy.updateLink($$[$0-2],$$[$0]); break; -case 101: +case 102: this.$ = [$$[$0]] break; -case 102: +case 103: $$[$0-2].push($$[$0]);this.$ = $$[$0-2]; break; -case 104: +case 105: this.$ = $$[$0-1] + $$[$0]; break; } }, -table: [{3:1,4:2,11:[1,3]},{1:[3]},o($V0,$V1,{5:4}),{12:[1,5]},{1:[2,1],6:6,7:7,8:8,9:$V2,10:$V3,12:$V4,19:$V5,21:13,22:14,24:15,25:16,26:17,27:18,28:19,29:$V6,33:22,35:28,42:29,43:30,67:$V7,68:$V8,69:$V9,70:$Va,71:$Vb,76:$Vc,77:$Vd,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{13:[1,40],15:[1,41],16:[1,42],17:[1,43],18:[1,44]},o($Vm,[2,3]),{8:45,21:13,22:14,24:15,25:16,26:17,27:18,28:19,29:$V6,33:22,35:28,42:29,43:30,67:$V7,68:$V8,69:$V9,70:$Va,71:$Vb,76:$Vc,77:$Vd,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},o($Vm,[2,5]),o($Vm,[2,6]),o($Vm,[2,7]),o($Vn,$Vo,{7:46,12:$V4,19:$V5}),o($Vn,[2,18],{7:47,12:$V4,19:$V5}),{19:[1,48]},{9:$Vp,10:$Vq,19:$Vr,23:49},{9:$Vp,10:$Vq,19:$Vr,23:53},{9:$Vp,10:$Vq,19:$Vr,23:54},{9:$Vp,10:$Vq,19:$Vr,23:55},{9:$Vp,10:$Vq,19:$Vr,23:56},{9:$Vp,10:$Vq,19:$Vr,23:57},{9:$Vp,10:$Vq,11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,19:$Vr,23:59,29:$Vz,30:58,32:$VA,43:67,44:$VB,47:$VC,49:$VD,63:60,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{77:[1,82]},o($VK,[2,37],{34:83,45:84,47:[1,85],48:[1,86],49:[1,87],50:$VL,51:$VM,52:$VN,53:$VO,54:$VP,55:$VQ,56:$VR,57:$VS,58:$VT,59:$VU,60:$VV,61:$VW}),{12:[1,100]},{12:[1,101]},{12:[1,102]},{12:[1,103]},{12:[1,104]},o($VX,[2,48],{43:30,42:110,12:[1,109],15:[1,108],36:[1,105],38:[1,106],40:[1,107],76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl}),o($VY,[2,50]),o($VY,[2,52],{44:[1,111]}),o($VZ,[2,128]),o($VZ,[2,129]),o($VZ,[2,130]),o($VZ,[2,131]),o($VZ,[2,132]),o($VZ,[2,133]),o($VZ,[2,134]),o($VZ,[2,135]),o($VZ,[2,136]),{9:$V_,12:$V$,14:112,19:$V01,20:115},{9:$V_,12:$V$,14:117,19:$V01,20:115},{9:$V_,12:$V$,14:118,19:$V01,20:115},{9:$V_,12:$V$,14:119,19:$V01,20:115},{9:$V_,12:$V$,14:120,19:$V01,20:115},o($Vm,[2,4]),o($Vn,[2,16]),o($Vn,[2,17]),o($Vm,[2,22]),o($Vm,[2,23]),o($Vm,[2,33]),o($Vm,[2,34]),o($Vm,[2,35]),o($Vm,[2,24]),o($Vm,[2,25]),o($Vm,[2,26]),o($Vm,[2,27]),o($Vm,[2,28]),{9:$Vp,10:$Vq,11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,19:$Vr,23:121,29:$Vz,32:$VA,43:67,44:$VB,47:$VC,49:$VD,63:122,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},o($V11,$V1,{5:123}),o($V21,[2,77]),o($V31,[2,118]),o($V31,[2,119]),o($V31,[2,120]),o($V31,[2,121]),o($V31,[2,122]),o($V31,[2,123]),o($V31,[2,124]),o($V31,$V41),o($V31,[2,126]),o($V31,[2,127]),o($V31,[2,81]),o($V31,[2,82]),o($V31,[2,83]),o($V31,[2,84]),o($V31,[2,85]),o($V31,[2,86]),o($V31,[2,87]),o($V31,[2,88]),o($V31,[2,89]),o($V31,[2,90]),o($V31,[2,91]),{9:$V51,11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,32:$VA,36:$V61,37:$V71,38:$V81,39:$V91,40:$Va1,41:$Vb1,43:67,44:$VB,47:$VC,49:$VD,50:$Vc1,51:$Vd1,52:$Ve1,53:$Vf1,62:$Vg1,63:126,64:124,65:125,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,86:127,87:$Vj,88:$Vk,89:$Vl,90:$Vh1,91:$Vi1,92:$Vj1},{33:143,35:28,42:29,43:30,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},o($Vk1,[2,56],{46:144,12:[1,145],62:[1,146]}),{12:[1,147]},{12:[1,148]},{12:[1,149]},o($Vl1,[2,64]),o($Vl1,[2,65]),o($Vl1,[2,66]),o($Vl1,[2,67]),o($Vl1,[2,68]),o($Vl1,[2,69]),o($Vl1,[2,70]),o($Vl1,[2,71]),o($Vl1,[2,72]),o($Vl1,[2,73]),o($Vl1,[2,74]),o($Vl1,[2,75]),{35:150,42:29,43:30,75:[1,151],76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{76:[1,152]},{35:153,42:29,43:30,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{35:154,42:29,43:30,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{35:155,42:29,43:30,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,30:156,32:$VA,43:67,44:$VB,47:$VC,49:$VD,63:60,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,30:158,32:$VA,38:[1,157],43:67,44:$VB,47:$VC,49:$VD,63:60,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,30:159,32:$VA,43:67,44:$VB,47:$VC,49:$VD,63:60,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,30:160,32:$VA,43:67,44:$VB,47:$VC,49:$VD,63:60,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},o($VX,[2,49]),o($VY,[2,51]),{43:161,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},o($V0,[2,8]),o($V0,[2,13]),o($V0,[2,14]),{19:[1,162]},{12:$V$,19:[2,21],20:163},o($V0,[2,9]),o($V0,[2,10]),o($V0,[2,11]),o($V0,[2,12]),o($V11,$V1,{5:164}),o($V21,[2,78]),{6:6,7:7,8:8,9:$V2,10:$V3,12:$Vm1,19:$V5,21:13,22:14,24:15,25:16,26:17,27:18,28:19,29:$V6,31:165,32:$Vn1,33:22,35:28,42:29,43:30,67:$V7,68:$V8,69:$V9,70:$Va,71:$Vb,76:$Vc,77:$Vd,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{9:$V51,11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,19:[2,100],29:$Vz,32:$VA,36:$V61,37:$V71,38:$V81,39:$V91,40:$Va1,41:$Vb1,43:67,44:$VB,47:$VC,49:$VD,50:$Vc1,51:$Vd1,52:$Ve1,53:$Vf1,62:$Vg1,63:126,65:168,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,86:127,87:$Vj,88:$Vk,89:$Vl,90:$Vh1,91:$Vi1,92:$Vj1},o($Vo1,[2,79]),o($Vo1,[2,116]),o($Vo1,[2,117]),o($Vo1,[2,137]),o($Vo1,[2,138]),o($Vo1,[2,139]),o($Vo1,[2,140]),o($Vo1,[2,141]),o($Vo1,[2,142]),o($Vo1,[2,143]),o($Vo1,[2,144]),o($Vo1,[2,145]),o($Vo1,[2,146]),o($Vo1,[2,147]),o($Vo1,[2,148]),o($Vo1,[2,149]),o($Vo1,[2,150]),o($Vo1,[2,151]),o($VK,[2,36]),o($Vk1,[2,54],{12:[1,169]}),o($Vk1,[2,57]),{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,30:170,32:$VA,43:67,44:$VB,47:$VC,49:$VD,63:60,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,30:171,32:$VA,43:67,44:$VB,47:$VC,49:$VD,63:60,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,30:172,32:$VA,43:67,44:$VB,47:$VC,49:$VD,63:60,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,30:173,32:$VA,43:67,44:$VB,47:$VC,49:$VD,63:60,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{12:[1,174],42:110,43:30,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{12:[1,175]},{12:[1,176]},{12:[1,177],42:110,43:30,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{12:[1,178],42:110,43:30,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{12:[1,179],42:110,43:30,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,32:$VA,37:[1,180],43:67,44:$VB,47:$VC,49:$VD,63:122,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,30:181,32:$VA,43:67,44:$VB,47:$VC,49:$VD,63:60,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,32:$VA,39:[1,182],43:67,44:$VB,47:$VC,49:$VD,63:122,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,32:$VA,41:[1,183],43:67,44:$VB,47:$VC,49:$VD,63:122,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,32:$VA,37:[1,184],43:67,44:$VB,47:$VC,49:$VD,63:122,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},o($VY,[2,53]),o($V0,[2,15]),{19:[2,20]},{6:6,7:7,8:8,9:$V2,10:$V3,12:$Vm1,19:$V5,21:13,22:14,24:15,25:16,26:17,27:18,28:19,29:$V6,31:185,32:$Vn1,33:22,35:28,42:29,43:30,67:$V7,68:$V8,69:$V9,70:$Va,71:$Vb,76:$Vc,77:$Vd,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{9:$Vp,10:$Vq,19:$Vr,23:186},o($VK,[2,31]),o($Vn,$Vo,{7:46,31:187,12:$Vm1,19:$V5,32:$Vn1}),o($Vo1,[2,80]),o($Vk1,[2,55]),{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,32:$VA,43:67,44:$VB,47:$VC,49:$VD,62:[1,188],63:122,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:[1,189],13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,32:$VA,43:67,44:$VB,47:$VC,49:$VD,63:122,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:[1,190],13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,32:$VA,43:67,44:$VB,47:$VC,49:$VD,63:122,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:[1,191],13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,32:$VA,43:67,44:$VB,47:$VC,49:$VD,63:122,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{12:$Vp1,44:$Vq1,67:$Vr1,74:192,75:$Vs1,76:$Vt1,77:$Vu1,78:193,80:194,81:$Vv1,82:$Vw1,83:$Vx1,84:$Vy1,85:$Vz1},{12:$Vp1,44:$Vq1,67:$Vr1,74:206,75:$Vs1,76:$Vt1,77:$Vu1,78:193,80:194,81:$Vv1,82:$Vw1,83:$Vx1,84:$Vy1,85:$Vz1},{12:$Vp1,44:$Vq1,67:$Vr1,74:207,75:$Vs1,76:$Vt1,77:$Vu1,78:193,80:194,81:$Vv1,82:$Vw1,83:$Vx1,84:$Vy1,85:$Vz1},{12:$Vp1,44:$Vq1,67:$Vr1,74:208,75:$Vs1,76:$Vt1,77:$Vu1,78:193,80:194,81:$Vv1,82:$Vw1,83:$Vx1,84:$Vy1,85:$Vz1},{35:209,42:29,43:30,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{35:210,42:29,43:30,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},o($VX,[2,38],{12:[1,211]}),{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,32:$VA,39:[1,212],43:67,44:$VB,47:$VC,49:$VD,63:122,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},o($VX,[2,42],{12:[1,213]}),o($VX,[2,44],{12:[1,214]}),o($VX,[2,46],{12:[1,215]}),{9:$Vp,10:$Vq,19:$Vr,23:216},o($Vm,[2,30]),o($VK,[2,32]),o([12,76,79,81,82,84,85,87,88,89],[2,76]),o($VA1,$V41,{45:217,50:$VL,51:$VM,52:$VN,53:$VO,54:$VP,55:$VQ,56:$VR,57:$VS,58:$VT,59:$VU,60:$VV,61:$VW}),o($VA1,$V41,{45:218,50:$VL,51:$VM,52:$VN,53:$VO,54:$VP,55:$VQ,56:$VR,57:$VS,58:$VT,59:$VU,60:$VV,61:$VW}),o($VA1,$V41,{45:219,50:$VL,51:$VM,52:$VN,53:$VO,54:$VP,55:$VQ,56:$VR,57:$VS,58:$VT,59:$VU,60:$VV,61:$VW}),o($VK,[2,97],{79:$VB1}),o($VC1,[2,101],{80:221,12:$Vp1,44:$Vq1,67:$Vr1,75:$Vs1,76:$Vt1,77:$Vu1,81:$Vv1,82:$Vw1,83:$Vx1,84:$Vy1,85:$Vz1}),o($VD1,[2,103]),o($VD1,[2,105]),o($VD1,[2,106]),o($VD1,[2,107]),o($VD1,[2,108]),o($VD1,[2,109]),o($VD1,[2,110]),o($VD1,[2,111]),o($VD1,[2,112]),o($VD1,[2,113]),o($VD1,[2,114]),o($VD1,[2,115]),o($VK,[2,98],{79:$VB1}),o($VK,[2,99],{79:$VB1}),o($VK,[2,94],{79:$VB1}),o($VK,[2,95],{43:30,42:110,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl}),o($VK,[2,96],{43:30,42:110,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl}),o($VX,[2,39]),{39:[1,222]},o($VX,[2,43]),o($VX,[2,45]),o($VX,[2,47]),o($Vm,[2,29]),o($Vk1,[2,58],{12:[1,223]}),o($Vk1,[2,60],{12:[1,224]}),o($Vk1,[2,62],{12:[1,225]}),{12:$Vp1,44:$Vq1,67:$Vr1,75:$Vs1,76:$Vt1,77:$Vu1,78:226,80:194,81:$Vv1,82:$Vw1,83:$Vx1,84:$Vy1,85:$Vz1},o($VD1,[2,104]),o($VX,[2,40],{12:[1,227]}),o($Vk1,[2,59]),o($Vk1,[2,61]),o($Vk1,[2,63]),o($VC1,[2,102],{80:221,12:$Vp1,44:$Vq1,67:$Vr1,75:$Vs1,76:$Vt1,77:$Vu1,81:$Vv1,82:$Vw1,83:$Vx1,84:$Vy1,85:$Vz1}),o($VX,[2,41])], -defaultActions: {163:[2,20]}, +table: [{3:1,4:2,11:[1,3]},{1:[3]},o($V0,$V1,{5:4}),{12:[1,5]},{1:[2,1],6:6,7:7,8:8,9:$V2,10:$V3,12:$V4,13:$V5,19:$V6,21:13,22:14,24:15,25:16,26:17,27:18,28:19,29:$V7,33:22,35:28,42:29,43:31,67:$V8,68:$V9,69:$Va,70:$Vb,71:$Vc,76:$Vd,77:$Ve,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},{13:[1,41],15:[1,42],16:[1,43],17:[1,44],18:[1,45]},o($Vn,[2,3]),{8:46,13:$V5,21:13,22:14,24:15,25:16,26:17,27:18,28:19,29:$V7,33:22,35:28,42:29,43:31,67:$V8,68:$V9,69:$Va,70:$Vb,71:$Vc,76:$Vd,77:$Ve,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},o($Vn,[2,5]),o($Vn,[2,6]),o($Vn,[2,7]),o($Vo,$Vp,{7:47,12:$V4,19:$V6}),o($Vo,[2,18],{7:48,12:$V4,19:$V6}),{19:[1,49]},{9:$Vq,10:$Vr,19:$Vs,23:50},{9:$Vq,10:$Vr,19:$Vs,23:54},{9:$Vq,10:$Vr,19:$Vs,23:55},{9:$Vq,10:$Vr,19:$Vs,23:56},{9:$Vq,10:$Vr,19:$Vs,23:57},{9:$Vq,10:$Vr,19:$Vs,23:58},{9:$Vq,10:$Vr,11:$Vt,12:$Vu,13:$Vv,15:$Vw,16:$Vx,17:$Vy,18:$Vz,19:$Vs,23:60,29:$VA,30:59,32:$VB,43:68,44:$VC,47:$VD,49:$VE,63:61,66:71,67:$VF,68:$VG,69:$VH,70:$VI,71:$VJ,73:62,76:$Vd,77:$VK,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},{77:[1,83]},o($VL,[2,37],{34:84,45:85,47:[1,86],48:[1,87],49:[1,88],50:$VM,51:$VN,52:$VO,53:$VP,54:$VQ,55:$VR,56:$VS,57:$VT,58:$VU,59:$VV,60:$VW,61:$VX}),{12:[1,101]},{12:[1,102]},{12:[1,103]},{12:[1,104]},{12:[1,105]},o($VY,[2,48],{43:31,42:111,12:[1,110],13:$V5,15:[1,109],36:[1,106],38:[1,107],40:[1,108],76:$Vd,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm}),o($VZ,[2,50]),o($VZ,[2,52]),o($VZ,[2,53],{44:[1,112]}),o($V_,[2,129]),o($V_,[2,130]),o($V_,[2,131]),o($V_,[2,132]),o($V_,[2,133]),o($V_,[2,134]),o($V_,[2,135]),o($V_,[2,136]),o($V_,[2,137]),{9:$V$,12:$V01,14:113,19:$V11,20:116},{9:$V$,12:$V01,14:118,19:$V11,20:116},{9:$V$,12:$V01,14:119,19:$V11,20:116},{9:$V$,12:$V01,14:120,19:$V11,20:116},{9:$V$,12:$V01,14:121,19:$V11,20:116},o($Vn,[2,4]),o($Vo,[2,16]),o($Vo,[2,17]),o($Vn,[2,22]),o($Vn,[2,23]),o($Vn,[2,33]),o($Vn,[2,34]),o($Vn,[2,35]),o($Vn,[2,24]),o($Vn,[2,25]),o($Vn,[2,26]),o($Vn,[2,27]),o($Vn,[2,28]),{9:$Vq,10:$Vr,11:$Vt,12:$Vu,13:$Vv,15:$Vw,16:$Vx,17:$Vy,18:$Vz,19:$Vs,23:122,29:$VA,32:$VB,43:68,44:$VC,47:$VD,49:$VE,63:123,66:71,67:$VF,68:$VG,69:$VH,70:$VI,71:$VJ,73:62,76:$Vd,77:$VK,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},o($V21,$V1,{5:124}),o($V31,[2,78]),o($V41,[2,119]),o($V41,[2,120]),o($V41,[2,121]),o($V41,[2,122]),o($V41,[2,123]),o($V41,[2,124]),o($V41,[2,125]),o($V41,$V51),o($V41,[2,127]),o($V41,[2,128]),o($V41,[2,82]),o($V41,[2,83]),o($V41,[2,84]),o($V41,[2,85]),o($V41,[2,86]),o($V41,[2,87]),o($V41,[2,88]),o($V41,[2,89]),o($V41,[2,90]),o($V41,[2,91]),o($V41,[2,92]),{9:$V61,11:$Vt,12:$Vu,13:$Vv,15:$Vw,16:$Vx,17:$Vy,18:$Vz,29:$VA,32:$VB,36:$V71,37:$V81,38:$V91,39:$Va1,40:$Vb1,41:$Vc1,43:68,44:$VC,47:$VD,49:$VE,50:$Vd1,51:$Ve1,52:$Vf1,53:$Vg1,62:$Vh1,63:127,64:125,65:126,66:71,67:$VF,68:$VG,69:$VH,70:$VI,71:$VJ,73:62,76:$Vd,77:$VK,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,86:128,87:$Vk,88:$Vl,89:$Vm,90:$Vi1,91:$Vj1,92:$Vk1},{13:$V5,33:144,35:28,42:29,43:31,76:$Vd,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},o($Vl1,[2,57],{46:145,12:[1,146],62:[1,147]}),{12:[1,148]},{12:[1,149]},{12:[1,150]},o($Vm1,[2,65]),o($Vm1,[2,66]),o($Vm1,[2,67]),o($Vm1,[2,68]),o($Vm1,[2,69]),o($Vm1,[2,70]),o($Vm1,[2,71]),o($Vm1,[2,72]),o($Vm1,[2,73]),o($Vm1,[2,74]),o($Vm1,[2,75]),o($Vm1,[2,76]),{13:$V5,35:151,42:29,43:31,75:[1,152],76:$Vd,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},{76:[1,153]},{13:$V5,35:154,42:29,43:31,76:$Vd,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},{13:$V5,35:155,42:29,43:31,76:$Vd,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},{13:$V5,35:156,42:29,43:31,76:$Vd,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},{11:$Vt,12:$Vu,13:$Vv,15:$Vw,16:$Vx,17:$Vy,18:$Vz,29:$VA,30:157,32:$VB,43:68,44:$VC,47:$VD,49:$VE,63:61,66:71,67:$VF,68:$VG,69:$VH,70:$VI,71:$VJ,73:62,76:$Vd,77:$VK,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},{11:$Vt,12:$Vu,13:$Vv,15:$Vw,16:$Vx,17:$Vy,18:$Vz,29:$VA,30:159,32:$VB,38:[1,158],43:68,44:$VC,47:$VD,49:$VE,63:61,66:71,67:$VF,68:$VG,69:$VH,70:$VI,71:$VJ,73:62,76:$Vd,77:$VK,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},{11:$Vt,12:$Vu,13:$Vv,15:$Vw,16:$Vx,17:$Vy,18:$Vz,29:$VA,30:160,32:$VB,43:68,44:$VC,47:$VD,49:$VE,63:61,66:71,67:$VF,68:$VG,69:$VH,70:$VI,71:$VJ,73:62,76:$Vd,77:$VK,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},{11:$Vt,12:$Vu,13:$Vv,15:$Vw,16:$Vx,17:$Vy,18:$Vz,29:$VA,30:161,32:$VB,43:68,44:$VC,47:$VD,49:$VE,63:61,66:71,67:$VF,68:$VG,69:$VH,70:$VI,71:$VJ,73:62,76:$Vd,77:$VK,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},o($VY,[2,49]),o($VZ,[2,51]),{43:162,76:$Vd,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},o($V0,[2,8]),o($V0,[2,13]),o($V0,[2,14]),{19:[1,163]},{12:$V01,19:[2,21],20:164},o($V0,[2,9]),o($V0,[2,10]),o($V0,[2,11]),o($V0,[2,12]),o($V21,$V1,{5:165}),o($V31,[2,79]),{6:6,7:7,8:8,9:$V2,10:$V3,12:$Vn1,13:$V5,19:$V6,21:13,22:14,24:15,25:16,26:17,27:18,28:19,29:$V7,31:166,32:$Vo1,33:22,35:28,42:29,43:31,67:$V8,68:$V9,69:$Va,70:$Vb,71:$Vc,76:$Vd,77:$Ve,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},{9:$V61,11:$Vt,12:$Vu,13:$Vv,15:$Vw,16:$Vx,17:$Vy,18:$Vz,19:[2,101],29:$VA,32:$VB,36:$V71,37:$V81,38:$V91,39:$Va1,40:$Vb1,41:$Vc1,43:68,44:$VC,47:$VD,49:$VE,50:$Vd1,51:$Ve1,52:$Vf1,53:$Vg1,62:$Vh1,63:127,65:169,66:71,67:$VF,68:$VG,69:$VH,70:$VI,71:$VJ,73:62,76:$Vd,77:$VK,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,86:128,87:$Vk,88:$Vl,89:$Vm,90:$Vi1,91:$Vj1,92:$Vk1},o($Vp1,[2,80]),o($Vp1,[2,117]),o($Vp1,[2,118]),o($Vp1,[2,138]),o($Vp1,[2,139]),o($Vp1,[2,140]),o($Vp1,[2,141]),o($Vp1,[2,142]),o($Vp1,[2,143]),o($Vp1,[2,144]),o($Vp1,[2,145]),o($Vp1,[2,146]),o($Vp1,[2,147]),o($Vp1,[2,148]),o($Vp1,[2,149]),o($Vp1,[2,150]),o($Vp1,[2,151]),o($Vp1,[2,152]),o($VL,[2,36]),o($Vl1,[2,55],{12:[1,170]}),o($Vl1,[2,58]),{11:$Vt,12:$Vu,13:$Vv,15:$Vw,16:$Vx,17:$Vy,18:$Vz,29:$VA,30:171,32:$VB,43:68,44:$VC,47:$VD,49:$VE,63:61,66:71,67:$VF,68:$VG,69:$VH,70:$VI,71:$VJ,73:62,76:$Vd,77:$VK,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},{11:$Vt,12:$Vu,13:$Vv,15:$Vw,16:$Vx,17:$Vy,18:$Vz,29:$VA,30:172,32:$VB,43:68,44:$VC,47:$VD,49:$VE,63:61,66:71,67:$VF,68:$VG,69:$VH,70:$VI,71:$VJ,73:62,76:$Vd,77:$VK,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},{11:$Vt,12:$Vu,13:$Vv,15:$Vw,16:$Vx,17:$Vy,18:$Vz,29:$VA,30:173,32:$VB,43:68,44:$VC,47:$VD,49:$VE,63:61,66:71,67:$VF,68:$VG,69:$VH,70:$VI,71:$VJ,73:62,76:$Vd,77:$VK,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},{11:$Vt,12:$Vu,13:$Vv,15:$Vw,16:$Vx,17:$Vy,18:$Vz,29:$VA,30:174,32:$VB,43:68,44:$VC,47:$VD,49:$VE,63:61,66:71,67:$VF,68:$VG,69:$VH,70:$VI,71:$VJ,73:62,76:$Vd,77:$VK,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},{12:[1,175],13:$V5,42:111,43:31,76:$Vd,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},{12:[1,176]},{12:[1,177]},{12:[1,178],13:$V5,42:111,43:31,76:$Vd,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},{12:[1,179],13:$V5,42:111,43:31,76:$Vd,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},{12:[1,180],13:$V5,42:111,43:31,76:$Vd,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},{11:$Vt,12:$Vu,13:$Vv,15:$Vw,16:$Vx,17:$Vy,18:$Vz,29:$VA,32:$VB,37:[1,181],43:68,44:$VC,47:$VD,49:$VE,63:123,66:71,67:$VF,68:$VG,69:$VH,70:$VI,71:$VJ,73:62,76:$Vd,77:$VK,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},{11:$Vt,12:$Vu,13:$Vv,15:$Vw,16:$Vx,17:$Vy,18:$Vz,29:$VA,30:182,32:$VB,43:68,44:$VC,47:$VD,49:$VE,63:61,66:71,67:$VF,68:$VG,69:$VH,70:$VI,71:$VJ,73:62,76:$Vd,77:$VK,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},{11:$Vt,12:$Vu,13:$Vv,15:$Vw,16:$Vx,17:$Vy,18:$Vz,29:$VA,32:$VB,39:[1,183],43:68,44:$VC,47:$VD,49:$VE,63:123,66:71,67:$VF,68:$VG,69:$VH,70:$VI,71:$VJ,73:62,76:$Vd,77:$VK,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},{11:$Vt,12:$Vu,13:$Vv,15:$Vw,16:$Vx,17:$Vy,18:$Vz,29:$VA,32:$VB,41:[1,184],43:68,44:$VC,47:$VD,49:$VE,63:123,66:71,67:$VF,68:$VG,69:$VH,70:$VI,71:$VJ,73:62,76:$Vd,77:$VK,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},{11:$Vt,12:$Vu,13:$Vv,15:$Vw,16:$Vx,17:$Vy,18:$Vz,29:$VA,32:$VB,37:[1,185],43:68,44:$VC,47:$VD,49:$VE,63:123,66:71,67:$VF,68:$VG,69:$VH,70:$VI,71:$VJ,73:62,76:$Vd,77:$VK,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},o($VZ,[2,54]),o($V0,[2,15]),{19:[2,20]},{6:6,7:7,8:8,9:$V2,10:$V3,12:$Vn1,13:$V5,19:$V6,21:13,22:14,24:15,25:16,26:17,27:18,28:19,29:$V7,31:186,32:$Vo1,33:22,35:28,42:29,43:31,67:$V8,68:$V9,69:$Va,70:$Vb,71:$Vc,76:$Vd,77:$Ve,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},{9:$Vq,10:$Vr,19:$Vs,23:187},o($VL,[2,31]),o($Vo,$Vp,{7:47,31:188,12:$Vn1,19:$V6,32:$Vo1}),o($Vp1,[2,81]),o($Vl1,[2,56]),{11:$Vt,12:$Vu,13:$Vv,15:$Vw,16:$Vx,17:$Vy,18:$Vz,29:$VA,32:$VB,43:68,44:$VC,47:$VD,49:$VE,62:[1,189],63:123,66:71,67:$VF,68:$VG,69:$VH,70:$VI,71:$VJ,73:62,76:$Vd,77:$VK,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},{11:$Vt,12:[1,190],13:$Vv,15:$Vw,16:$Vx,17:$Vy,18:$Vz,29:$VA,32:$VB,43:68,44:$VC,47:$VD,49:$VE,63:123,66:71,67:$VF,68:$VG,69:$VH,70:$VI,71:$VJ,73:62,76:$Vd,77:$VK,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},{11:$Vt,12:[1,191],13:$Vv,15:$Vw,16:$Vx,17:$Vy,18:$Vz,29:$VA,32:$VB,43:68,44:$VC,47:$VD,49:$VE,63:123,66:71,67:$VF,68:$VG,69:$VH,70:$VI,71:$VJ,73:62,76:$Vd,77:$VK,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},{11:$Vt,12:[1,192],13:$Vv,15:$Vw,16:$Vx,17:$Vy,18:$Vz,29:$VA,32:$VB,43:68,44:$VC,47:$VD,49:$VE,63:123,66:71,67:$VF,68:$VG,69:$VH,70:$VI,71:$VJ,73:62,76:$Vd,77:$VK,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},{12:$Vq1,44:$Vr1,67:$Vs1,74:193,75:$Vt1,76:$Vu1,77:$Vv1,78:194,80:195,81:$Vw1,82:$Vx1,83:$Vy1,84:$Vz1,85:$VA1},{12:$Vq1,44:$Vr1,67:$Vs1,74:207,75:$Vt1,76:$Vu1,77:$Vv1,78:194,80:195,81:$Vw1,82:$Vx1,83:$Vy1,84:$Vz1,85:$VA1},{12:$Vq1,44:$Vr1,67:$Vs1,74:208,75:$Vt1,76:$Vu1,77:$Vv1,78:194,80:195,81:$Vw1,82:$Vx1,83:$Vy1,84:$Vz1,85:$VA1},{12:$Vq1,44:$Vr1,67:$Vs1,74:209,75:$Vt1,76:$Vu1,77:$Vv1,78:194,80:195,81:$Vw1,82:$Vx1,83:$Vy1,84:$Vz1,85:$VA1},{13:$V5,35:210,42:29,43:31,76:$Vd,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},{13:$V5,35:211,42:29,43:31,76:$Vd,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},o($VY,[2,38],{12:[1,212]}),{11:$Vt,12:$Vu,13:$Vv,15:$Vw,16:$Vx,17:$Vy,18:$Vz,29:$VA,32:$VB,39:[1,213],43:68,44:$VC,47:$VD,49:$VE,63:123,66:71,67:$VF,68:$VG,69:$VH,70:$VI,71:$VJ,73:62,76:$Vd,77:$VK,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm},o($VY,[2,42],{12:[1,214]}),o($VY,[2,44],{12:[1,215]}),o($VY,[2,46],{12:[1,216]}),{9:$Vq,10:$Vr,19:$Vs,23:217},o($Vn,[2,30]),o($VL,[2,32]),o([12,13,76,79,81,82,84,85,87,88,89],[2,77]),o($VB1,$V51,{45:218,50:$VM,51:$VN,52:$VO,53:$VP,54:$VQ,55:$VR,56:$VS,57:$VT,58:$VU,59:$VV,60:$VW,61:$VX}),o($VB1,$V51,{45:219,50:$VM,51:$VN,52:$VO,53:$VP,54:$VQ,55:$VR,56:$VS,57:$VT,58:$VU,59:$VV,60:$VW,61:$VX}),o($VB1,$V51,{45:220,50:$VM,51:$VN,52:$VO,53:$VP,54:$VQ,55:$VR,56:$VS,57:$VT,58:$VU,59:$VV,60:$VW,61:$VX}),o($VL,[2,98],{79:$VC1}),o($VD1,[2,102],{80:222,12:$Vq1,44:$Vr1,67:$Vs1,75:$Vt1,76:$Vu1,77:$Vv1,81:$Vw1,82:$Vx1,83:$Vy1,84:$Vz1,85:$VA1}),o($VE1,[2,104]),o($VE1,[2,106]),o($VE1,[2,107]),o($VE1,[2,108]),o($VE1,[2,109]),o($VE1,[2,110]),o($VE1,[2,111]),o($VE1,[2,112]),o($VE1,[2,113]),o($VE1,[2,114]),o($VE1,[2,115]),o($VE1,[2,116]),o($VL,[2,99],{79:$VC1}),o($VL,[2,100],{79:$VC1}),o($VL,[2,95],{79:$VC1}),o($VL,[2,96],{43:31,42:111,13:$V5,76:$Vd,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm}),o($VL,[2,97],{43:31,42:111,13:$V5,76:$Vd,79:$Vf,81:$Vg,82:$Vh,84:$Vi,85:$Vj,87:$Vk,88:$Vl,89:$Vm}),o($VY,[2,39]),{39:[1,223]},o($VY,[2,43]),o($VY,[2,45]),o($VY,[2,47]),o($Vn,[2,29]),o($Vl1,[2,59],{12:[1,224]}),o($Vl1,[2,61],{12:[1,225]}),o($Vl1,[2,63],{12:[1,226]}),{12:$Vq1,44:$Vr1,67:$Vs1,75:$Vt1,76:$Vu1,77:$Vv1,78:227,80:195,81:$Vw1,82:$Vx1,83:$Vy1,84:$Vz1,85:$VA1},o($VE1,[2,105]),o($VY,[2,40],{12:[1,228]}),o($Vl1,[2,60]),o($Vl1,[2,62]),o($Vl1,[2,64]),o($VD1,[2,103],{80:222,12:$Vq1,44:$Vr1,67:$Vs1,75:$Vt1,76:$Vu1,77:$Vv1,81:$Vw1,82:$Vx1,83:$Vy1,84:$Vz1,85:$VA1}),o($VY,[2,41])], +defaultActions: {164:[2,20]}, parseError: function parseError(str, hash) { if (hash.recoverable) { this.trace(str); diff --git a/src/diagrams/flowchart/parser/flow.spec.js b/src/diagrams/flowchart/parser/flow.spec.js index 3027496f7..219435392 100644 --- a/src/diagrams/flowchart/parser/flow.spec.js +++ b/src/diagrams/flowchart/parser/flow.spec.js @@ -424,7 +424,18 @@ describe('when parsing ',function(){ expect(edges[0].text).toBe('text including graph space'); }); - + it('should handle keywords',function(){ + var res = flow.parser.parse('graph TD;V-->a[v]'); + var vert = flow.parser.yy.getVertices(); + var edges = flow.parser.yy.getEdges(); + expect(vert['a'].text).toBe('v'); + }); + it('should handle keywords',function(){ + var res = flow.parser.parse('graph TD;V-->a[v]'); + var vert = flow.parser.yy.getVertices(); + var edges = flow.parser.yy.getEdges(); + expect(vert['a'].text).toBe('v'); + }); }); describe("it should handle new line type notation",function() { diff --git a/src/diagrams/gantt/exGantt.md b/src/diagrams/gantt/exGantt.md new file mode 100644 index 000000000..69cb7ce99 --- /dev/null +++ b/src/diagrams/gantt/exGantt.md @@ -0,0 +1,23 @@ +```mermaid +gantt + dateFormat yyyy-mm-dd + title Adding gantt diagram functionality to mermaid + + section Design + Design jison grammar :des1, 2014-01-01, 2014-01-04 + Create example text :des2, 2014-01-01, 3d + Bounce gantt example with users :des3, after des2, 5d + + section Implementation + update build script :2014-01-02,1h + Implement parser and jison :after des1, 2d + Create tests for parser :3d + Create renderer :5d + Create tests for renderer :2d + Add to mermaid core :1d + + section Documentation + Describe gantt syntax :a1, 2014-01-01, 3d + Add gantt diagram to demo page :after a1 , 2h + Add gantt to diagram to demo page :after a1 , 2h +``` diff --git a/src/diagrams/gantt/gant.css b/src/diagrams/gantt/gant.css new file mode 100644 index 000000000..75c66621f --- /dev/null +++ b/src/diagrams/gantt/gant.css @@ -0,0 +1,61 @@ + +* { + margin: 0; + padding: 0; +} +body { + background: #fff; + font-family: 'Open-Sans',sans-serif; + +} + +#container{ + margin: 0 auto; + position: relative; + width:800px; + overflow: visible; +} + + +.svg { + width:800px; + height:400px; + overflow: visible; + position:absolute; +} + +.grid .tick { + stroke: lightgrey; + opacity: 0.3; + shape-rendering: crispEdges; +} +.grid path { + stroke-width: 0; +} + + +#tag { + color: white; + background: #FA283D; + width: 150px; + position: absolute; + display: none; + padding:3px 6px; + margin-left: -80px; + font-size: 11px; +} + + + +#tag:before { + border: solid transparent; + content: ' '; + height: 0; + left: 50%; + margin-left: -5px; + position: absolute; + width: 0; + border-width: 10px; + border-bottom-color: #FA283D; + top: -20px; +} \ No newline at end of file diff --git a/src/diagrams/gantt/gantt.spec.js b/src/diagrams/gantt/gantt.spec.js new file mode 100644 index 000000000..8b02bd7e2 --- /dev/null +++ b/src/diagrams/gantt/gantt.spec.js @@ -0,0 +1,46 @@ +/** + * Created by knut on 14-11-18. + */ +describe('when parsing a gantt diagram it',function() { + var parseError, gantt; + beforeEach(function () { + gantt = require('./parser/gantt').parser; + gantt.yy = require('./ganttDb'); + parseError = function(err, hash) { + console.log('Syntax error:' + err); + }; + //ex.yy.parseError = parseError; + }); + + it('should handle an dateFormat definition', function () { + var str = 'gantt\ndateFormat yyyy-mm-dd'; + + gantt.parse(str); + }); + it('should handle an dateFormat definition', function () { + var str = 'gantt\ntitle Adding gantt diagram functionality to mermaid'; + + gantt.parse(str); + }); + it('should handle an dateFormat definition', function () { + var str = 'gantt\ntitle Adding gantt diagram functionality to mermaid'; + + gantt.parse(str); + }); + it('should handle an dateFormat definition', function () { + var str = 'gantt\nsection Documentation'; + + gantt.parse(str); + }); + it('should handle an dateFormat definition', function () { + var str = 'gantt\n' + + 'section Documentation\n' + + //'section Documentation2\n'; + //'Design jison grammar :'; + 'Design jison grammar:des1, 2014-01-01, 2014-01-04'; + + gantt.parse(str); + }); +}); + +// Ogiltigt id i after id diff --git a/src/diagrams/gantt/ganttDb.js b/src/diagrams/gantt/ganttDb.js new file mode 100644 index 000000000..e927ecaa9 --- /dev/null +++ b/src/diagrams/gantt/ganttDb.js @@ -0,0 +1,174 @@ +/** + * Created by knut on 15-01-14. + */ + +var dateFormat = ''; +var title = ''; +var info = false; +var sections = []; +var tasks = []; +var currentSection = ''; + +exports.clear = function(){ + sections = []; + tasks = []; + currentSection = ''; + title = ''; + taskCnt = 0; + lastTask = undefined; +}; + +exports.setDateFormat = function(txt){ + dateFormat = txt; +}; + +exports.getDateFormat = function(){ + return dateFormat; +}; +exports.setTitle = function(txt){ + title = txt; +}; + +exports.gettitle = function(){ + return title; +}; + +exports.addSection = function(txt){ + currentSection = txt; + sections.push(txt); +}; + +exports.findTaskById = function(id) { + var i; + for(i=0;i" + + "Type: " + d3.select(this).data()[0].type + "
" + + "Starts: " + d3.select(this).data()[0].startTime + "
" + + "Ends: " + d3.select(this).data()[0].endTime + "
" + + "Details: " + d3.select(this).data()[0].details; + } else { + tag = "Task: " + d3.select(this).data()[0].task + "
" + + "Type: " + d3.select(this).data()[0].type + "
" + + "Starts: " + d3.select(this).data()[0].startTime + "
" + + "Ends: " + d3.select(this).data()[0].endTime; + } + var output = document.getElementById("tag"); + + var x = this.x.animVal.getItem(this) + "px"; + var y = this.y.animVal.getItem(this) + 25 + "px"; + + output.innerHTML = tag; + output.style.top = y; + output.style.left = x; + output.style.display = "block"; + }).on('mouseout', function() { + var output = document.getElementById("tag"); + output.style.display = "none"; + }); + + + innerRects.on('mouseover', function(e) { + //console.log(this); + var tag = ""; + + if (typeof d3.select(this).data()[0].details !== 'undefined'){ + tag = "Task: " + d3.select(this).data()[0].task + "
" + + "Type: " + d3.select(this).data()[0].type + "
" + + "Starts: " + d3.select(this).data()[0].startTime + "
" + + "Ends: " + d3.select(this).data()[0].endTime + "
" + + "Details: " + d3.select(this).data()[0].details; + } else { + tag = "Task: " + d3.select(this).data()[0].task + "
" + + "Type: " + d3.select(this).data()[0].type + "
" + + "Starts: " + d3.select(this).data()[0].startTime + "
" + + "Ends: " + d3.select(this).data()[0].endTime; + } + var output = document.getElementById("tag"); + + var x = (this.x.animVal.value + this.width.animVal.value/2) + "px"; + var y = this.y.animVal.value + 25 + "px"; + + output.innerHTML = tag; + output.style.top = y; + output.style.left = x; + output.style.display = "block"; + }).on('mouseout', function() { + var output = document.getElementById("tag"); + output.style.display = "none"; + + }); + + + +} + + +function makeGrid(theSidePad, theTopPad, w, h){ + + var xAxis = d3.svg.axis() + .scale(timeScale) + .orient('bottom') + .ticks(d3.time.weeks, 5) + .tickSize(-h+theTopPad+20, 0, 0) + .tickFormat(d3.time.format('%d %b')); + + var grid = svg.append('g') + .attr('class', 'grid') + .attr('transform', 'translate(' +theSidePad + ', ' + (h - 50) + ')') + .call(xAxis) + .selectAll("text") + .style("text-anchor", "middle") + .attr("fill", "#000") + .attr("stroke", "none") + .attr("font-size", 10) + .attr("dy", "1em"); +} + +function vertLabels(theGap, theTopPad, theSidePad, theBarHeight, theColorScale){ + var numOccurances = []; + var prevGap = 0; + + for (var i = 0; i < categories.length; i++){ + numOccurances[i] = [categories[i], getCount(categories[i], catsUnfiltered)]; + } + + var axisText = svg.append("g") //without doing this, impossible to put grid lines behind text + .selectAll("text") + .data(numOccurances) + .enter() + .append("text") + .text(function(d){ + return d[0]; + }) + .attr("x", 10) + .attr("y", function(d, i){ + if (i > 0){ + for (var j = 0; j < i; j++){ + prevGap += numOccurances[i-1][1]; + // console.log(prevGap); + return d[1]*theGap/2 + prevGap*theGap + theTopPad; + } + } else{ + return d[1]*theGap/2 + theTopPad; + } + }) + .attr("font-size", 11) + .attr("text-anchor", "start") + .attr("text-height", 14) + .attr("fill", function(d){ + for (var i = 0; i < categories.length; i++){ + if (d[0] == categories[i]){ + // console.log("true!"); + return d3.rgb(theColorScale(i)).darker(); + } + } + }); + +} + +//from this stackexchange question: http://stackoverflow.com/questions/1890203/unique-for-arrays-in-javascript +function checkUnique(arr) { + var hash = {}, result = []; + for ( var i = 0, l = arr.length; i < l; ++i ) { + if ( !hash.hasOwnProperty(arr[i]) ) { //it works with objects! in FF, at least + hash[ arr[i] ] = true; + result.push(arr[i]); + } + } + return result; +} + +//from this stackexchange question: http://stackoverflow.com/questions/14227981/count-how-many-strings-in-an-array-have-duplicates-in-the-same-array +function getCounts(arr) { + var i = arr.length, // var to loop over + obj = {}; // obj to store results + while (i) obj[arr[--i]] = (obj[arr[i]] || 0) + 1; // count occurrences + return obj; +} + +// get specific from everything +function getCount(word, arr) { + return getCounts(arr)[word] || 0; +} \ No newline at end of file diff --git a/src/diagrams/gantt/parser/gantt.jison b/src/diagrams/gantt/parser/gantt.jison new file mode 100644 index 000000000..226100c01 --- /dev/null +++ b/src/diagrams/gantt/parser/gantt.jison @@ -0,0 +1,63 @@ +/** mermaid + * http://knsv.github.io/mermaid/ + * (c) 2015 Knut Sveidqvist + * MIT license. + */ +%lex + +%options case-insensitive + +%{ + // Pre-lexer code can go here +%} + +%% + +[\n]+ return 'NL'; +\s+ /* skip whitespace */ +\#[^\n]* /* skip comments */ +\%%[^\n]* /* skip comments */ +"gantt" return 'gantt'; +"dateFormat" return 'dateFormat'; +"yyyy"\-"mm"\-"dd" return 'dateFormatInst'; +\d\d\d\d"-"\d\d"-"\d\d return 'date'; +"title"\s[^#\n;]+ return 'title'; +"section"\s[^#:\n;]+ return 'section'; +[^#:\n;]+ return 'taskTxt'; +":"[^#\n;]+ return 'taskData'; +":" return ':'; +<> return 'EOF'; +. return 'INVALID'; + +/lex + +%left '^' + +%start start + +%% /* language grammar */ + +start + : gantt document 'EOF' { return $2; } + ; + +document + : /* empty */ { $$ = [] } + | document line {$1.push($2);$$ = $1} + ; + +line + : SPACE statement { $$ = $2 } + | statement { $$ = $1 } + | NL { $$=[];} + | EOF { $$=[];} + ; + +statement + : 'dateFormat' dateFormatInst {yy.setDateFormat($2);$$=$2;} + | title {yy.setTitle($1.substr(6));$$=$1.substr(6);} + | section {yy.addSection($1.substr(8));$$=$1.substr(8);} + | taskTxt taskData + ; + +%% \ No newline at end of file diff --git a/src/diagrams/gantt/parser/gantt.js b/src/diagrams/gantt/parser/gantt.js new file mode 100644 index 000000000..83d10653a --- /dev/null +++ b/src/diagrams/gantt/parser/gantt.js @@ -0,0 +1,649 @@ +/* parser generated by jison 0.4.15 */ +/* + Returns a Parser object of the following structure: + + Parser: { + yy: {} + } + + Parser.prototype: { + yy: {}, + trace: function(), + symbols_: {associative list: name ==> number}, + terminals_: {associative list: number ==> name}, + productions_: [...], + performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), + table: [...], + defaultActions: {...}, + parseError: function(str, hash), + parse: function(input), + + lexer: { + EOF: 1, + parseError: function(str, hash), + setInput: function(input), + input: function(), + unput: function(str), + more: function(), + less: function(n), + pastInput: function(), + upcomingInput: function(), + showPosition: function(), + test_match: function(regex_match_array, rule_index), + next: function(), + lex: function(), + begin: function(condition), + popState: function(), + _currentRules: function(), + topState: function(), + pushState: function(condition), + + options: { + ranges: boolean (optional: true ==> token location info will include a .range[] member) + flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) + backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) + }, + + performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), + rules: [...], + conditions: {associative list: name ==> set}, + } + } + + + token location info (@$, _$, etc.): { + first_line: n, + last_line: n, + first_column: n, + last_column: n, + range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) + } + + + the parseError function receives a 'hash' object with these members for lexer and parser errors: { + text: (matched text) + token: (the produced terminal token, if any) + line: (yylineno) + } + while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { + loc: (yylloc) + expected: (string describing the set of expected tokens) + recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) + } +*/ +var parser = (function(){ +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[6,8,10,11,13,14,15],$V1=[1,9],$V2=[1,10],$V3=[1,11],$V4=[1,12]; +var parser = {trace: function trace() { }, +yy: {}, +symbols_: {"error":2,"start":3,"gantt":4,"document":5,"EOF":6,"line":7,"SPACE":8,"statement":9,"NL":10,"dateFormat":11,"dateFormatInst":12,"title":13,"section":14,"taskTxt":15,"taskData":16,"$accept":0,"$end":1}, +terminals_: {2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",11:"dateFormat",12:"dateFormatInst",13:"title",14:"section",15:"taskTxt",16:"taskData"}, +productions_: [0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,2],[9,1],[9,1],[9,2]], +performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { +/* this == yyval */ + +var $0 = $$.length - 1; +switch (yystate) { +case 1: + return $$[$0-1]; +break; +case 2: + this.$ = [] +break; +case 3: +$$[$0-1].push($$[$0]);this.$ = $$[$0-1] +break; +case 4: case 5: + this.$ = $$[$0] +break; +case 6: case 7: + this.$=[]; +break; +case 8: +yy.setDateFormat($$[$0]);this.$=$$[$0]; +break; +case 9: +yy.setTitle($$[$0].substr(6));this.$=$$[$0].substr(6); +break; +case 10: +yy.addSection($$[$0].substr(8));this.$=$$[$0].substr(8); +break; +} +}, +table: [{3:1,4:[1,2]},{1:[3]},o($V0,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:$V1,13:$V2,14:$V3,15:$V4},o($V0,[2,7],{1:[2,1]}),o($V0,[2,3]),{9:13,11:$V1,13:$V2,14:$V3,15:$V4},o($V0,[2,5]),o($V0,[2,6]),{12:[1,14]},o($V0,[2,9]),o($V0,[2,10]),{16:[1,15]},o($V0,[2,4]),o($V0,[2,8]),o($V0,[2,11])], +defaultActions: {}, +parseError: function parseError(str, hash) { + if (hash.recoverable) { + this.trace(str); + } else { + throw new Error(str); + } +}, +parse: function parse(input) { + var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; + var args = lstack.slice.call(arguments, 1); + var lexer = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k)) { + sharedState.yy[k] = this.yy[k]; + } + } + lexer.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer; + sharedState.yy.parser = this; + if (typeof lexer.yylloc == 'undefined') { + lexer.yylloc = {}; + } + var yyloc = lexer.yylloc; + lstack.push(yyloc); + var ranges = lexer.options && lexer.options.ranges; + if (typeof sharedState.yy.parseError === 'function') { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; + } + function popStack(n) { + stack.length = stack.length - 2 * n; + vstack.length = vstack.length - n; + lstack.length = lstack.length - n; + } + _token_stack: + function lex() { + var token; + token = lexer.lex() || EOF; + if (typeof token !== 'number') { + token = self.symbols_[token] || token; + } + return token; + } + var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; + while (true) { + state = stack[stack.length - 1]; + if (this.defaultActions[state]) { + action = this.defaultActions[state]; + } else { + if (symbol === null || typeof symbol == 'undefined') { + symbol = lex(); + } + action = table[state] && table[state][symbol]; + } + if (typeof action === 'undefined' || !action.length || !action[0]) { + var errStr = ''; + expected = []; + for (p in table[state]) { + if (this.terminals_[p] && p > TERROR) { + expected.push('\'' + this.terminals_[p] + '\''); + } + } + if (lexer.showPosition) { + errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; + } else { + errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); + } + this.parseError(errStr, { + text: lexer.match, + token: this.terminals_[symbol] || symbol, + line: lexer.yylineno, + loc: yyloc, + expected: expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer.yytext); + lstack.push(lexer.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer.yyleng; + yytext = lexer.yytext; + yylineno = lexer.yylineno; + yyloc = lexer.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r !== 'undefined') { + return r; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState); + break; + case 3: + return true; + } + } + return true; +}}; +/* generated by jison-lex 0.3.4 */ +var lexer = (function(){ +var lexer = ({ + +EOF:1, + +parseError:function parseError(str, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str, hash); + } else { + throw new Error(str); + } + }, + +// resets the lexer, sets new input +setInput:function (input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ''; + this.conditionStack = ['INITIAL']; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0,0]; + } + this.offset = 0; + return this; + }, + +// consumes and returns one char from the input +input:function () { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + + this._input = this._input.slice(1); + return ch; + }, + +// unshifts one char (or a string) into the input +unput:function (ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + //this.yyleng -= len; + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r = this.yylloc.range; + + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? + (lines.length === oldLines.length ? this.yylloc.first_column : 0) + + oldLines[oldLines.length - lines.length].length - lines[0].length : + this.yylloc.first_column - len + }; + + if (this.options.ranges) { + this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, + +// When called from action, caches matched text and appends it on next action +more:function () { + this._more = true; + return this; + }, + +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function () { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + + } + return this; + }, + +// retain first n characters of the match +less:function (n) { + this.unput(this.match.slice(n)); + }, + +// displays already matched input, i.e. for error messages +pastInput:function () { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); + }, + +// displays upcoming input, i.e. for error messages +upcomingInput:function () { + var next = this.match; + if (next.length < 20) { + next += this._input.substr(0, 20-next.length); + } + return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); + }, + +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function () { + var pre = this.pastInput(); + var c = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c + "^"; + }, + +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function (match, indexed_rule) { + var token, + lines, + backup; + + if (this.options.backtrack_lexer) { + // save context + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + + lines = match[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? + lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : + this.yylloc.last_column + match[0].length + }; + this.yytext += match[0]; + this.match += match[0]; + this.matches = match; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match[0].length); + this.matched += match[0]; + token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token) { + return token; + } else if (this._backtrack) { + // recover context + for (var k in backup) { + this[k] = backup[k]; + } + return false; // rule action called reject() implying the next rule should be tested instead. + } + return false; + }, + +// return next match in input +next:function () { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + + var token, + match, + tempMatch, + index; + if (!this._more) { + this.yytext = ''; + this.match = ''; + } + var rules = this._currentRules(); + for (var i = 0; i < rules.length; i++) { + tempMatch = this._input.match(this.rules[rules[i]]); + if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { + match = tempMatch; + index = i; + if (this.options.backtrack_lexer) { + token = this.test_match(tempMatch, rules[i]); + if (token !== false) { + return token; + } else if (this._backtrack) { + match = false; + continue; // rule action called reject() implying a rule MISmatch. + } else { + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match) { + token = this.test_match(match, rules[index]); + if (token !== false) { + return token; + } + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, + +// return next match that has a token +lex:function lex() { + var r = this.next(); + if (r) { + return r; + } else { + return this.lex(); + } + }, + +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function begin(condition) { + this.conditionStack.push(condition); + }, + +// pop the previously active lexer condition state off the condition stack +popState:function popState() { + var n = this.conditionStack.length - 1; + if (n > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, + +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function _currentRules() { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, + +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function topState(n) { + n = this.conditionStack.length - 1 - Math.abs(n || 0); + if (n >= 0) { + return this.conditionStack[n]; + } else { + return "INITIAL"; + } + }, + +// alias for begin(condition) +pushState:function pushState(condition) { + this.begin(condition); + }, + +// return the number of states currently on the stack +stateStackSize:function stateStackSize() { + return this.conditionStack.length; + }, +options: {"case-insensitive":true}, +performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { + // Pre-lexer code can go here + +var YYSTATE=YY_START; +switch($avoiding_name_collisions) { +case 0:return 10; +break; +case 1:/* skip whitespace */ +break; +case 2:/* skip comments */ +break; +case 3:/* skip comments */ +break; +case 4:return 4; +break; +case 5:return 11; +break; +case 6:return 12; +break; +case 7:return 'date'; +break; +case 8:return 13; +break; +case 9:return 14; +break; +case 10:return 15; +break; +case 11:return 16; +break; +case 12:return ':'; +break; +case 13:return 6; +break; +case 14:return 'INVALID'; +break; +} +}, +rules: [/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\b)/i,/^(?:yyyy-mm-dd\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i], +conditions: {"INITIAL":{"rules":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],"inclusive":true}} +}); +return lexer; +})(); +parser.lexer = lexer; +function Parser () { + this.yy = {}; +} +Parser.prototype = parser;parser.Parser = Parser; +return new Parser; +})(); + + +if (typeof require !== 'undefined' && typeof exports !== 'undefined') { +exports.parser = parser; +exports.Parser = parser.Parser; +exports.parse = function () { return parser.parse.apply(parser, arguments); }; +exports.main = function commonjsMain(args) { + if (!args[1]) { + console.log('Usage: '+args[0]+' FILE'); + process.exit(1); + } + var source = require('fs').readFileSync(require('path').normalize(args[1]), "utf8"); + return exports.parser.parse(source); +}; +if (typeof module !== 'undefined' && require.main === module) { + exports.main(process.argv.slice(1)); +} +} \ No newline at end of file diff --git a/src/diagrams/sequenceDiagram/parser/sequenceDiagram.jison b/src/diagrams/sequenceDiagram/parser/sequenceDiagram.jison index f7d0f637d..6ead4c855 100644 --- a/src/diagrams/sequenceDiagram/parser/sequenceDiagram.jison +++ b/src/diagrams/sequenceDiagram/parser/sequenceDiagram.jison @@ -1,4 +1,9 @@ -/** js sequence diagrams +/** mermaid + * http://knsv.github.io/mermaid/ + * (c) 2014-2015 Knut Sveidqvist + * MIT license. + * + * Based on js sequence diagrams jison grammr * http://bramp.github.io/js-sequence-diagrams/ * (c) 2012-2013 Andrew Brampton (bramp.net) * Simplified BSD license. diff --git a/test/web.html b/test/web.html index 62f33125e..d696abb4c 100644 --- a/test/web.html +++ b/test/web.html @@ -27,6 +27,14 @@ +

Issue 2

+
+ graph LR + A[Square Rect] -- Link text --> B((Circle)) + A --> C(Round Rect) + B --> D{Rhombus} + C --> D +

Issue

graph TD