1 | module.exports =
|
2 | (function(modules) {
|
3 |
|
4 | var installedModules = {};
|
5 |
|
6 |
|
7 | function __webpack_require__(moduleId) {
|
8 |
|
9 |
|
10 | if(installedModules[moduleId]) {
|
11 | return installedModules[moduleId].exports;
|
12 | }
|
13 |
|
14 | var module = installedModules[moduleId] = {
|
15 | i: moduleId,
|
16 | l: false,
|
17 | exports: {}
|
18 | };
|
19 |
|
20 |
|
21 | modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
22 |
|
23 |
|
24 | module.l = true;
|
25 |
|
26 |
|
27 | return module.exports;
|
28 | }
|
29 |
|
30 |
|
31 |
|
32 | __webpack_require__.m = modules;
|
33 |
|
34 |
|
35 | __webpack_require__.c = installedModules;
|
36 |
|
37 |
|
38 | __webpack_require__.d = function(exports, name, getter) {
|
39 | if(!__webpack_require__.o(exports, name)) {
|
40 | Object.defineProperty(exports, name, {
|
41 | configurable: false,
|
42 | enumerable: true,
|
43 | get: getter
|
44 | /******/ });
|
45 | /******/ }
|
46 | /******/ };
|
47 | /******/
|
48 | /******/ // getDefaultExport function for compatibility with non-harmony modules
|
49 | /******/ __webpack_require__.n = function(module) {
|
50 | var getter = module && module.__esModule ?
|
51 | function getDefault() { return module['default']; } :
|
52 | function getModuleExports() { return module; };
|
53 | __webpack_require__.d(getter, 'a', getter);
|
54 | return getter;
|
55 | };
|
56 |
|
57 |
|
58 | __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
59 |
|
60 |
|
61 | __webpack_require__.p = "";
|
62 |
|
63 |
|
64 | return __webpack_require__(__webpack_require__.s = 21);
|
65 | })
|
66 |
|
67 | ([
|
68 |
|
69 | (function(module, exports, __webpack_require__) {
|
70 |
|
71 | "use strict";
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 | function formatTime(timestamp) {
|
87 | var hh = timestamp.getUTCHours();
|
88 | var mm = timestamp.getUTCMinutes();
|
89 | var ss = timestamp.getSeconds();
|
90 | var ms = timestamp.getMilliseconds();
|
91 |
|
92 |
|
93 |
|
94 | if (hh < 10) {
|
95 | hh = '0' + hh;
|
96 | }
|
97 | if (mm < 10) {
|
98 | mm = '0' + mm;
|
99 | }
|
100 | if (ss < 10) {
|
101 | ss = '0' + ss;
|
102 | }
|
103 | if (ms < 100) {
|
104 | ms = '0' + ms;
|
105 | }
|
106 | if (ms < 10) {
|
107 | ms = '00' + ms;
|
108 | }
|
109 |
|
110 | var t = hh + ':' + mm + ':' + ss + ' (' + ms + ')';
|
111 | return t;
|
112 | }
|
113 |
|
114 | function format(level) {
|
115 | var time = formatTime(new Date());
|
116 | return '%c ' + time + ' :%c' + level + ': ';
|
117 | }
|
118 |
|
119 | var debug = function debug() {};
|
120 | var info = function info() {};
|
121 | var warn = function warn() {};
|
122 | var error = function error() {};
|
123 | var fatal = function fatal() {};
|
124 |
|
125 |
|
126 |
|
127 |
|
128 |
|
129 |
|
130 |
|
131 |
|
132 |
|
133 | exports.setLogLevel = function (level) {
|
134 | if (level < 6) {
|
135 | exports.Log.fatal = console.log.bind(console, format('FATAL'), 'color:grey;', 'color: red;');
|
136 | }
|
137 | if (level < 5) {
|
138 | exports.Log.error = console.log.bind(console, format('ERROR'), 'color:grey;', 'color: red;');
|
139 | }
|
140 | if (level < 4) {
|
141 | exports.Log.warn = console.log.bind(console, format('WARN'), 'color:grey;', 'color: orange;');
|
142 | }
|
143 | if (level < 3) {
|
144 | exports.Log.info = console.log.bind(console, format('INFO'), 'color:grey;', 'color: info;');
|
145 | }
|
146 | if (level < 2) {
|
147 | exports.Log.debug = console.log.bind(console, format('DEBUG'), 'color:grey;', 'color: green;');
|
148 | }
|
149 | };
|
150 |
|
151 | exports.Log = {
|
152 | debug: debug,
|
153 | info: info,
|
154 | warn: warn,
|
155 | error: error,
|
156 | fatal: fatal
|
157 | };
|
158 |
|
159 | }),
|
160 |
|
161 | (function(module, exports, __webpack_require__) {
|
162 |
|
163 | "use strict";
|
164 |
|
165 |
|
166 | var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
167 |
|
168 | var d3 = __webpack_require__(22);
|
169 |
|
170 | module.exports = d3;
|
171 |
|
172 |
|
173 |
|
174 |
|
175 |
|
176 |
|
177 |
|
178 |
|
179 |
|
180 |
|
181 |
|
182 | (function () {
|
183 |
|
184 |
|
185 |
|
186 |
|
187 | var forceWrapMethod = false;
|
188 | forceWrapMethod = 'tspans';
|
189 |
|
190 |
|
191 |
|
192 |
|
193 |
|
194 | if (d3.selection.prototype.textwrap) {
|
195 | return false;
|
196 | }
|
197 |
|
198 |
|
199 |
|
200 |
|
201 | if (typeof forceWrapMethod === 'undefined') {
|
202 | forceWrapMethod = false;
|
203 | }
|
204 |
|
205 |
|
206 |
|
207 | d3.selection.prototype.textwrap = d3.selection.enter.prototype.textwrap = function (bounds, padding) {
|
208 |
|
209 | padding = parseInt(padding) || 0;
|
210 |
|
211 |
|
212 |
|
213 | var selection = this;
|
214 |
|
215 |
|
216 | var returnValue;
|
217 |
|
218 |
|
219 |
|
220 | var extractBounds = function extractBounds(bounds) {
|
221 |
|
222 | var boundingRect = bounds[0][0];
|
223 |
|
224 | var elementType = boundingRect.tagName.toString();
|
225 |
|
226 | if (elementType !== 'rect') {
|
227 | return false;
|
228 |
|
229 | } else {
|
230 | var boundsExtracted = {};
|
231 | boundsExtracted.x = d3.select(boundingRect).attr('x') || 0;
|
232 | boundsExtracted.y = d3.select(boundingRect).attr('y') || 0;
|
233 | boundsExtracted.width = d3.select(boundingRect).attr('width') || 0;
|
234 | boundsExtracted.height = d3.select(boundingRect).attr('height') || 0;
|
235 |
|
236 | boundsExtracted.attr = bounds.attr;
|
237 | }
|
238 | return boundsExtracted;
|
239 | };
|
240 |
|
241 |
|
242 |
|
243 |
|
244 | var verifyBounds = function verifyBounds(bounds) {
|
245 |
|
246 |
|
247 |
|
248 |
|
249 | if (!bounds.attr) {
|
250 | bounds.attr = function (property) {
|
251 | if (this[property]) {
|
252 | return this[property];
|
253 | }
|
254 | };
|
255 | }
|
256 |
|
257 |
|
258 | if ((typeof bounds === 'undefined' ? 'undefined' : _typeof(bounds)) === 'object' && typeof bounds.x !== 'undefined' && typeof bounds.y !== 'undefined' && typeof bounds.width !== 'undefined' && typeof bounds.height !== 'undefined'
|
259 |
|
260 | ) {
|
261 |
|
262 | return bounds;
|
263 |
|
264 |
|
265 | } else if (
|
266 |
|
267 | typeof Array.isArray === 'function' && Array.isArray(bounds) ||
|
268 |
|
269 |
|
270 | Object.prototype.toString.call(bounds) === '[object Array]') {
|
271 |
|
272 |
|
273 | var extractedBounds = extractBounds(bounds);
|
274 | return extractedBounds;
|
275 | } else {
|
276 |
|
277 |
|
278 |
|
279 | return false;
|
280 | }
|
281 | };
|
282 |
|
283 | var applyPadding = function applyPadding(bounds, padding) {
|
284 | var paddedBounds = bounds;
|
285 | if (padding !== 0) {
|
286 | paddedBounds.x = parseInt(paddedBounds.x) + padding;
|
287 | paddedBounds.y = parseInt(paddedBounds.y) + padding;
|
288 | paddedBounds.width -= padding * 2;
|
289 | paddedBounds.height -= padding * 2;
|
290 | }
|
291 | return paddedBounds;
|
292 | };
|
293 |
|
294 |
|
295 | var verifiedBounds = verifyBounds(bounds);
|
296 |
|
297 |
|
298 | if (padding) {
|
299 | verifiedBounds = applyPadding(verifiedBounds, padding);
|
300 | }
|
301 |
|
302 |
|
303 | if (
|
304 |
|
305 | selection.length === 0 ||
|
306 |
|
307 | !d3 ||
|
308 |
|
309 | !bounds ||
|
310 |
|
311 | !verifiedBounds) {
|
312 |
|
313 |
|
314 |
|
315 | if (selection) {
|
316 | return selection;
|
317 |
|
318 |
|
319 |
|
320 | } else {
|
321 | return false;
|
322 | }
|
323 |
|
324 |
|
325 | } else {
|
326 |
|
327 |
|
328 |
|
329 |
|
330 |
|
331 | bounds = verifiedBounds;
|
332 |
|
333 |
|
334 | var wrapWithForeignobjects = function wrapWithForeignobjects(item) {
|
335 |
|
336 | var parent = d3.select(item[0].parentNode);
|
337 | var textNode = parent.select('text');
|
338 | var styledLineHeight = textNode.style('line-height');
|
339 |
|
340 | var textToWrap = textNode.text();
|
341 |
|
342 | textNode.remove();
|
343 | var foreignObject = parent.append('foreignObject');
|
344 |
|
345 | foreignObject.attr('requiredFeatures', 'http://www.w3.org/TR/SVG11/feature#Extensibility').attr('x', bounds.x).attr('y', bounds.y).attr('width', bounds.width).attr('height', bounds.height);
|
346 |
|
347 | var wrapDiv = foreignObject.append('xhtml:div')
|
348 |
|
349 |
|
350 |
|
351 |
|
352 |
|
353 | .attr('class', 'wrapped');
|
354 |
|
355 | wrapDiv.style('height', bounds.height).style('width', bounds.width)
|
356 |
|
357 | .html(textToWrap);
|
358 | if (styledLineHeight) {
|
359 | wrapDiv.style('line-height', styledLineHeight);
|
360 | }
|
361 | returnValue = parent.select('foreignObject');
|
362 | };
|
363 |
|
364 |
|
365 | var wrapWithTspans = function wrapWithTspans(item) {
|
366 |
|
367 | var textNode = item[0];
|
368 | var parent = textNode.parentNode;
|
369 | var textNodeSelected = d3.select(textNode);
|
370 |
|
371 | var textNodeHeight = textNode.getBBox().height;
|
372 | var textNodeWidth = textNode.getBBox().width;
|
373 |
|
374 |
|
375 | var lineHeight;
|
376 | var renderedLineHeight = textNodeHeight;
|
377 | var styledLineHeight = textNodeSelected.style('line-height');
|
378 | if (styledLineHeight && parseInt(styledLineHeight)) {
|
379 | lineHeight = parseInt(styledLineHeight.replace('px', ''));
|
380 | } else {
|
381 | lineHeight = renderedLineHeight;
|
382 | }
|
383 |
|
384 |
|
385 | if (textNodeWidth > bounds.width) {
|
386 |
|
387 |
|
388 |
|
389 |
|
390 | var textToWrap = textNodeSelected.text();
|
391 | textNodeSelected.text('');
|
392 | if (textToWrap) {
|
393 |
|
394 |
|
395 | var breakDelimiter;
|
396 |
|
397 | var textToWrapArray;
|
398 | if (textToWrap.indexOf(' ') !== -1) {
|
399 | breakDelimiter = ' ';
|
400 | textToWrapArray = textToWrap.split(' ');
|
401 | } else {
|
402 |
|
403 |
|
404 |
|
405 |
|
406 | breakDelimiter = '';
|
407 | var stringLength = textToWrap.length;
|
408 | var numberOfSubstrings = Math.ceil(textNodeWidth / bounds.width);
|
409 | var spliceInterval = Math.floor(stringLength / numberOfSubstrings);
|
410 | if (!(spliceInterval * numberOfSubstrings >= stringLength)) {
|
411 | numberOfSubstrings++;
|
412 | }
|
413 | textToWrapArray = [];
|
414 | var substring;
|
415 | var startPosition;
|
416 | for (var i = 0; i < numberOfSubstrings; i++) {
|
417 | startPosition = i * spliceInterval;
|
418 | substring = textToWrap.substr(startPosition, spliceInterval);
|
419 | textToWrapArray.push(substring);
|
420 | }
|
421 | }
|
422 |
|
423 |
|
424 |
|
425 |
|
426 | var substrings = [];
|
427 |
|
428 |
|
429 |
|
430 |
|
431 |
|
432 |
|
433 |
|
434 | var totalOffset = 0;
|
435 |
|
436 | var temp = {};
|
437 |
|
438 |
|
439 | for (i = 0; i < textToWrapArray.length; i++) {
|
440 | var word = textToWrapArray[i];
|
441 | var previousString = textNodeSelected.text();
|
442 | var previousWidth = textNode.getComputedTextLength();
|
443 |
|
444 |
|
445 | var newstring;
|
446 | if (previousString) {
|
447 | newstring = previousString + breakDelimiter + word;
|
448 | } else {
|
449 | newstring = word;
|
450 | }
|
451 |
|
452 |
|
453 | textNodeSelected.text(newstring);
|
454 | var newWidth = textNode.getComputedTextLength();
|
455 |
|
456 |
|
457 |
|
458 |
|
459 |
|
460 |
|
461 |
|
462 |
|
463 | if (newWidth > bounds.width) {
|
464 | if (previousString && previousString !== '') {
|
465 | totalOffset = totalOffset + previousWidth;
|
466 | temp = { string: previousString, width: previousWidth, offset: totalOffset };
|
467 | substrings.push(temp);
|
468 | textNodeSelected.text('');
|
469 | textNodeSelected.text(word);
|
470 |
|
471 | if (i === textToWrapArray.length - 1) {
|
472 | newstring = word;
|
473 | textNodeSelected.text(newstring);
|
474 | newWidth = textNode.getComputedTextLength();
|
475 | }
|
476 | }
|
477 | }
|
478 |
|
479 |
|
480 |
|
481 | if (i === textToWrapArray.length - 1) {
|
482 | textNodeSelected.text('');
|
483 | var finalString = newstring;
|
484 | if (finalString && finalString !== '') {
|
485 | if (newWidth - totalOffset > 0) {
|
486 | newWidth = newWidth - totalOffset;
|
487 | }
|
488 | temp = { string: finalString, width: newWidth, offset: totalOffset };
|
489 | substrings.push(temp);
|
490 | }
|
491 | }
|
492 | }
|
493 |
|
494 |
|
495 | var currentTspan;
|
496 |
|
497 |
|
498 |
|
499 | textNodeSelected.text('');
|
500 | for (i = 0; i < substrings.length; i++) {
|
501 | substring = substrings[i].string;
|
502 |
|
503 |
|
504 | if (i * lineHeight < bounds.height - lineHeight * 1.5) {
|
505 | currentTspan = textNodeSelected.append('tspan').text(substring);
|
506 |
|
507 | currentTspan.attr('dy', function (d) {
|
508 | if (i > 0) {
|
509 | return lineHeight;
|
510 | }
|
511 | });
|
512 |
|
513 |
|
514 |
|
515 | currentTspan.attr('x', function () {
|
516 | var xOffset = bounds.x;
|
517 | if (padding) {
|
518 | xOffset += padding;
|
519 | }
|
520 | return xOffset;
|
521 | });
|
522 | }
|
523 | }
|
524 | }
|
525 | }
|
526 |
|
527 | textNodeSelected.attr('y', function () {
|
528 | var yOffset = bounds.y;
|
529 |
|
530 |
|
531 |
|
532 | if (lineHeight) {
|
533 | yOffset += lineHeight;
|
534 | }
|
535 |
|
536 | if (padding) {
|
537 | yOffset += padding;
|
538 | }
|
539 | return yOffset;
|
540 | });
|
541 |
|
542 | textNodeSelected.attr('x', function () {
|
543 | var xOffset = bounds.x;
|
544 | if (padding) {
|
545 | xOffset += padding;
|
546 | }
|
547 | return xOffset;
|
548 | });
|
549 |
|
550 |
|
551 |
|
552 | returnValue = d3.select(parent).selectAll('text');
|
553 | };
|
554 |
|
555 |
|
556 |
|
557 | var wrapMethod;
|
558 |
|
559 |
|
560 |
|
561 | if (forceWrapMethod) {
|
562 | if (forceWrapMethod === 'foreignobjects') {
|
563 | wrapMethod = wrapWithForeignobjects;
|
564 | } else if (forceWrapMethod === 'tspans') {
|
565 | wrapMethod = wrapWithTspans;
|
566 | }
|
567 | }
|
568 |
|
569 |
|
570 |
|
571 |
|
572 | if (!forceWrapMethod) {
|
573 | if (typeof SVGForeignObjectElement !== 'undefined') {
|
574 | wrapMethod = wrapWithForeignobjects;
|
575 | } else {
|
576 | wrapMethod = wrapWithTspans;
|
577 | }
|
578 | }
|
579 |
|
580 |
|
581 |
|
582 | for (var i = 0; i < selection.length; i++) {
|
583 | var item = selection[i];
|
584 | wrapMethod(item);
|
585 | }
|
586 |
|
587 |
|
588 |
|
589 | return returnValue;
|
590 | }
|
591 | };
|
592 | })();
|
593 |
|
594 | }),
|
595 |
|
596 | (function(module, exports) {
|
597 |
|
598 | module.exports = function(module) {
|
599 | if(!module.webpackPolyfill) {
|
600 | module.deprecate = function() {};
|
601 | module.paths = [];
|
602 |
|
603 | if(!module.children) module.children = [];
|
604 | Object.defineProperty(module, "loaded", {
|
605 | enumerable: true,
|
606 | get: function() {
|
607 | return module.l;
|
608 | }
|
609 | });
|
610 | Object.defineProperty(module, "id", {
|
611 | enumerable: true,
|
612 | get: function() {
|
613 | return module.i;
|
614 | }
|
615 | });
|
616 | module.webpackPolyfill = 1;
|
617 | }
|
618 | return module;
|
619 | };
|
620 |
|
621 |
|
622 | }),
|
623 |
|
624 | (function(module, exports) {
|
625 |
|
626 | module.exports = require("fs");
|
627 |
|
628 | }),
|
629 |
|
630 | (function(module, exports) {
|
631 |
|
632 | module.exports = require("path");
|
633 |
|
634 | }),
|
635 |
|
636 | (function(module, exports, __webpack_require__) {
|
637 |
|
638 | "use strict";
|
639 |
|
640 |
|
641 | var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
642 |
|
643 |
|
644 |
|
645 |
|
646 | var Logger = __webpack_require__(0);
|
647 | var log = Logger.Log;
|
648 | var utils = __webpack_require__(6);
|
649 |
|
650 | var d3 = __webpack_require__(1);
|
651 | var vertices = {};
|
652 | var edges = [];
|
653 | var classes = [];
|
654 | var subGraphs = [];
|
655 | var tooltips = {};
|
656 | var subCount = 0;
|
657 | var direction;
|
658 |
|
659 | var funs = [];
|
660 |
|
661 |
|
662 |
|
663 |
|
664 |
|
665 |
|
666 |
|
667 | exports.addVertex = function (id, text, type, style) {
|
668 | var txt;
|
669 |
|
670 | if (typeof id === 'undefined') {
|
671 | return;
|
672 | }
|
673 | if (id.trim().length === 0) {
|
674 | return;
|
675 | }
|
676 |
|
677 | if (typeof vertices[id] === 'undefined') {
|
678 | vertices[id] = { id: id, styles: [], classes: [] };
|
679 | }
|
680 | if (typeof text !== 'undefined') {
|
681 | txt = text.trim();
|
682 |
|
683 |
|
684 | if (txt[0] === '"' && txt[txt.length - 1] === '"') {
|
685 | txt = txt.substring(1, txt.length - 1);
|
686 | }
|
687 |
|
688 | vertices[id].text = txt;
|
689 | }
|
690 | if (typeof type !== 'undefined') {
|
691 | vertices[id].type = type;
|
692 | }
|
693 | if (typeof type !== 'undefined') {
|
694 | vertices[id].type = type;
|
695 | }
|
696 | if (typeof style !== 'undefined') {
|
697 | if (style !== null) {
|
698 | style.forEach(function (s) {
|
699 | vertices[id].styles.push(s);
|
700 | });
|
701 | }
|
702 | }
|
703 | };
|
704 |
|
705 |
|
706 |
|
707 |
|
708 |
|
709 |
|
710 |
|
711 |
|
712 | exports.addLink = function (start, end, type, linktext) {
|
713 | log.info('Got edge...', start, end);
|
714 | var edge = { start: start, end: end, type: undefined, text: '' };
|
715 | linktext = type.text;
|
716 |
|
717 | if (typeof linktext !== 'undefined') {
|
718 | edge.text = linktext.trim();
|
719 |
|
720 |
|
721 | if (edge.text[0] === '"' && edge.text[edge.text.length - 1] === '"') {
|
722 | edge.text = edge.text.substring(1, edge.text.length - 1);
|
723 | }
|
724 | }
|
725 |
|
726 | if (typeof type !== 'undefined') {
|
727 | edge.type = type.type;
|
728 | edge.stroke = type.stroke;
|
729 | }
|
730 | edges.push(edge);
|
731 | };
|
732 |
|
733 |
|
734 |
|
735 |
|
736 |
|
737 |
|
738 | exports.updateLinkInterpolate = function (pos, interp) {
|
739 | if (pos === 'default') {
|
740 | edges.defaultInterpolate = interp;
|
741 | } else {
|
742 | edges[pos].interpolate = interp;
|
743 | }
|
744 | };
|
745 |
|
746 |
|
747 |
|
748 |
|
749 |
|
750 |
|
751 | exports.updateLink = function (pos, style) {
|
752 | if (pos === 'default') {
|
753 | edges.defaultStyle = style;
|
754 | } else {
|
755 | if (utils.isSubstringInArray('fill', style) === -1) {
|
756 | style.push('fill:none');
|
757 | }
|
758 | edges[pos].style = style;
|
759 | }
|
760 | };
|
761 |
|
762 | exports.addClass = function (id, style) {
|
763 | if (typeof classes[id] === 'undefined') {
|
764 | classes[id] = { id: id, styles: [] };
|
765 | }
|
766 |
|
767 | if (typeof style !== 'undefined') {
|
768 | if (style !== null) {
|
769 | style.forEach(function (s) {
|
770 | classes[id].styles.push(s);
|
771 | });
|
772 | }
|
773 | }
|
774 | };
|
775 |
|
776 |
|
777 |
|
778 |
|
779 |
|
780 | exports.setDirection = function (dir) {
|
781 | direction = dir;
|
782 | };
|
783 |
|
784 |
|
785 |
|
786 |
|
787 |
|
788 | exports.setClass = function (id, className) {
|
789 | if (id.indexOf(',') > 0) {
|
790 | id.split(',').forEach(function (id2) {
|
791 | if (typeof vertices[id2] !== 'undefined') {
|
792 | vertices[id2].classes.push(className);
|
793 | }
|
794 | });
|
795 | } else {
|
796 | if (typeof vertices[id] !== 'undefined') {
|
797 | vertices[id].classes.push(className);
|
798 | }
|
799 | }
|
800 | };
|
801 |
|
802 | var setTooltip = function setTooltip(id, tooltip) {
|
803 | if (typeof tooltip !== 'undefined') {
|
804 | tooltips[id] = tooltip;
|
805 | }
|
806 | };
|
807 |
|
808 | var setClickFun = function setClickFun(id, functionName) {
|
809 | if (typeof functionName === 'undefined') {
|
810 | return;
|
811 | }
|
812 | if (typeof vertices[id] !== 'undefined') {
|
813 | funs.push(function (element) {
|
814 | var elem = d3.select(element).select('#' + id);
|
815 | if (elem !== null) {
|
816 | elem.on('click', function () {
|
817 | window[functionName](id);
|
818 | });
|
819 | }
|
820 | });
|
821 | }
|
822 | };
|
823 |
|
824 | var setLink = function setLink(id, linkStr) {
|
825 | if (typeof linkStr === 'undefined') {
|
826 | return;
|
827 | }
|
828 | if (typeof vertices[id] !== 'undefined') {
|
829 | funs.push(function (element) {
|
830 | var elem = d3.select(element).select('#' + id);
|
831 | if (elem !== null) {
|
832 | elem.on('click', function () {
|
833 | window.open(linkStr, 'newTab');
|
834 | });
|
835 | }
|
836 | });
|
837 | }
|
838 | };
|
839 | exports.getTooltip = function (id) {
|
840 | return tooltips[id];
|
841 | };
|
842 |
|
843 |
|
844 |
|
845 |
|
846 |
|
847 | exports.setClickEvent = function (id, functionName, link, tooltip) {
|
848 | if (id.indexOf(',') > 0) {
|
849 | id.split(',').forEach(function (id2) {
|
850 | setTooltip(id2, tooltip);
|
851 | setClickFun(id2, functionName);
|
852 | setLink(id2, link);
|
853 | });
|
854 | } else {
|
855 | setTooltip(id, tooltip);
|
856 | setClickFun(id, functionName);
|
857 | setLink(id, link);
|
858 | }
|
859 | };
|
860 |
|
861 | exports.bindFunctions = function (element) {
|
862 | funs.forEach(function (fun) {
|
863 | fun(element);
|
864 | });
|
865 | };
|
866 | exports.getDirection = function () {
|
867 | return direction;
|
868 | };
|
869 |
|
870 |
|
871 |
|
872 |
|
873 | exports.getVertices = function () {
|
874 | return vertices;
|
875 | };
|
876 |
|
877 |
|
878 |
|
879 |
|
880 |
|
881 | exports.getEdges = function () {
|
882 | return edges;
|
883 | };
|
884 |
|
885 |
|
886 |
|
887 |
|
888 |
|
889 | exports.getClasses = function () {
|
890 | return classes;
|
891 | };
|
892 |
|
893 | var setupToolTips = function setupToolTips(element) {
|
894 | var tooltipElem = d3.select('.mermaidTooltip');
|
895 | if (tooltipElem[0][0] === null) {
|
896 | tooltipElem = d3.select('body').append('div').attr('class', 'mermaidTooltip').style('opacity', 0);
|
897 | }
|
898 |
|
899 | var svg = d3.select(element).select('svg');
|
900 |
|
901 | var nodes = svg.selectAll('g.node');
|
902 | nodes.on('mouseover', function () {
|
903 | var el = d3.select(this);
|
904 | var title = el.attr('title');
|
905 |
|
906 | if (title === null) {
|
907 | return;
|
908 | }
|
909 | var rect = this.getBoundingClientRect();
|
910 |
|
911 | tooltipElem.transition().duration(200).style('opacity', '.9');
|
912 | tooltipElem.html(el.attr('title')).style('left', rect.left + (rect.right - rect.left) / 2 + 'px').style('top', rect.top - 14 + document.body.scrollTop + 'px');
|
913 | el.classed('hover', true);
|
914 | }).on('mouseout', function () {
|
915 | tooltipElem.transition().duration(500).style('opacity', 0);
|
916 | var el = d3.select(this);
|
917 | el.classed('hover', false);
|
918 | });
|
919 | };
|
920 | funs.push(setupToolTips);
|
921 |
|
922 |
|
923 |
|
924 |
|
925 | exports.clear = function () {
|
926 | vertices = {};
|
927 | classes = {};
|
928 | edges = [];
|
929 | funs = [];
|
930 | funs.push(setupToolTips);
|
931 | subGraphs = [];
|
932 | subCount = 0;
|
933 | tooltips = [];
|
934 | };
|
935 |
|
936 |
|
937 |
|
938 |
|
939 | exports.defaultStyle = function () {
|
940 | return 'fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;';
|
941 | };
|
942 |
|
943 |
|
944 |
|
945 |
|
946 | exports.addSubGraph = function (list, title) {
|
947 | function uniq(a) {
|
948 | var prims = { 'boolean': {}, 'number': {}, 'string': {} };
|
949 | var objs = [];
|
950 |
|
951 | return a.filter(function (item) {
|
952 | var type = typeof item === 'undefined' ? 'undefined' : _typeof(item);
|
953 | if (item === ' ') {
|
954 | return false;
|
955 | }
|
956 | if (type in prims) {
|
957 | return prims[type].hasOwnProperty(item) ? false : prims[type][item] = true;
|
958 | } else {
|
959 | return objs.indexOf(item) >= 0 ? false : objs.push(item);
|
960 | }
|
961 | });
|
962 | }
|
963 |
|
964 | var nodeList = [];
|
965 |
|
966 | nodeList = uniq(nodeList.concat.apply(nodeList, list));
|
967 |
|
968 | var subGraph = { id: 'subGraph' + subCount, nodes: nodeList, title: title };
|
969 | subGraphs.push(subGraph);
|
970 | subCount = subCount + 1;
|
971 | return subGraph.id;
|
972 | };
|
973 |
|
974 | var getPosForId = function getPosForId(id) {
|
975 | var i;
|
976 | for (i = 0; i < subGraphs.length; i++) {
|
977 | if (subGraphs[i].id === id) {
|
978 | return i;
|
979 | }
|
980 | }
|
981 | return -1;
|
982 | };
|
983 | var secCount = -1;
|
984 | var posCrossRef = [];
|
985 | var indexNodes = function indexNodes(id, pos) {
|
986 | var nodes = subGraphs[pos].nodes;
|
987 | secCount = secCount + 1;
|
988 | if (secCount > 2000) {
|
989 | return;
|
990 | }
|
991 | posCrossRef[secCount] = pos;
|
992 |
|
993 | if (subGraphs[pos].id === id) {
|
994 | return {
|
995 | result: true,
|
996 | count: 0
|
997 | };
|
998 | }
|
999 |
|
1000 | var count = 0;
|
1001 | var posCount = 1;
|
1002 | while (count < nodes.length) {
|
1003 | var childPos = getPosForId(nodes[count]);
|
1004 |
|
1005 | if (childPos >= 0) {
|
1006 | var res = indexNodes(id, childPos);
|
1007 | if (res.result) {
|
1008 | return {
|
1009 | result: true,
|
1010 | count: posCount + res.count
|
1011 | };
|
1012 | } else {
|
1013 | posCount = posCount + res.count;
|
1014 | }
|
1015 | }
|
1016 | count = count + 1;
|
1017 | }
|
1018 |
|
1019 | return {
|
1020 | result: false,
|
1021 | count: posCount
|
1022 | };
|
1023 | };
|
1024 |
|
1025 | exports.getDepthFirstPos = function (pos) {
|
1026 | return posCrossRef[pos];
|
1027 | };
|
1028 | exports.indexNodes = function () {
|
1029 | secCount = -1;
|
1030 | if (subGraphs.length > 0) {
|
1031 | indexNodes('none', subGraphs.length - 1, 0);
|
1032 | }
|
1033 | };
|
1034 |
|
1035 | exports.getSubGraphs = function () {
|
1036 | return subGraphs;
|
1037 | };
|
1038 |
|
1039 | exports.parseError = function (err, hash) {
|
1040 | global.mermaidAPI.parseError(err, hash);
|
1041 | };
|
1042 |
|
1043 | }),
|
1044 |
|
1045 | (function(module, exports, __webpack_require__) {
|
1046 |
|
1047 | "use strict";
|
1048 |
|
1049 |
|
1050 |
|
1051 |
|
1052 |
|
1053 | var Logger = __webpack_require__(0);
|
1054 | var log = Logger.Log;
|
1055 |
|
1056 |
|
1057 |
|
1058 |
|
1059 |
|
1060 |
|
1061 |
|
1062 |
|
1063 |
|
1064 |
|
1065 |
|
1066 |
|
1067 |
|
1068 |
|
1069 |
|
1070 |
|
1071 |
|
1072 |
|
1073 | var detectType = function detectType(text) {
|
1074 | text = text.replace(/^\s*%%.*\n/g, '\n');
|
1075 | if (text.match(/^\s*sequenceDiagram/)) {
|
1076 | return 'sequenceDiagram';
|
1077 | }
|
1078 |
|
1079 | if (text.match(/^\s*digraph/)) {
|
1080 | return 'dotGraph';
|
1081 | }
|
1082 |
|
1083 | if (text.match(/^\s*info/)) {
|
1084 | return 'info';
|
1085 | }
|
1086 |
|
1087 | if (text.match(/^\s*gantt/)) {
|
1088 | return 'gantt';
|
1089 | }
|
1090 |
|
1091 | if (text.match(/^\s*classDiagram/)) {
|
1092 | log.debug('Detected classDiagram syntax');
|
1093 | return 'classDiagram';
|
1094 | }
|
1095 |
|
1096 | if (text.match(/^\s*gitGraph/)) {
|
1097 | log.debug('Detected gitGraph syntax');
|
1098 | return 'gitGraph';
|
1099 | }
|
1100 | return 'graph';
|
1101 | };
|
1102 | exports.detectType = detectType;
|
1103 |
|
1104 |
|
1105 |
|
1106 |
|
1107 |
|
1108 |
|
1109 |
|
1110 | var cloneCssStyles = function cloneCssStyles(svg, classes) {
|
1111 | var usedStyles = '';
|
1112 | var sheets = document.styleSheets;
|
1113 | var rule;
|
1114 | for (var i = 0; i < sheets.length; i++) {
|
1115 |
|
1116 | if (sheets[i].title !== 'mermaid-svg-internal-css') {
|
1117 | try {
|
1118 | var rules = sheets[i].cssRules;
|
1119 | if (rules !== null) {
|
1120 | for (var j = 0; j < rules.length; j++) {
|
1121 | rule = rules[j];
|
1122 | if (typeof rule.style !== 'undefined') {
|
1123 | var elems;
|
1124 | elems = svg.querySelectorAll(rule.selectorText);
|
1125 | if (elems.length > 0) {
|
1126 | usedStyles += rule.selectorText + ' { ' + rule.style.cssText + '}\n';
|
1127 | }
|
1128 | }
|
1129 | }
|
1130 | }
|
1131 | } catch (err) {
|
1132 | if (typeof rule !== 'undefined') {
|
1133 | log.warn('Invalid CSS selector "' + rule.selectorText + '"', err);
|
1134 | }
|
1135 | }
|
1136 | }
|
1137 | }
|
1138 |
|
1139 | var defaultStyles = '';
|
1140 | var embeddedStyles = '';
|
1141 |
|
1142 | for (var className in classes) {
|
1143 | if (classes.hasOwnProperty(className) && typeof className !== 'undefined') {
|
1144 | if (className === 'default') {
|
1145 | if (classes.default.styles instanceof Array) {
|
1146 | defaultStyles += '#' + svg.id.trim() + ' .node' + '>rect { ' + classes[className].styles.join('; ') + '; }\n';
|
1147 | }
|
1148 | if (classes.default.nodeLabelStyles instanceof Array) {
|
1149 | defaultStyles += '#' + svg.id.trim() + ' .node text ' + ' { ' + classes[className].nodeLabelStyles.join('; ') + '; }\n';
|
1150 | }
|
1151 | if (classes.default.edgeLabelStyles instanceof Array) {
|
1152 | defaultStyles += '#' + svg.id.trim() + ' .edgeLabel text ' + ' { ' + classes[className].edgeLabelStyles.join('; ') + '; }\n';
|
1153 | }
|
1154 | if (classes.default.clusterStyles instanceof Array) {
|
1155 | defaultStyles += '#' + svg.id.trim() + ' .cluster rect ' + ' { ' + classes[className].clusterStyles.join('; ') + '; }\n';
|
1156 | }
|
1157 | } else {
|
1158 | if (classes[className].styles instanceof Array) {
|
1159 | embeddedStyles += '#' + svg.id.trim() + ' .' + className + '>rect, .' + className + '>polygon, .' + className + '>circle, .' + className + '>ellipse { ' + classes[className].styles.join('; ') + '; }\n';
|
1160 | }
|
1161 | }
|
1162 | }
|
1163 | }
|
1164 |
|
1165 | if (usedStyles !== '' || defaultStyles !== '' || embeddedStyles !== '') {
|
1166 | var s = document.createElement('style');
|
1167 | s.setAttribute('type', 'text/css');
|
1168 | s.setAttribute('title', 'mermaid-svg-internal-css');
|
1169 | s.innerHTML = '/* <![CDATA[ */\n';
|
1170 |
|
1171 | if (defaultStyles !== '') {
|
1172 | s.innerHTML += defaultStyles;
|
1173 | }
|
1174 | if (usedStyles !== '') {
|
1175 | s.innerHTML += usedStyles;
|
1176 | }
|
1177 | if (embeddedStyles !== '') {
|
1178 | s.innerHTML += embeddedStyles;
|
1179 | }
|
1180 | s.innerHTML += '/* ]]> */\n';
|
1181 | svg.insertBefore(s, svg.firstChild);
|
1182 | }
|
1183 | };
|
1184 |
|
1185 | exports.cloneCssStyles = cloneCssStyles;
|
1186 |
|
1187 |
|
1188 |
|
1189 |
|
1190 |
|
1191 |
|
1192 |
|
1193 |
|
1194 | var isSubstringInArray = function isSubstringInArray(str, arr) {
|
1195 | for (var i = 0; i < arr.length; i++) {
|
1196 | if (arr[i].match(str)) return i;
|
1197 | }
|
1198 | return -1;
|
1199 | };
|
1200 |
|
1201 | exports.isSubstringInArray = isSubstringInArray;
|
1202 |
|
1203 | }),
|
1204 |
|
1205 | (function(module, exports, __webpack_require__) {
|
1206 |
|
1207 | "use strict";
|
1208 | (function(module) {
|
1209 |
|
1210 |
|
1211 |
|
1212 |
|
1213 |
|
1214 |
|
1215 |
|
1216 |
|
1217 |
|
1218 |
|
1219 |
|
1220 |
|
1221 |
|
1222 |
|
1223 |
|
1224 |
|
1225 |
|
1226 |
|
1227 |
|
1228 |
|
1229 |
|
1230 |
|
1231 |
|
1232 |
|
1233 |
|
1234 |
|
1235 |
|
1236 |
|
1237 |
|
1238 |
|
1239 |
|
1240 |
|
1241 |
|
1242 |
|
1243 |
|
1244 |
|
1245 |
|
1246 |
|
1247 |
|
1248 |
|
1249 |
|
1250 |
|
1251 |
|
1252 |
|
1253 |
|
1254 |
|
1255 |
|
1256 |
|
1257 |
|
1258 |
|
1259 |
|
1260 |
|
1261 |
|
1262 |
|
1263 |
|
1264 |
|
1265 |
|
1266 |
|
1267 |
|
1268 |
|
1269 |
|
1270 |
|
1271 |
|
1272 |
|
1273 |
|
1274 |
|
1275 |
|
1276 |
|
1277 |
|
1278 |
|
1279 |
|
1280 |
|
1281 |
|
1282 |
|
1283 | var parser = function () {
|
1284 | var o = function o(k, v, _o, l) {
|
1285 | for (_o = _o || {}, l = k.length; l--; _o[k[l]] = v) {}return _o;
|
1286 | },
|
1287 | $V0 = [1, 4],
|
1288 | $V1 = [1, 3],
|
1289 | $V2 = [1, 5],
|
1290 | $V3 = [1, 8, 9, 10, 11, 13, 18, 30, 46, 71, 72, 73, 74, 75, 81, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98],
|
1291 | $V4 = [2, 2],
|
1292 | $V5 = [1, 12],
|
1293 | $V6 = [1, 13],
|
1294 | $V7 = [1, 14],
|
1295 | $V8 = [1, 15],
|
1296 | $V9 = [1, 31],
|
1297 | $Va = [1, 33],
|
1298 | $Vb = [1, 22],
|
1299 | $Vc = [1, 34],
|
1300 | $Vd = [1, 24],
|
1301 | $Ve = [1, 25],
|
1302 | $Vf = [1, 26],
|
1303 | $Vg = [1, 27],
|
1304 | $Vh = [1, 28],
|
1305 | $Vi = [1, 38],
|
1306 | $Vj = [1, 40],
|
1307 | $Vk = [1, 35],
|
1308 | $Vl = [1, 39],
|
1309 | $Vm = [1, 45],
|
1310 | $Vn = [1, 44],
|
1311 | $Vo = [1, 36],
|
1312 | $Vp = [1, 37],
|
1313 | $Vq = [1, 41],
|
1314 | $Vr = [1, 42],
|
1315 | $Vs = [1, 43],
|
1316 | $Vt = [1, 8, 9, 10, 11, 13, 18, 30, 32, 46, 71, 72, 73, 74, 75, 81, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98],
|
1317 | $Vu = [1, 53],
|
1318 | $Vv = [1, 52],
|
1319 | $Vw = [1, 54],
|
1320 | $Vx = [1, 72],
|
1321 | $Vy = [1, 80],
|
1322 | $Vz = [1, 81],
|
1323 | $VA = [1, 66],
|
1324 | $VB = [1, 65],
|
1325 | $VC = [1, 85],
|
1326 | $VD = [1, 84],
|
1327 | $VE = [1, 82],
|
1328 | $VF = [1, 83],
|
1329 | $VG = [1, 73],
|
1330 | $VH = [1, 68],
|
1331 | $VI = [1, 67],
|
1332 | $VJ = [1, 63],
|
1333 | $VK = [1, 75],
|
1334 | $VL = [1, 76],
|
1335 | $VM = [1, 77],
|
1336 | $VN = [1, 78],
|
1337 | $VO = [1, 79],
|
1338 | $VP = [1, 70],
|
1339 | $VQ = [1, 69],
|
1340 | $VR = [8, 9, 11],
|
1341 | $VS = [8, 9, 11, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64],
|
1342 | $VT = [1, 115],
|
1343 | $VU = [8, 9, 10, 11, 13, 15, 18, 36, 38, 40, 42, 46, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 81, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98],
|
1344 | $VV = [8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 30, 32, 36, 37, 38, 39, 40, 41, 42, 43, 46, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 71, 72, 73, 74, 75, 78, 81, 84, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98],
|
1345 | $VW = [1, 117],
|
1346 | $VX = [1, 118],
|
1347 | $VY = [8, 9, 10, 11, 13, 18, 30, 32, 46, 71, 72, 73, 74, 75, 81, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98],
|
1348 | $VZ = [8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 30, 32, 37, 39, 41, 43, 46, 50, 51, 52, 53, 54, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 71, 72, 73, 74, 75, 78, 81, 84, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98],
|
1349 | $V_ = [13, 18, 46, 81, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98],
|
1350 | $V$ = [13, 18, 46, 49, 65, 81, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98],
|
1351 | $V01 = [1, 191],
|
1352 | $V11 = [1, 188],
|
1353 | $V21 = [1, 195],
|
1354 | $V31 = [1, 192],
|
1355 | $V41 = [1, 189],
|
1356 | $V51 = [1, 196],
|
1357 | $V61 = [1, 186],
|
1358 | $V71 = [1, 187],
|
1359 | $V81 = [1, 190],
|
1360 | $V91 = [1, 193],
|
1361 | $Va1 = [1, 194],
|
1362 | $Vb1 = [1, 213],
|
1363 | $Vc1 = [8, 9, 11, 86],
|
1364 | $Vd1 = [8, 9, 10, 11, 46, 71, 80, 81, 84, 86, 88, 89, 90, 91, 92];
|
1365 | var parser = { trace: function trace() {},
|
1366 | yy: {},
|
1367 | symbols_: { "error": 2, "mermaidDoc": 3, "graphConfig": 4, "document": 5, "line": 6, "statement": 7, "SEMI": 8, "NEWLINE": 9, "SPACE": 10, "EOF": 11, "GRAPH": 12, "DIR": 13, "FirstStmtSeperator": 14, "TAGEND": 15, "TAGSTART": 16, "UP": 17, "DOWN": 18, "ending": 19, "endToken": 20, "spaceList": 21, "spaceListNewline": 22, "verticeStatement": 23, "separator": 24, "styleStatement": 25, "linkStyleStatement": 26, "classDefStatement": 27, "classStatement": 28, "clickStatement": 29, "subgraph": 30, "text": 31, "end": 32, "vertex": 33, "link": 34, "alphaNum": 35, "SQS": 36, "SQE": 37, "PS": 38, "PE": 39, "(-": 40, "-)": 41, "DIAMOND_START": 42, "DIAMOND_STOP": 43, "alphaNumStatement": 44, "alphaNumToken": 45, "MINUS": 46, "linkStatement": 47, "arrowText": 48, "TESTSTR": 49, "--": 50, "ARROW_POINT": 51, "ARROW_CIRCLE": 52, "ARROW_CROSS": 53, "ARROW_OPEN": 54, "-.": 55, "DOTTED_ARROW_POINT": 56, "DOTTED_ARROW_CIRCLE": 57, "DOTTED_ARROW_CROSS": 58, "DOTTED_ARROW_OPEN": 59, "==": 60, "THICK_ARROW_POINT": 61, "THICK_ARROW_CIRCLE": 62, "THICK_ARROW_CROSS": 63, "THICK_ARROW_OPEN": 64, "PIPE": 65, "textToken": 66, "STR": 67, "commentText": 68, "commentToken": 69, "keywords": 70, "STYLE": 71, "LINKSTYLE": 72, "CLASSDEF": 73, "CLASS": 74, "CLICK": 75, "textNoTags": 76, "textNoTagsToken": 77, "DEFAULT": 78, "stylesOpt": 79, "HEX": 80, "NUM": 81, "INTERPOLATE": 82, "commentStatement": 83, "PCT": 84, "style": 85, "COMMA": 86, "styleComponent": 87, "ALPHA": 88, "COLON": 89, "UNIT": 90, "BRKT": 91, "DOT": 92, "graphCodeTokens": 93, "PUNCTUATION": 94, "UNICODE_TEXT": 95, "PLUS": 96, "EQUALS": 97, "MULT": 98, "TAG_START": 99, "TAG_END": 100, "QUOTE": 101, "$accept": 0, "$end": 1 },
|
1368 | terminals_: { 2: "error", 8: "SEMI", 9: "NEWLINE", 10: "SPACE", 11: "EOF", 12: "GRAPH", 13: "DIR", 15: "TAGEND", 16: "TAGSTART", 17: "UP", 18: "DOWN", 30: "subgraph", 32: "end", 36: "SQS", 37: "SQE", 38: "PS", 39: "PE", 40: "(-", 41: "-)", 42: "DIAMOND_START", 43: "DIAMOND_STOP", 46: "MINUS", 49: "TESTSTR", 50: "--", 51: "ARROW_POINT", 52: "ARROW_CIRCLE", 53: "ARROW_CROSS", 54: "ARROW_OPEN", 55: "-.", 56: "DOTTED_ARROW_POINT", 57: "DOTTED_ARROW_CIRCLE", 58: "DOTTED_ARROW_CROSS", 59: "DOTTED_ARROW_OPEN", 60: "==", 61: "THICK_ARROW_POINT", 62: "THICK_ARROW_CIRCLE", 63: "THICK_ARROW_CROSS", 64: "THICK_ARROW_OPEN", 65: "PIPE", 67: "STR", 71: "STYLE", 72: "LINKSTYLE", 73: "CLASSDEF", 74: "CLASS", 75: "CLICK", 78: "DEFAULT", 80: "HEX", 81: "NUM", 82: "INTERPOLATE", 84: "PCT", 86: "COMMA", 88: "ALPHA", 89: "COLON", 90: "UNIT", 91: "BRKT", 92: "DOT", 94: "PUNCTUATION", 95: "UNICODE_TEXT", 96: "PLUS", 97: "EQUALS", 98: "MULT", 99: "TAG_START", 100: "TAG_END", 101: "QUOTE" },
|
1369 | productions_: [0, [3, 2], [5, 0], [5, 2], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [4, 2], [4, 2], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [19, 2], [19, 1], [20, 1], [20, 1], [20, 1], [14, 1], [14, 1], [14, 2], [22, 2], [22, 2], [22, 1], [22, 1], [21, 2], [21, 1], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 5], [7, 4], [24, 1], [24, 1], [24, 1], [23, 3], [23, 1], [33, 4], [33, 5], [33, 6], [33, 7], [33, 4], [33, 5], [33, 4], [33, 5], [33, 4], [33, 5], [33, 4], [33, 5], [33, 1], [33, 2], [35, 1], [35, 2], [44, 1], [44, 1], [44, 1], [44, 1], [34, 2], [34, 3], [34, 3], [34, 1], [34, 3], [34, 3], [34, 3], [34, 3], [34, 3], [34, 3], [34, 3], [34, 3], [34, 3], [34, 3], [34, 3], [34, 3], [47, 1], [47, 1], [47, 1], [47, 1], [47, 1], [47, 1], [47, 1], [47, 1], [47, 1], [47, 1], [47, 1], [47, 1], [48, 3], [31, 1], [31, 2], [31, 1], [68, 1], [68, 2], [70, 1], [70, 1], [70, 1], [70, 1], [70, 1], [70, 1], [70, 1], [70, 1], [70, 1], [70, 1], [70, 1], [76, 1], [76, 2], [27, 5], [27, 5], [28, 5], [29, 5], [29, 7], [29, 5], [29, 7], [25, 5], [25, 5], [26, 5], [26, 5], [26, 9], [26, 9], [26, 7], [26, 7], [83, 3], [79, 1], [79, 3], [85, 1], [85, 2], [87, 1], [87, 1], [87, 1], [87, 1], [87, 1], [87, 1], [87, 1], [87, 1], [87, 1], [87, 1], [87, 1], [69, 1], [69, 1], [66, 1], [66, 1], [66, 1], [66, 1], [66, 1], [66, 1], [66, 1], [77, 1], [77, 1], [77, 1], [77, 1], [45, 1], [45, 1], [45, 1], [45, 1], [45, 1], [45, 1], [45, 1], [45, 1], [45, 1], [45, 1], [45, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1]],
|
1370 | performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
|
1371 |
|
1372 |
|
1373 | var $0 = $$.length - 1;
|
1374 | switch (yystate) {
|
1375 | case 2:
|
1376 | this.$ = [];
|
1377 | break;
|
1378 | case 3:
|
1379 |
|
1380 | if ($$[$0] !== []) {
|
1381 | $$[$0 - 1].push($$[$0]);
|
1382 | }
|
1383 | this.$ = $$[$0 - 1];
|
1384 | break;
|
1385 | case 4:case 57:case 59:case 60:case 92:case 94:case 95:case 108:
|
1386 | this.$ = $$[$0];
|
1387 | break;
|
1388 | case 11:
|
1389 | yy.setDirection($$[$0 - 1]);this.$ = $$[$0 - 1];
|
1390 | break;
|
1391 | case 12:
|
1392 | yy.setDirection("LR");this.$ = $$[$0 - 1];
|
1393 | break;
|
1394 | case 13:
|
1395 | yy.setDirection("RL");this.$ = $$[$0 - 1];
|
1396 | break;
|
1397 | case 14:
|
1398 | yy.setDirection("BT");this.$ = $$[$0 - 1];
|
1399 | break;
|
1400 | case 15:
|
1401 | yy.setDirection("TB");this.$ = $$[$0 - 1];
|
1402 | break;
|
1403 | case 30:
|
1404 | this.$ = $$[$0 - 1];
|
1405 | break;
|
1406 | case 31:case 32:case 33:case 34:case 35:
|
1407 | this.$ = [];
|
1408 | break;
|
1409 | case 36:
|
1410 | this.$ = yy.addSubGraph($$[$0 - 1], $$[$0 - 3]);
|
1411 | break;
|
1412 | case 37:
|
1413 | this.$ = yy.addSubGraph($$[$0 - 1], undefined);
|
1414 | break;
|
1415 | case 41:
|
1416 | yy.addLink($$[$0 - 2], $$[$0], $$[$0 - 1]);this.$ = [$$[$0 - 2], $$[$0]];
|
1417 | break;
|
1418 | case 42:
|
1419 | this.$ = [$$[$0]];
|
1420 | break;
|
1421 | case 43:
|
1422 | this.$ = $$[$0 - 3];yy.addVertex($$[$0 - 3], $$[$0 - 1], 'square');
|
1423 | break;
|
1424 | case 44:
|
1425 | this.$ = $$[$0 - 4];yy.addVertex($$[$0 - 4], $$[$0 - 2], 'square');
|
1426 | break;
|
1427 | case 45:
|
1428 | this.$ = $$[$0 - 5];yy.addVertex($$[$0 - 5], $$[$0 - 2], 'circle');
|
1429 | break;
|
1430 | case 46:
|
1431 | this.$ = $$[$0 - 6];yy.addVertex($$[$0 - 6], $$[$0 - 3], 'circle');
|
1432 | break;
|
1433 | case 47:
|
1434 | this.$ = $$[$0 - 3];yy.addVertex($$[$0 - 3], $$[$0 - 1], 'ellipse');
|
1435 | break;
|
1436 | case 48:
|
1437 | this.$ = $$[$0 - 4];yy.addVertex($$[$0 - 4], $$[$0 - 2], 'ellipse');
|
1438 | break;
|
1439 | case 49:
|
1440 | this.$ = $$[$0 - 3];yy.addVertex($$[$0 - 3], $$[$0 - 1], 'round');
|
1441 | break;
|
1442 | case 50:
|
1443 | this.$ = $$[$0 - 4];yy.addVertex($$[$0 - 4], $$[$0 - 2], 'round');
|
1444 | break;
|
1445 | case 51:
|
1446 | this.$ = $$[$0 - 3];yy.addVertex($$[$0 - 3], $$[$0 - 1], 'diamond');
|
1447 | break;
|
1448 | case 52:
|
1449 | this.$ = $$[$0 - 4];yy.addVertex($$[$0 - 4], $$[$0 - 2], 'diamond');
|
1450 | break;
|
1451 | case 53:
|
1452 | this.$ = $$[$0 - 3];yy.addVertex($$[$0 - 3], $$[$0 - 1], 'odd');
|
1453 | break;
|
1454 | case 54:
|
1455 | this.$ = $$[$0 - 4];yy.addVertex($$[$0 - 4], $$[$0 - 2], 'odd');
|
1456 | break;
|
1457 | case 55:
|
1458 | this.$ = $$[$0];yy.addVertex($$[$0]);
|
1459 | break;
|
1460 | case 56:
|
1461 | this.$ = $$[$0 - 1];yy.addVertex($$[$0 - 1]);
|
1462 | break;
|
1463 | case 58:case 93:case 96:case 109:
|
1464 | this.$ = $$[$0 - 1] + '' + $$[$0];
|
1465 | break;
|
1466 | case 61:
|
1467 | this.$ = 'v';
|
1468 | break;
|
1469 | case 62:
|
1470 | this.$ = '-';
|
1471 | break;
|
1472 | case 63:
|
1473 | $$[$0 - 1].text = $$[$0];this.$ = $$[$0 - 1];
|
1474 | break;
|
1475 | case 64:case 65:
|
1476 | $$[$0 - 2].text = $$[$0 - 1];this.$ = $$[$0 - 2];
|
1477 | break;
|
1478 | case 66:
|
1479 | this.$ = $$[$0];
|
1480 | break;
|
1481 | case 67:
|
1482 | this.$ = { "type": "arrow", "stroke": "normal", "text": $$[$0 - 1] };
|
1483 | break;
|
1484 | case 68:
|
1485 | this.$ = { "type": "arrow_circle", "stroke": "normal", "text": $$[$0 - 1] };
|
1486 | break;
|
1487 | case 69:
|
1488 | this.$ = { "type": "arrow_cross", "stroke": "normal", "text": $$[$0 - 1] };
|
1489 | break;
|
1490 | case 70:
|
1491 | this.$ = { "type": "arrow_open", "stroke": "normal", "text": $$[$0 - 1] };
|
1492 | break;
|
1493 | case 71:
|
1494 | this.$ = { "type": "arrow", "stroke": "dotted", "text": $$[$0 - 1] };
|
1495 | break;
|
1496 | case 72:
|
1497 | this.$ = { "type": "arrow_circle", "stroke": "dotted", "text": $$[$0 - 1] };
|
1498 | break;
|
1499 | case 73:
|
1500 | this.$ = { "type": "arrow_cross", "stroke": "dotted", "text": $$[$0 - 1] };
|
1501 | break;
|
1502 | case 74:
|
1503 | this.$ = { "type": "arrow_open", "stroke": "dotted", "text": $$[$0 - 1] };
|
1504 | break;
|
1505 | case 75:
|
1506 | this.$ = { "type": "arrow", "stroke": "thick", "text": $$[$0 - 1] };
|
1507 | break;
|
1508 | case 76:
|
1509 | this.$ = { "type": "arrow_circle", "stroke": "thick", "text": $$[$0 - 1] };
|
1510 | break;
|
1511 | case 77:
|
1512 | this.$ = { "type": "arrow_cross", "stroke": "thick", "text": $$[$0 - 1] };
|
1513 | break;
|
1514 | case 78:
|
1515 | this.$ = { "type": "arrow_open", "stroke": "thick", "text": $$[$0 - 1] };
|
1516 | break;
|
1517 | case 79:
|
1518 | this.$ = { "type": "arrow", "stroke": "normal" };
|
1519 | break;
|
1520 | case 80:
|
1521 | this.$ = { "type": "arrow_circle", "stroke": "normal" };
|
1522 | break;
|
1523 | case 81:
|
1524 | this.$ = { "type": "arrow_cross", "stroke": "normal" };
|
1525 | break;
|
1526 | case 82:
|
1527 | this.$ = { "type": "arrow_open", "stroke": "normal" };
|
1528 | break;
|
1529 | case 83:
|
1530 | this.$ = { "type": "arrow", "stroke": "dotted" };
|
1531 | break;
|
1532 | case 84:
|
1533 | this.$ = { "type": "arrow_circle", "stroke": "dotted" };
|
1534 | break;
|
1535 | case 85:
|
1536 | this.$ = { "type": "arrow_cross", "stroke": "dotted" };
|
1537 | break;
|
1538 | case 86:
|
1539 | this.$ = { "type": "arrow_open", "stroke": "dotted" };
|
1540 | break;
|
1541 | case 87:
|
1542 | this.$ = { "type": "arrow", "stroke": "thick" };
|
1543 | break;
|
1544 | case 88:
|
1545 | this.$ = { "type": "arrow_circle", "stroke": "thick" };
|
1546 | break;
|
1547 | case 89:
|
1548 | this.$ = { "type": "arrow_cross", "stroke": "thick" };
|
1549 | break;
|
1550 | case 90:
|
1551 | this.$ = { "type": "arrow_open", "stroke": "thick" };
|
1552 | break;
|
1553 | case 91:
|
1554 | this.$ = $$[$0 - 1];
|
1555 | break;
|
1556 | case 110:case 111:
|
1557 | this.$ = $$[$0 - 4];yy.addClass($$[$0 - 2], $$[$0]);
|
1558 | break;
|
1559 | case 112:
|
1560 | this.$ = $$[$0 - 4];yy.setClass($$[$0 - 2], $$[$0]);
|
1561 | break;
|
1562 | case 113:
|
1563 | this.$ = $$[$0 - 4];yy.setClickEvent($$[$0 - 2], $$[$0], undefined, undefined);
|
1564 | break;
|
1565 | case 114:
|
1566 | this.$ = $$[$0 - 6];yy.setClickEvent($$[$0 - 4], $$[$0 - 2], undefined, $$[$0]);
|
1567 | break;
|
1568 | case 115:
|
1569 | this.$ = $$[$0 - 4];yy.setClickEvent($$[$0 - 2], undefined, $$[$0], undefined);
|
1570 | break;
|
1571 | case 116:
|
1572 | this.$ = $$[$0 - 6];yy.setClickEvent($$[$0 - 4], undefined, $$[$0 - 2], $$[$0]);
|
1573 | break;
|
1574 | case 117:
|
1575 | this.$ = $$[$0 - 4];yy.addVertex($$[$0 - 2], undefined, undefined, $$[$0]);
|
1576 | break;
|
1577 | case 118:case 119:case 120:
|
1578 | this.$ = $$[$0 - 4];yy.updateLink($$[$0 - 2], $$[$0]);
|
1579 | break;
|
1580 | case 121:case 122:
|
1581 | this.$ = $$[$0 - 8];yy.updateLinkInterpolate($$[$0 - 6], $$[$0 - 2]);yy.updateLink($$[$0 - 6], $$[$0]);
|
1582 | break;
|
1583 | case 123:case 124:
|
1584 | this.$ = $$[$0 - 6];yy.updateLinkInterpolate($$[$0 - 4], $$[$0]);
|
1585 | break;
|
1586 | case 126:
|
1587 | this.$ = [$$[$0]];
|
1588 | break;
|
1589 | case 127:
|
1590 | $$[$0 - 2].push($$[$0]);this.$ = $$[$0 - 2];
|
1591 | break;
|
1592 | case 129:
|
1593 | this.$ = $$[$0 - 1] + $$[$0];
|
1594 | break;
|
1595 | }
|
1596 | },
|
1597 | table: [{ 3: 1, 4: 2, 9: $V0, 10: $V1, 12: $V2 }, { 1: [3] }, o($V3, $V4, { 5: 6 }), { 4: 7, 9: $V0, 10: $V1, 12: $V2 }, { 4: 8, 9: $V0, 10: $V1, 12: $V2 }, { 10: [1, 9] }, { 1: [2, 1], 6: 10, 7: 11, 8: $V5, 9: $V6, 10: $V7, 11: $V8, 13: $V9, 18: $Va, 23: 16, 25: 17, 26: 18, 27: 19, 28: 20, 29: 21, 30: $Vb, 33: 23, 35: 29, 44: 30, 45: 32, 46: $Vc, 71: $Vd, 72: $Ve, 73: $Vf, 74: $Vg, 75: $Vh, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($V3, [2, 9]), o($V3, [2, 10]), { 13: [1, 46], 15: [1, 47], 16: [1, 48], 17: [1, 49], 18: [1, 50] }, o($Vt, [2, 3]), o($Vt, [2, 4]), o($Vt, [2, 5]), o($Vt, [2, 6]), o($Vt, [2, 7]), o($Vt, [2, 8]), { 8: $Vu, 9: $Vv, 11: $Vw, 24: 51 }, { 8: $Vu, 9: $Vv, 11: $Vw, 24: 55 }, { 8: $Vu, 9: $Vv, 11: $Vw, 24: 56 }, { 8: $Vu, 9: $Vv, 11: $Vw, 24: 57 }, { 8: $Vu, 9: $Vv, 11: $Vw, 24: 58 }, { 8: $Vu, 9: $Vv, 11: $Vw, 24: 59 }, { 8: $Vu, 9: $Vv, 10: $Vx, 11: $Vw, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 24: 61, 30: $VE, 31: 60, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($VR, [2, 42], { 34: 86, 47: 87, 50: [1, 88], 51: [1, 91], 52: [1, 92], 53: [1, 93], 54: [1, 94], 55: [1, 89], 56: [1, 95], 57: [1, 96], 58: [1, 97], 59: [1, 98], 60: [1, 90], 61: [1, 99], 62: [1, 100], 63: [1, 101], 64: [1, 102] }), { 10: [1, 103] }, { 10: [1, 104] }, { 10: [1, 105] }, { 10: [1, 106] }, { 10: [1, 107] }, o($VS, [2, 55], { 45: 32, 21: 113, 44: 114, 10: $VT, 13: $V9, 15: [1, 112], 18: $Va, 36: [1, 108], 38: [1, 109], 40: [1, 110], 42: [1, 111], 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }), o($VU, [2, 57]), o($VU, [2, 59]), o($VU, [2, 60]), o($VU, [2, 61]), o($VU, [2, 62]), o($VV, [2, 154]), o($VV, [2, 155]), o($VV, [2, 156]), o($VV, [2, 157]), o($VV, [2, 158]), o($VV, [2, 159]), o($VV, [2, 160]), o($VV, [2, 161]), o($VV, [2, 162]), o($VV, [2, 163]), o($VV, [2, 164]), { 8: $VW, 9: $VX, 10: $VT, 14: 116, 21: 119 }, { 8: $VW, 9: $VX, 10: $VT, 14: 120, 21: 119 }, { 8: $VW, 9: $VX, 10: $VT, 14: 121, 21: 119 }, { 8: $VW, 9: $VX, 10: $VT, 14: 122, 21: 119 }, { 8: $VW, 9: $VX, 10: $VT, 14: 123, 21: 119 }, o($Vt, [2, 30]), o($Vt, [2, 38]), o($Vt, [2, 39]), o($Vt, [2, 40]), o($Vt, [2, 31]), o($Vt, [2, 32]), o($Vt, [2, 33]), o($Vt, [2, 34]), o($Vt, [2, 35]), { 8: $Vu, 9: $Vv, 10: $Vx, 11: $Vw, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 24: 124, 30: $VE, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($VY, $V4, { 5: 126 }), o($VZ, [2, 92]), o($VZ, [2, 94]), o($VZ, [2, 143]), o($VZ, [2, 144]), o($VZ, [2, 145]), o($VZ, [2, 146]), o($VZ, [2, 147]), o($VZ, [2, 148]), o($VZ, [2, 149]), o($VZ, [2, 150]), o($VZ, [2, 151]), o($VZ, [2, 152]), o($VZ, [2, 153]), o($VZ, [2, 97]), o($VZ, [2, 98]), o($VZ, [2, 99]), o($VZ, [2, 100]), o($VZ, [2, 101]), o($VZ, [2, 102]), o($VZ, [2, 103]), o($VZ, [2, 104]), o($VZ, [2, 105]), o($VZ, [2, 106]), o($VZ, [2, 107]), { 13: $V9, 18: $Va, 33: 127, 35: 29, 44: 30, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($V_, [2, 66], { 48: 128, 49: [1, 129], 65: [1, 130] }), { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 131, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 132, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 133, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($V$, [2, 79]), o($V$, [2, 80]), o($V$, [2, 81]), o($V$, [2, 82]), o($V$, [2, 83]), o($V$, [2, 84]), o($V$, [2, 85]), o($V$, [2, 86]), o($V$, [2, 87]), o($V$, [2, 88]), o($V$, [2, 89]), o($V$, [2, 90]), { 13: $V9, 18: $Va, 35: 134, 44: 30, 45: 32, 46: $Vc, 80: [1, 135], 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 78: [1, 136], 81: [1, 137] }, { 13: $V9, 18: $Va, 35: 139, 44: 30, 45: 32, 46: $Vc, 78: [1, 138], 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 13: $V9, 18: $Va, 35: 140, 44: 30, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 13: $V9, 18: $Va, 35: 141, 44: 30, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 142, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 144, 32: $VF, 38: [1, 143], 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 145, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 146, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 147, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($VS, [2, 56]), o($VU, [2, 58]), o($VS, [2, 29], { 21: 148, 10: $VT }), o($V3, [2, 11]), o($V3, [2, 21]), o($V3, [2, 22]), { 9: [1, 149] }, o($V3, [2, 12]), o($V3, [2, 13]), o($V3, [2, 14]), o($V3, [2, 15]), o($VY, $V4, { 5: 150 }), o($VZ, [2, 93]), { 6: 10, 7: 11, 8: $V5, 9: $V6, 10: $V7, 11: $V8, 13: $V9, 18: $Va, 23: 16, 25: 17, 26: 18, 27: 19, 28: 20, 29: 21, 30: $Vb, 32: [1, 151], 33: 23, 35: 29, 44: 30, 45: 32, 46: $Vc, 71: $Vd, 72: $Ve, 73: $Vf, 74: $Vg, 75: $Vh, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($VR, [2, 41]), o($V_, [2, 63], { 10: [1, 152] }), { 10: [1, 153] }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 154, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 45: 71, 46: $VG, 50: $VH, 51: [1, 155], 52: [1, 156], 53: [1, 157], 54: [1, 158], 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 45: 71, 46: $VG, 50: $VH, 56: [1, 159], 57: [1, 160], 58: [1, 161], 59: [1, 162], 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 61: [1, 163], 62: [1, 164], 63: [1, 165], 64: [1, 166], 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: [1, 167], 13: $V9, 18: $Va, 44: 114, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: [1, 168] }, { 10: [1, 169] }, { 10: [1, 170] }, { 10: [1, 171] }, { 10: [1, 172], 13: $V9, 18: $Va, 44: 114, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: [1, 173], 13: $V9, 18: $Va, 44: 114, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: [1, 174], 13: $V9, 18: $Va, 44: 114, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 37: [1, 175], 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 176, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 39: [1, 177], 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 41: [1, 178], 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 43: [1, 179], 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 37: [1, 180], 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($VS, [2, 28]), o($V3, [2, 23]), { 6: 10, 7: 11, 8: $V5, 9: $V6, 10: $V7, 11: $V8, 13: $V9, 18: $Va, 23: 16, 25: 17, 26: 18, 27: 19, 28: 20, 29: 21, 30: $Vb, 32: [1, 181], 33: 23, 35: 29, 44: 30, 45: 32, 46: $Vc, 71: $Vd, 72: $Ve, 73: $Vf, 74: $Vg, 75: $Vh, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($Vt, [2, 37]), o($V_, [2, 65]), o($V_, [2, 64]), { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 65: [1, 182], 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($V_, [2, 67]), o($V_, [2, 68]), o($V_, [2, 69]), o($V_, [2, 70]), o($V_, [2, 71]), o($V_, [2, 72]), o($V_, [2, 73]), o($V_, [2, 74]), o($V_, [2, 75]), o($V_, [2, 76]), o($V_, [2, 77]), o($V_, [2, 78]), { 10: $V01, 46: $V11, 71: $V21, 79: 183, 80: $V31, 81: $V41, 84: $V51, 85: 184, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1 }, { 10: $V01, 46: $V11, 71: $V21, 79: 197, 80: $V31, 81: $V41, 84: $V51, 85: 184, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1 }, { 10: $V01, 46: $V11, 71: $V21, 79: 198, 80: $V31, 81: $V41, 82: [1, 199], 84: $V51, 85: 184, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1 }, { 10: $V01, 46: $V11, 71: $V21, 79: 200, 80: $V31, 81: $V41, 82: [1, 201], 84: $V51, 85: 184, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1 }, { 10: $V01, 46: $V11, 71: $V21, 79: 202, 80: $V31, 81: $V41, 84: $V51, 85: 184, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1 }, { 10: $V01, 46: $V11, 71: $V21, 79: 203, 80: $V31, 81: $V41, 84: $V51, 85: 184, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1 }, { 13: $V9, 18: $Va, 35: 204, 44: 30, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 13: $V9, 18: $Va, 35: 205, 44: 30, 45: 32, 46: $Vc, 67: [1, 206], 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($VS, [2, 43], { 21: 207, 10: $VT }), { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 39: [1, 208], 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($VS, [2, 49], { 21: 209, 10: $VT }), o($VS, [2, 47], { 21: 210, 10: $VT }), o($VS, [2, 51], { 21: 211, 10: $VT }), o($VS, [2, 53], { 21: 212, 10: $VT }), o($Vt, [2, 36]), o([10, 13, 18, 46, 81, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98], [2, 91]), o($VR, [2, 117], { 86: $Vb1 }), o($Vc1, [2, 126], { 87: 214, 10: $V01, 46: $V11, 71: $V21, 80: $V31, 81: $V41, 84: $V51, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1 }), o($Vd1, [2, 128]), o($Vd1, [2, 130]), o($Vd1, [2, 131]), o($Vd1, [2, 132]), o($Vd1, [2, 133]), o($Vd1, [2, 134]), o($Vd1, [2, 135]), o($Vd1, [2, 136]), o($Vd1, [2, 137]), o($Vd1, [2, 138]), o($Vd1, [2, 139]), o($Vd1, [2, 140]), o($VR, [2, 118], { 86: $Vb1 }), o($VR, [2, 119], { 86: $Vb1 }), { 10: [1, 215] }, o($VR, [2, 120], { 86: $Vb1 }), { 10: [1, 216] }, o($VR, [2, 110], { 86: $Vb1 }), o($VR, [2, 111], { 86: $Vb1 }), o($VR, [2, 112], { 45: 32, 44: 114, 13: $V9, 18: $Va, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }), o($VR, [2, 113], { 45: 32, 44: 114, 10: [1, 217], 13: $V9, 18: $Va, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }), o($VR, [2, 115], { 10: [1, 218] }), o($VS, [2, 44]), { 39: [1, 219] }, o($VS, [2, 50]), o($VS, [2, 48]), o($VS, [2, 52]), o($VS, [2, 54]), { 10: $V01, 46: $V11, 71: $V21, 80: $V31, 81: $V41, 84: $V51, 85: 220, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1 }, o($Vd1, [2, 129]), { 13: $V9, 18: $Va, 35: 221, 44: 30, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 13: $V9, 18: $Va, 35: 222, 44: 30, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 67: [1, 223] }, { 67: [1, 224] }, o($VS, [2, 45], { 21: 225, 10: $VT }), o($Vc1, [2, 127], { 87: 214, 10: $V01, 46: $V11, 71: $V21, 80: $V31, 81: $V41, 84: $V51, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1 }), o($VR, [2, 123], { 45: 32, 44: 114, 10: [1, 226], 13: $V9, 18: $Va, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }), o($VR, [2, 124], { 45: 32, 44: 114, 10: [1, 227], 13: $V9, 18: $Va, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }), o($VR, [2, 114]), o($VR, [2, 116]), o($VS, [2, 46]), { 10: $V01, 46: $V11, 71: $V21, 79: 228, 80: $V31, 81: $V41, 84: $V51, 85: 184, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1 }, { 10: $V01, 46: $V11, 71: $V21, 79: 229, 80: $V31, 81: $V41, 84: $V51, 85: 184, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1 }, o($VR, [2, 121], { 86: $Vb1 }), o($VR, [2, 122], { 86: $Vb1 })],
|
1598 | defaultActions: {},
|
1599 | parseError: function parseError(str, hash) {
|
1600 | if (hash.recoverable) {
|
1601 | this.trace(str);
|
1602 | } else {
|
1603 | var _parseError = function _parseError(msg, hash) {
|
1604 | this.message = msg;
|
1605 | this.hash = hash;
|
1606 | };
|
1607 |
|
1608 | _parseError.prototype = Error;
|
1609 |
|
1610 | throw new _parseError(str, hash);
|
1611 | }
|
1612 | },
|
1613 | parse: function parse(input) {
|
1614 | var self = this,
|
1615 | stack = [0],
|
1616 | tstack = [],
|
1617 | vstack = [null],
|
1618 | lstack = [],
|
1619 | table = this.table,
|
1620 | yytext = '',
|
1621 | yylineno = 0,
|
1622 | yyleng = 0,
|
1623 | recovering = 0,
|
1624 | TERROR = 2,
|
1625 | EOF = 1;
|
1626 | var args = lstack.slice.call(arguments, 1);
|
1627 | var lexer = Object.create(this.lexer);
|
1628 | var sharedState = { yy: {} };
|
1629 | for (var k in this.yy) {
|
1630 | if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
|
1631 | sharedState.yy[k] = this.yy[k];
|
1632 | }
|
1633 | }
|
1634 | lexer.setInput(input, sharedState.yy);
|
1635 | sharedState.yy.lexer = lexer;
|
1636 | sharedState.yy.parser = this;
|
1637 | if (typeof lexer.yylloc == 'undefined') {
|
1638 | lexer.yylloc = {};
|
1639 | }
|
1640 | var yyloc = lexer.yylloc;
|
1641 | lstack.push(yyloc);
|
1642 | var ranges = lexer.options && lexer.options.ranges;
|
1643 | if (typeof sharedState.yy.parseError === 'function') {
|
1644 | this.parseError = sharedState.yy.parseError;
|
1645 | } else {
|
1646 | this.parseError = Object.getPrototypeOf(this).parseError;
|
1647 | }
|
1648 | function popStack(n) {
|
1649 | stack.length = stack.length - 2 * n;
|
1650 | vstack.length = vstack.length - n;
|
1651 | lstack.length = lstack.length - n;
|
1652 | }
|
1653 | function lex() {
|
1654 | var token;
|
1655 | token = tstack.pop() || lexer.lex() || EOF;
|
1656 | if (typeof token !== 'number') {
|
1657 | if (token instanceof Array) {
|
1658 | tstack = token;
|
1659 | token = tstack.pop();
|
1660 | }
|
1661 | token = self.symbols_[token] || token;
|
1662 | }
|
1663 | return token;
|
1664 | }
|
1665 | var symbol,
|
1666 | preErrorSymbol,
|
1667 | state,
|
1668 | action,
|
1669 | a,
|
1670 | r,
|
1671 | yyval = {},
|
1672 | p,
|
1673 | len,
|
1674 | newState,
|
1675 | expected;
|
1676 | while (true) {
|
1677 | state = stack[stack.length - 1];
|
1678 | if (this.defaultActions[state]) {
|
1679 | action = this.defaultActions[state];
|
1680 | } else {
|
1681 | if (symbol === null || typeof symbol == 'undefined') {
|
1682 | symbol = lex();
|
1683 | }
|
1684 | action = table[state] && table[state][symbol];
|
1685 | }
|
1686 | if (typeof action === 'undefined' || !action.length || !action[0]) {
|
1687 | var errStr = '';
|
1688 | expected = [];
|
1689 | for (p in table[state]) {
|
1690 | if (this.terminals_[p] && p > TERROR) {
|
1691 | expected.push('\'' + this.terminals_[p] + '\'');
|
1692 | }
|
1693 | }
|
1694 | if (lexer.showPosition) {
|
1695 | errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
|
1696 | } else {
|
1697 | errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
|
1698 | }
|
1699 | this.parseError(errStr, {
|
1700 | text: lexer.match,
|
1701 | token: this.terminals_[symbol] || symbol,
|
1702 | line: lexer.yylineno,
|
1703 | loc: yyloc,
|
1704 | expected: expected
|
1705 | });
|
1706 | }
|
1707 | if (action[0] instanceof Array && action.length > 1) {
|
1708 | throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
|
1709 | }
|
1710 | switch (action[0]) {
|
1711 | case 1:
|
1712 | stack.push(symbol);
|
1713 | vstack.push(lexer.yytext);
|
1714 | lstack.push(lexer.yylloc);
|
1715 | stack.push(action[1]);
|
1716 | symbol = null;
|
1717 | if (!preErrorSymbol) {
|
1718 | yyleng = lexer.yyleng;
|
1719 | yytext = lexer.yytext;
|
1720 | yylineno = lexer.yylineno;
|
1721 | yyloc = lexer.yylloc;
|
1722 | if (recovering > 0) {
|
1723 | recovering--;
|
1724 | }
|
1725 | } else {
|
1726 | symbol = preErrorSymbol;
|
1727 | preErrorSymbol = null;
|
1728 | }
|
1729 | break;
|
1730 | case 2:
|
1731 | len = this.productions_[action[1]][1];
|
1732 | yyval.$ = vstack[vstack.length - len];
|
1733 | yyval._$ = {
|
1734 | first_line: lstack[lstack.length - (len || 1)].first_line,
|
1735 | last_line: lstack[lstack.length - 1].last_line,
|
1736 | first_column: lstack[lstack.length - (len || 1)].first_column,
|
1737 | last_column: lstack[lstack.length - 1].last_column
|
1738 | };
|
1739 | if (ranges) {
|
1740 | yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
|
1741 | }
|
1742 | r = this.performAction.apply(yyval, [yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack].concat(args));
|
1743 | if (typeof r !== 'undefined') {
|
1744 | return r;
|
1745 | }
|
1746 | if (len) {
|
1747 | stack = stack.slice(0, -1 * len * 2);
|
1748 | vstack = vstack.slice(0, -1 * len);
|
1749 | lstack = lstack.slice(0, -1 * len);
|
1750 | }
|
1751 | stack.push(this.productions_[action[1]][0]);
|
1752 | vstack.push(yyval.$);
|
1753 | lstack.push(yyval._$);
|
1754 | newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
|
1755 | stack.push(newState);
|
1756 | break;
|
1757 | case 3:
|
1758 | return true;
|
1759 | }
|
1760 | }
|
1761 | return true;
|
1762 | } };
|
1763 |
|
1764 |
|
1765 | var lexer = function () {
|
1766 | var lexer = {
|
1767 |
|
1768 | EOF: 1,
|
1769 |
|
1770 | parseError: function parseError(str, hash) {
|
1771 | if (this.yy.parser) {
|
1772 | this.yy.parser.parseError(str, hash);
|
1773 | } else {
|
1774 | throw new Error(str);
|
1775 | }
|
1776 | },
|
1777 |
|
1778 |
|
1779 | setInput: function setInput(input, yy) {
|
1780 | this.yy = yy || this.yy || {};
|
1781 | this._input = input;
|
1782 | this._more = this._backtrack = this.done = false;
|
1783 | this.yylineno = this.yyleng = 0;
|
1784 | this.yytext = this.matched = this.match = '';
|
1785 | this.conditionStack = ['INITIAL'];
|
1786 | this.yylloc = {
|
1787 | first_line: 1,
|
1788 | first_column: 0,
|
1789 | last_line: 1,
|
1790 | last_column: 0
|
1791 | };
|
1792 | if (this.options.ranges) {
|
1793 | this.yylloc.range = [0, 0];
|
1794 | }
|
1795 | this.offset = 0;
|
1796 | return this;
|
1797 | },
|
1798 |
|
1799 |
|
1800 | input: function input() {
|
1801 | var ch = this._input[0];
|
1802 | this.yytext += ch;
|
1803 | this.yyleng++;
|
1804 | this.offset++;
|
1805 | this.match += ch;
|
1806 | this.matched += ch;
|
1807 | var lines = ch.match(/(?:\r\n?|\n).*/g);
|
1808 | if (lines) {
|
1809 | this.yylineno++;
|
1810 | this.yylloc.last_line++;
|
1811 | } else {
|
1812 | this.yylloc.last_column++;
|
1813 | }
|
1814 | if (this.options.ranges) {
|
1815 | this.yylloc.range[1]++;
|
1816 | }
|
1817 |
|
1818 | this._input = this._input.slice(1);
|
1819 | return ch;
|
1820 | },
|
1821 |
|
1822 |
|
1823 | unput: function unput(ch) {
|
1824 | var len = ch.length;
|
1825 | var lines = ch.split(/(?:\r\n?|\n)/g);
|
1826 |
|
1827 | this._input = ch + this._input;
|
1828 | this.yytext = this.yytext.substr(0, this.yytext.length - len);
|
1829 |
|
1830 | this.offset -= len;
|
1831 | var oldLines = this.match.split(/(?:\r\n?|\n)/g);
|
1832 | this.match = this.match.substr(0, this.match.length - 1);
|
1833 | this.matched = this.matched.substr(0, this.matched.length - 1);
|
1834 |
|
1835 | if (lines.length - 1) {
|
1836 | this.yylineno -= lines.length - 1;
|
1837 | }
|
1838 | var r = this.yylloc.range;
|
1839 |
|
1840 | this.yylloc = {
|
1841 | first_line: this.yylloc.first_line,
|
1842 | last_line: this.yylineno + 1,
|
1843 | first_column: this.yylloc.first_column,
|
1844 | 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
|
1845 | };
|
1846 |
|
1847 | if (this.options.ranges) {
|
1848 | this.yylloc.range = [r[0], r[0] + this.yyleng - len];
|
1849 | }
|
1850 | this.yyleng = this.yytext.length;
|
1851 | return this;
|
1852 | },
|
1853 |
|
1854 |
|
1855 | more: function more() {
|
1856 | this._more = true;
|
1857 | return this;
|
1858 | },
|
1859 |
|
1860 |
|
1861 | reject: function reject() {
|
1862 | if (this.options.backtrack_lexer) {
|
1863 | this._backtrack = true;
|
1864 | } else {
|
1865 | 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(), {
|
1866 | text: "",
|
1867 | token: null,
|
1868 | line: this.yylineno
|
1869 | });
|
1870 | }
|
1871 | return this;
|
1872 | },
|
1873 |
|
1874 |
|
1875 | less: function less(n) {
|
1876 | this.unput(this.match.slice(n));
|
1877 | },
|
1878 |
|
1879 |
|
1880 | pastInput: function pastInput() {
|
1881 | var past = this.matched.substr(0, this.matched.length - this.match.length);
|
1882 | return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, "");
|
1883 | },
|
1884 |
|
1885 |
|
1886 | upcomingInput: function upcomingInput() {
|
1887 | var next = this.match;
|
1888 | if (next.length < 20) {
|
1889 | next += this._input.substr(0, 20 - next.length);
|
1890 | }
|
1891 | return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
|
1892 | },
|
1893 |
|
1894 |
|
1895 | showPosition: function showPosition() {
|
1896 | var pre = this.pastInput();
|
1897 | var c = new Array(pre.length + 1).join("-");
|
1898 | return pre + this.upcomingInput() + "\n" + c + "^";
|
1899 | },
|
1900 |
|
1901 |
|
1902 | test_match: function test_match(match, indexed_rule) {
|
1903 | var token, lines, backup;
|
1904 |
|
1905 | if (this.options.backtrack_lexer) {
|
1906 |
|
1907 | backup = {
|
1908 | yylineno: this.yylineno,
|
1909 | yylloc: {
|
1910 | first_line: this.yylloc.first_line,
|
1911 | last_line: this.last_line,
|
1912 | first_column: this.yylloc.first_column,
|
1913 | last_column: this.yylloc.last_column
|
1914 | },
|
1915 | yytext: this.yytext,
|
1916 | match: this.match,
|
1917 | matches: this.matches,
|
1918 | matched: this.matched,
|
1919 | yyleng: this.yyleng,
|
1920 | offset: this.offset,
|
1921 | _more: this._more,
|
1922 | _input: this._input,
|
1923 | yy: this.yy,
|
1924 | conditionStack: this.conditionStack.slice(0),
|
1925 | done: this.done
|
1926 | };
|
1927 | if (this.options.ranges) {
|
1928 | backup.yylloc.range = this.yylloc.range.slice(0);
|
1929 | }
|
1930 | }
|
1931 |
|
1932 | lines = match[0].match(/(?:\r\n?|\n).*/g);
|
1933 | if (lines) {
|
1934 | this.yylineno += lines.length;
|
1935 | }
|
1936 | this.yylloc = {
|
1937 | first_line: this.yylloc.last_line,
|
1938 | last_line: this.yylineno + 1,
|
1939 | first_column: this.yylloc.last_column,
|
1940 | last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
|
1941 | };
|
1942 | this.yytext += match[0];
|
1943 | this.match += match[0];
|
1944 | this.matches = match;
|
1945 | this.yyleng = this.yytext.length;
|
1946 | if (this.options.ranges) {
|
1947 | this.yylloc.range = [this.offset, this.offset += this.yyleng];
|
1948 | }
|
1949 | this._more = false;
|
1950 | this._backtrack = false;
|
1951 | this._input = this._input.slice(match[0].length);
|
1952 | this.matched += match[0];
|
1953 | token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
|
1954 | if (this.done && this._input) {
|
1955 | this.done = false;
|
1956 | }
|
1957 | if (token) {
|
1958 | return token;
|
1959 | } else if (this._backtrack) {
|
1960 |
|
1961 | for (var k in backup) {
|
1962 | this[k] = backup[k];
|
1963 | }
|
1964 | return false;
|
1965 | }
|
1966 | return false;
|
1967 | },
|
1968 |
|
1969 |
|
1970 | next: function next() {
|
1971 | if (this.done) {
|
1972 | return this.EOF;
|
1973 | }
|
1974 | if (!this._input) {
|
1975 | this.done = true;
|
1976 | }
|
1977 |
|
1978 | var token, match, tempMatch, index;
|
1979 | if (!this._more) {
|
1980 | this.yytext = '';
|
1981 | this.match = '';
|
1982 | }
|
1983 | var rules = this._currentRules();
|
1984 | for (var i = 0; i < rules.length; i++) {
|
1985 | tempMatch = this._input.match(this.rules[rules[i]]);
|
1986 | if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
|
1987 | match = tempMatch;
|
1988 | index = i;
|
1989 | if (this.options.backtrack_lexer) {
|
1990 | token = this.test_match(tempMatch, rules[i]);
|
1991 | if (token !== false) {
|
1992 | return token;
|
1993 | } else if (this._backtrack) {
|
1994 | match = false;
|
1995 | continue;
|
1996 | } else {
|
1997 |
|
1998 | return false;
|
1999 | }
|
2000 | } else if (!this.options.flex) {
|
2001 | break;
|
2002 | }
|
2003 | }
|
2004 | }
|
2005 | if (match) {
|
2006 | token = this.test_match(match, rules[index]);
|
2007 | if (token !== false) {
|
2008 | return token;
|
2009 | }
|
2010 |
|
2011 | return false;
|
2012 | }
|
2013 | if (this._input === "") {
|
2014 | return this.EOF;
|
2015 | } else {
|
2016 | return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
|
2017 | text: "",
|
2018 | token: null,
|
2019 | line: this.yylineno
|
2020 | });
|
2021 | }
|
2022 | },
|
2023 |
|
2024 |
|
2025 | lex: function lex() {
|
2026 | var r = this.next();
|
2027 | if (r) {
|
2028 | return r;
|
2029 | } else {
|
2030 | return this.lex();
|
2031 | }
|
2032 | },
|
2033 |
|
2034 |
|
2035 | begin: function begin(condition) {
|
2036 | this.conditionStack.push(condition);
|
2037 | },
|
2038 |
|
2039 |
|
2040 | popState: function popState() {
|
2041 | var n = this.conditionStack.length - 1;
|
2042 | if (n > 0) {
|
2043 | return this.conditionStack.pop();
|
2044 | } else {
|
2045 | return this.conditionStack[0];
|
2046 | }
|
2047 | },
|
2048 |
|
2049 |
|
2050 | _currentRules: function _currentRules() {
|
2051 | if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
|
2052 | return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
|
2053 | } else {
|
2054 | return this.conditions["INITIAL"].rules;
|
2055 | }
|
2056 | },
|
2057 |
|
2058 |
|
2059 | topState: function topState(n) {
|
2060 | n = this.conditionStack.length - 1 - Math.abs(n || 0);
|
2061 | if (n >= 0) {
|
2062 | return this.conditionStack[n];
|
2063 | } else {
|
2064 | return "INITIAL";
|
2065 | }
|
2066 | },
|
2067 |
|
2068 |
|
2069 | pushState: function pushState(condition) {
|
2070 | this.begin(condition);
|
2071 | },
|
2072 |
|
2073 |
|
2074 | stateStackSize: function stateStackSize() {
|
2075 | return this.conditionStack.length;
|
2076 | },
|
2077 | options: {},
|
2078 | performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
|
2079 | var YYSTATE = YY_START;
|
2080 | switch ($avoiding_name_collisions) {
|
2081 | case 0:
|
2082 |
|
2083 | break;
|
2084 | case 1:
|
2085 | this.begin("string");
|
2086 | break;
|
2087 | case 2:
|
2088 | this.popState();
|
2089 | break;
|
2090 | case 3:
|
2091 | return "STR";
|
2092 | break;
|
2093 | case 4:
|
2094 | return 71;
|
2095 | break;
|
2096 | case 5:
|
2097 | return 78;
|
2098 | break;
|
2099 | case 6:
|
2100 | return 72;
|
2101 | break;
|
2102 | case 7:
|
2103 | return 82;
|
2104 | break;
|
2105 | case 8:
|
2106 | return 73;
|
2107 | break;
|
2108 | case 9:
|
2109 | return 74;
|
2110 | break;
|
2111 | case 10:
|
2112 | return 75;
|
2113 | break;
|
2114 | case 11:
|
2115 | return 12;
|
2116 | break;
|
2117 | case 12:
|
2118 | return 30;
|
2119 | break;
|
2120 | case 13:
|
2121 | return 32;
|
2122 | break;
|
2123 | case 14:
|
2124 | return 13;
|
2125 | break;
|
2126 | case 15:
|
2127 | return 13;
|
2128 | break;
|
2129 | case 16:
|
2130 | return 13;
|
2131 | break;
|
2132 | case 17:
|
2133 | return 13;
|
2134 | break;
|
2135 | case 18:
|
2136 | return 13;
|
2137 | break;
|
2138 | case 19:
|
2139 | return 13;
|
2140 | break;
|
2141 | case 20:
|
2142 | return 81;
|
2143 | break;
|
2144 | case 21:
|
2145 | return 91;
|
2146 | break;
|
2147 | case 22:
|
2148 | return 89;
|
2149 | break;
|
2150 | case 23:
|
2151 | return 8;
|
2152 | break;
|
2153 | case 24:
|
2154 | return 86;
|
2155 | break;
|
2156 | case 25:
|
2157 | return 98;
|
2158 | break;
|
2159 | case 26:
|
2160 | return 16;
|
2161 | break;
|
2162 | case 27:
|
2163 | return 15;
|
2164 | break;
|
2165 | case 28:
|
2166 | return 17;
|
2167 | break;
|
2168 | case 29:
|
2169 | return 18;
|
2170 | break;
|
2171 | case 30:
|
2172 | return 53;
|
2173 | break;
|
2174 | case 31:
|
2175 | return 51;
|
2176 | break;
|
2177 | case 32:
|
2178 | return 52;
|
2179 | break;
|
2180 | case 33:
|
2181 | return 54;
|
2182 | break;
|
2183 | case 34:
|
2184 | return 58;
|
2185 | break;
|
2186 | case 35:
|
2187 | return 56;
|
2188 | break;
|
2189 | case 36:
|
2190 | return 57;
|
2191 | break;
|
2192 | case 37:
|
2193 | return 59;
|
2194 | break;
|
2195 | case 38:
|
2196 | return 58;
|
2197 | break;
|
2198 | case 39:
|
2199 | return 56;
|
2200 | break;
|
2201 | case 40:
|
2202 | return 57;
|
2203 | break;
|
2204 | case 41:
|
2205 | return 59;
|
2206 | break;
|
2207 | case 42:
|
2208 | return 63;
|
2209 | break;
|
2210 | case 43:
|
2211 | return 61;
|
2212 | break;
|
2213 | case 44:
|
2214 | return 62;
|
2215 | break;
|
2216 | case 45:
|
2217 | return 64;
|
2218 | break;
|
2219 | case 46:
|
2220 | return 50;
|
2221 | break;
|
2222 | case 47:
|
2223 | return 55;
|
2224 | break;
|
2225 | case 48:
|
2226 | return 60;
|
2227 | break;
|
2228 | case 49:
|
2229 | return 40;
|
2230 | break;
|
2231 | case 50:
|
2232 | return 41;
|
2233 | break;
|
2234 | case 51:
|
2235 | return 46;
|
2236 | break;
|
2237 | case 52:
|
2238 | return 92;
|
2239 | break;
|
2240 | case 53:
|
2241 | return 96;
|
2242 | break;
|
2243 | case 54:
|
2244 | return 84;
|
2245 | break;
|
2246 | case 55:
|
2247 | return 97;
|
2248 | break;
|
2249 | case 56:
|
2250 | return 97;
|
2251 | break;
|
2252 | case 57:
|
2253 | return 88;
|
2254 | break;
|
2255 | case 58:
|
2256 | return 94;
|
2257 | break;
|
2258 | case 59:
|
2259 | return 95;
|
2260 | break;
|
2261 | case 60:
|
2262 | return 65;
|
2263 | break;
|
2264 | case 61:
|
2265 | return 38;
|
2266 | break;
|
2267 | case 62:
|
2268 | return 39;
|
2269 | break;
|
2270 | case 63:
|
2271 | return 36;
|
2272 | break;
|
2273 | case 64:
|
2274 | return 37;
|
2275 | break;
|
2276 | case 65:
|
2277 | return 42;
|
2278 | break;
|
2279 | case 66:
|
2280 | return 43;
|
2281 | break;
|
2282 | case 67:
|
2283 | return 101;
|
2284 | break;
|
2285 | case 68:
|
2286 | return 9;
|
2287 | break;
|
2288 | case 69:
|
2289 | return 10;
|
2290 | break;
|
2291 | case 70:
|
2292 | return 11;
|
2293 | break;
|
2294 | }
|
2295 | },
|
2296 | rules: [/^(?:%%[^\n]*)/, /^(?:["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:style\b)/, /^(?:default\b)/, /^(?:linkStyle\b)/, /^(?:interpolate\b)/, /^(?:classDef\b)/, /^(?:class\b)/, /^(?:click\b)/, /^(?:graph\b)/, /^(?:subgraph\b)/, /^(?:end\b\s*)/, /^(?:LR\b)/, /^(?:RL\b)/, /^(?:TB\b)/, /^(?:BT\b)/, /^(?:TD\b)/, /^(?:BR\b)/, /^(?:[0-9]+)/, /^(?:#)/, /^(?::)/, /^(?:;)/, /^(?:,)/, /^(?:\*)/, /^(?:<)/, /^(?:>)/, /^(?:\^)/, /^(?:v\b)/, /^(?:\s*--[x]\s*)/, /^(?:\s*-->\s*)/, /^(?:\s*--[o]\s*)/, /^(?:\s*---\s*)/, /^(?:\s*-\.-[x]\s*)/, /^(?:\s*-\.->\s*)/, /^(?:\s*-\.-[o]\s*)/, /^(?:\s*-\.-\s*)/, /^(?:\s*.-[x]\s*)/, /^(?:\s*\.->\s*)/, /^(?:\s*\.-[o]\s*)/, /^(?:\s*\.-\s*)/, /^(?:\s*==[x]\s*)/, /^(?:\s*==>\s*)/, /^(?:\s*==[o]\s*)/, /^(?:\s*==[\=]\s*)/, /^(?:\s*--\s*)/, /^(?:\s*-\.\s*)/, /^(?:\s*==\s*)/, /^(?:\(-)/, /^(?:-\))/, /^(?:-)/, /^(?:\.)/, /^(?:\+)/, /^(?:%)/, /^(?:=)/, /^(?:=)/, /^(?:[A-Za-z]+)/, /^(?:[!"#$%&'*+,-.`?\\_\/])/, /^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/, /^(?:\|)/, /^(?:\()/, /^(?:\))/, /^(?:\[)/, /^(?:\])/, /^(?:\{)/, /^(?:\})/, /^(?:")/, /^(?:\n+)/, /^(?:\s)/, /^(?:$)/],
|
2297 | conditions: { "string": { "rules": [2, 3], "inclusive": false }, "INITIAL": { "rules": [0, 1, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70], "inclusive": true } }
|
2298 | };
|
2299 | return lexer;
|
2300 | }();
|
2301 | parser.lexer = lexer;
|
2302 | function Parser() {
|
2303 | this.yy = {};
|
2304 | }
|
2305 | Parser.prototype = parser;parser.Parser = Parser;
|
2306 | return new Parser();
|
2307 | }();
|
2308 |
|
2309 | if (true) {
|
2310 | exports.parser = parser;
|
2311 | exports.Parser = parser.Parser;
|
2312 | exports.parse = function () {
|
2313 | return parser.parse.apply(parser, arguments);
|
2314 | };
|
2315 | exports.main = function commonjsMain(args) {
|
2316 | if (!args[1]) {
|
2317 | console.log('Usage: ' + args[0] + ' FILE');
|
2318 | process.exit(1);
|
2319 | }
|
2320 | var source = __webpack_require__(3).readFileSync(__webpack_require__(4).normalize(args[1]), "utf8");
|
2321 | return exports.parser.parse(source);
|
2322 | };
|
2323 | if (typeof module !== 'undefined' && __webpack_require__.c[__webpack_require__.s] === module) {
|
2324 | exports.main(process.argv.slice(1));
|
2325 | }
|
2326 | }
|
2327 | }.call(exports, __webpack_require__(2)(module)))
|
2328 |
|
2329 | }),
|
2330 |
|
2331 | (function(module, exports, __webpack_require__) {
|
2332 |
|
2333 | "use strict";
|
2334 | (function(module) {
|
2335 |
|
2336 |
|
2337 |
|
2338 |
|
2339 |
|
2340 |
|
2341 |
|
2342 |
|
2343 |
|
2344 |
|
2345 |
|
2346 |
|
2347 |
|
2348 |
|
2349 |
|
2350 |
|
2351 |
|
2352 |
|
2353 |
|
2354 |
|
2355 |
|
2356 |
|
2357 |
|
2358 |
|
2359 |
|
2360 |
|
2361 |
|
2362 |
|
2363 |
|
2364 |
|
2365 |
|
2366 |
|
2367 |
|
2368 |
|
2369 |
|
2370 |
|
2371 |
|
2372 |
|
2373 |
|
2374 |
|
2375 |
|
2376 |
|
2377 |
|
2378 |
|
2379 |
|
2380 |
|
2381 |
|
2382 |
|
2383 |
|
2384 |
|
2385 |
|
2386 |
|
2387 |
|
2388 |
|
2389 |
|
2390 |
|
2391 |
|
2392 |
|
2393 |
|
2394 |
|
2395 |
|
2396 |
|
2397 |
|
2398 |
|
2399 |
|
2400 |
|
2401 |
|
2402 |
|
2403 |
|
2404 |
|
2405 |
|
2406 |
|
2407 |
|
2408 |
|
2409 | var parser = function () {
|
2410 | var o = function o(k, v, _o, l) {
|
2411 | for (_o = _o || {}, l = k.length; l--; _o[k[l]] = v) {}return _o;
|
2412 | },
|
2413 | $V0 = [1, 5],
|
2414 | $V1 = [1, 6],
|
2415 | $V2 = [1, 12],
|
2416 | $V3 = [1, 13],
|
2417 | $V4 = [1, 14],
|
2418 | $V5 = [1, 15],
|
2419 | $V6 = [1, 16],
|
2420 | $V7 = [1, 17],
|
2421 | $V8 = [1, 18],
|
2422 | $V9 = [1, 19],
|
2423 | $Va = [1, 20],
|
2424 | $Vb = [1, 21],
|
2425 | $Vc = [1, 22],
|
2426 | $Vd = [8, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26],
|
2427 | $Ve = [1, 37],
|
2428 | $Vf = [1, 33],
|
2429 | $Vg = [1, 34],
|
2430 | $Vh = [1, 35],
|
2431 | $Vi = [1, 36],
|
2432 | $Vj = [8, 10, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 28, 32, 37, 39, 40, 45, 57, 58],
|
2433 | $Vk = [10, 28],
|
2434 | $Vl = [10, 28, 37, 57, 58],
|
2435 | $Vm = [2, 49],
|
2436 | $Vn = [1, 45],
|
2437 | $Vo = [1, 48],
|
2438 | $Vp = [1, 49],
|
2439 | $Vq = [1, 52],
|
2440 | $Vr = [2, 65],
|
2441 | $Vs = [1, 65],
|
2442 | $Vt = [1, 66],
|
2443 | $Vu = [1, 67],
|
2444 | $Vv = [1, 68],
|
2445 | $Vw = [1, 69],
|
2446 | $Vx = [1, 70],
|
2447 | $Vy = [1, 71],
|
2448 | $Vz = [1, 72],
|
2449 | $VA = [1, 73],
|
2450 | $VB = [8, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 47],
|
2451 | $VC = [10, 28, 37];
|
2452 | var parser = { trace: function trace() {},
|
2453 | yy: {},
|
2454 | symbols_: { "error": 2, "expressions": 3, "graph": 4, "EOF": 5, "graphStatement": 6, "idStatement": 7, "{": 8, "stmt_list": 9, "}": 10, "strict": 11, "GRAPH": 12, "DIGRAPH": 13, "textNoTags": 14, "textNoTagsToken": 15, "ALPHA": 16, "NUM": 17, "COLON": 18, "PLUS": 19, "EQUALS": 20, "MULT": 21, "DOT": 22, "BRKT": 23, "SPACE": 24, "MINUS": 25, "keywords": 26, "stmt": 27, ";": 28, "node_stmt": 29, "edge_stmt": 30, "attr_stmt": 31, "=": 32, "subgraph": 33, "attr_list": 34, "NODE": 35, "EDGE": 36, "[": 37, "a_list": 38, "]": 39, ",": 40, "edgeRHS": 41, "node_id": 42, "edgeop": 43, "port": 44, ":": 45, "compass_pt": 46, "SUBGRAPH": 47, "n": 48, "ne": 49, "e": 50, "se": 51, "s": 52, "sw": 53, "w": 54, "nw": 55, "c": 56, "ARROW_POINT": 57, "ARROW_OPEN": 58, "$accept": 0, "$end": 1 },
|
2455 | terminals_: { 2: "error", 5: "EOF", 8: "{", 10: "}", 11: "strict", 12: "GRAPH", 13: "DIGRAPH", 16: "ALPHA", 17: "NUM", 18: "COLON", 19: "PLUS", 20: "EQUALS", 21: "MULT", 22: "DOT", 23: "BRKT", 24: "SPACE", 25: "MINUS", 26: "keywords", 28: ";", 32: "=", 35: "NODE", 36: "EDGE", 37: "[", 39: "]", 40: ",", 45: ":", 47: "SUBGRAPH", 48: "n", 49: "ne", 50: "e", 51: "se", 52: "s", 53: "sw", 54: "w", 55: "nw", 56: "c", 57: "ARROW_POINT", 58: "ARROW_OPEN" },
|
2456 | productions_: [0, [3, 2], [4, 5], [4, 6], [4, 4], [6, 1], [6, 1], [7, 1], [14, 1], [14, 2], [15, 1], [15, 1], [15, 1], [15, 1], [15, 1], [15, 1], [15, 1], [15, 1], [15, 1], [15, 1], [15, 1], [9, 1], [9, 3], [27, 1], [27, 1], [27, 1], [27, 3], [27, 1], [31, 2], [31, 2], [31, 2], [34, 4], [34, 3], [34, 3], [34, 2], [38, 5], [38, 5], [38, 3], [30, 3], [30, 3], [30, 2], [30, 2], [41, 3], [41, 3], [41, 2], [41, 2], [29, 2], [29, 1], [42, 2], [42, 1], [44, 4], [44, 2], [44, 2], [33, 5], [33, 4], [33, 3], [46, 1], [46, 1], [46, 1], [46, 1], [46, 1], [46, 1], [46, 1], [46, 1], [46, 1], [46, 0], [43, 1], [43, 1]],
|
2457 | performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
|
2458 |
|
2459 |
|
2460 | var $0 = $$.length - 1;
|
2461 | switch (yystate) {
|
2462 | case 1:
|
2463 | this.$ = $$[$0 - 1];
|
2464 | break;
|
2465 | case 2:
|
2466 | this.$ = $$[$0 - 4];
|
2467 | break;
|
2468 | case 3:
|
2469 | this.$ = $$[$0 - 5];
|
2470 | break;
|
2471 | case 4:
|
2472 | this.$ = $$[$0 - 3];
|
2473 | break;
|
2474 | case 8:case 10:case 11:
|
2475 | this.$ = $$[$0];
|
2476 | break;
|
2477 | case 9:
|
2478 | this.$ = $$[$0 - 1] + '' + $$[$0];
|
2479 | break;
|
2480 | case 12:case 13:case 14:case 15:case 16:case 18:case 19:case 20:
|
2481 | this.$ = $$[$0];
|
2482 | break;
|
2483 | case 17:
|
2484 | this.$ = '<br>';
|
2485 | break;
|
2486 | case 39:
|
2487 | this.$ = 'oy';
|
2488 | break;
|
2489 | case 40:
|
2490 |
|
2491 | yy.addLink($$[$0 - 1], $$[$0].id, $$[$0].op);
|
2492 | this.$ = 'oy';
|
2493 | break;
|
2494 | case 42:
|
2495 |
|
2496 | yy.addLink($$[$0 - 1], $$[$0].id, $$[$0].op);
|
2497 | this.$ = { op: $$[$0 - 2], id: $$[$0 - 1] };
|
2498 |
|
2499 | break;
|
2500 | case 44:
|
2501 |
|
2502 | this.$ = { op: $$[$0 - 1], id: $$[$0] };
|
2503 |
|
2504 | break;
|
2505 | case 48:
|
2506 | yy.addVertex($$[$0 - 1]);this.$ = $$[$0 - 1];
|
2507 | break;
|
2508 | case 49:
|
2509 | yy.addVertex($$[$0]);this.$ = $$[$0];
|
2510 | break;
|
2511 | case 66:
|
2512 | this.$ = 'arrow';
|
2513 | break;
|
2514 | case 67:
|
2515 | this.$ = 'arrow_open';
|
2516 | break;
|
2517 | }
|
2518 | },
|
2519 | table: [{ 3: 1, 4: 2, 6: 3, 11: [1, 4], 12: $V0, 13: $V1 }, { 1: [3] }, { 5: [1, 7] }, { 7: 8, 8: [1, 9], 14: 10, 15: 11, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc }, { 6: 23, 12: $V0, 13: $V1 }, o($Vd, [2, 5]), o($Vd, [2, 6]), { 1: [2, 1] }, { 8: [1, 24] }, { 7: 30, 8: $Ve, 9: 25, 12: $Vf, 14: 10, 15: 11, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc, 27: 26, 29: 27, 30: 28, 31: 29, 33: 31, 35: $Vg, 36: $Vh, 42: 32, 47: $Vi }, o([8, 10, 28, 32, 37, 39, 40, 45, 57, 58], [2, 7], { 15: 38, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc }), o($Vj, [2, 8]), o($Vj, [2, 10]), o($Vj, [2, 11]), o($Vj, [2, 12]), o($Vj, [2, 13]), o($Vj, [2, 14]), o($Vj, [2, 15]), o($Vj, [2, 16]), o($Vj, [2, 17]), o($Vj, [2, 18]), o($Vj, [2, 19]), o($Vj, [2, 20]), { 7: 39, 14: 10, 15: 11, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc }, { 7: 30, 8: $Ve, 9: 40, 12: $Vf, 14: 10, 15: 11, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc, 27: 26, 29: 27, 30: 28, 31: 29, 33: 31, 35: $Vg, 36: $Vh, 42: 32, 47: $Vi }, { 10: [1, 41] }, { 10: [2, 21], 28: [1, 42] }, o($Vk, [2, 23]), o($Vk, [2, 24]), o($Vk, [2, 25]), o($Vl, $Vm, { 44: 44, 32: [1, 43], 45: $Vn }), o($Vk, [2, 27], { 41: 46, 43: 47, 57: $Vo, 58: $Vp }), o($Vk, [2, 47], { 43: 47, 34: 50, 41: 51, 37: $Vq, 57: $Vo, 58: $Vp }), { 34: 53, 37: $Vq }, { 34: 54, 37: $Vq }, { 34: 55, 37: $Vq }, { 7: 56, 8: [1, 57], 14: 10, 15: 11, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc }, { 7: 30, 8: $Ve, 9: 58, 12: $Vf, 14: 10, 15: 11, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc, 27: 26, 29: 27, 30: 28, 31: 29, 33: 31, 35: $Vg, 36: $Vh, 42: 32, 47: $Vi }, o($Vj, [2, 9]), { 8: [1, 59] }, { 10: [1, 60] }, { 5: [2, 4] }, { 7: 30, 8: $Ve, 9: 61, 12: $Vf, 14: 10, 15: 11, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc, 27: 26, 29: 27, 30: 28, 31: 29, 33: 31, 35: $Vg, 36: $Vh, 42: 32, 47: $Vi }, { 7: 62, 14: 10, 15: 11, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc }, o($Vl, [2, 48]), o($Vl, $Vr, { 14: 10, 15: 11, 7: 63, 46: 64, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc, 48: $Vs, 49: $Vt, 50: $Vu, 51: $Vv, 52: $Vw, 53: $Vx, 54: $Vy, 55: $Vz, 56: $VA }), o($Vk, [2, 41], { 34: 74, 37: $Vq }), { 7: 77, 8: $Ve, 14: 10, 15: 11, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc, 33: 76, 42: 75, 47: $Vi }, o($VB, [2, 66]), o($VB, [2, 67]), o($Vk, [2, 46]), o($Vk, [2, 40], { 34: 78, 37: $Vq }), { 7: 81, 14: 10, 15: 11, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc, 38: 79, 39: [1, 80] }, o($Vk, [2, 28]), o($Vk, [2, 29]), o($Vk, [2, 30]), { 8: [1, 82] }, { 7: 30, 8: $Ve, 9: 83, 12: $Vf, 14: 10, 15: 11, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc, 27: 26, 29: 27, 30: 28, 31: 29, 33: 31, 35: $Vg, 36: $Vh, 42: 32, 47: $Vi }, { 10: [1, 84] }, { 7: 30, 8: $Ve, 9: 85, 12: $Vf, 14: 10, 15: 11, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc, 27: 26, 29: 27, 30: 28, 31: 29, 33: 31, 35: $Vg, 36: $Vh, 42: 32, 47: $Vi }, { 5: [2, 2] }, { 10: [2, 22] }, o($Vk, [2, 26]), o($Vl, [2, 51], { 45: [1, 86] }), o($Vl, [2, 52]), o($Vl, [2, 56]), o($Vl, [2, 57]), o($Vl, [2, 58]), o($Vl, [2, 59]), o($Vl, [2, 60]), o($Vl, [2, 61]), o($Vl, [2, 62]), o($Vl, [2, 63]), o($Vl, [2, 64]), o($Vk, [2, 38]), o($VC, [2, 44], { 43: 47, 41: 87, 57: $Vo, 58: $Vp }), o($VC, [2, 45], { 43: 47, 41: 88, 57: $Vo, 58: $Vp }), o($Vl, $Vm, { 44: 44, 45: $Vn }), o($Vk, [2, 39]), { 39: [1, 89] }, o($Vk, [2, 34], { 34: 90, 37: $Vq }), { 32: [1, 91] }, { 7: 30, 8: $Ve, 9: 92, 12: $Vf, 14: 10, 15: 11, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc, 27: 26, 29: 27, 30: 28, 31: 29, 33: 31, 35: $Vg, 36: $Vh, 42: 32, 47: $Vi }, { 10: [1, 93] }, o($Vl, [2, 55]), { 10: [1, 94] }, o($Vl, $Vr, { 46: 95, 48: $Vs, 49: $Vt, 50: $Vu, 51: $Vv, 52: $Vw, 53: $Vx, 54: $Vy, 55: $Vz, 56: $VA }), o($VC, [2, 42]), o($VC, [2, 43]), o($Vk, [2, 33], { 34: 96, 37: $Vq }), o($Vk, [2, 32]), { 7: 97, 14: 10, 15: 11, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc }, { 10: [1, 98] }, o($Vl, [2, 54]), { 5: [2, 3] }, o($Vl, [2, 50]), o($Vk, [2, 31]), { 28: [1, 99], 39: [2, 37], 40: [1, 100] }, o($Vl, [2, 53]), { 7: 81, 14: 10, 15: 11, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc, 38: 101 }, { 7: 81, 14: 10, 15: 11, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc, 38: 102 }, { 39: [2, 35] }, { 39: [2, 36] }],
|
2520 | defaultActions: { 7: [2, 1], 41: [2, 4], 60: [2, 2], 61: [2, 22], 94: [2, 3], 101: [2, 35], 102: [2, 36] },
|
2521 | parseError: function parseError(str, hash) {
|
2522 | if (hash.recoverable) {
|
2523 | this.trace(str);
|
2524 | } else {
|
2525 | var _parseError = function _parseError(msg, hash) {
|
2526 | this.message = msg;
|
2527 | this.hash = hash;
|
2528 | };
|
2529 |
|
2530 | _parseError.prototype = Error;
|
2531 |
|
2532 | throw new _parseError(str, hash);
|
2533 | }
|
2534 | },
|
2535 | parse: function parse(input) {
|
2536 | var self = this,
|
2537 | stack = [0],
|
2538 | tstack = [],
|
2539 | vstack = [null],
|
2540 | lstack = [],
|
2541 | table = this.table,
|
2542 | yytext = '',
|
2543 | yylineno = 0,
|
2544 | yyleng = 0,
|
2545 | recovering = 0,
|
2546 | TERROR = 2,
|
2547 | EOF = 1;
|
2548 | var args = lstack.slice.call(arguments, 1);
|
2549 | var lexer = Object.create(this.lexer);
|
2550 | var sharedState = { yy: {} };
|
2551 | for (var k in this.yy) {
|
2552 | if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
|
2553 | sharedState.yy[k] = this.yy[k];
|
2554 | }
|
2555 | }
|
2556 | lexer.setInput(input, sharedState.yy);
|
2557 | sharedState.yy.lexer = lexer;
|
2558 | sharedState.yy.parser = this;
|
2559 | if (typeof lexer.yylloc == 'undefined') {
|
2560 | lexer.yylloc = {};
|
2561 | }
|
2562 | var yyloc = lexer.yylloc;
|
2563 | lstack.push(yyloc);
|
2564 | var ranges = lexer.options && lexer.options.ranges;
|
2565 | if (typeof sharedState.yy.parseError === 'function') {
|
2566 | this.parseError = sharedState.yy.parseError;
|
2567 | } else {
|
2568 | this.parseError = Object.getPrototypeOf(this).parseError;
|
2569 | }
|
2570 | function popStack(n) {
|
2571 | stack.length = stack.length - 2 * n;
|
2572 | vstack.length = vstack.length - n;
|
2573 | lstack.length = lstack.length - n;
|
2574 | }
|
2575 | function lex() {
|
2576 | var token;
|
2577 | token = tstack.pop() || lexer.lex() || EOF;
|
2578 | if (typeof token !== 'number') {
|
2579 | if (token instanceof Array) {
|
2580 | tstack = token;
|
2581 | token = tstack.pop();
|
2582 | }
|
2583 | token = self.symbols_[token] || token;
|
2584 | }
|
2585 | return token;
|
2586 | }
|
2587 | var symbol,
|
2588 | preErrorSymbol,
|
2589 | state,
|
2590 | action,
|
2591 | a,
|
2592 | r,
|
2593 | yyval = {},
|
2594 | p,
|
2595 | len,
|
2596 | newState,
|
2597 | expected;
|
2598 | while (true) {
|
2599 | state = stack[stack.length - 1];
|
2600 | if (this.defaultActions[state]) {
|
2601 | action = this.defaultActions[state];
|
2602 | } else {
|
2603 | if (symbol === null || typeof symbol == 'undefined') {
|
2604 | symbol = lex();
|
2605 | }
|
2606 | action = table[state] && table[state][symbol];
|
2607 | }
|
2608 | if (typeof action === 'undefined' || !action.length || !action[0]) {
|
2609 | var errStr = '';
|
2610 | expected = [];
|
2611 | for (p in table[state]) {
|
2612 | if (this.terminals_[p] && p > TERROR) {
|
2613 | expected.push('\'' + this.terminals_[p] + '\'');
|
2614 | }
|
2615 | }
|
2616 | if (lexer.showPosition) {
|
2617 | errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
|
2618 | } else {
|
2619 | errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
|
2620 | }
|
2621 | this.parseError(errStr, {
|
2622 | text: lexer.match,
|
2623 | token: this.terminals_[symbol] || symbol,
|
2624 | line: lexer.yylineno,
|
2625 | loc: yyloc,
|
2626 | expected: expected
|
2627 | });
|
2628 | }
|
2629 | if (action[0] instanceof Array && action.length > 1) {
|
2630 | throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
|
2631 | }
|
2632 | switch (action[0]) {
|
2633 | case 1:
|
2634 | stack.push(symbol);
|
2635 | vstack.push(lexer.yytext);
|
2636 | lstack.push(lexer.yylloc);
|
2637 | stack.push(action[1]);
|
2638 | symbol = null;
|
2639 | if (!preErrorSymbol) {
|
2640 | yyleng = lexer.yyleng;
|
2641 | yytext = lexer.yytext;
|
2642 | yylineno = lexer.yylineno;
|
2643 | yyloc = lexer.yylloc;
|
2644 | if (recovering > 0) {
|
2645 | recovering--;
|
2646 | }
|
2647 | } else {
|
2648 | symbol = preErrorSymbol;
|
2649 | preErrorSymbol = null;
|
2650 | }
|
2651 | break;
|
2652 | case 2:
|
2653 | len = this.productions_[action[1]][1];
|
2654 | yyval.$ = vstack[vstack.length - len];
|
2655 | yyval._$ = {
|
2656 | first_line: lstack[lstack.length - (len || 1)].first_line,
|
2657 | last_line: lstack[lstack.length - 1].last_line,
|
2658 | first_column: lstack[lstack.length - (len || 1)].first_column,
|
2659 | last_column: lstack[lstack.length - 1].last_column
|
2660 | };
|
2661 | if (ranges) {
|
2662 | yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
|
2663 | }
|
2664 | r = this.performAction.apply(yyval, [yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack].concat(args));
|
2665 | if (typeof r !== 'undefined') {
|
2666 | return r;
|
2667 | }
|
2668 | if (len) {
|
2669 | stack = stack.slice(0, -1 * len * 2);
|
2670 | vstack = vstack.slice(0, -1 * len);
|
2671 | lstack = lstack.slice(0, -1 * len);
|
2672 | }
|
2673 | stack.push(this.productions_[action[1]][0]);
|
2674 | vstack.push(yyval.$);
|
2675 | lstack.push(yyval._$);
|
2676 | newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
|
2677 | stack.push(newState);
|
2678 | break;
|
2679 | case 3:
|
2680 | return true;
|
2681 | }
|
2682 | }
|
2683 | return true;
|
2684 | } };
|
2685 |
|
2686 |
|
2687 | var lexer = function () {
|
2688 | var lexer = {
|
2689 |
|
2690 | EOF: 1,
|
2691 |
|
2692 | parseError: function parseError(str, hash) {
|
2693 | if (this.yy.parser) {
|
2694 | this.yy.parser.parseError(str, hash);
|
2695 | } else {
|
2696 | throw new Error(str);
|
2697 | }
|
2698 | },
|
2699 |
|
2700 |
|
2701 | setInput: function setInput(input, yy) {
|
2702 | this.yy = yy || this.yy || {};
|
2703 | this._input = input;
|
2704 | this._more = this._backtrack = this.done = false;
|
2705 | this.yylineno = this.yyleng = 0;
|
2706 | this.yytext = this.matched = this.match = '';
|
2707 | this.conditionStack = ['INITIAL'];
|
2708 | this.yylloc = {
|
2709 | first_line: 1,
|
2710 | first_column: 0,
|
2711 | last_line: 1,
|
2712 | last_column: 0
|
2713 | };
|
2714 | if (this.options.ranges) {
|
2715 | this.yylloc.range = [0, 0];
|
2716 | }
|
2717 | this.offset = 0;
|
2718 | return this;
|
2719 | },
|
2720 |
|
2721 |
|
2722 | input: function input() {
|
2723 | var ch = this._input[0];
|
2724 | this.yytext += ch;
|
2725 | this.yyleng++;
|
2726 | this.offset++;
|
2727 | this.match += ch;
|
2728 | this.matched += ch;
|
2729 | var lines = ch.match(/(?:\r\n?|\n).*/g);
|
2730 | if (lines) {
|
2731 | this.yylineno++;
|
2732 | this.yylloc.last_line++;
|
2733 | } else {
|
2734 | this.yylloc.last_column++;
|
2735 | }
|
2736 | if (this.options.ranges) {
|
2737 | this.yylloc.range[1]++;
|
2738 | }
|
2739 |
|
2740 | this._input = this._input.slice(1);
|
2741 | return ch;
|
2742 | },
|
2743 |
|
2744 |
|
2745 | unput: function unput(ch) {
|
2746 | var len = ch.length;
|
2747 | var lines = ch.split(/(?:\r\n?|\n)/g);
|
2748 |
|
2749 | this._input = ch + this._input;
|
2750 | this.yytext = this.yytext.substr(0, this.yytext.length - len);
|
2751 |
|
2752 | this.offset -= len;
|
2753 | var oldLines = this.match.split(/(?:\r\n?|\n)/g);
|
2754 | this.match = this.match.substr(0, this.match.length - 1);
|
2755 | this.matched = this.matched.substr(0, this.matched.length - 1);
|
2756 |
|
2757 | if (lines.length - 1) {
|
2758 | this.yylineno -= lines.length - 1;
|
2759 | }
|
2760 | var r = this.yylloc.range;
|
2761 |
|
2762 | this.yylloc = {
|
2763 | first_line: this.yylloc.first_line,
|
2764 | last_line: this.yylineno + 1,
|
2765 | first_column: this.yylloc.first_column,
|
2766 | 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
|
2767 | };
|
2768 |
|
2769 | if (this.options.ranges) {
|
2770 | this.yylloc.range = [r[0], r[0] + this.yyleng - len];
|
2771 | }
|
2772 | this.yyleng = this.yytext.length;
|
2773 | return this;
|
2774 | },
|
2775 |
|
2776 |
|
2777 | more: function more() {
|
2778 | this._more = true;
|
2779 | return this;
|
2780 | },
|
2781 |
|
2782 |
|
2783 | reject: function reject() {
|
2784 | if (this.options.backtrack_lexer) {
|
2785 | this._backtrack = true;
|
2786 | } else {
|
2787 | 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(), {
|
2788 | text: "",
|
2789 | token: null,
|
2790 | line: this.yylineno
|
2791 | });
|
2792 | }
|
2793 | return this;
|
2794 | },
|
2795 |
|
2796 |
|
2797 | less: function less(n) {
|
2798 | this.unput(this.match.slice(n));
|
2799 | },
|
2800 |
|
2801 |
|
2802 | pastInput: function pastInput() {
|
2803 | var past = this.matched.substr(0, this.matched.length - this.match.length);
|
2804 | return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, "");
|
2805 | },
|
2806 |
|
2807 |
|
2808 | upcomingInput: function upcomingInput() {
|
2809 | var next = this.match;
|
2810 | if (next.length < 20) {
|
2811 | next += this._input.substr(0, 20 - next.length);
|
2812 | }
|
2813 | return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
|
2814 | },
|
2815 |
|
2816 |
|
2817 | showPosition: function showPosition() {
|
2818 | var pre = this.pastInput();
|
2819 | var c = new Array(pre.length + 1).join("-");
|
2820 | return pre + this.upcomingInput() + "\n" + c + "^";
|
2821 | },
|
2822 |
|
2823 |
|
2824 | test_match: function test_match(match, indexed_rule) {
|
2825 | var token, lines, backup;
|
2826 |
|
2827 | if (this.options.backtrack_lexer) {
|
2828 |
|
2829 | backup = {
|
2830 | yylineno: this.yylineno,
|
2831 | yylloc: {
|
2832 | first_line: this.yylloc.first_line,
|
2833 | last_line: this.last_line,
|
2834 | first_column: this.yylloc.first_column,
|
2835 | last_column: this.yylloc.last_column
|
2836 | },
|
2837 | yytext: this.yytext,
|
2838 | match: this.match,
|
2839 | matches: this.matches,
|
2840 | matched: this.matched,
|
2841 | yyleng: this.yyleng,
|
2842 | offset: this.offset,
|
2843 | _more: this._more,
|
2844 | _input: this._input,
|
2845 | yy: this.yy,
|
2846 | conditionStack: this.conditionStack.slice(0),
|
2847 | done: this.done
|
2848 | };
|
2849 | if (this.options.ranges) {
|
2850 | backup.yylloc.range = this.yylloc.range.slice(0);
|
2851 | }
|
2852 | }
|
2853 |
|
2854 | lines = match[0].match(/(?:\r\n?|\n).*/g);
|
2855 | if (lines) {
|
2856 | this.yylineno += lines.length;
|
2857 | }
|
2858 | this.yylloc = {
|
2859 | first_line: this.yylloc.last_line,
|
2860 | last_line: this.yylineno + 1,
|
2861 | first_column: this.yylloc.last_column,
|
2862 | last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
|
2863 | };
|
2864 | this.yytext += match[0];
|
2865 | this.match += match[0];
|
2866 | this.matches = match;
|
2867 | this.yyleng = this.yytext.length;
|
2868 | if (this.options.ranges) {
|
2869 | this.yylloc.range = [this.offset, this.offset += this.yyleng];
|
2870 | }
|
2871 | this._more = false;
|
2872 | this._backtrack = false;
|
2873 | this._input = this._input.slice(match[0].length);
|
2874 | this.matched += match[0];
|
2875 | token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
|
2876 | if (this.done && this._input) {
|
2877 | this.done = false;
|
2878 | }
|
2879 | if (token) {
|
2880 | return token;
|
2881 | } else if (this._backtrack) {
|
2882 |
|
2883 | for (var k in backup) {
|
2884 | this[k] = backup[k];
|
2885 | }
|
2886 | return false;
|
2887 | }
|
2888 | return false;
|
2889 | },
|
2890 |
|
2891 |
|
2892 | next: function next() {
|
2893 | if (this.done) {
|
2894 | return this.EOF;
|
2895 | }
|
2896 | if (!this._input) {
|
2897 | this.done = true;
|
2898 | }
|
2899 |
|
2900 | var token, match, tempMatch, index;
|
2901 | if (!this._more) {
|
2902 | this.yytext = '';
|
2903 | this.match = '';
|
2904 | }
|
2905 | var rules = this._currentRules();
|
2906 | for (var i = 0; i < rules.length; i++) {
|
2907 | tempMatch = this._input.match(this.rules[rules[i]]);
|
2908 | if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
|
2909 | match = tempMatch;
|
2910 | index = i;
|
2911 | if (this.options.backtrack_lexer) {
|
2912 | token = this.test_match(tempMatch, rules[i]);
|
2913 | if (token !== false) {
|
2914 | return token;
|
2915 | } else if (this._backtrack) {
|
2916 | match = false;
|
2917 | continue;
|
2918 | } else {
|
2919 |
|
2920 | return false;
|
2921 | }
|
2922 | } else if (!this.options.flex) {
|
2923 | break;
|
2924 | }
|
2925 | }
|
2926 | }
|
2927 | if (match) {
|
2928 | token = this.test_match(match, rules[index]);
|
2929 | if (token !== false) {
|
2930 | return token;
|
2931 | }
|
2932 |
|
2933 | return false;
|
2934 | }
|
2935 | if (this._input === "") {
|
2936 | return this.EOF;
|
2937 | } else {
|
2938 | return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
|
2939 | text: "",
|
2940 | token: null,
|
2941 | line: this.yylineno
|
2942 | });
|
2943 | }
|
2944 | },
|
2945 |
|
2946 |
|
2947 | lex: function lex() {
|
2948 | var r = this.next();
|
2949 | if (r) {
|
2950 | return r;
|
2951 | } else {
|
2952 | return this.lex();
|
2953 | }
|
2954 | },
|
2955 |
|
2956 |
|
2957 | begin: function begin(condition) {
|
2958 | this.conditionStack.push(condition);
|
2959 | },
|
2960 |
|
2961 |
|
2962 | popState: function popState() {
|
2963 | var n = this.conditionStack.length - 1;
|
2964 | if (n > 0) {
|
2965 | return this.conditionStack.pop();
|
2966 | } else {
|
2967 | return this.conditionStack[0];
|
2968 | }
|
2969 | },
|
2970 |
|
2971 |
|
2972 | _currentRules: function _currentRules() {
|
2973 | if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
|
2974 | return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
|
2975 | } else {
|
2976 | return this.conditions["INITIAL"].rules;
|
2977 | }
|
2978 | },
|
2979 |
|
2980 |
|
2981 | topState: function topState(n) {
|
2982 | n = this.conditionStack.length - 1 - Math.abs(n || 0);
|
2983 | if (n >= 0) {
|
2984 | return this.conditionStack[n];
|
2985 | } else {
|
2986 | return "INITIAL";
|
2987 | }
|
2988 | },
|
2989 |
|
2990 |
|
2991 | pushState: function pushState(condition) {
|
2992 | this.begin(condition);
|
2993 | },
|
2994 |
|
2995 |
|
2996 | stateStackSize: function stateStackSize() {
|
2997 | return this.conditionStack.length;
|
2998 | },
|
2999 | options: {},
|
3000 | performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
|
3001 | var YYSTATE = YY_START;
|
3002 | switch ($avoiding_name_collisions) {
|
3003 | case 0:
|
3004 | return 'STYLE';
|
3005 | break;
|
3006 | case 1:
|
3007 | return 'LINKSTYLE';
|
3008 | break;
|
3009 | case 2:
|
3010 | return 'CLASSDEF';
|
3011 | break;
|
3012 | case 3:
|
3013 | return 'CLASS';
|
3014 | break;
|
3015 | case 4:
|
3016 | return 'CLICK';
|
3017 | break;
|
3018 | case 5:
|
3019 | return 12;
|
3020 | break;
|
3021 | case 6:
|
3022 | return 13;
|
3023 | break;
|
3024 | case 7:
|
3025 | return 47;
|
3026 | break;
|
3027 | case 8:
|
3028 | return 35;
|
3029 | break;
|
3030 | case 9:
|
3031 | return 36;
|
3032 | break;
|
3033 | case 10:
|
3034 | return 'DIR';
|
3035 | break;
|
3036 | case 11:
|
3037 | return 'DIR';
|
3038 | break;
|
3039 | case 12:
|
3040 | return 'DIR';
|
3041 | break;
|
3042 | case 13:
|
3043 | return 'DIR';
|
3044 | break;
|
3045 | case 14:
|
3046 | return 'DIR';
|
3047 | break;
|
3048 | case 15:
|
3049 | return 'DIR';
|
3050 | break;
|
3051 | case 16:
|
3052 | return 17;
|
3053 | break;
|
3054 | case 17:
|
3055 | return 23;
|
3056 | break;
|
3057 | case 18:
|
3058 | return 18;
|
3059 | break;
|
3060 | case 19:
|
3061 | return 28;
|
3062 | break;
|
3063 | case 20:
|
3064 | return 40;
|
3065 | break;
|
3066 | case 21:
|
3067 | return 32;
|
3068 | break;
|
3069 | case 22:
|
3070 | return 21;
|
3071 | break;
|
3072 | case 23:
|
3073 | return 22;
|
3074 | break;
|
3075 | case 24:
|
3076 | return 'ARROW_CROSS';
|
3077 | break;
|
3078 | case 25:
|
3079 | return 57;
|
3080 | break;
|
3081 | case 26:
|
3082 | return 'ARROW_CIRCLE';
|
3083 | break;
|
3084 | case 27:
|
3085 | return 58;
|
3086 | break;
|
3087 | case 28:
|
3088 | return 25;
|
3089 | break;
|
3090 | case 29:
|
3091 | return 19;
|
3092 | break;
|
3093 | case 30:
|
3094 | return 20;
|
3095 | break;
|
3096 | case 31:
|
3097 | return 16;
|
3098 | break;
|
3099 | case 32:
|
3100 | return 'PIPE';
|
3101 | break;
|
3102 | case 33:
|
3103 | return 'PS';
|
3104 | break;
|
3105 | case 34:
|
3106 | return 'PE';
|
3107 | break;
|
3108 | case 35:
|
3109 | return 37;
|
3110 | break;
|
3111 | case 36:
|
3112 | return 39;
|
3113 | break;
|
3114 | case 37:
|
3115 | return 8;
|
3116 | break;
|
3117 | case 38:
|
3118 | return 10;
|
3119 | break;
|
3120 | case 39:
|
3121 | return 'QUOTE';
|
3122 | break;
|
3123 | case 40:
|
3124 | return 24;
|
3125 | break;
|
3126 | case 41:
|
3127 | return 'NEWLINE';
|
3128 | break;
|
3129 | case 42:
|
3130 | return 5;
|
3131 | break;
|
3132 | }
|
3133 | },
|
3134 | rules: [/^(?:style\b)/, /^(?:linkStyle\b)/, /^(?:classDef\b)/, /^(?:class\b)/, /^(?:click\b)/, /^(?:graph\b)/, /^(?:digraph\b)/, /^(?:subgraph\b)/, /^(?:node\b)/, /^(?:edge\b)/, /^(?:LR\b)/, /^(?:RL\b)/, /^(?:TB\b)/, /^(?:BT\b)/, /^(?:TD\b)/, /^(?:BR\b)/, /^(?:[0-9])/, /^(?:#)/, /^(?::)/, /^(?:;)/, /^(?:,)/, /^(?:=)/, /^(?:\*)/, /^(?:\.)/, /^(?:--[x])/, /^(?:->)/, /^(?:--[o])/, /^(?:--)/, /^(?:-)/, /^(?:\+)/, /^(?:=)/, /^(?:[\u0021-\u0027\u002A-\u002E\u003F\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC_])/, /^(?:\|)/, /^(?:\()/, /^(?:\))/, /^(?:\[)/, /^(?:\])/, /^(?:\{)/, /^(?:\})/, /^(?:")/, /^(?:\s)/, /^(?:\n)/, /^(?:$)/],
|
3135 | conditions: { "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42], "inclusive": true } }
|
3136 | };
|
3137 | return lexer;
|
3138 | }();
|
3139 | parser.lexer = lexer;
|
3140 | function Parser() {
|
3141 | this.yy = {};
|
3142 | }
|
3143 | Parser.prototype = parser;parser.Parser = Parser;
|
3144 | return new Parser();
|
3145 | }();
|
3146 |
|
3147 | if (true) {
|
3148 | exports.parser = parser;
|
3149 | exports.Parser = parser.Parser;
|
3150 | exports.parse = function () {
|
3151 | return parser.parse.apply(parser, arguments);
|
3152 | };
|
3153 | exports.main = function commonjsMain(args) {
|
3154 | if (!args[1]) {
|
3155 | console.log('Usage: ' + args[0] + ' FILE');
|
3156 | process.exit(1);
|
3157 | }
|
3158 | var source = __webpack_require__(3).readFileSync(__webpack_require__(4).normalize(args[1]), "utf8");
|
3159 | return exports.parser.parse(source);
|
3160 | };
|
3161 | if (typeof module !== 'undefined' && __webpack_require__.c[__webpack_require__.s] === module) {
|
3162 | exports.main(process.argv.slice(1));
|
3163 | }
|
3164 | }
|
3165 | }.call(exports, __webpack_require__(2)(module)))
|
3166 |
|
3167 | }),
|
3168 |
|
3169 | (function(module, exports, __webpack_require__) {
|
3170 |
|
3171 | "use strict";
|
3172 | (function(module) {
|
3173 |
|
3174 |
|
3175 |
|
3176 |
|
3177 |
|
3178 |
|
3179 |
|
3180 |
|
3181 |
|
3182 |
|
3183 |
|
3184 |
|
3185 |
|
3186 |
|
3187 |
|
3188 |
|
3189 |
|
3190 |
|
3191 |
|
3192 |
|
3193 |
|
3194 |
|
3195 |
|
3196 |
|
3197 |
|
3198 |
|
3199 |
|
3200 |
|
3201 |
|
3202 |
|
3203 |
|
3204 |
|
3205 |
|
3206 |
|
3207 |
|
3208 |
|
3209 |
|
3210 |
|
3211 |
|
3212 |
|
3213 |
|
3214 |
|
3215 |
|
3216 |
|
3217 |
|
3218 |
|
3219 |
|
3220 |
|
3221 |
|
3222 |
|
3223 |
|
3224 |
|
3225 |
|
3226 |
|
3227 |
|
3228 |
|
3229 |
|
3230 |
|
3231 |
|
3232 |
|
3233 |
|
3234 |
|
3235 |
|
3236 |
|
3237 |
|
3238 |
|
3239 |
|
3240 |
|
3241 |
|
3242 |
|
3243 |
|
3244 |
|
3245 |
|
3246 |
|
3247 | var parser = function () {
|
3248 | var o = function o(k, v, _o, l) {
|
3249 | for (_o = _o || {}, l = k.length; l--; _o[k[l]] = v) {}return _o;
|
3250 | },
|
3251 | $V0 = [1, 2],
|
3252 | $V1 = [1, 3],
|
3253 | $V2 = [1, 4],
|
3254 | $V3 = [2, 4],
|
3255 | $V4 = [1, 9],
|
3256 | $V5 = [1, 11],
|
3257 | $V6 = [1, 12],
|
3258 | $V7 = [1, 14],
|
3259 | $V8 = [1, 15],
|
3260 | $V9 = [1, 17],
|
3261 | $Va = [1, 18],
|
3262 | $Vb = [1, 19],
|
3263 | $Vc = [1, 20],
|
3264 | $Vd = [1, 21],
|
3265 | $Ve = [1, 23],
|
3266 | $Vf = [1, 24],
|
3267 | $Vg = [1, 4, 5, 10, 15, 16, 18, 20, 21, 22, 23, 24, 25, 27, 28, 39],
|
3268 | $Vh = [1, 32],
|
3269 | $Vi = [4, 5, 10, 15, 16, 18, 20, 21, 22, 23, 25, 28, 39],
|
3270 | $Vj = [4, 5, 10, 15, 16, 18, 20, 21, 22, 23, 25, 27, 28, 39],
|
3271 | $Vk = [37, 38, 39];
|
3272 | var parser = { trace: function trace() {},
|
3273 | yy: {},
|
3274 | symbols_: { "error": 2, "start": 3, "SPACE": 4, "NL": 5, "SD": 6, "document": 7, "line": 8, "statement": 9, "participant": 10, "actor": 11, "AS": 12, "restOfLine": 13, "signal": 14, "activate": 15, "deactivate": 16, "note_statement": 17, "title": 18, "text2": 19, "loop": 20, "end": 21, "opt": 22, "alt": 23, "else": 24, "par": 25, "par_sections": 26, "and": 27, "note": 28, "placement": 29, "over": 30, "actor_pair": 31, "spaceList": 32, ",": 33, "left_of": 34, "right_of": 35, "signaltype": 36, "+": 37, "-": 38, "ACTOR": 39, "SOLID_OPEN_ARROW": 40, "DOTTED_OPEN_ARROW": 41, "SOLID_ARROW": 42, "DOTTED_ARROW": 43, "SOLID_CROSS": 44, "DOTTED_CROSS": 45, "TXT": 46, "$accept": 0, "$end": 1 },
|
3275 | terminals_: { 2: "error", 4: "SPACE", 5: "NL", 6: "SD", 10: "participant", 12: "AS", 13: "restOfLine", 15: "activate", 16: "deactivate", 18: "title", 20: "loop", 21: "end", 22: "opt", 23: "alt", 24: "else", 25: "par", 27: "and", 28: "note", 30: "over", 33: ",", 34: "left_of", 35: "right_of", 37: "+", 38: "-", 39: "ACTOR", 40: "SOLID_OPEN_ARROW", 41: "DOTTED_OPEN_ARROW", 42: "SOLID_ARROW", 43: "DOTTED_ARROW", 44: "SOLID_CROSS", 45: "DOTTED_CROSS", 46: "TXT" },
|
3276 | productions_: [0, [3, 2], [3, 2], [3, 2], [7, 0], [7, 2], [8, 2], [8, 1], [8, 1], [9, 5], [9, 3], [9, 2], [9, 3], [9, 3], [9, 2], [9, 3], [9, 4], [9, 4], [9, 7], [9, 4], [26, 1], [26, 4], [17, 4], [17, 4], [32, 2], [32, 1], [31, 3], [31, 1], [29, 1], [29, 1], [14, 5], [14, 5], [14, 4], [11, 1], [36, 1], [36, 1], [36, 1], [36, 1], [36, 1], [36, 1], [19, 1]],
|
3277 | performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
|
3278 |
|
3279 |
|
3280 | var $0 = $$.length - 1;
|
3281 | switch (yystate) {
|
3282 | case 3:
|
3283 | yy.apply($$[$0]);return $$[$0];
|
3284 | break;
|
3285 | case 4:
|
3286 | this.$ = [];
|
3287 | break;
|
3288 | case 5:
|
3289 | $$[$0 - 1].push($$[$0]);this.$ = $$[$0 - 1];
|
3290 | break;
|
3291 | case 6:case 7:
|
3292 | this.$ = $$[$0];
|
3293 | break;
|
3294 | case 8:
|
3295 | this.$ = [];
|
3296 | break;
|
3297 | case 9:
|
3298 | $$[$0 - 3].description = $$[$0 - 1];this.$ = $$[$0 - 3];
|
3299 | break;
|
3300 | case 10:
|
3301 | this.$ = $$[$0 - 1];
|
3302 | break;
|
3303 | case 12:
|
3304 | this.$ = { type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0 - 1] };
|
3305 | break;
|
3306 | case 13:
|
3307 | this.$ = { type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0 - 1] };
|
3308 | break;
|
3309 | case 15:
|
3310 | this.$ = [{ type: 'setTitle', text: $$[$0 - 1] }];
|
3311 | break;
|
3312 | case 16:
|
3313 |
|
3314 | $$[$0 - 1].unshift({ type: 'loopStart', loopText: $$[$0 - 2], signalType: yy.LINETYPE.LOOP_START });
|
3315 | $$[$0 - 1].push({ type: 'loopEnd', loopText: $$[$0 - 2], signalType: yy.LINETYPE.LOOP_END });
|
3316 | this.$ = $$[$0 - 1];
|
3317 | break;
|
3318 | case 17:
|
3319 |
|
3320 | $$[$0 - 1].unshift({ type: 'optStart', optText: $$[$0 - 2], signalType: yy.LINETYPE.OPT_START });
|
3321 | $$[$0 - 1].push({ type: 'optEnd', optText: $$[$0 - 2], signalType: yy.LINETYPE.OPT_END });
|
3322 | this.$ = $$[$0 - 1];
|
3323 | break;
|
3324 | case 18:
|
3325 |
|
3326 |
|
3327 | $$[$0 - 4].unshift({ type: 'altStart', altText: $$[$0 - 5], signalType: yy.LINETYPE.ALT_START });
|
3328 |
|
3329 |
|
3330 | $$[$0 - 4].push({ type: 'else', altText: $$[$0 - 2], signalType: yy.LINETYPE.ALT_ELSE });
|
3331 |
|
3332 | $$[$0 - 4] = $$[$0 - 4].concat($$[$0 - 1]);
|
3333 |
|
3334 | $$[$0 - 4].push({ type: 'altEnd', signalType: yy.LINETYPE.ALT_END });
|
3335 |
|
3336 | this.$ = $$[$0 - 4];
|
3337 | break;
|
3338 | case 19:
|
3339 |
|
3340 |
|
3341 | $$[$0 - 1].unshift({ type: 'parStart', parText: $$[$0 - 2], signalType: yy.LINETYPE.PAR_START });
|
3342 |
|
3343 |
|
3344 | $$[$0 - 1].push({ type: 'parEnd', signalType: yy.LINETYPE.PAR_END });
|
3345 | this.$ = $$[$0 - 1];
|
3346 | break;
|
3347 | case 21:
|
3348 | this.$ = $$[$0 - 3].concat([{ type: 'and', parText: $$[$0 - 1], signalType: yy.LINETYPE.PAR_AND }, $$[$0]]);
|
3349 | break;
|
3350 | case 22:
|
3351 |
|
3352 | this.$ = [$$[$0 - 1], { type: 'addNote', placement: $$[$0 - 2], actor: $$[$0 - 1].actor, text: $$[$0] }];
|
3353 | break;
|
3354 | case 23:
|
3355 |
|
3356 |
|
3357 | $$[$0 - 2] = [].concat($$[$0 - 1], $$[$0 - 1]).slice(0, 2);
|
3358 | $$[$0 - 2][0] = $$[$0 - 2][0].actor;
|
3359 | $$[$0 - 2][1] = $$[$0 - 2][1].actor;
|
3360 | this.$ = [$$[$0 - 1], { type: 'addNote', placement: yy.PLACEMENT.OVER, actor: $$[$0 - 2].slice(0, 2), text: $$[$0] }];
|
3361 | break;
|
3362 | case 26:
|
3363 | this.$ = [$$[$0 - 2], $$[$0]];
|
3364 | break;
|
3365 | case 27:
|
3366 | this.$ = $$[$0];
|
3367 | break;
|
3368 | case 28:
|
3369 | this.$ = yy.PLACEMENT.LEFTOF;
|
3370 | break;
|
3371 | case 29:
|
3372 | this.$ = yy.PLACEMENT.RIGHTOF;
|
3373 | break;
|
3374 | case 30:
|
3375 | this.$ = [$$[$0 - 4], $$[$0 - 1], { type: 'addMessage', from: $$[$0 - 4].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 3], msg: $$[$0] }, { type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0 - 1] }];
|
3376 | break;
|
3377 | case 31:
|
3378 | this.$ = [$$[$0 - 4], $$[$0 - 1], { type: 'addMessage', from: $$[$0 - 4].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 3], msg: $$[$0] }, { type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0 - 4] }];
|
3379 | break;
|
3380 | case 32:
|
3381 | this.$ = [$$[$0 - 3], $$[$0 - 1], { type: 'addMessage', from: $$[$0 - 3].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 2], msg: $$[$0] }];
|
3382 | break;
|
3383 | case 33:
|
3384 | this.$ = { type: 'addActor', actor: $$[$0] };
|
3385 | break;
|
3386 | case 34:
|
3387 | this.$ = yy.LINETYPE.SOLID_OPEN;
|
3388 | break;
|
3389 | case 35:
|
3390 | this.$ = yy.LINETYPE.DOTTED_OPEN;
|
3391 | break;
|
3392 | case 36:
|
3393 | this.$ = yy.LINETYPE.SOLID;
|
3394 | break;
|
3395 | case 37:
|
3396 | this.$ = yy.LINETYPE.DOTTED;
|
3397 | break;
|
3398 | case 38:
|
3399 | this.$ = yy.LINETYPE.SOLID_CROSS;
|
3400 | break;
|
3401 | case 39:
|
3402 | this.$ = yy.LINETYPE.DOTTED_CROSS;
|
3403 | break;
|
3404 | case 40:
|
3405 | this.$ = $$[$0].substring(1).trim().replace(/\\n/gm, "\n");
|
3406 | break;
|
3407 | }
|
3408 | },
|
3409 | table: [{ 3: 1, 4: $V0, 5: $V1, 6: $V2 }, { 1: [3] }, { 3: 5, 4: $V0, 5: $V1, 6: $V2 }, { 3: 6, 4: $V0, 5: $V1, 6: $V2 }, o([1, 4, 5, 10, 15, 16, 18, 20, 22, 23, 25, 28, 39], $V3, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 22, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 22: $Vb, 23: $Vc, 25: $Vd, 28: $Ve, 39: $Vf }, o($Vg, [2, 5]), { 9: 25, 10: $V6, 11: 22, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 22: $Vb, 23: $Vc, 25: $Vd, 28: $Ve, 39: $Vf }, o($Vg, [2, 7]), o($Vg, [2, 8]), { 11: 26, 39: $Vf }, { 5: [1, 27] }, { 11: 28, 39: $Vf }, { 11: 29, 39: $Vf }, { 5: [1, 30] }, { 19: 31, 46: $Vh }, { 13: [1, 33] }, { 13: [1, 34] }, { 13: [1, 35] }, { 13: [1, 36] }, { 36: 37, 40: [1, 38], 41: [1, 39], 42: [1, 40], 43: [1, 41], 44: [1, 42], 45: [1, 43] }, { 29: 44, 30: [1, 45], 34: [1, 46], 35: [1, 47] }, o([5, 12, 33, 40, 41, 42, 43, 44, 45, 46], [2, 33]), o($Vg, [2, 6]), { 5: [1, 49], 12: [1, 48] }, o($Vg, [2, 11]), { 5: [1, 50] }, { 5: [1, 51] }, o($Vg, [2, 14]), { 5: [1, 52] }, { 5: [2, 40] }, o($Vi, $V3, { 7: 53 }), o($Vi, $V3, { 7: 54 }), o([4, 5, 10, 15, 16, 18, 20, 22, 23, 24, 25, 28, 39], $V3, { 7: 55 }), o($Vj, $V3, { 26: 56, 7: 57 }), { 11: 60, 37: [1, 58], 38: [1, 59], 39: $Vf }, o($Vk, [2, 34]), o($Vk, [2, 35]), o($Vk, [2, 36]), o($Vk, [2, 37]), o($Vk, [2, 38]), o($Vk, [2, 39]), { 11: 61, 39: $Vf }, { 11: 63, 31: 62, 39: $Vf }, { 39: [2, 28] }, { 39: [2, 29] }, { 13: [1, 64] }, o($Vg, [2, 10]), o($Vg, [2, 12]), o($Vg, [2, 13]), o($Vg, [2, 15]), { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 22, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 21: [1, 65], 22: $Vb, 23: $Vc, 25: $Vd, 28: $Ve, 39: $Vf }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 22, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 21: [1, 66], 22: $Vb, 23: $Vc, 25: $Vd, 28: $Ve, 39: $Vf }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 22, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 22: $Vb, 23: $Vc, 24: [1, 67], 25: $Vd, 28: $Ve, 39: $Vf }, { 21: [1, 68] }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 22, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 21: [2, 20], 22: $Vb, 23: $Vc, 25: $Vd, 27: [1, 69], 28: $Ve, 39: $Vf }, { 11: 70, 39: $Vf }, { 11: 71, 39: $Vf }, { 19: 72, 46: $Vh }, { 19: 73, 46: $Vh }, { 19: 74, 46: $Vh }, { 33: [1, 75], 46: [2, 27] }, { 5: [1, 76] }, o($Vg, [2, 16]), o($Vg, [2, 17]), { 13: [1, 77] }, o($Vg, [2, 19]), { 13: [1, 78] }, { 19: 79, 46: $Vh }, { 19: 80, 46: $Vh }, { 5: [2, 32] }, { 5: [2, 22] }, { 5: [2, 23] }, { 11: 81, 39: $Vf }, o($Vg, [2, 9]), o($Vi, $V3, { 7: 82 }), o($Vj, $V3, { 7: 57, 26: 83 }), { 5: [2, 30] }, { 5: [2, 31] }, { 46: [2, 26] }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 22, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 21: [1, 84], 22: $Vb, 23: $Vc, 25: $Vd, 28: $Ve, 39: $Vf }, { 21: [2, 21] }, o($Vg, [2, 18])],
|
3410 | defaultActions: { 5: [2, 1], 6: [2, 2], 32: [2, 40], 46: [2, 28], 47: [2, 29], 72: [2, 32], 73: [2, 22], 74: [2, 23], 79: [2, 30], 80: [2, 31], 81: [2, 26], 83: [2, 21] },
|
3411 | parseError: function parseError(str, hash) {
|
3412 | if (hash.recoverable) {
|
3413 | this.trace(str);
|
3414 | } else {
|
3415 | var _parseError = function _parseError(msg, hash) {
|
3416 | this.message = msg;
|
3417 | this.hash = hash;
|
3418 | };
|
3419 |
|
3420 | _parseError.prototype = Error;
|
3421 |
|
3422 | throw new _parseError(str, hash);
|
3423 | }
|
3424 | },
|
3425 | parse: function parse(input) {
|
3426 | var self = this,
|
3427 | stack = [0],
|
3428 | tstack = [],
|
3429 | vstack = [null],
|
3430 | lstack = [],
|
3431 | table = this.table,
|
3432 | yytext = '',
|
3433 | yylineno = 0,
|
3434 | yyleng = 0,
|
3435 | recovering = 0,
|
3436 | TERROR = 2,
|
3437 | EOF = 1;
|
3438 | var args = lstack.slice.call(arguments, 1);
|
3439 | var lexer = Object.create(this.lexer);
|
3440 | var sharedState = { yy: {} };
|
3441 | for (var k in this.yy) {
|
3442 | if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
|
3443 | sharedState.yy[k] = this.yy[k];
|
3444 | }
|
3445 | }
|
3446 | lexer.setInput(input, sharedState.yy);
|
3447 | sharedState.yy.lexer = lexer;
|
3448 | sharedState.yy.parser = this;
|
3449 | if (typeof lexer.yylloc == 'undefined') {
|
3450 | lexer.yylloc = {};
|
3451 | }
|
3452 | var yyloc = lexer.yylloc;
|
3453 | lstack.push(yyloc);
|
3454 | var ranges = lexer.options && lexer.options.ranges;
|
3455 | if (typeof sharedState.yy.parseError === 'function') {
|
3456 | this.parseError = sharedState.yy.parseError;
|
3457 | } else {
|
3458 | this.parseError = Object.getPrototypeOf(this).parseError;
|
3459 | }
|
3460 | function popStack(n) {
|
3461 | stack.length = stack.length - 2 * n;
|
3462 | vstack.length = vstack.length - n;
|
3463 | lstack.length = lstack.length - n;
|
3464 | }
|
3465 | function lex() {
|
3466 | var token;
|
3467 | token = tstack.pop() || lexer.lex() || EOF;
|
3468 | if (typeof token !== 'number') {
|
3469 | if (token instanceof Array) {
|
3470 | tstack = token;
|
3471 | token = tstack.pop();
|
3472 | }
|
3473 | token = self.symbols_[token] || token;
|
3474 | }
|
3475 | return token;
|
3476 | }
|
3477 | var symbol,
|
3478 | preErrorSymbol,
|
3479 | state,
|
3480 | action,
|
3481 | a,
|
3482 | r,
|
3483 | yyval = {},
|
3484 | p,
|
3485 | len,
|
3486 | newState,
|
3487 | expected;
|
3488 | while (true) {
|
3489 | state = stack[stack.length - 1];
|
3490 | if (this.defaultActions[state]) {
|
3491 | action = this.defaultActions[state];
|
3492 | } else {
|
3493 | if (symbol === null || typeof symbol == 'undefined') {
|
3494 | symbol = lex();
|
3495 | }
|
3496 | action = table[state] && table[state][symbol];
|
3497 | }
|
3498 | if (typeof action === 'undefined' || !action.length || !action[0]) {
|
3499 | var errStr = '';
|
3500 | expected = [];
|
3501 | for (p in table[state]) {
|
3502 | if (this.terminals_[p] && p > TERROR) {
|
3503 | expected.push('\'' + this.terminals_[p] + '\'');
|
3504 | }
|
3505 | }
|
3506 | if (lexer.showPosition) {
|
3507 | errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
|
3508 | } else {
|
3509 | errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
|
3510 | }
|
3511 | this.parseError(errStr, {
|
3512 | text: lexer.match,
|
3513 | token: this.terminals_[symbol] || symbol,
|
3514 | line: lexer.yylineno,
|
3515 | loc: yyloc,
|
3516 | expected: expected
|
3517 | });
|
3518 | }
|
3519 | if (action[0] instanceof Array && action.length > 1) {
|
3520 | throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
|
3521 | }
|
3522 | switch (action[0]) {
|
3523 | case 1:
|
3524 | stack.push(symbol);
|
3525 | vstack.push(lexer.yytext);
|
3526 | lstack.push(lexer.yylloc);
|
3527 | stack.push(action[1]);
|
3528 | symbol = null;
|
3529 | if (!preErrorSymbol) {
|
3530 | yyleng = lexer.yyleng;
|
3531 | yytext = lexer.yytext;
|
3532 | yylineno = lexer.yylineno;
|
3533 | yyloc = lexer.yylloc;
|
3534 | if (recovering > 0) {
|
3535 | recovering--;
|
3536 | }
|
3537 | } else {
|
3538 | symbol = preErrorSymbol;
|
3539 | preErrorSymbol = null;
|
3540 | }
|
3541 | break;
|
3542 | case 2:
|
3543 | len = this.productions_[action[1]][1];
|
3544 | yyval.$ = vstack[vstack.length - len];
|
3545 | yyval._$ = {
|
3546 | first_line: lstack[lstack.length - (len || 1)].first_line,
|
3547 | last_line: lstack[lstack.length - 1].last_line,
|
3548 | first_column: lstack[lstack.length - (len || 1)].first_column,
|
3549 | last_column: lstack[lstack.length - 1].last_column
|
3550 | };
|
3551 | if (ranges) {
|
3552 | yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
|
3553 | }
|
3554 | r = this.performAction.apply(yyval, [yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack].concat(args));
|
3555 | if (typeof r !== 'undefined') {
|
3556 | return r;
|
3557 | }
|
3558 | if (len) {
|
3559 | stack = stack.slice(0, -1 * len * 2);
|
3560 | vstack = vstack.slice(0, -1 * len);
|
3561 | lstack = lstack.slice(0, -1 * len);
|
3562 | }
|
3563 | stack.push(this.productions_[action[1]][0]);
|
3564 | vstack.push(yyval.$);
|
3565 | lstack.push(yyval._$);
|
3566 | newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
|
3567 | stack.push(newState);
|
3568 | break;
|
3569 | case 3:
|
3570 | return true;
|
3571 | }
|
3572 | }
|
3573 | return true;
|
3574 | } };
|
3575 |
|
3576 |
|
3577 | var lexer = function () {
|
3578 | var lexer = {
|
3579 |
|
3580 | EOF: 1,
|
3581 |
|
3582 | parseError: function parseError(str, hash) {
|
3583 | if (this.yy.parser) {
|
3584 | this.yy.parser.parseError(str, hash);
|
3585 | } else {
|
3586 | throw new Error(str);
|
3587 | }
|
3588 | },
|
3589 |
|
3590 |
|
3591 | setInput: function setInput(input, yy) {
|
3592 | this.yy = yy || this.yy || {};
|
3593 | this._input = input;
|
3594 | this._more = this._backtrack = this.done = false;
|
3595 | this.yylineno = this.yyleng = 0;
|
3596 | this.yytext = this.matched = this.match = '';
|
3597 | this.conditionStack = ['INITIAL'];
|
3598 | this.yylloc = {
|
3599 | first_line: 1,
|
3600 | first_column: 0,
|
3601 | last_line: 1,
|
3602 | last_column: 0
|
3603 | };
|
3604 | if (this.options.ranges) {
|
3605 | this.yylloc.range = [0, 0];
|
3606 | }
|
3607 | this.offset = 0;
|
3608 | return this;
|
3609 | },
|
3610 |
|
3611 |
|
3612 | input: function input() {
|
3613 | var ch = this._input[0];
|
3614 | this.yytext += ch;
|
3615 | this.yyleng++;
|
3616 | this.offset++;
|
3617 | this.match += ch;
|
3618 | this.matched += ch;
|
3619 | var lines = ch.match(/(?:\r\n?|\n).*/g);
|
3620 | if (lines) {
|
3621 | this.yylineno++;
|
3622 | this.yylloc.last_line++;
|
3623 | } else {
|
3624 | this.yylloc.last_column++;
|
3625 | }
|
3626 | if (this.options.ranges) {
|
3627 | this.yylloc.range[1]++;
|
3628 | }
|
3629 |
|
3630 | this._input = this._input.slice(1);
|
3631 | return ch;
|
3632 | },
|
3633 |
|
3634 |
|
3635 | unput: function unput(ch) {
|
3636 | var len = ch.length;
|
3637 | var lines = ch.split(/(?:\r\n?|\n)/g);
|
3638 |
|
3639 | this._input = ch + this._input;
|
3640 | this.yytext = this.yytext.substr(0, this.yytext.length - len);
|
3641 |
|
3642 | this.offset -= len;
|
3643 | var oldLines = this.match.split(/(?:\r\n?|\n)/g);
|
3644 | this.match = this.match.substr(0, this.match.length - 1);
|
3645 | this.matched = this.matched.substr(0, this.matched.length - 1);
|
3646 |
|
3647 | if (lines.length - 1) {
|
3648 | this.yylineno -= lines.length - 1;
|
3649 | }
|
3650 | var r = this.yylloc.range;
|
3651 |
|
3652 | this.yylloc = {
|
3653 | first_line: this.yylloc.first_line,
|
3654 | last_line: this.yylineno + 1,
|
3655 | first_column: this.yylloc.first_column,
|
3656 | 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
|
3657 | };
|
3658 |
|
3659 | if (this.options.ranges) {
|
3660 | this.yylloc.range = [r[0], r[0] + this.yyleng - len];
|
3661 | }
|
3662 | this.yyleng = this.yytext.length;
|
3663 | return this;
|
3664 | },
|
3665 |
|
3666 |
|
3667 | more: function more() {
|
3668 | this._more = true;
|
3669 | return this;
|
3670 | },
|
3671 |
|
3672 |
|
3673 | reject: function reject() {
|
3674 | if (this.options.backtrack_lexer) {
|
3675 | this._backtrack = true;
|
3676 | } else {
|
3677 | 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(), {
|
3678 | text: "",
|
3679 | token: null,
|
3680 | line: this.yylineno
|
3681 | });
|
3682 | }
|
3683 | return this;
|
3684 | },
|
3685 |
|
3686 |
|
3687 | less: function less(n) {
|
3688 | this.unput(this.match.slice(n));
|
3689 | },
|
3690 |
|
3691 |
|
3692 | pastInput: function pastInput() {
|
3693 | var past = this.matched.substr(0, this.matched.length - this.match.length);
|
3694 | return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, "");
|
3695 | },
|
3696 |
|
3697 |
|
3698 | upcomingInput: function upcomingInput() {
|
3699 | var next = this.match;
|
3700 | if (next.length < 20) {
|
3701 | next += this._input.substr(0, 20 - next.length);
|
3702 | }
|
3703 | return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
|
3704 | },
|
3705 |
|
3706 |
|
3707 | showPosition: function showPosition() {
|
3708 | var pre = this.pastInput();
|
3709 | var c = new Array(pre.length + 1).join("-");
|
3710 | return pre + this.upcomingInput() + "\n" + c + "^";
|
3711 | },
|
3712 |
|
3713 |
|
3714 | test_match: function test_match(match, indexed_rule) {
|
3715 | var token, lines, backup;
|
3716 |
|
3717 | if (this.options.backtrack_lexer) {
|
3718 |
|
3719 | backup = {
|
3720 | yylineno: this.yylineno,
|
3721 | yylloc: {
|
3722 | first_line: this.yylloc.first_line,
|
3723 | last_line: this.last_line,
|
3724 | first_column: this.yylloc.first_column,
|
3725 | last_column: this.yylloc.last_column
|
3726 | },
|
3727 | yytext: this.yytext,
|
3728 | match: this.match,
|
3729 | matches: this.matches,
|
3730 | matched: this.matched,
|
3731 | yyleng: this.yyleng,
|
3732 | offset: this.offset,
|
3733 | _more: this._more,
|
3734 | _input: this._input,
|
3735 | yy: this.yy,
|
3736 | conditionStack: this.conditionStack.slice(0),
|
3737 | done: this.done
|
3738 | };
|
3739 | if (this.options.ranges) {
|
3740 | backup.yylloc.range = this.yylloc.range.slice(0);
|
3741 | }
|
3742 | }
|
3743 |
|
3744 | lines = match[0].match(/(?:\r\n?|\n).*/g);
|
3745 | if (lines) {
|
3746 | this.yylineno += lines.length;
|
3747 | }
|
3748 | this.yylloc = {
|
3749 | first_line: this.yylloc.last_line,
|
3750 | last_line: this.yylineno + 1,
|
3751 | first_column: this.yylloc.last_column,
|
3752 | last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
|
3753 | };
|
3754 | this.yytext += match[0];
|
3755 | this.match += match[0];
|
3756 | this.matches = match;
|
3757 | this.yyleng = this.yytext.length;
|
3758 | if (this.options.ranges) {
|
3759 | this.yylloc.range = [this.offset, this.offset += this.yyleng];
|
3760 | }
|
3761 | this._more = false;
|
3762 | this._backtrack = false;
|
3763 | this._input = this._input.slice(match[0].length);
|
3764 | this.matched += match[0];
|
3765 | token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
|
3766 | if (this.done && this._input) {
|
3767 | this.done = false;
|
3768 | }
|
3769 | if (token) {
|
3770 | return token;
|
3771 | } else if (this._backtrack) {
|
3772 |
|
3773 | for (var k in backup) {
|
3774 | this[k] = backup[k];
|
3775 | }
|
3776 | return false;
|
3777 | }
|
3778 | return false;
|
3779 | },
|
3780 |
|
3781 |
|
3782 | next: function next() {
|
3783 | if (this.done) {
|
3784 | return this.EOF;
|
3785 | }
|
3786 | if (!this._input) {
|
3787 | this.done = true;
|
3788 | }
|
3789 |
|
3790 | var token, match, tempMatch, index;
|
3791 | if (!this._more) {
|
3792 | this.yytext = '';
|
3793 | this.match = '';
|
3794 | }
|
3795 | var rules = this._currentRules();
|
3796 | for (var i = 0; i < rules.length; i++) {
|
3797 | tempMatch = this._input.match(this.rules[rules[i]]);
|
3798 | if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
|
3799 | match = tempMatch;
|
3800 | index = i;
|
3801 | if (this.options.backtrack_lexer) {
|
3802 | token = this.test_match(tempMatch, rules[i]);
|
3803 | if (token !== false) {
|
3804 | return token;
|
3805 | } else if (this._backtrack) {
|
3806 | match = false;
|
3807 | continue;
|
3808 | } else {
|
3809 |
|
3810 | return false;
|
3811 | }
|
3812 | } else if (!this.options.flex) {
|
3813 | break;
|
3814 | }
|
3815 | }
|
3816 | }
|
3817 | if (match) {
|
3818 | token = this.test_match(match, rules[index]);
|
3819 | if (token !== false) {
|
3820 | return token;
|
3821 | }
|
3822 |
|
3823 | return false;
|
3824 | }
|
3825 | if (this._input === "") {
|
3826 | return this.EOF;
|
3827 | } else {
|
3828 | return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
|
3829 | text: "",
|
3830 | token: null,
|
3831 | line: this.yylineno
|
3832 | });
|
3833 | }
|
3834 | },
|
3835 |
|
3836 |
|
3837 | lex: function lex() {
|
3838 | var r = this.next();
|
3839 | if (r) {
|
3840 | return r;
|
3841 | } else {
|
3842 | return this.lex();
|
3843 | }
|
3844 | },
|
3845 |
|
3846 |
|
3847 | begin: function begin(condition) {
|
3848 | this.conditionStack.push(condition);
|
3849 | },
|
3850 |
|
3851 |
|
3852 | popState: function popState() {
|
3853 | var n = this.conditionStack.length - 1;
|
3854 | if (n > 0) {
|
3855 | return this.conditionStack.pop();
|
3856 | } else {
|
3857 | return this.conditionStack[0];
|
3858 | }
|
3859 | },
|
3860 |
|
3861 |
|
3862 | _currentRules: function _currentRules() {
|
3863 | if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
|
3864 | return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
|
3865 | } else {
|
3866 | return this.conditions["INITIAL"].rules;
|
3867 | }
|
3868 | },
|
3869 |
|
3870 |
|
3871 | topState: function topState(n) {
|
3872 | n = this.conditionStack.length - 1 - Math.abs(n || 0);
|
3873 | if (n >= 0) {
|
3874 | return this.conditionStack[n];
|
3875 | } else {
|
3876 | return "INITIAL";
|
3877 | }
|
3878 | },
|
3879 |
|
3880 |
|
3881 | pushState: function pushState(condition) {
|
3882 | this.begin(condition);
|
3883 | },
|
3884 |
|
3885 |
|
3886 | stateStackSize: function stateStackSize() {
|
3887 | return this.conditionStack.length;
|
3888 | },
|
3889 | options: { "case-insensitive": true },
|
3890 | performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
|
3891 | var YYSTATE = YY_START;
|
3892 | switch ($avoiding_name_collisions) {
|
3893 | case 0:
|
3894 | return 5;
|
3895 | break;
|
3896 | case 1:
|
3897 |
|
3898 | break;
|
3899 | case 2:
|
3900 |
|
3901 | break;
|
3902 | case 3:
|
3903 |
|
3904 | break;
|
3905 | case 4:
|
3906 |
|
3907 | break;
|
3908 | case 5:
|
3909 | this.begin('ID');return 10;
|
3910 | break;
|
3911 | case 6:
|
3912 | this.begin('ALIAS');return 39;
|
3913 | break;
|
3914 | case 7:
|
3915 | this.popState();this.popState();this.begin('LINE');return 12;
|
3916 | break;
|
3917 | case 8:
|
3918 | this.popState();this.popState();return 5;
|
3919 | break;
|
3920 | case 9:
|
3921 | this.begin('LINE');return 20;
|
3922 | break;
|
3923 | case 10:
|
3924 | this.begin('LINE');return 22;
|
3925 | break;
|
3926 | case 11:
|
3927 | this.begin('LINE');return 23;
|
3928 | break;
|
3929 | case 12:
|
3930 | this.begin('LINE');return 24;
|
3931 | break;
|
3932 | case 13:
|
3933 | this.begin('LINE');return 25;
|
3934 | break;
|
3935 | case 14:
|
3936 | this.begin('LINE');return 27;
|
3937 | break;
|
3938 | case 15:
|
3939 | this.popState();return 13;
|
3940 | break;
|
3941 | case 16:
|
3942 | return 21;
|
3943 | break;
|
3944 | case 17:
|
3945 | return 34;
|
3946 | break;
|
3947 | case 18:
|
3948 | return 35;
|
3949 | break;
|
3950 | case 19:
|
3951 | return 30;
|
3952 | break;
|
3953 | case 20:
|
3954 | return 28;
|
3955 | break;
|
3956 | case 21:
|
3957 | this.begin('ID');return 15;
|
3958 | break;
|
3959 | case 22:
|
3960 | this.begin('ID');return 16;
|
3961 | break;
|
3962 | case 23:
|
3963 | return 18;
|
3964 | break;
|
3965 | case 24:
|
3966 | return 6;
|
3967 | break;
|
3968 | case 25:
|
3969 | return 33;
|
3970 | break;
|
3971 | case 26:
|
3972 | return 5;
|
3973 | break;
|
3974 | case 27:
|
3975 | yy_.yytext = yy_.yytext.trim();return 39;
|
3976 | break;
|
3977 | case 28:
|
3978 | return 42;
|
3979 | break;
|
3980 | case 29:
|
3981 | return 43;
|
3982 | break;
|
3983 | case 30:
|
3984 | return 40;
|
3985 | break;
|
3986 | case 31:
|
3987 | return 41;
|
3988 | break;
|
3989 | case 32:
|
3990 | return 44;
|
3991 | break;
|
3992 | case 33:
|
3993 | return 45;
|
3994 | break;
|
3995 | case 34:
|
3996 | return 46;
|
3997 | break;
|
3998 | case 35:
|
3999 | return 37;
|
4000 | break;
|
4001 | case 36:
|
4002 | return 38;
|
4003 | break;
|
4004 | case 37:
|
4005 | return 5;
|
4006 | break;
|
4007 | case 38:
|
4008 | return 'INVALID';
|
4009 | break;
|
4010 | }
|
4011 | },
|
4012 | rules: [/^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:participant\b)/i, /^(?:[^\->:\n,;]+?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i, /^(?:as\b)/i, /^(?:(?:))/i, /^(?:loop\b)/i, /^(?:opt\b)/i, /^(?:alt\b)/i, /^(?:else\b)/i, /^(?:par\b)/i, /^(?:and\b)/i, /^(?:[^#\n;]*)/i, /^(?:end\b)/i, /^(?:left of\b)/i, /^(?:right of\b)/i, /^(?:over\b)/i, /^(?:note\b)/i, /^(?:activate\b)/i, /^(?:deactivate\b)/i, /^(?:title\b)/i, /^(?:sequenceDiagram\b)/i, /^(?:,)/i, /^(?:;)/i, /^(?:[^\+\->:\n,;]+)/i, /^(?:->>)/i, /^(?:-->>)/i, /^(?:->)/i, /^(?:-->)/i, /^(?:-[x])/i, /^(?:--[x])/i, /^(?::[^#\n;]+)/i, /^(?:\+)/i, /^(?:-)/i, /^(?:$)/i, /^(?:.)/i],
|
4013 | conditions: { "LINE": { "rules": [2, 3, 15], "inclusive": false }, "ALIAS": { "rules": [2, 3, 7, 8], "inclusive": false }, "ID": { "rules": [2, 3, 6], "inclusive": false }, "INITIAL": { "rules": [0, 1, 3, 4, 5, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38], "inclusive": true } }
|
4014 | };
|
4015 | return lexer;
|
4016 | }();
|
4017 | parser.lexer = lexer;
|
4018 | function Parser() {
|
4019 | this.yy = {};
|
4020 | }
|
4021 | Parser.prototype = parser;parser.Parser = Parser;
|
4022 | return new Parser();
|
4023 | }();
|
4024 |
|
4025 | if (true) {
|
4026 | exports.parser = parser;
|
4027 | exports.Parser = parser.Parser;
|
4028 | exports.parse = function () {
|
4029 | return parser.parse.apply(parser, arguments);
|
4030 | };
|
4031 | exports.main = function commonjsMain(args) {
|
4032 | if (!args[1]) {
|
4033 | console.log('Usage: ' + args[0] + ' FILE');
|
4034 | process.exit(1);
|
4035 | }
|
4036 | var source = __webpack_require__(3).readFileSync(__webpack_require__(4).normalize(args[1]), "utf8");
|
4037 | return exports.parser.parse(source);
|
4038 | };
|
4039 | if (typeof module !== 'undefined' && __webpack_require__.c[__webpack_require__.s] === module) {
|
4040 | exports.main(process.argv.slice(1));
|
4041 | }
|
4042 | }
|
4043 | }.call(exports, __webpack_require__(2)(module)))
|
4044 |
|
4045 | }),
|
4046 |
|
4047 | (function(module, exports, __webpack_require__) {
|
4048 |
|
4049 | "use strict";
|
4050 |
|
4051 |
|
4052 |
|
4053 |
|
4054 |
|
4055 | var actors = {};
|
4056 | var messages = [];
|
4057 | var notes = [];
|
4058 | var title = '';
|
4059 | var Logger = __webpack_require__(0);
|
4060 | var log = Logger.Log;
|
4061 |
|
4062 | exports.addActor = function (id, name, description) {
|
4063 |
|
4064 | var old = actors[id];
|
4065 | if (old && name === old.name && description == null) return;
|
4066 |
|
4067 |
|
4068 | if (description == null) description = name;
|
4069 |
|
4070 | actors[id] = { name: name, description: description };
|
4071 | };
|
4072 |
|
4073 | exports.addMessage = function (idFrom, idTo, message, answer) {
|
4074 | messages.push({ from: idFrom, to: idTo, message: message, answer: answer });
|
4075 | };
|
4076 |
|
4077 | exports.addSignal = function (idFrom, idTo, message, messageType) {
|
4078 | log.debug('Adding message from=' + idFrom + ' to=' + idTo + ' message=' + message + ' type=' + messageType);
|
4079 | messages.push({ from: idFrom, to: idTo, message: message, type: messageType });
|
4080 | };
|
4081 |
|
4082 | exports.getMessages = function () {
|
4083 | return messages;
|
4084 | };
|
4085 |
|
4086 | exports.getActors = function () {
|
4087 | return actors;
|
4088 | };
|
4089 | exports.getActor = function (id) {
|
4090 | return actors[id];
|
4091 | };
|
4092 | exports.getActorKeys = function () {
|
4093 | return Object.keys(actors);
|
4094 | };
|
4095 | exports.getTitle = function () {
|
4096 | return title;
|
4097 | };
|
4098 |
|
4099 | exports.clear = function () {
|
4100 | actors = {};
|
4101 | messages = [];
|
4102 | };
|
4103 |
|
4104 | exports.LINETYPE = {
|
4105 | SOLID: 0,
|
4106 | DOTTED: 1,
|
4107 | NOTE: 2,
|
4108 | SOLID_CROSS: 3,
|
4109 | DOTTED_CROSS: 4,
|
4110 | SOLID_OPEN: 5,
|
4111 | DOTTED_OPEN: 6,
|
4112 | LOOP_START: 10,
|
4113 | LOOP_END: 11,
|
4114 | ALT_START: 12,
|
4115 | ALT_ELSE: 13,
|
4116 | ALT_END: 14,
|
4117 | OPT_START: 15,
|
4118 | OPT_END: 16,
|
4119 | ACTIVE_START: 17,
|
4120 | ACTIVE_END: 18,
|
4121 | PAR_START: 19,
|
4122 | PAR_AND: 20,
|
4123 | PAR_END: 21
|
4124 | };
|
4125 |
|
4126 | exports.ARROWTYPE = {
|
4127 | FILLED: 0,
|
4128 | OPEN: 1
|
4129 | };
|
4130 |
|
4131 | exports.PLACEMENT = {
|
4132 | LEFTOF: 0,
|
4133 | RIGHTOF: 1,
|
4134 | OVER: 2
|
4135 | };
|
4136 |
|
4137 | exports.addNote = function (actor, placement, message) {
|
4138 | var note = { actor: actor, placement: placement, message: message
|
4139 |
|
4140 |
|
4141 | };var actors = [].concat(actor, actor);
|
4142 |
|
4143 | notes.push(note);
|
4144 | messages.push({ from: actors[0], to: actors[1], message: message, type: exports.LINETYPE.NOTE, placement: placement });
|
4145 | };
|
4146 |
|
4147 | exports.setTitle = function (titleText) {
|
4148 | title = titleText;
|
4149 | };
|
4150 |
|
4151 | exports.parseError = function (err, hash) {
|
4152 | global.mermaidAPI.parseError(err, hash);
|
4153 | };
|
4154 |
|
4155 | exports.apply = function (param) {
|
4156 | if (param instanceof Array) {
|
4157 | param.forEach(function (item) {
|
4158 | exports.apply(item);
|
4159 | });
|
4160 | } else {
|
4161 | switch (param.type) {
|
4162 | case 'addActor':
|
4163 | exports.addActor(param.actor, param.actor, param.description);
|
4164 | break;
|
4165 | case 'activeStart':
|
4166 | exports.addSignal(param.actor, undefined, undefined, param.signalType);
|
4167 | break;
|
4168 | case 'activeEnd':
|
4169 | exports.addSignal(param.actor, undefined, undefined, param.signalType);
|
4170 | break;
|
4171 | case 'addNote':
|
4172 | exports.addNote(param.actor, param.placement, param.text);
|
4173 | break;
|
4174 | case 'addMessage':
|
4175 | exports.addSignal(param.from, param.to, param.msg, param.signalType);
|
4176 | break;
|
4177 | case 'loopStart':
|
4178 | exports.addSignal(undefined, undefined, param.loopText, param.signalType);
|
4179 | break;
|
4180 | case 'loopEnd':
|
4181 | exports.addSignal(undefined, undefined, undefined, param.signalType);
|
4182 | break;
|
4183 | case 'optStart':
|
4184 | exports.addSignal(undefined, undefined, param.optText, param.signalType);
|
4185 | break;
|
4186 | case 'optEnd':
|
4187 | exports.addSignal(undefined, undefined, undefined, param.signalType);
|
4188 | break;
|
4189 | case 'altStart':
|
4190 | exports.addSignal(undefined, undefined, param.altText, param.signalType);
|
4191 | break;
|
4192 | case 'else':
|
4193 | exports.addSignal(undefined, undefined, param.altText, param.signalType);
|
4194 | break;
|
4195 | case 'altEnd':
|
4196 | exports.addSignal(undefined, undefined, undefined, param.signalType);
|
4197 | break;
|
4198 | case 'setTitle':
|
4199 | exports.setTitle(param.text);
|
4200 | break;
|
4201 | case 'parStart':
|
4202 | exports.addSignal(undefined, undefined, param.parText, param.signalType);
|
4203 | break;
|
4204 | case 'and':
|
4205 | exports.addSignal(undefined, undefined, param.parText, param.signalType);
|
4206 | break;
|
4207 | case 'parEnd':
|
4208 | exports.addSignal(undefined, undefined, undefined, param.signalType);
|
4209 | break;
|
4210 | }
|
4211 | }
|
4212 | };
|
4213 |
|
4214 | }),
|
4215 |
|
4216 | (function(module, exports, __webpack_require__) {
|
4217 |
|
4218 | "use strict";
|
4219 |
|
4220 |
|
4221 |
|
4222 |
|
4223 |
|
4224 | var Logger = __webpack_require__(0);
|
4225 | var log = Logger.Log;
|
4226 |
|
4227 | var message = '';
|
4228 | var info = false;
|
4229 |
|
4230 | exports.setMessage = function (txt) {
|
4231 | log.debug('Setting message to: ' + txt);
|
4232 | message = txt;
|
4233 | };
|
4234 |
|
4235 | exports.getMessage = function () {
|
4236 | return message;
|
4237 | };
|
4238 |
|
4239 | exports.setInfo = function (inf) {
|
4240 | info = inf;
|
4241 | };
|
4242 |
|
4243 | exports.getInfo = function () {
|
4244 | return info;
|
4245 | };
|
4246 |
|
4247 | exports.parseError = function (err, hash) {
|
4248 | global.mermaidAPI.parseError(err, hash);
|
4249 | };
|
4250 |
|
4251 | }),
|
4252 |
|
4253 | (function(module, exports, __webpack_require__) {
|
4254 |
|
4255 | "use strict";
|
4256 | (function(module) {
|
4257 |
|
4258 |
|
4259 |
|
4260 |
|
4261 |
|
4262 |
|
4263 |
|
4264 |
|
4265 |
|
4266 |
|
4267 |
|
4268 |
|
4269 |
|
4270 |
|
4271 |
|
4272 |
|
4273 |
|
4274 |
|
4275 |
|
4276 |
|
4277 |
|
4278 |
|
4279 |
|
4280 |
|
4281 |
|
4282 |
|
4283 |
|
4284 |
|
4285 |
|
4286 |
|
4287 |
|
4288 |
|
4289 |
|
4290 |
|
4291 |
|
4292 |
|
4293 |
|
4294 |
|
4295 |
|
4296 |
|
4297 |
|
4298 |
|
4299 |
|
4300 |
|
4301 |
|
4302 |
|
4303 |
|
4304 |
|
4305 |
|
4306 |
|
4307 |
|
4308 |
|
4309 |
|
4310 |
|
4311 |
|
4312 |
|
4313 |
|
4314 |
|
4315 |
|
4316 |
|
4317 |
|
4318 |
|
4319 |
|
4320 |
|
4321 |
|
4322 |
|
4323 |
|
4324 |
|
4325 |
|
4326 |
|
4327 |
|
4328 |
|
4329 |
|
4330 |
|
4331 | var parser = function () {
|
4332 | var o = function o(k, v, _o, l) {
|
4333 | for (_o = _o || {}, l = k.length; l--; _o[k[l]] = v) {}return _o;
|
4334 | },
|
4335 | $V0 = [6, 9, 10, 12];
|
4336 | var parser = { trace: function trace() {},
|
4337 | yy: {},
|
4338 | symbols_: { "error": 2, "start": 3, "info": 4, "document": 5, "EOF": 6, "line": 7, "statement": 8, "NL": 9, "showInfo": 10, "message": 11, "say": 12, "TXT": 13, "$accept": 0, "$end": 1 },
|
4339 | terminals_: { 2: "error", 4: "info", 6: "EOF", 9: "NL", 10: "showInfo", 12: "say", 13: "TXT" },
|
4340 | productions_: [0, [3, 3], [5, 0], [5, 2], [7, 1], [7, 1], [8, 1], [8, 1], [11, 2]],
|
4341 | performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
|
4342 |
|
4343 |
|
4344 | var $0 = $$.length - 1;
|
4345 | switch (yystate) {
|
4346 | case 1:
|
4347 | return yy;
|
4348 | break;
|
4349 | case 4:
|
4350 |
|
4351 | break;
|
4352 | case 6:
|
4353 | yy.setInfo(true);
|
4354 | break;
|
4355 | case 7:
|
4356 | yy.setMessage($$[$0]);
|
4357 | break;
|
4358 | case 8:
|
4359 | this.$ = $$[$0 - 1].substring(1).trim().replace(/\\n/gm, "\n");
|
4360 | break;
|
4361 | }
|
4362 | },
|
4363 | table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, o($V0, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: 6, 9: [1, 7], 10: [1, 8], 11: 9, 12: [1, 10] }, { 1: [2, 1] }, o($V0, [2, 3]), o($V0, [2, 4]), o($V0, [2, 5]), o($V0, [2, 6]), o($V0, [2, 7]), { 13: [1, 11] }, o($V0, [2, 8])],
|
4364 | defaultActions: { 4: [2, 1] },
|
4365 | parseError: function parseError(str, hash) {
|
4366 | if (hash.recoverable) {
|
4367 | this.trace(str);
|
4368 | } else {
|
4369 | var _parseError = function _parseError(msg, hash) {
|
4370 | this.message = msg;
|
4371 | this.hash = hash;
|
4372 | };
|
4373 |
|
4374 | _parseError.prototype = Error;
|
4375 |
|
4376 | throw new _parseError(str, hash);
|
4377 | }
|
4378 | },
|
4379 | parse: function parse(input) {
|
4380 | var self = this,
|
4381 | stack = [0],
|
4382 | tstack = [],
|
4383 | vstack = [null],
|
4384 | lstack = [],
|
4385 | table = this.table,
|
4386 | yytext = '',
|
4387 | yylineno = 0,
|
4388 | yyleng = 0,
|
4389 | recovering = 0,
|
4390 | TERROR = 2,
|
4391 | EOF = 1;
|
4392 | var args = lstack.slice.call(arguments, 1);
|
4393 | var lexer = Object.create(this.lexer);
|
4394 | var sharedState = { yy: {} };
|
4395 | for (var k in this.yy) {
|
4396 | if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
|
4397 | sharedState.yy[k] = this.yy[k];
|
4398 | }
|
4399 | }
|
4400 | lexer.setInput(input, sharedState.yy);
|
4401 | sharedState.yy.lexer = lexer;
|
4402 | sharedState.yy.parser = this;
|
4403 | if (typeof lexer.yylloc == 'undefined') {
|
4404 | lexer.yylloc = {};
|
4405 | }
|
4406 | var yyloc = lexer.yylloc;
|
4407 | lstack.push(yyloc);
|
4408 | var ranges = lexer.options && lexer.options.ranges;
|
4409 | if (typeof sharedState.yy.parseError === 'function') {
|
4410 | this.parseError = sharedState.yy.parseError;
|
4411 | } else {
|
4412 | this.parseError = Object.getPrototypeOf(this).parseError;
|
4413 | }
|
4414 | function popStack(n) {
|
4415 | stack.length = stack.length - 2 * n;
|
4416 | vstack.length = vstack.length - n;
|
4417 | lstack.length = lstack.length - n;
|
4418 | }
|
4419 | function lex() {
|
4420 | var token;
|
4421 | token = tstack.pop() || lexer.lex() || EOF;
|
4422 | if (typeof token !== 'number') {
|
4423 | if (token instanceof Array) {
|
4424 | tstack = token;
|
4425 | token = tstack.pop();
|
4426 | }
|
4427 | token = self.symbols_[token] || token;
|
4428 | }
|
4429 | return token;
|
4430 | }
|
4431 | var symbol,
|
4432 | preErrorSymbol,
|
4433 | state,
|
4434 | action,
|
4435 | a,
|
4436 | r,
|
4437 | yyval = {},
|
4438 | p,
|
4439 | len,
|
4440 | newState,
|
4441 | expected;
|
4442 | while (true) {
|
4443 | state = stack[stack.length - 1];
|
4444 | if (this.defaultActions[state]) {
|
4445 | action = this.defaultActions[state];
|
4446 | } else {
|
4447 | if (symbol === null || typeof symbol == 'undefined') {
|
4448 | symbol = lex();
|
4449 | }
|
4450 | action = table[state] && table[state][symbol];
|
4451 | }
|
4452 | if (typeof action === 'undefined' || !action.length || !action[0]) {
|
4453 | var errStr = '';
|
4454 | expected = [];
|
4455 | for (p in table[state]) {
|
4456 | if (this.terminals_[p] && p > TERROR) {
|
4457 | expected.push('\'' + this.terminals_[p] + '\'');
|
4458 | }
|
4459 | }
|
4460 | if (lexer.showPosition) {
|
4461 | errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
|
4462 | } else {
|
4463 | errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
|
4464 | }
|
4465 | this.parseError(errStr, {
|
4466 | text: lexer.match,
|
4467 | token: this.terminals_[symbol] || symbol,
|
4468 | line: lexer.yylineno,
|
4469 | loc: yyloc,
|
4470 | expected: expected
|
4471 | });
|
4472 | }
|
4473 | if (action[0] instanceof Array && action.length > 1) {
|
4474 | throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
|
4475 | }
|
4476 | switch (action[0]) {
|
4477 | case 1:
|
4478 | stack.push(symbol);
|
4479 | vstack.push(lexer.yytext);
|
4480 | lstack.push(lexer.yylloc);
|
4481 | stack.push(action[1]);
|
4482 | symbol = null;
|
4483 | if (!preErrorSymbol) {
|
4484 | yyleng = lexer.yyleng;
|
4485 | yytext = lexer.yytext;
|
4486 | yylineno = lexer.yylineno;
|
4487 | yyloc = lexer.yylloc;
|
4488 | if (recovering > 0) {
|
4489 | recovering--;
|
4490 | }
|
4491 | } else {
|
4492 | symbol = preErrorSymbol;
|
4493 | preErrorSymbol = null;
|
4494 | }
|
4495 | break;
|
4496 | case 2:
|
4497 | len = this.productions_[action[1]][1];
|
4498 | yyval.$ = vstack[vstack.length - len];
|
4499 | yyval._$ = {
|
4500 | first_line: lstack[lstack.length - (len || 1)].first_line,
|
4501 | last_line: lstack[lstack.length - 1].last_line,
|
4502 | first_column: lstack[lstack.length - (len || 1)].first_column,
|
4503 | last_column: lstack[lstack.length - 1].last_column
|
4504 | };
|
4505 | if (ranges) {
|
4506 | yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
|
4507 | }
|
4508 | r = this.performAction.apply(yyval, [yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack].concat(args));
|
4509 | if (typeof r !== 'undefined') {
|
4510 | return r;
|
4511 | }
|
4512 | if (len) {
|
4513 | stack = stack.slice(0, -1 * len * 2);
|
4514 | vstack = vstack.slice(0, -1 * len);
|
4515 | lstack = lstack.slice(0, -1 * len);
|
4516 | }
|
4517 | stack.push(this.productions_[action[1]][0]);
|
4518 | vstack.push(yyval.$);
|
4519 | lstack.push(yyval._$);
|
4520 | newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
|
4521 | stack.push(newState);
|
4522 | break;
|
4523 | case 3:
|
4524 | return true;
|
4525 | }
|
4526 | }
|
4527 | return true;
|
4528 | } };
|
4529 |
|
4530 |
|
4531 | var lexer = function () {
|
4532 | var lexer = {
|
4533 |
|
4534 | EOF: 1,
|
4535 |
|
4536 | parseError: function parseError(str, hash) {
|
4537 | if (this.yy.parser) {
|
4538 | this.yy.parser.parseError(str, hash);
|
4539 | } else {
|
4540 | throw new Error(str);
|
4541 | }
|
4542 | },
|
4543 |
|
4544 |
|
4545 | setInput: function setInput(input, yy) {
|
4546 | this.yy = yy || this.yy || {};
|
4547 | this._input = input;
|
4548 | this._more = this._backtrack = this.done = false;
|
4549 | this.yylineno = this.yyleng = 0;
|
4550 | this.yytext = this.matched = this.match = '';
|
4551 | this.conditionStack = ['INITIAL'];
|
4552 | this.yylloc = {
|
4553 | first_line: 1,
|
4554 | first_column: 0,
|
4555 | last_line: 1,
|
4556 | last_column: 0
|
4557 | };
|
4558 | if (this.options.ranges) {
|
4559 | this.yylloc.range = [0, 0];
|
4560 | }
|
4561 | this.offset = 0;
|
4562 | return this;
|
4563 | },
|
4564 |
|
4565 |
|
4566 | input: function input() {
|
4567 | var ch = this._input[0];
|
4568 | this.yytext += ch;
|
4569 | this.yyleng++;
|
4570 | this.offset++;
|
4571 | this.match += ch;
|
4572 | this.matched += ch;
|
4573 | var lines = ch.match(/(?:\r\n?|\n).*/g);
|
4574 | if (lines) {
|
4575 | this.yylineno++;
|
4576 | this.yylloc.last_line++;
|
4577 | } else {
|
4578 | this.yylloc.last_column++;
|
4579 | }
|
4580 | if (this.options.ranges) {
|
4581 | this.yylloc.range[1]++;
|
4582 | }
|
4583 |
|
4584 | this._input = this._input.slice(1);
|
4585 | return ch;
|
4586 | },
|
4587 |
|
4588 |
|
4589 | unput: function unput(ch) {
|
4590 | var len = ch.length;
|
4591 | var lines = ch.split(/(?:\r\n?|\n)/g);
|
4592 |
|
4593 | this._input = ch + this._input;
|
4594 | this.yytext = this.yytext.substr(0, this.yytext.length - len);
|
4595 |
|
4596 | this.offset -= len;
|
4597 | var oldLines = this.match.split(/(?:\r\n?|\n)/g);
|
4598 | this.match = this.match.substr(0, this.match.length - 1);
|
4599 | this.matched = this.matched.substr(0, this.matched.length - 1);
|
4600 |
|
4601 | if (lines.length - 1) {
|
4602 | this.yylineno -= lines.length - 1;
|
4603 | }
|
4604 | var r = this.yylloc.range;
|
4605 |
|
4606 | this.yylloc = {
|
4607 | first_line: this.yylloc.first_line,
|
4608 | last_line: this.yylineno + 1,
|
4609 | first_column: this.yylloc.first_column,
|
4610 | 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
|
4611 | };
|
4612 |
|
4613 | if (this.options.ranges) {
|
4614 | this.yylloc.range = [r[0], r[0] + this.yyleng - len];
|
4615 | }
|
4616 | this.yyleng = this.yytext.length;
|
4617 | return this;
|
4618 | },
|
4619 |
|
4620 |
|
4621 | more: function more() {
|
4622 | this._more = true;
|
4623 | return this;
|
4624 | },
|
4625 |
|
4626 |
|
4627 | reject: function reject() {
|
4628 | if (this.options.backtrack_lexer) {
|
4629 | this._backtrack = true;
|
4630 | } else {
|
4631 | 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(), {
|
4632 | text: "",
|
4633 | token: null,
|
4634 | line: this.yylineno
|
4635 | });
|
4636 | }
|
4637 | return this;
|
4638 | },
|
4639 |
|
4640 |
|
4641 | less: function less(n) {
|
4642 | this.unput(this.match.slice(n));
|
4643 | },
|
4644 |
|
4645 |
|
4646 | pastInput: function pastInput() {
|
4647 | var past = this.matched.substr(0, this.matched.length - this.match.length);
|
4648 | return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, "");
|
4649 | },
|
4650 |
|
4651 |
|
4652 | upcomingInput: function upcomingInput() {
|
4653 | var next = this.match;
|
4654 | if (next.length < 20) {
|
4655 | next += this._input.substr(0, 20 - next.length);
|
4656 | }
|
4657 | return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
|
4658 | },
|
4659 |
|
4660 |
|
4661 | showPosition: function showPosition() {
|
4662 | var pre = this.pastInput();
|
4663 | var c = new Array(pre.length + 1).join("-");
|
4664 | return pre + this.upcomingInput() + "\n" + c + "^";
|
4665 | },
|
4666 |
|
4667 |
|
4668 | test_match: function test_match(match, indexed_rule) {
|
4669 | var token, lines, backup;
|
4670 |
|
4671 | if (this.options.backtrack_lexer) {
|
4672 |
|
4673 | backup = {
|
4674 | yylineno: this.yylineno,
|
4675 | yylloc: {
|
4676 | first_line: this.yylloc.first_line,
|
4677 | last_line: this.last_line,
|
4678 | first_column: this.yylloc.first_column,
|
4679 | last_column: this.yylloc.last_column
|
4680 | },
|
4681 | yytext: this.yytext,
|
4682 | match: this.match,
|
4683 | matches: this.matches,
|
4684 | matched: this.matched,
|
4685 | yyleng: this.yyleng,
|
4686 | offset: this.offset,
|
4687 | _more: this._more,
|
4688 | _input: this._input,
|
4689 | yy: this.yy,
|
4690 | conditionStack: this.conditionStack.slice(0),
|
4691 | done: this.done
|
4692 | };
|
4693 | if (this.options.ranges) {
|
4694 | backup.yylloc.range = this.yylloc.range.slice(0);
|
4695 | }
|
4696 | }
|
4697 |
|
4698 | lines = match[0].match(/(?:\r\n?|\n).*/g);
|
4699 | if (lines) {
|
4700 | this.yylineno += lines.length;
|
4701 | }
|
4702 | this.yylloc = {
|
4703 | first_line: this.yylloc.last_line,
|
4704 | last_line: this.yylineno + 1,
|
4705 | first_column: this.yylloc.last_column,
|
4706 | last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
|
4707 | };
|
4708 | this.yytext += match[0];
|
4709 | this.match += match[0];
|
4710 | this.matches = match;
|
4711 | this.yyleng = this.yytext.length;
|
4712 | if (this.options.ranges) {
|
4713 | this.yylloc.range = [this.offset, this.offset += this.yyleng];
|
4714 | }
|
4715 | this._more = false;
|
4716 | this._backtrack = false;
|
4717 | this._input = this._input.slice(match[0].length);
|
4718 | this.matched += match[0];
|
4719 | token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
|
4720 | if (this.done && this._input) {
|
4721 | this.done = false;
|
4722 | }
|
4723 | if (token) {
|
4724 | return token;
|
4725 | } else if (this._backtrack) {
|
4726 |
|
4727 | for (var k in backup) {
|
4728 | this[k] = backup[k];
|
4729 | }
|
4730 | return false;
|
4731 | }
|
4732 | return false;
|
4733 | },
|
4734 |
|
4735 |
|
4736 | next: function next() {
|
4737 | if (this.done) {
|
4738 | return this.EOF;
|
4739 | }
|
4740 | if (!this._input) {
|
4741 | this.done = true;
|
4742 | }
|
4743 |
|
4744 | var token, match, tempMatch, index;
|
4745 | if (!this._more) {
|
4746 | this.yytext = '';
|
4747 | this.match = '';
|
4748 | }
|
4749 | var rules = this._currentRules();
|
4750 | for (var i = 0; i < rules.length; i++) {
|
4751 | tempMatch = this._input.match(this.rules[rules[i]]);
|
4752 | if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
|
4753 | match = tempMatch;
|
4754 | index = i;
|
4755 | if (this.options.backtrack_lexer) {
|
4756 | token = this.test_match(tempMatch, rules[i]);
|
4757 | if (token !== false) {
|
4758 | return token;
|
4759 | } else if (this._backtrack) {
|
4760 | match = false;
|
4761 | continue;
|
4762 | } else {
|
4763 |
|
4764 | return false;
|
4765 | }
|
4766 | } else if (!this.options.flex) {
|
4767 | break;
|
4768 | }
|
4769 | }
|
4770 | }
|
4771 | if (match) {
|
4772 | token = this.test_match(match, rules[index]);
|
4773 | if (token !== false) {
|
4774 | return token;
|
4775 | }
|
4776 |
|
4777 | return false;
|
4778 | }
|
4779 | if (this._input === "") {
|
4780 | return this.EOF;
|
4781 | } else {
|
4782 | return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
|
4783 | text: "",
|
4784 | token: null,
|
4785 | line: this.yylineno
|
4786 | });
|
4787 | }
|
4788 | },
|
4789 |
|
4790 |
|
4791 | lex: function lex() {
|
4792 | var r = this.next();
|
4793 | if (r) {
|
4794 | return r;
|
4795 | } else {
|
4796 | return this.lex();
|
4797 | }
|
4798 | },
|
4799 |
|
4800 |
|
4801 | begin: function begin(condition) {
|
4802 | this.conditionStack.push(condition);
|
4803 | },
|
4804 |
|
4805 |
|
4806 | popState: function popState() {
|
4807 | var n = this.conditionStack.length - 1;
|
4808 | if (n > 0) {
|
4809 | return this.conditionStack.pop();
|
4810 | } else {
|
4811 | return this.conditionStack[0];
|
4812 | }
|
4813 | },
|
4814 |
|
4815 |
|
4816 | _currentRules: function _currentRules() {
|
4817 | if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
|
4818 | return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
|
4819 | } else {
|
4820 | return this.conditions["INITIAL"].rules;
|
4821 | }
|
4822 | },
|
4823 |
|
4824 |
|
4825 | topState: function topState(n) {
|
4826 | n = this.conditionStack.length - 1 - Math.abs(n || 0);
|
4827 | if (n >= 0) {
|
4828 | return this.conditionStack[n];
|
4829 | } else {
|
4830 | return "INITIAL";
|
4831 | }
|
4832 | },
|
4833 |
|
4834 |
|
4835 | pushState: function pushState(condition) {
|
4836 | this.begin(condition);
|
4837 | },
|
4838 |
|
4839 |
|
4840 | stateStackSize: function stateStackSize() {
|
4841 | return this.conditionStack.length;
|
4842 | },
|
4843 | options: { "case-insensitive": true },
|
4844 | performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
|
4845 |
|
4846 |
|
4847 | var YYSTATE = YY_START;
|
4848 | switch ($avoiding_name_collisions) {
|
4849 | case 0:
|
4850 | return 9;
|
4851 | break;
|
4852 | case 1:
|
4853 | return 10;
|
4854 | break;
|
4855 | case 2:
|
4856 | return 4;
|
4857 | break;
|
4858 | case 3:
|
4859 | return 12;
|
4860 | break;
|
4861 | case 4:
|
4862 | return 13;
|
4863 | break;
|
4864 | case 5:
|
4865 | return 6;
|
4866 | break;
|
4867 | case 6:
|
4868 | return 'INVALID';
|
4869 | break;
|
4870 | }
|
4871 | },
|
4872 | rules: [/^(?:[\n]+)/i, /^(?:showInfo\b)/i, /^(?:info\b)/i, /^(?:say\b)/i, /^(?::[^#\n;]+)/i, /^(?:$)/i, /^(?:.)/i],
|
4873 | conditions: { "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6], "inclusive": true } }
|
4874 | };
|
4875 | return lexer;
|
4876 | }();
|
4877 | parser.lexer = lexer;
|
4878 | function Parser() {
|
4879 | this.yy = {};
|
4880 | }
|
4881 | Parser.prototype = parser;parser.Parser = Parser;
|
4882 | return new Parser();
|
4883 | }();
|
4884 |
|
4885 | if (true) {
|
4886 | exports.parser = parser;
|
4887 | exports.Parser = parser.Parser;
|
4888 | exports.parse = function () {
|
4889 | return parser.parse.apply(parser, arguments);
|
4890 | };
|
4891 | exports.main = function commonjsMain(args) {
|
4892 | if (!args[1]) {
|
4893 | console.log('Usage: ' + args[0] + ' FILE');
|
4894 | process.exit(1);
|
4895 | }
|
4896 | var source = __webpack_require__(3).readFileSync(__webpack_require__(4).normalize(args[1]), "utf8");
|
4897 | return exports.parser.parse(source);
|
4898 | };
|
4899 | if (typeof module !== 'undefined' && __webpack_require__.c[__webpack_require__.s] === module) {
|
4900 | exports.main(process.argv.slice(1));
|
4901 | }
|
4902 | }
|
4903 | }.call(exports, __webpack_require__(2)(module)))
|
4904 |
|
4905 | }),
|
4906 |
|
4907 | (function(module, exports, __webpack_require__) {
|
4908 |
|
4909 | "use strict";
|
4910 | (function(module) {
|
4911 |
|
4912 |
|
4913 |
|
4914 |
|
4915 |
|
4916 |
|
4917 |
|
4918 |
|
4919 |
|
4920 |
|
4921 |
|
4922 |
|
4923 |
|
4924 |
|
4925 |
|
4926 |
|
4927 |
|
4928 |
|
4929 |
|
4930 |
|
4931 |
|
4932 |
|
4933 |
|
4934 |
|
4935 |
|
4936 |
|
4937 |
|
4938 |
|
4939 |
|
4940 |
|
4941 |
|
4942 |
|
4943 |
|
4944 |
|
4945 |
|
4946 |
|
4947 |
|
4948 |
|
4949 |
|
4950 |
|
4951 |
|
4952 |
|
4953 |
|
4954 |
|
4955 |
|
4956 |
|
4957 |
|
4958 |
|
4959 |
|
4960 |
|
4961 |
|
4962 |
|
4963 |
|
4964 |
|
4965 |
|
4966 |
|
4967 |
|
4968 |
|
4969 |
|
4970 |
|
4971 |
|
4972 |
|
4973 |
|
4974 |
|
4975 |
|
4976 |
|
4977 |
|
4978 |
|
4979 |
|
4980 |
|
4981 |
|
4982 |
|
4983 |
|
4984 |
|
4985 | var parser = function () {
|
4986 | var o = function o(k, v, _o, l) {
|
4987 | for (_o = _o || {}, l = k.length; l--; _o[k[l]] = v) {}return _o;
|
4988 | },
|
4989 | $V0 = [6, 8, 10, 11, 12, 13, 14],
|
4990 | $V1 = [1, 9],
|
4991 | $V2 = [1, 10],
|
4992 | $V3 = [1, 11],
|
4993 | $V4 = [1, 12];
|
4994 | var parser = { trace: function trace() {},
|
4995 | yy: {},
|
4996 | symbols_: { "error": 2, "start": 3, "gantt": 4, "document": 5, "EOF": 6, "line": 7, "SPACE": 8, "statement": 9, "NL": 10, "dateFormat": 11, "title": 12, "section": 13, "taskTxt": 14, "taskData": 15, "$accept": 0, "$end": 1 },
|
4997 | terminals_: { 2: "error", 4: "gantt", 6: "EOF", 8: "SPACE", 10: "NL", 11: "dateFormat", 12: "title", 13: "section", 14: "taskTxt", 15: "taskData" },
|
4998 | productions_: [0, [3, 3], [5, 0], [5, 2], [7, 2], [7, 1], [7, 1], [7, 1], [9, 1], [9, 1], [9, 1], [9, 2]],
|
4999 | performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
|
5000 |
|
5001 |
|
5002 | var $0 = $$.length - 1;
|
5003 | switch (yystate) {
|
5004 | case 1:
|
5005 | return $$[$0 - 1];
|
5006 | break;
|
5007 | case 2:
|
5008 | this.$ = [];
|
5009 | break;
|
5010 | case 3:
|
5011 | $$[$0 - 1].push($$[$0]);this.$ = $$[$0 - 1];
|
5012 | break;
|
5013 | case 4:case 5:
|
5014 | this.$ = $$[$0];
|
5015 | break;
|
5016 | case 6:case 7:
|
5017 | this.$ = [];
|
5018 | break;
|
5019 | case 8:
|
5020 | yy.setDateFormat($$[$0].substr(11));this.$ = $$[$0].substr(11);
|
5021 | break;
|
5022 | case 9:
|
5023 | yy.setTitle($$[$0].substr(6));this.$ = $$[$0].substr(6);
|
5024 | break;
|
5025 | case 10:
|
5026 | yy.addSection($$[$0].substr(8));this.$ = $$[$0].substr(8);
|
5027 | break;
|
5028 | case 11:
|
5029 | yy.addTask($$[$0 - 1], $$[$0]);this.$ = 'task';
|
5030 | break;
|
5031 | }
|
5032 | },
|
5033 | 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, 12: $V2, 13: $V3, 14: $V4 }, o($V0, [2, 7], { 1: [2, 1] }), o($V0, [2, 3]), { 9: 13, 11: $V1, 12: $V2, 13: $V3, 14: $V4 }, o($V0, [2, 5]), o($V0, [2, 6]), o($V0, [2, 8]), o($V0, [2, 9]), o($V0, [2, 10]), { 15: [1, 14] }, o($V0, [2, 4]), o($V0, [2, 11])],
|
5034 | defaultActions: {},
|
5035 | parseError: function parseError(str, hash) {
|
5036 | if (hash.recoverable) {
|
5037 | this.trace(str);
|
5038 | } else {
|
5039 | var _parseError = function _parseError(msg, hash) {
|
5040 | this.message = msg;
|
5041 | this.hash = hash;
|
5042 | };
|
5043 |
|
5044 | _parseError.prototype = Error;
|
5045 |
|
5046 | throw new _parseError(str, hash);
|
5047 | }
|
5048 | },
|
5049 | parse: function parse(input) {
|
5050 | var self = this,
|
5051 | stack = [0],
|
5052 | tstack = [],
|
5053 | vstack = [null],
|
5054 | lstack = [],
|
5055 | table = this.table,
|
5056 | yytext = '',
|
5057 | yylineno = 0,
|
5058 | yyleng = 0,
|
5059 | recovering = 0,
|
5060 | TERROR = 2,
|
5061 | EOF = 1;
|
5062 | var args = lstack.slice.call(arguments, 1);
|
5063 | var lexer = Object.create(this.lexer);
|
5064 | var sharedState = { yy: {} };
|
5065 | for (var k in this.yy) {
|
5066 | if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
|
5067 | sharedState.yy[k] = this.yy[k];
|
5068 | }
|
5069 | }
|
5070 | lexer.setInput(input, sharedState.yy);
|
5071 | sharedState.yy.lexer = lexer;
|
5072 | sharedState.yy.parser = this;
|
5073 | if (typeof lexer.yylloc == 'undefined') {
|
5074 | lexer.yylloc = {};
|
5075 | }
|
5076 | var yyloc = lexer.yylloc;
|
5077 | lstack.push(yyloc);
|
5078 | var ranges = lexer.options && lexer.options.ranges;
|
5079 | if (typeof sharedState.yy.parseError === 'function') {
|
5080 | this.parseError = sharedState.yy.parseError;
|
5081 | } else {
|
5082 | this.parseError = Object.getPrototypeOf(this).parseError;
|
5083 | }
|
5084 | function popStack(n) {
|
5085 | stack.length = stack.length - 2 * n;
|
5086 | vstack.length = vstack.length - n;
|
5087 | lstack.length = lstack.length - n;
|
5088 | }
|
5089 | function lex() {
|
5090 | var token;
|
5091 | token = tstack.pop() || lexer.lex() || EOF;
|
5092 | if (typeof token !== 'number') {
|
5093 | if (token instanceof Array) {
|
5094 | tstack = token;
|
5095 | token = tstack.pop();
|
5096 | }
|
5097 | token = self.symbols_[token] || token;
|
5098 | }
|
5099 | return token;
|
5100 | }
|
5101 | var symbol,
|
5102 | preErrorSymbol,
|
5103 | state,
|
5104 | action,
|
5105 | a,
|
5106 | r,
|
5107 | yyval = {},
|
5108 | p,
|
5109 | len,
|
5110 | newState,
|
5111 | expected;
|
5112 | while (true) {
|
5113 | state = stack[stack.length - 1];
|
5114 | if (this.defaultActions[state]) {
|
5115 | action = this.defaultActions[state];
|
5116 | } else {
|
5117 | if (symbol === null || typeof symbol == 'undefined') {
|
5118 | symbol = lex();
|
5119 | }
|
5120 | action = table[state] && table[state][symbol];
|
5121 | }
|
5122 | if (typeof action === 'undefined' || !action.length || !action[0]) {
|
5123 | var errStr = '';
|
5124 | expected = [];
|
5125 | for (p in table[state]) {
|
5126 | if (this.terminals_[p] && p > TERROR) {
|
5127 | expected.push('\'' + this.terminals_[p] + '\'');
|
5128 | }
|
5129 | }
|
5130 | if (lexer.showPosition) {
|
5131 | errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
|
5132 | } else {
|
5133 | errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
|
5134 | }
|
5135 | this.parseError(errStr, {
|
5136 | text: lexer.match,
|
5137 | token: this.terminals_[symbol] || symbol,
|
5138 | line: lexer.yylineno,
|
5139 | loc: yyloc,
|
5140 | expected: expected
|
5141 | });
|
5142 | }
|
5143 | if (action[0] instanceof Array && action.length > 1) {
|
5144 | throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
|
5145 | }
|
5146 | switch (action[0]) {
|
5147 | case 1:
|
5148 | stack.push(symbol);
|
5149 | vstack.push(lexer.yytext);
|
5150 | lstack.push(lexer.yylloc);
|
5151 | stack.push(action[1]);
|
5152 | symbol = null;
|
5153 | if (!preErrorSymbol) {
|
5154 | yyleng = lexer.yyleng;
|
5155 | yytext = lexer.yytext;
|
5156 | yylineno = lexer.yylineno;
|
5157 | yyloc = lexer.yylloc;
|
5158 | if (recovering > 0) {
|
5159 | recovering--;
|
5160 | }
|
5161 | } else {
|
5162 | symbol = preErrorSymbol;
|
5163 | preErrorSymbol = null;
|
5164 | }
|
5165 | break;
|
5166 | case 2:
|
5167 | len = this.productions_[action[1]][1];
|
5168 | yyval.$ = vstack[vstack.length - len];
|
5169 | yyval._$ = {
|
5170 | first_line: lstack[lstack.length - (len || 1)].first_line,
|
5171 | last_line: lstack[lstack.length - 1].last_line,
|
5172 | first_column: lstack[lstack.length - (len || 1)].first_column,
|
5173 | last_column: lstack[lstack.length - 1].last_column
|
5174 | };
|
5175 | if (ranges) {
|
5176 | yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
|
5177 | }
|
5178 | r = this.performAction.apply(yyval, [yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack].concat(args));
|
5179 | if (typeof r !== 'undefined') {
|
5180 | return r;
|
5181 | }
|
5182 | if (len) {
|
5183 | stack = stack.slice(0, -1 * len * 2);
|
5184 | vstack = vstack.slice(0, -1 * len);
|
5185 | lstack = lstack.slice(0, -1 * len);
|
5186 | }
|
5187 | stack.push(this.productions_[action[1]][0]);
|
5188 | vstack.push(yyval.$);
|
5189 | lstack.push(yyval._$);
|
5190 | newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
|
5191 | stack.push(newState);
|
5192 | break;
|
5193 | case 3:
|
5194 | return true;
|
5195 | }
|
5196 | }
|
5197 | return true;
|
5198 | } };
|
5199 |
|
5200 |
|
5201 | var lexer = function () {
|
5202 | var lexer = {
|
5203 |
|
5204 | EOF: 1,
|
5205 |
|
5206 | parseError: function parseError(str, hash) {
|
5207 | if (this.yy.parser) {
|
5208 | this.yy.parser.parseError(str, hash);
|
5209 | } else {
|
5210 | throw new Error(str);
|
5211 | }
|
5212 | },
|
5213 |
|
5214 |
|
5215 | setInput: function setInput(input, yy) {
|
5216 | this.yy = yy || this.yy || {};
|
5217 | this._input = input;
|
5218 | this._more = this._backtrack = this.done = false;
|
5219 | this.yylineno = this.yyleng = 0;
|
5220 | this.yytext = this.matched = this.match = '';
|
5221 | this.conditionStack = ['INITIAL'];
|
5222 | this.yylloc = {
|
5223 | first_line: 1,
|
5224 | first_column: 0,
|
5225 | last_line: 1,
|
5226 | last_column: 0
|
5227 | };
|
5228 | if (this.options.ranges) {
|
5229 | this.yylloc.range = [0, 0];
|
5230 | }
|
5231 | this.offset = 0;
|
5232 | return this;
|
5233 | },
|
5234 |
|
5235 |
|
5236 | input: function input() {
|
5237 | var ch = this._input[0];
|
5238 | this.yytext += ch;
|
5239 | this.yyleng++;
|
5240 | this.offset++;
|
5241 | this.match += ch;
|
5242 | this.matched += ch;
|
5243 | var lines = ch.match(/(?:\r\n?|\n).*/g);
|
5244 | if (lines) {
|
5245 | this.yylineno++;
|
5246 | this.yylloc.last_line++;
|
5247 | } else {
|
5248 | this.yylloc.last_column++;
|
5249 | }
|
5250 | if (this.options.ranges) {
|
5251 | this.yylloc.range[1]++;
|
5252 | }
|
5253 |
|
5254 | this._input = this._input.slice(1);
|
5255 | return ch;
|
5256 | },
|
5257 |
|
5258 |
|
5259 | unput: function unput(ch) {
|
5260 | var len = ch.length;
|
5261 | var lines = ch.split(/(?:\r\n?|\n)/g);
|
5262 |
|
5263 | this._input = ch + this._input;
|
5264 | this.yytext = this.yytext.substr(0, this.yytext.length - len);
|
5265 |
|
5266 | this.offset -= len;
|
5267 | var oldLines = this.match.split(/(?:\r\n?|\n)/g);
|
5268 | this.match = this.match.substr(0, this.match.length - 1);
|
5269 | this.matched = this.matched.substr(0, this.matched.length - 1);
|
5270 |
|
5271 | if (lines.length - 1) {
|
5272 | this.yylineno -= lines.length - 1;
|
5273 | }
|
5274 | var r = this.yylloc.range;
|
5275 |
|
5276 | this.yylloc = {
|
5277 | first_line: this.yylloc.first_line,
|
5278 | last_line: this.yylineno + 1,
|
5279 | first_column: this.yylloc.first_column,
|
5280 | 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
|
5281 | };
|
5282 |
|
5283 | if (this.options.ranges) {
|
5284 | this.yylloc.range = [r[0], r[0] + this.yyleng - len];
|
5285 | }
|
5286 | this.yyleng = this.yytext.length;
|
5287 | return this;
|
5288 | },
|
5289 |
|
5290 |
|
5291 | more: function more() {
|
5292 | this._more = true;
|
5293 | return this;
|
5294 | },
|
5295 |
|
5296 |
|
5297 | reject: function reject() {
|
5298 | if (this.options.backtrack_lexer) {
|
5299 | this._backtrack = true;
|
5300 | } else {
|
5301 | 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(), {
|
5302 | text: "",
|
5303 | token: null,
|
5304 | line: this.yylineno
|
5305 | });
|
5306 | }
|
5307 | return this;
|
5308 | },
|
5309 |
|
5310 |
|
5311 | less: function less(n) {
|
5312 | this.unput(this.match.slice(n));
|
5313 | },
|
5314 |
|
5315 |
|
5316 | pastInput: function pastInput() {
|
5317 | var past = this.matched.substr(0, this.matched.length - this.match.length);
|
5318 | return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, "");
|
5319 | },
|
5320 |
|
5321 |
|
5322 | upcomingInput: function upcomingInput() {
|
5323 | var next = this.match;
|
5324 | if (next.length < 20) {
|
5325 | next += this._input.substr(0, 20 - next.length);
|
5326 | }
|
5327 | return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
|
5328 | },
|
5329 |
|
5330 |
|
5331 | showPosition: function showPosition() {
|
5332 | var pre = this.pastInput();
|
5333 | var c = new Array(pre.length + 1).join("-");
|
5334 | return pre + this.upcomingInput() + "\n" + c + "^";
|
5335 | },
|
5336 |
|
5337 |
|
5338 | test_match: function test_match(match, indexed_rule) {
|
5339 | var token, lines, backup;
|
5340 |
|
5341 | if (this.options.backtrack_lexer) {
|
5342 |
|
5343 | backup = {
|
5344 | yylineno: this.yylineno,
|
5345 | yylloc: {
|
5346 | first_line: this.yylloc.first_line,
|
5347 | last_line: this.last_line,
|
5348 | first_column: this.yylloc.first_column,
|
5349 | last_column: this.yylloc.last_column
|
5350 | },
|
5351 | yytext: this.yytext,
|
5352 | match: this.match,
|
5353 | matches: this.matches,
|
5354 | matched: this.matched,
|
5355 | yyleng: this.yyleng,
|
5356 | offset: this.offset,
|
5357 | _more: this._more,
|
5358 | _input: this._input,
|
5359 | yy: this.yy,
|
5360 | conditionStack: this.conditionStack.slice(0),
|
5361 | done: this.done
|
5362 | };
|
5363 | if (this.options.ranges) {
|
5364 | backup.yylloc.range = this.yylloc.range.slice(0);
|
5365 | }
|
5366 | }
|
5367 |
|
5368 | lines = match[0].match(/(?:\r\n?|\n).*/g);
|
5369 | if (lines) {
|
5370 | this.yylineno += lines.length;
|
5371 | }
|
5372 | this.yylloc = {
|
5373 | first_line: this.yylloc.last_line,
|
5374 | last_line: this.yylineno + 1,
|
5375 | first_column: this.yylloc.last_column,
|
5376 | last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
|
5377 | };
|
5378 | this.yytext += match[0];
|
5379 | this.match += match[0];
|
5380 | this.matches = match;
|
5381 | this.yyleng = this.yytext.length;
|
5382 | if (this.options.ranges) {
|
5383 | this.yylloc.range = [this.offset, this.offset += this.yyleng];
|
5384 | }
|
5385 | this._more = false;
|
5386 | this._backtrack = false;
|
5387 | this._input = this._input.slice(match[0].length);
|
5388 | this.matched += match[0];
|
5389 | token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
|
5390 | if (this.done && this._input) {
|
5391 | this.done = false;
|
5392 | }
|
5393 | if (token) {
|
5394 | return token;
|
5395 | } else if (this._backtrack) {
|
5396 |
|
5397 | for (var k in backup) {
|
5398 | this[k] = backup[k];
|
5399 | }
|
5400 | return false;
|
5401 | }
|
5402 | return false;
|
5403 | },
|
5404 |
|
5405 |
|
5406 | next: function next() {
|
5407 | if (this.done) {
|
5408 | return this.EOF;
|
5409 | }
|
5410 | if (!this._input) {
|
5411 | this.done = true;
|
5412 | }
|
5413 |
|
5414 | var token, match, tempMatch, index;
|
5415 | if (!this._more) {
|
5416 | this.yytext = '';
|
5417 | this.match = '';
|
5418 | }
|
5419 | var rules = this._currentRules();
|
5420 | for (var i = 0; i < rules.length; i++) {
|
5421 | tempMatch = this._input.match(this.rules[rules[i]]);
|
5422 | if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
|
5423 | match = tempMatch;
|
5424 | index = i;
|
5425 | if (this.options.backtrack_lexer) {
|
5426 | token = this.test_match(tempMatch, rules[i]);
|
5427 | if (token !== false) {
|
5428 | return token;
|
5429 | } else if (this._backtrack) {
|
5430 | match = false;
|
5431 | continue;
|
5432 | } else {
|
5433 |
|
5434 | return false;
|
5435 | }
|
5436 | } else if (!this.options.flex) {
|
5437 | break;
|
5438 | }
|
5439 | }
|
5440 | }
|
5441 | if (match) {
|
5442 | token = this.test_match(match, rules[index]);
|
5443 | if (token !== false) {
|
5444 | return token;
|
5445 | }
|
5446 |
|
5447 | return false;
|
5448 | }
|
5449 | if (this._input === "") {
|
5450 | return this.EOF;
|
5451 | } else {
|
5452 | return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
|
5453 | text: "",
|
5454 | token: null,
|
5455 | line: this.yylineno
|
5456 | });
|
5457 | }
|
5458 | },
|
5459 |
|
5460 |
|
5461 | lex: function lex() {
|
5462 | var r = this.next();
|
5463 | if (r) {
|
5464 | return r;
|
5465 | } else {
|
5466 | return this.lex();
|
5467 | }
|
5468 | },
|
5469 |
|
5470 |
|
5471 | begin: function begin(condition) {
|
5472 | this.conditionStack.push(condition);
|
5473 | },
|
5474 |
|
5475 |
|
5476 | popState: function popState() {
|
5477 | var n = this.conditionStack.length - 1;
|
5478 | if (n > 0) {
|
5479 | return this.conditionStack.pop();
|
5480 | } else {
|
5481 | return this.conditionStack[0];
|
5482 | }
|
5483 | },
|
5484 |
|
5485 |
|
5486 | _currentRules: function _currentRules() {
|
5487 | if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
|
5488 | return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
|
5489 | } else {
|
5490 | return this.conditions["INITIAL"].rules;
|
5491 | }
|
5492 | },
|
5493 |
|
5494 |
|
5495 | topState: function topState(n) {
|
5496 | n = this.conditionStack.length - 1 - Math.abs(n || 0);
|
5497 | if (n >= 0) {
|
5498 | return this.conditionStack[n];
|
5499 | } else {
|
5500 | return "INITIAL";
|
5501 | }
|
5502 | },
|
5503 |
|
5504 |
|
5505 | pushState: function pushState(condition) {
|
5506 | this.begin(condition);
|
5507 | },
|
5508 |
|
5509 |
|
5510 | stateStackSize: function stateStackSize() {
|
5511 | return this.conditionStack.length;
|
5512 | },
|
5513 | options: { "case-insensitive": true },
|
5514 | performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
|
5515 |
|
5516 |
|
5517 | var YYSTATE = YY_START;
|
5518 | switch ($avoiding_name_collisions) {
|
5519 | case 0:
|
5520 | return 10;
|
5521 | break;
|
5522 | case 1:
|
5523 |
|
5524 | break;
|
5525 | case 2:
|
5526 |
|
5527 | break;
|
5528 | case 3:
|
5529 |
|
5530 | break;
|
5531 | case 4:
|
5532 | return 4;
|
5533 | break;
|
5534 | case 5:
|
5535 | return 11;
|
5536 | break;
|
5537 | case 6:
|
5538 | return 'date';
|
5539 | break;
|
5540 | case 7:
|
5541 | return 12;
|
5542 | break;
|
5543 | case 8:
|
5544 | return 13;
|
5545 | break;
|
5546 | case 9:
|
5547 | return 14;
|
5548 | break;
|
5549 | case 10:
|
5550 | return 15;
|
5551 | break;
|
5552 | case 11:
|
5553 | return ':';
|
5554 | break;
|
5555 | case 12:
|
5556 | return 6;
|
5557 | break;
|
5558 | case 13:
|
5559 | return 'INVALID';
|
5560 | break;
|
5561 | }
|
5562 | },
|
5563 | rules: [/^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:gantt\b)/i, /^(?:dateFormat\s[^#\n;]+)/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],
|
5564 | conditions: { "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], "inclusive": true } }
|
5565 | };
|
5566 | return lexer;
|
5567 | }();
|
5568 | parser.lexer = lexer;
|
5569 | function Parser() {
|
5570 | this.yy = {};
|
5571 | }
|
5572 | Parser.prototype = parser;parser.Parser = Parser;
|
5573 | return new Parser();
|
5574 | }();
|
5575 |
|
5576 | if (true) {
|
5577 | exports.parser = parser;
|
5578 | exports.Parser = parser.Parser;
|
5579 | exports.parse = function () {
|
5580 | return parser.parse.apply(parser, arguments);
|
5581 | };
|
5582 | exports.main = function commonjsMain(args) {
|
5583 | if (!args[1]) {
|
5584 | console.log('Usage: ' + args[0] + ' FILE');
|
5585 | process.exit(1);
|
5586 | }
|
5587 | var source = __webpack_require__(3).readFileSync(__webpack_require__(4).normalize(args[1]), "utf8");
|
5588 | return exports.parser.parse(source);
|
5589 | };
|
5590 | if (typeof module !== 'undefined' && __webpack_require__.c[__webpack_require__.s] === module) {
|
5591 | exports.main(process.argv.slice(1));
|
5592 | }
|
5593 | }
|
5594 | }.call(exports, __webpack_require__(2)(module)))
|
5595 |
|
5596 | }),
|
5597 |
|
5598 | (function(module, exports, __webpack_require__) {
|
5599 |
|
5600 | "use strict";
|
5601 |
|
5602 |
|
5603 |
|
5604 |
|
5605 |
|
5606 | var moment = __webpack_require__(15);
|
5607 | var Logger = __webpack_require__(0);
|
5608 | var log = Logger.Log;
|
5609 |
|
5610 | var dateFormat = '';
|
5611 | var title = '';
|
5612 | var sections = [];
|
5613 | var tasks = [];
|
5614 | var currentSection = '';
|
5615 |
|
5616 | exports.clear = function () {
|
5617 | sections = [];
|
5618 | tasks = [];
|
5619 | currentSection = '';
|
5620 | title = '';
|
5621 | taskCnt = 0;
|
5622 | lastTask = undefined;
|
5623 | lastTaskID = undefined;
|
5624 | rawTasks = [];
|
5625 | };
|
5626 |
|
5627 | exports.setDateFormat = function (txt) {
|
5628 | dateFormat = txt;
|
5629 | };
|
5630 |
|
5631 | exports.getDateFormat = function () {
|
5632 | return dateFormat;
|
5633 | };
|
5634 | exports.setTitle = function (txt) {
|
5635 | title = txt;
|
5636 | };
|
5637 |
|
5638 | exports.getTitle = function () {
|
5639 | return title;
|
5640 | };
|
5641 |
|
5642 | exports.addSection = function (txt) {
|
5643 | currentSection = txt;
|
5644 | sections.push(txt);
|
5645 | };
|
5646 |
|
5647 | exports.getTasks = function () {
|
5648 | var allItemsPricessed = compileTasks();
|
5649 | var maxDepth = 10;
|
5650 | var iterationCount = 0;
|
5651 | while (!allItemsPricessed && iterationCount < maxDepth) {
|
5652 | allItemsPricessed = compileTasks();
|
5653 | iterationCount++;
|
5654 | }
|
5655 |
|
5656 | tasks = rawTasks;
|
5657 |
|
5658 | return tasks;
|
5659 | };
|
5660 |
|
5661 | var getStartDate = function getStartDate(prevTime, dateFormat, str) {
|
5662 | str = str.trim();
|
5663 |
|
5664 |
|
5665 | var re = /^after\s+([\d\w-]+)/;
|
5666 | var afterStatement = re.exec(str.trim());
|
5667 |
|
5668 | if (afterStatement !== null) {
|
5669 | var task = exports.findTaskById(afterStatement[1]);
|
5670 |
|
5671 | if (typeof task === 'undefined') {
|
5672 | var dt = new Date();
|
5673 | dt.setHours(0, 0, 0, 0);
|
5674 | return dt;
|
5675 | }
|
5676 | return task.endTime;
|
5677 | }
|
5678 |
|
5679 |
|
5680 | if (moment(str, dateFormat.trim(), true).isValid()) {
|
5681 | return moment(str, dateFormat.trim(), true).toDate();
|
5682 | } else {
|
5683 | log.debug('Invalid date:' + str);
|
5684 | log.debug('With date format:' + dateFormat.trim());
|
5685 | }
|
5686 |
|
5687 |
|
5688 | return new Date();
|
5689 | };
|
5690 |
|
5691 | var getEndDate = function getEndDate(prevTime, dateFormat, str) {
|
5692 | str = str.trim();
|
5693 |
|
5694 |
|
5695 | if (moment(str, dateFormat.trim(), true).isValid()) {
|
5696 | return moment(str, dateFormat.trim()).toDate();
|
5697 | }
|
5698 |
|
5699 | var d = moment(prevTime);
|
5700 |
|
5701 | var re = /^([\d]+)([wdhms])/;
|
5702 | var durationStatement = re.exec(str.trim());
|
5703 |
|
5704 | if (durationStatement !== null) {
|
5705 | switch (durationStatement[2]) {
|
5706 | case 's':
|
5707 | d.add(durationStatement[1], 'seconds');
|
5708 | break;
|
5709 | case 'm':
|
5710 | d.add(durationStatement[1], 'minutes');
|
5711 | break;
|
5712 | case 'h':
|
5713 | d.add(durationStatement[1], 'hours');
|
5714 | break;
|
5715 | case 'd':
|
5716 | d.add(durationStatement[1], 'days');
|
5717 | break;
|
5718 | case 'w':
|
5719 | d.add(durationStatement[1], 'weeks');
|
5720 | break;
|
5721 | }
|
5722 | return d.toDate();
|
5723 | }
|
5724 |
|
5725 | return d.toDate();
|
5726 | };
|
5727 |
|
5728 | var taskCnt = 0;
|
5729 | var parseId = function parseId(idStr) {
|
5730 | if (typeof idStr === 'undefined') {
|
5731 | taskCnt = taskCnt + 1;
|
5732 | return 'task' + taskCnt;
|
5733 | }
|
5734 | return idStr;
|
5735 | };
|
5736 |
|
5737 |
|
5738 |
|
5739 |
|
5740 |
|
5741 |
|
5742 |
|
5743 |
|
5744 |
|
5745 |
|
5746 |
|
5747 | var compileData = function compileData(prevTask, dataStr) {
|
5748 | var ds;
|
5749 |
|
5750 | if (dataStr.substr(0, 1) === ':') {
|
5751 | ds = dataStr.substr(1, dataStr.length);
|
5752 | } else {
|
5753 | ds = dataStr;
|
5754 | }
|
5755 |
|
5756 | var data = ds.split(',');
|
5757 |
|
5758 | var task = {};
|
5759 | var df = exports.getDateFormat();
|
5760 |
|
5761 |
|
5762 | var matchFound = true;
|
5763 | while (matchFound) {
|
5764 | matchFound = false;
|
5765 | if (data[0].match(/^\s*active\s*$/)) {
|
5766 | task.active = true;
|
5767 | data.shift(1);
|
5768 | matchFound = true;
|
5769 | }
|
5770 | if (data[0].match(/^\s*done\s*$/)) {
|
5771 | task.done = true;
|
5772 | data.shift(1);
|
5773 | matchFound = true;
|
5774 | }
|
5775 | if (data[0].match(/^\s*crit\s*$/)) {
|
5776 | task.crit = true;
|
5777 | data.shift(1);
|
5778 | matchFound = true;
|
5779 | }
|
5780 | }
|
5781 | var i;
|
5782 | for (i = 0; i < data.length; i++) {
|
5783 | data[i] = data[i].trim();
|
5784 | }
|
5785 |
|
5786 | switch (data.length) {
|
5787 | case 1:
|
5788 | task.id = parseId();
|
5789 | task.startTime = prevTask.endTime;
|
5790 | task.endTime = getEndDate(task.startTime, df, data[0]);
|
5791 | break;
|
5792 | case 2:
|
5793 | task.id = parseId();
|
5794 | task.startTime = getStartDate(undefined, df, data[0]);
|
5795 | task.endTime = getEndDate(task.startTime, df, data[1]);
|
5796 | break;
|
5797 | case 3:
|
5798 | task.id = parseId(data[0]);
|
5799 | task.startTime = getStartDate(undefined, df, data[1]);
|
5800 | task.endTime = getEndDate(task.startTime, df, data[2]);
|
5801 | break;
|
5802 | default:
|
5803 | }
|
5804 |
|
5805 | return task;
|
5806 | };
|
5807 |
|
5808 | var parseData = function parseData(prevTaskId, dataStr) {
|
5809 | var ds;
|
5810 |
|
5811 | if (dataStr.substr(0, 1) === ':') {
|
5812 | ds = dataStr.substr(1, dataStr.length);
|
5813 | } else {
|
5814 | ds = dataStr;
|
5815 | }
|
5816 |
|
5817 | var data = ds.split(',');
|
5818 |
|
5819 | var task = {};
|
5820 |
|
5821 |
|
5822 | var matchFound = true;
|
5823 | while (matchFound) {
|
5824 | matchFound = false;
|
5825 | if (data[0].match(/^\s*active\s*$/)) {
|
5826 | task.active = true;
|
5827 | data.shift(1);
|
5828 | matchFound = true;
|
5829 | }
|
5830 | if (data[0].match(/^\s*done\s*$/)) {
|
5831 | task.done = true;
|
5832 | data.shift(1);
|
5833 | matchFound = true;
|
5834 | }
|
5835 | if (data[0].match(/^\s*crit\s*$/)) {
|
5836 | task.crit = true;
|
5837 | data.shift(1);
|
5838 | matchFound = true;
|
5839 | }
|
5840 | }
|
5841 | var i;
|
5842 | for (i = 0; i < data.length; i++) {
|
5843 | data[i] = data[i].trim();
|
5844 | }
|
5845 |
|
5846 | switch (data.length) {
|
5847 | case 1:
|
5848 | task.id = parseId();
|
5849 | task.startTime = { type: 'prevTaskEnd', id: prevTaskId };
|
5850 | task.endTime = { data: data[0] };
|
5851 | break;
|
5852 | case 2:
|
5853 | task.id = parseId();
|
5854 | task.startTime = { type: 'getStartDate', startData: data[0] };
|
5855 | task.endTime = { data: data[1] };
|
5856 | break;
|
5857 | case 3:
|
5858 | task.id = parseId(data[0]);
|
5859 | task.startTime = { type: 'getStartDate', startData: data[1] };
|
5860 | task.endTime = { data: data[2] };
|
5861 | break;
|
5862 | default:
|
5863 | }
|
5864 |
|
5865 | return task;
|
5866 | };
|
5867 |
|
5868 | var lastTask;
|
5869 | var lastTaskID;
|
5870 | var rawTasks = [];
|
5871 | var taskDb = {};
|
5872 | exports.addTask = function (descr, data) {
|
5873 | var rawTask = {
|
5874 | section: currentSection,
|
5875 | type: currentSection,
|
5876 | processed: false,
|
5877 | raw: { data: data },
|
5878 | task: descr
|
5879 | };
|
5880 | var taskInfo = parseData(lastTaskID, data);
|
5881 | rawTask.raw.startTime = taskInfo.startTime;
|
5882 | rawTask.raw.endTime = taskInfo.endTime;
|
5883 | rawTask.id = taskInfo.id;
|
5884 | rawTask.prevTaskId = lastTaskID;
|
5885 | rawTask.active = taskInfo.active;
|
5886 | rawTask.done = taskInfo.done;
|
5887 | rawTask.crit = taskInfo.crit;
|
5888 |
|
5889 | var pos = rawTasks.push(rawTask);
|
5890 |
|
5891 | lastTaskID = rawTask.id;
|
5892 |
|
5893 | taskDb[rawTask.id] = pos - 1;
|
5894 | };
|
5895 |
|
5896 | exports.findTaskById = function (id) {
|
5897 | var pos = taskDb[id];
|
5898 | return rawTasks[pos];
|
5899 | };
|
5900 |
|
5901 | exports.addTaskOrg = function (descr, data) {
|
5902 | var newTask = {
|
5903 | section: currentSection,
|
5904 | type: currentSection,
|
5905 | description: descr,
|
5906 | task: descr
|
5907 | };
|
5908 | var taskInfo = compileData(lastTask, data);
|
5909 | newTask.startTime = taskInfo.startTime;
|
5910 | newTask.endTime = taskInfo.endTime;
|
5911 | newTask.id = taskInfo.id;
|
5912 | newTask.active = taskInfo.active;
|
5913 | newTask.done = taskInfo.done;
|
5914 | newTask.crit = taskInfo.crit;
|
5915 | lastTask = newTask;
|
5916 | tasks.push(newTask);
|
5917 | };
|
5918 |
|
5919 | var compileTasks = function compileTasks() {
|
5920 | var df = exports.getDateFormat();
|
5921 |
|
5922 | var compileTask = function compileTask(pos) {
|
5923 | var task = rawTasks[pos];
|
5924 | var startTime = '';
|
5925 | switch (rawTasks[pos].raw.startTime.type) {
|
5926 | case 'prevTaskEnd':
|
5927 | var prevTask = exports.findTaskById(task.prevTaskId);
|
5928 | task.startTime = prevTask.endTime;
|
5929 | break;
|
5930 | case 'getStartDate':
|
5931 | startTime = getStartDate(undefined, df, rawTasks[pos].raw.startTime.startData);
|
5932 | if (startTime) {
|
5933 | rawTasks[pos].startTime = startTime;
|
5934 | }
|
5935 | break;
|
5936 | }
|
5937 |
|
5938 | if (rawTasks[pos].startTime) {
|
5939 | rawTasks[pos].endTime = getEndDate(rawTasks[pos].startTime, df, rawTasks[pos].raw.endTime.data);
|
5940 | if (rawTasks[pos].endTime) {
|
5941 | rawTasks[pos].processed = true;
|
5942 | }
|
5943 | }
|
5944 |
|
5945 | return rawTasks[pos].processed;
|
5946 | };
|
5947 |
|
5948 | var i;
|
5949 | var allProcessed = true;
|
5950 | for (i = 0; i < rawTasks.length; i++) {
|
5951 | compileTask(i);
|
5952 |
|
5953 | allProcessed = allProcessed && rawTasks[i].processed;
|
5954 | }
|
5955 | return allProcessed;
|
5956 | };
|
5957 |
|
5958 | exports.parseError = function (err, hash) {
|
5959 | global.mermaidAPI.parseError(err, hash);
|
5960 | };
|
5961 |
|
5962 | }),
|
5963 |
|
5964 | (function(module, exports) {
|
5965 |
|
5966 | module.exports = require("moment");
|
5967 |
|
5968 | }),
|
5969 |
|
5970 | (function(module, exports, __webpack_require__) {
|
5971 |
|
5972 | "use strict";
|
5973 | (function(module) {
|
5974 |
|
5975 |
|
5976 |
|
5977 |
|
5978 |
|
5979 |
|
5980 |
|
5981 |
|
5982 |
|
5983 |
|
5984 |
|
5985 |
|
5986 |
|
5987 |
|
5988 |
|
5989 |
|
5990 |
|
5991 |
|
5992 |
|
5993 |
|
5994 |
|
5995 |
|
5996 |
|
5997 |
|
5998 |
|
5999 |
|
6000 |
|
6001 |
|
6002 |
|
6003 |
|
6004 |
|
6005 |
|
6006 |
|
6007 |
|
6008 |
|
6009 |
|
6010 |
|
6011 |
|
6012 |
|
6013 |
|
6014 |
|
6015 |
|
6016 |
|
6017 |
|
6018 |
|
6019 |
|
6020 |
|
6021 |
|
6022 |
|
6023 |
|
6024 |
|
6025 |
|
6026 |
|
6027 |
|
6028 |
|
6029 |
|
6030 |
|
6031 |
|
6032 |
|
6033 |
|
6034 |
|
6035 |
|
6036 |
|
6037 |
|
6038 |
|
6039 |
|
6040 |
|
6041 |
|
6042 |
|
6043 |
|
6044 |
|
6045 |
|
6046 |
|
6047 |
|
6048 | var parser = function () {
|
6049 | var o = function o(k, v, _o, l) {
|
6050 | for (_o = _o || {}, l = k.length; l--; _o[k[l]] = v) {}return _o;
|
6051 | },
|
6052 | $V0 = [1, 11],
|
6053 | $V1 = [1, 12],
|
6054 | $V2 = [1, 13],
|
6055 | $V3 = [1, 15],
|
6056 | $V4 = [1, 16],
|
6057 | $V5 = [1, 17],
|
6058 | $V6 = [6, 8],
|
6059 | $V7 = [1, 26],
|
6060 | $V8 = [1, 27],
|
6061 | $V9 = [1, 28],
|
6062 | $Va = [1, 29],
|
6063 | $Vb = [1, 30],
|
6064 | $Vc = [1, 31],
|
6065 | $Vd = [6, 8, 13, 17, 23, 26, 27, 28, 29, 30, 31],
|
6066 | $Ve = [6, 8, 13, 17, 23, 26, 27, 28, 29, 30, 31, 45, 46, 47],
|
6067 | $Vf = [23, 45, 46, 47],
|
6068 | $Vg = [23, 30, 31, 45, 46, 47],
|
6069 | $Vh = [23, 26, 27, 28, 29, 45, 46, 47],
|
6070 | $Vi = [6, 8, 13],
|
6071 | $Vj = [1, 46];
|
6072 | var parser = { trace: function trace() {},
|
6073 | yy: {},
|
6074 | symbols_: { "error": 2, "mermaidDoc": 3, "graphConfig": 4, "CLASS_DIAGRAM": 5, "NEWLINE": 6, "statements": 7, "EOF": 8, "statement": 9, "className": 10, "alphaNumToken": 11, "relationStatement": 12, "LABEL": 13, "classStatement": 14, "methodStatement": 15, "CLASS": 16, "STRUCT_START": 17, "members": 18, "STRUCT_STOP": 19, "MEMBER": 20, "SEPARATOR": 21, "relation": 22, "STR": 23, "relationType": 24, "lineType": 25, "AGGREGATION": 26, "EXTENSION": 27, "COMPOSITION": 28, "DEPENDENCY": 29, "LINE": 30, "DOTTED_LINE": 31, "commentToken": 32, "textToken": 33, "graphCodeTokens": 34, "textNoTagsToken": 35, "TAGSTART": 36, "TAGEND": 37, "==": 38, "--": 39, "PCT": 40, "DEFAULT": 41, "SPACE": 42, "MINUS": 43, "keywords": 44, "UNICODE_TEXT": 45, "NUM": 46, "ALPHA": 47, "$accept": 0, "$end": 1 },
|
6075 | terminals_: { 2: "error", 5: "CLASS_DIAGRAM", 6: "NEWLINE", 8: "EOF", 13: "LABEL", 16: "CLASS", 17: "STRUCT_START", 19: "STRUCT_STOP", 20: "MEMBER", 21: "SEPARATOR", 23: "STR", 26: "AGGREGATION", 27: "EXTENSION", 28: "COMPOSITION", 29: "DEPENDENCY", 30: "LINE", 31: "DOTTED_LINE", 34: "graphCodeTokens", 36: "TAGSTART", 37: "TAGEND", 38: "==", 39: "--", 40: "PCT", 41: "DEFAULT", 42: "SPACE", 43: "MINUS", 44: "keywords", 45: "UNICODE_TEXT", 46: "NUM", 47: "ALPHA" },
|
6076 | productions_: [0, [3, 1], [4, 4], [7, 1], [7, 3], [10, 2], [10, 1], [9, 1], [9, 2], [9, 1], [9, 1], [14, 2], [14, 5], [18, 1], [18, 2], [15, 1], [15, 2], [15, 1], [15, 1], [12, 3], [12, 4], [12, 4], [12, 5], [22, 3], [22, 2], [22, 2], [22, 1], [24, 1], [24, 1], [24, 1], [24, 1], [25, 1], [25, 1], [32, 1], [32, 1], [33, 1], [33, 1], [33, 1], [33, 1], [33, 1], [33, 1], [33, 1], [35, 1], [35, 1], [35, 1], [35, 1], [11, 1], [11, 1], [11, 1]],
|
6077 | performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
|
6078 |
|
6079 |
|
6080 | var $0 = $$.length - 1;
|
6081 | switch (yystate) {
|
6082 | case 5:
|
6083 | this.$ = $$[$0 - 1] + $$[$0];
|
6084 | break;
|
6085 | case 6:
|
6086 | this.$ = $$[$0];
|
6087 | break;
|
6088 | case 7:
|
6089 | yy.addRelation($$[$0]);
|
6090 | break;
|
6091 | case 8:
|
6092 | $$[$0 - 1].title = yy.cleanupLabel($$[$0]);yy.addRelation($$[$0 - 1]);
|
6093 | break;
|
6094 | case 12:
|
6095 | yy.addMembers($$[$0 - 3], $$[$0 - 1]);
|
6096 | break;
|
6097 | case 13:
|
6098 | this.$ = [$$[$0]];
|
6099 | break;
|
6100 | case 14:
|
6101 | $$[$0].push($$[$0 - 1]);this.$ = $$[$0];
|
6102 | break;
|
6103 | case 15:
|
6104 |
|
6105 | break;
|
6106 | case 16:
|
6107 | yy.addMembers($$[$0 - 1], yy.cleanupLabel($$[$0]));
|
6108 | break;
|
6109 | case 17:
|
6110 | console.warn('Member', $$[$0]);
|
6111 | break;
|
6112 | case 18:
|
6113 |
|
6114 | break;
|
6115 | case 19:
|
6116 | this.$ = { 'id1': $$[$0 - 2], 'id2': $$[$0], relation: $$[$0 - 1], relationTitle1: 'none', relationTitle2: 'none' };
|
6117 | break;
|
6118 | case 20:
|
6119 | this.$ = { id1: $$[$0 - 3], id2: $$[$0], relation: $$[$0 - 1], relationTitle1: $$[$0 - 2], relationTitle2: 'none' };
|
6120 | break;
|
6121 | case 21:
|
6122 | this.$ = { id1: $$[$0 - 3], id2: $$[$0], relation: $$[$0 - 2], relationTitle1: 'none', relationTitle2: $$[$0 - 1] };
|
6123 | break;
|
6124 | case 22:
|
6125 | this.$ = { id1: $$[$0 - 4], id2: $$[$0], relation: $$[$0 - 2], relationTitle1: $$[$0 - 3], relationTitle2: $$[$0 - 1] };
|
6126 | break;
|
6127 | case 23:
|
6128 | this.$ = { type1: $$[$0 - 2], type2: $$[$0], lineType: $$[$0 - 1] };
|
6129 | break;
|
6130 | case 24:
|
6131 | this.$ = { type1: 'none', type2: $$[$0], lineType: $$[$0 - 1] };
|
6132 | break;
|
6133 | case 25:
|
6134 | this.$ = { type1: $$[$0 - 1], type2: 'none', lineType: $$[$0] };
|
6135 | break;
|
6136 | case 26:
|
6137 | this.$ = { type1: 'none', type2: 'none', lineType: $$[$0] };
|
6138 | break;
|
6139 | case 27:
|
6140 | this.$ = yy.relationType.AGGREGATION;
|
6141 | break;
|
6142 | case 28:
|
6143 | this.$ = yy.relationType.EXTENSION;
|
6144 | break;
|
6145 | case 29:
|
6146 | this.$ = yy.relationType.COMPOSITION;
|
6147 | break;
|
6148 | case 30:
|
6149 | this.$ = yy.relationType.DEPENDENCY;
|
6150 | break;
|
6151 | case 31:
|
6152 | this.$ = yy.lineType.LINE;
|
6153 | break;
|
6154 | case 32:
|
6155 | this.$ = yy.lineType.DOTTED_LINE;
|
6156 | break;
|
6157 | }
|
6158 | },
|
6159 | table: [{ 3: 1, 4: 2, 5: [1, 3] }, { 1: [3] }, { 1: [2, 1] }, { 6: [1, 4] }, { 7: 5, 9: 6, 10: 10, 11: 14, 12: 7, 14: 8, 15: 9, 16: $V0, 20: $V1, 21: $V2, 45: $V3, 46: $V4, 47: $V5 }, { 8: [1, 18] }, { 6: [1, 19], 8: [2, 3] }, o($V6, [2, 7], { 13: [1, 20] }), o($V6, [2, 9]), o($V6, [2, 10]), o($V6, [2, 15], { 22: 21, 24: 24, 25: 25, 13: [1, 23], 23: [1, 22], 26: $V7, 27: $V8, 28: $V9, 29: $Va, 30: $Vb, 31: $Vc }), { 10: 32, 11: 14, 45: $V3, 46: $V4, 47: $V5 }, o($V6, [2, 17]), o($V6, [2, 18]), o($Vd, [2, 6], { 11: 14, 10: 33, 45: $V3, 46: $V4, 47: $V5 }), o($Ve, [2, 46]), o($Ve, [2, 47]), o($Ve, [2, 48]), { 1: [2, 2] }, { 7: 34, 9: 6, 10: 10, 11: 14, 12: 7, 14: 8, 15: 9, 16: $V0, 20: $V1, 21: $V2, 45: $V3, 46: $V4, 47: $V5 }, o($V6, [2, 8]), { 10: 35, 11: 14, 23: [1, 36], 45: $V3, 46: $V4, 47: $V5 }, { 22: 37, 24: 24, 25: 25, 26: $V7, 27: $V8, 28: $V9, 29: $Va, 30: $Vb, 31: $Vc }, o($V6, [2, 16]), { 25: 38, 30: $Vb, 31: $Vc }, o($Vf, [2, 26], { 24: 39, 26: $V7, 27: $V8, 28: $V9, 29: $Va }), o($Vg, [2, 27]), o($Vg, [2, 28]), o($Vg, [2, 29]), o($Vg, [2, 30]), o($Vh, [2, 31]), o($Vh, [2, 32]), o($V6, [2, 11], { 17: [1, 40] }), o($Vd, [2, 5]), { 8: [2, 4] }, o($Vi, [2, 19]), { 10: 41, 11: 14, 45: $V3, 46: $V4, 47: $V5 }, { 10: 42, 11: 14, 23: [1, 43], 45: $V3, 46: $V4, 47: $V5 }, o($Vf, [2, 25], { 24: 44, 26: $V7, 27: $V8, 28: $V9, 29: $Va }), o($Vf, [2, 24]), { 18: 45, 20: $Vj }, o($Vi, [2, 21]), o($Vi, [2, 20]), { 10: 47, 11: 14, 45: $V3, 46: $V4, 47: $V5 }, o($Vf, [2, 23]), { 19: [1, 48] }, { 18: 49, 19: [2, 13], 20: $Vj }, o($Vi, [2, 22]), o($V6, [2, 12]), { 19: [2, 14] }],
|
6160 | defaultActions: { 2: [2, 1], 18: [2, 2], 34: [2, 4], 49: [2, 14] },
|
6161 | parseError: function parseError(str, hash) {
|
6162 | if (hash.recoverable) {
|
6163 | this.trace(str);
|
6164 | } else {
|
6165 | var _parseError = function _parseError(msg, hash) {
|
6166 | this.message = msg;
|
6167 | this.hash = hash;
|
6168 | };
|
6169 |
|
6170 | _parseError.prototype = Error;
|
6171 |
|
6172 | throw new _parseError(str, hash);
|
6173 | }
|
6174 | },
|
6175 | parse: function parse(input) {
|
6176 | var self = this,
|
6177 | stack = [0],
|
6178 | tstack = [],
|
6179 | vstack = [null],
|
6180 | lstack = [],
|
6181 | table = this.table,
|
6182 | yytext = '',
|
6183 | yylineno = 0,
|
6184 | yyleng = 0,
|
6185 | recovering = 0,
|
6186 | TERROR = 2,
|
6187 | EOF = 1;
|
6188 | var args = lstack.slice.call(arguments, 1);
|
6189 | var lexer = Object.create(this.lexer);
|
6190 | var sharedState = { yy: {} };
|
6191 | for (var k in this.yy) {
|
6192 | if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
|
6193 | sharedState.yy[k] = this.yy[k];
|
6194 | }
|
6195 | }
|
6196 | lexer.setInput(input, sharedState.yy);
|
6197 | sharedState.yy.lexer = lexer;
|
6198 | sharedState.yy.parser = this;
|
6199 | if (typeof lexer.yylloc == 'undefined') {
|
6200 | lexer.yylloc = {};
|
6201 | }
|
6202 | var yyloc = lexer.yylloc;
|
6203 | lstack.push(yyloc);
|
6204 | var ranges = lexer.options && lexer.options.ranges;
|
6205 | if (typeof sharedState.yy.parseError === 'function') {
|
6206 | this.parseError = sharedState.yy.parseError;
|
6207 | } else {
|
6208 | this.parseError = Object.getPrototypeOf(this).parseError;
|
6209 | }
|
6210 | function popStack(n) {
|
6211 | stack.length = stack.length - 2 * n;
|
6212 | vstack.length = vstack.length - n;
|
6213 | lstack.length = lstack.length - n;
|
6214 | }
|
6215 | function lex() {
|
6216 | var token;
|
6217 | token = tstack.pop() || lexer.lex() || EOF;
|
6218 | if (typeof token !== 'number') {
|
6219 | if (token instanceof Array) {
|
6220 | tstack = token;
|
6221 | token = tstack.pop();
|
6222 | }
|
6223 | token = self.symbols_[token] || token;
|
6224 | }
|
6225 | return token;
|
6226 | }
|
6227 | var symbol,
|
6228 | preErrorSymbol,
|
6229 | state,
|
6230 | action,
|
6231 | a,
|
6232 | r,
|
6233 | yyval = {},
|
6234 | p,
|
6235 | len,
|
6236 | newState,
|
6237 | expected;
|
6238 | while (true) {
|
6239 | state = stack[stack.length - 1];
|
6240 | if (this.defaultActions[state]) {
|
6241 | action = this.defaultActions[state];
|
6242 | } else {
|
6243 | if (symbol === null || typeof symbol == 'undefined') {
|
6244 | symbol = lex();
|
6245 | }
|
6246 | action = table[state] && table[state][symbol];
|
6247 | }
|
6248 | if (typeof action === 'undefined' || !action.length || !action[0]) {
|
6249 | var errStr = '';
|
6250 | expected = [];
|
6251 | for (p in table[state]) {
|
6252 | if (this.terminals_[p] && p > TERROR) {
|
6253 | expected.push('\'' + this.terminals_[p] + '\'');
|
6254 | }
|
6255 | }
|
6256 | if (lexer.showPosition) {
|
6257 | errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
|
6258 | } else {
|
6259 | errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
|
6260 | }
|
6261 | this.parseError(errStr, {
|
6262 | text: lexer.match,
|
6263 | token: this.terminals_[symbol] || symbol,
|
6264 | line: lexer.yylineno,
|
6265 | loc: yyloc,
|
6266 | expected: expected
|
6267 | });
|
6268 | }
|
6269 | if (action[0] instanceof Array && action.length > 1) {
|
6270 | throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
|
6271 | }
|
6272 | switch (action[0]) {
|
6273 | case 1:
|
6274 | stack.push(symbol);
|
6275 | vstack.push(lexer.yytext);
|
6276 | lstack.push(lexer.yylloc);
|
6277 | stack.push(action[1]);
|
6278 | symbol = null;
|
6279 | if (!preErrorSymbol) {
|
6280 | yyleng = lexer.yyleng;
|
6281 | yytext = lexer.yytext;
|
6282 | yylineno = lexer.yylineno;
|
6283 | yyloc = lexer.yylloc;
|
6284 | if (recovering > 0) {
|
6285 | recovering--;
|
6286 | }
|
6287 | } else {
|
6288 | symbol = preErrorSymbol;
|
6289 | preErrorSymbol = null;
|
6290 | }
|
6291 | break;
|
6292 | case 2:
|
6293 | len = this.productions_[action[1]][1];
|
6294 | yyval.$ = vstack[vstack.length - len];
|
6295 | yyval._$ = {
|
6296 | first_line: lstack[lstack.length - (len || 1)].first_line,
|
6297 | last_line: lstack[lstack.length - 1].last_line,
|
6298 | first_column: lstack[lstack.length - (len || 1)].first_column,
|
6299 | last_column: lstack[lstack.length - 1].last_column
|
6300 | };
|
6301 | if (ranges) {
|
6302 | yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
|
6303 | }
|
6304 | r = this.performAction.apply(yyval, [yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack].concat(args));
|
6305 | if (typeof r !== 'undefined') {
|
6306 | return r;
|
6307 | }
|
6308 | if (len) {
|
6309 | stack = stack.slice(0, -1 * len * 2);
|
6310 | vstack = vstack.slice(0, -1 * len);
|
6311 | lstack = lstack.slice(0, -1 * len);
|
6312 | }
|
6313 | stack.push(this.productions_[action[1]][0]);
|
6314 | vstack.push(yyval.$);
|
6315 | lstack.push(yyval._$);
|
6316 | newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
|
6317 | stack.push(newState);
|
6318 | break;
|
6319 | case 3:
|
6320 | return true;
|
6321 | }
|
6322 | }
|
6323 | return true;
|
6324 | } };
|
6325 |
|
6326 |
|
6327 | var lexer = function () {
|
6328 | var lexer = {
|
6329 |
|
6330 | EOF: 1,
|
6331 |
|
6332 | parseError: function parseError(str, hash) {
|
6333 | if (this.yy.parser) {
|
6334 | this.yy.parser.parseError(str, hash);
|
6335 | } else {
|
6336 | throw new Error(str);
|
6337 | }
|
6338 | },
|
6339 |
|
6340 |
|
6341 | setInput: function setInput(input, yy) {
|
6342 | this.yy = yy || this.yy || {};
|
6343 | this._input = input;
|
6344 | this._more = this._backtrack = this.done = false;
|
6345 | this.yylineno = this.yyleng = 0;
|
6346 | this.yytext = this.matched = this.match = '';
|
6347 | this.conditionStack = ['INITIAL'];
|
6348 | this.yylloc = {
|
6349 | first_line: 1,
|
6350 | first_column: 0,
|
6351 | last_line: 1,
|
6352 | last_column: 0
|
6353 | };
|
6354 | if (this.options.ranges) {
|
6355 | this.yylloc.range = [0, 0];
|
6356 | }
|
6357 | this.offset = 0;
|
6358 | return this;
|
6359 | },
|
6360 |
|
6361 |
|
6362 | input: function input() {
|
6363 | var ch = this._input[0];
|
6364 | this.yytext += ch;
|
6365 | this.yyleng++;
|
6366 | this.offset++;
|
6367 | this.match += ch;
|
6368 | this.matched += ch;
|
6369 | var lines = ch.match(/(?:\r\n?|\n).*/g);
|
6370 | if (lines) {
|
6371 | this.yylineno++;
|
6372 | this.yylloc.last_line++;
|
6373 | } else {
|
6374 | this.yylloc.last_column++;
|
6375 | }
|
6376 | if (this.options.ranges) {
|
6377 | this.yylloc.range[1]++;
|
6378 | }
|
6379 |
|
6380 | this._input = this._input.slice(1);
|
6381 | return ch;
|
6382 | },
|
6383 |
|
6384 |
|
6385 | unput: function unput(ch) {
|
6386 | var len = ch.length;
|
6387 | var lines = ch.split(/(?:\r\n?|\n)/g);
|
6388 |
|
6389 | this._input = ch + this._input;
|
6390 | this.yytext = this.yytext.substr(0, this.yytext.length - len);
|
6391 |
|
6392 | this.offset -= len;
|
6393 | var oldLines = this.match.split(/(?:\r\n?|\n)/g);
|
6394 | this.match = this.match.substr(0, this.match.length - 1);
|
6395 | this.matched = this.matched.substr(0, this.matched.length - 1);
|
6396 |
|
6397 | if (lines.length - 1) {
|
6398 | this.yylineno -= lines.length - 1;
|
6399 | }
|
6400 | var r = this.yylloc.range;
|
6401 |
|
6402 | this.yylloc = {
|
6403 | first_line: this.yylloc.first_line,
|
6404 | last_line: this.yylineno + 1,
|
6405 | first_column: this.yylloc.first_column,
|
6406 | 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
|
6407 | };
|
6408 |
|
6409 | if (this.options.ranges) {
|
6410 | this.yylloc.range = [r[0], r[0] + this.yyleng - len];
|
6411 | }
|
6412 | this.yyleng = this.yytext.length;
|
6413 | return this;
|
6414 | },
|
6415 |
|
6416 |
|
6417 | more: function more() {
|
6418 | this._more = true;
|
6419 | return this;
|
6420 | },
|
6421 |
|
6422 |
|
6423 | reject: function reject() {
|
6424 | if (this.options.backtrack_lexer) {
|
6425 | this._backtrack = true;
|
6426 | } else {
|
6427 | 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(), {
|
6428 | text: "",
|
6429 | token: null,
|
6430 | line: this.yylineno
|
6431 | });
|
6432 | }
|
6433 | return this;
|
6434 | },
|
6435 |
|
6436 |
|
6437 | less: function less(n) {
|
6438 | this.unput(this.match.slice(n));
|
6439 | },
|
6440 |
|
6441 |
|
6442 | pastInput: function pastInput() {
|
6443 | var past = this.matched.substr(0, this.matched.length - this.match.length);
|
6444 | return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, "");
|
6445 | },
|
6446 |
|
6447 |
|
6448 | upcomingInput: function upcomingInput() {
|
6449 | var next = this.match;
|
6450 | if (next.length < 20) {
|
6451 | next += this._input.substr(0, 20 - next.length);
|
6452 | }
|
6453 | return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
|
6454 | },
|
6455 |
|
6456 |
|
6457 | showPosition: function showPosition() {
|
6458 | var pre = this.pastInput();
|
6459 | var c = new Array(pre.length + 1).join("-");
|
6460 | return pre + this.upcomingInput() + "\n" + c + "^";
|
6461 | },
|
6462 |
|
6463 |
|
6464 | test_match: function test_match(match, indexed_rule) {
|
6465 | var token, lines, backup;
|
6466 |
|
6467 | if (this.options.backtrack_lexer) {
|
6468 |
|
6469 | backup = {
|
6470 | yylineno: this.yylineno,
|
6471 | yylloc: {
|
6472 | first_line: this.yylloc.first_line,
|
6473 | last_line: this.last_line,
|
6474 | first_column: this.yylloc.first_column,
|
6475 | last_column: this.yylloc.last_column
|
6476 | },
|
6477 | yytext: this.yytext,
|
6478 | match: this.match,
|
6479 | matches: this.matches,
|
6480 | matched: this.matched,
|
6481 | yyleng: this.yyleng,
|
6482 | offset: this.offset,
|
6483 | _more: this._more,
|
6484 | _input: this._input,
|
6485 | yy: this.yy,
|
6486 | conditionStack: this.conditionStack.slice(0),
|
6487 | done: this.done
|
6488 | };
|
6489 | if (this.options.ranges) {
|
6490 | backup.yylloc.range = this.yylloc.range.slice(0);
|
6491 | }
|
6492 | }
|
6493 |
|
6494 | lines = match[0].match(/(?:\r\n?|\n).*/g);
|
6495 | if (lines) {
|
6496 | this.yylineno += lines.length;
|
6497 | }
|
6498 | this.yylloc = {
|
6499 | first_line: this.yylloc.last_line,
|
6500 | last_line: this.yylineno + 1,
|
6501 | first_column: this.yylloc.last_column,
|
6502 | last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
|
6503 | };
|
6504 | this.yytext += match[0];
|
6505 | this.match += match[0];
|
6506 | this.matches = match;
|
6507 | this.yyleng = this.yytext.length;
|
6508 | if (this.options.ranges) {
|
6509 | this.yylloc.range = [this.offset, this.offset += this.yyleng];
|
6510 | }
|
6511 | this._more = false;
|
6512 | this._backtrack = false;
|
6513 | this._input = this._input.slice(match[0].length);
|
6514 | this.matched += match[0];
|
6515 | token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
|
6516 | if (this.done && this._input) {
|
6517 | this.done = false;
|
6518 | }
|
6519 | if (token) {
|
6520 | return token;
|
6521 | } else if (this._backtrack) {
|
6522 |
|
6523 | for (var k in backup) {
|
6524 | this[k] = backup[k];
|
6525 | }
|
6526 | return false;
|
6527 | }
|
6528 | return false;
|
6529 | },
|
6530 |
|
6531 |
|
6532 | next: function next() {
|
6533 | if (this.done) {
|
6534 | return this.EOF;
|
6535 | }
|
6536 | if (!this._input) {
|
6537 | this.done = true;
|
6538 | }
|
6539 |
|
6540 | var token, match, tempMatch, index;
|
6541 | if (!this._more) {
|
6542 | this.yytext = '';
|
6543 | this.match = '';
|
6544 | }
|
6545 | var rules = this._currentRules();
|
6546 | for (var i = 0; i < rules.length; i++) {
|
6547 | tempMatch = this._input.match(this.rules[rules[i]]);
|
6548 | if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
|
6549 | match = tempMatch;
|
6550 | index = i;
|
6551 | if (this.options.backtrack_lexer) {
|
6552 | token = this.test_match(tempMatch, rules[i]);
|
6553 | if (token !== false) {
|
6554 | return token;
|
6555 | } else if (this._backtrack) {
|
6556 | match = false;
|
6557 | continue;
|
6558 | } else {
|
6559 |
|
6560 | return false;
|
6561 | }
|
6562 | } else if (!this.options.flex) {
|
6563 | break;
|
6564 | }
|
6565 | }
|
6566 | }
|
6567 | if (match) {
|
6568 | token = this.test_match(match, rules[index]);
|
6569 | if (token !== false) {
|
6570 | return token;
|
6571 | }
|
6572 |
|
6573 | return false;
|
6574 | }
|
6575 | if (this._input === "") {
|
6576 | return this.EOF;
|
6577 | } else {
|
6578 | return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
|
6579 | text: "",
|
6580 | token: null,
|
6581 | line: this.yylineno
|
6582 | });
|
6583 | }
|
6584 | },
|
6585 |
|
6586 |
|
6587 | lex: function lex() {
|
6588 | var r = this.next();
|
6589 | if (r) {
|
6590 | return r;
|
6591 | } else {
|
6592 | return this.lex();
|
6593 | }
|
6594 | },
|
6595 |
|
6596 |
|
6597 | begin: function begin(condition) {
|
6598 | this.conditionStack.push(condition);
|
6599 | },
|
6600 |
|
6601 |
|
6602 | popState: function popState() {
|
6603 | var n = this.conditionStack.length - 1;
|
6604 | if (n > 0) {
|
6605 | return this.conditionStack.pop();
|
6606 | } else {
|
6607 | return this.conditionStack[0];
|
6608 | }
|
6609 | },
|
6610 |
|
6611 |
|
6612 | _currentRules: function _currentRules() {
|
6613 | if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
|
6614 | return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
|
6615 | } else {
|
6616 | return this.conditions["INITIAL"].rules;
|
6617 | }
|
6618 | },
|
6619 |
|
6620 |
|
6621 | topState: function topState(n) {
|
6622 | n = this.conditionStack.length - 1 - Math.abs(n || 0);
|
6623 | if (n >= 0) {
|
6624 | return this.conditionStack[n];
|
6625 | } else {
|
6626 | return "INITIAL";
|
6627 | }
|
6628 | },
|
6629 |
|
6630 |
|
6631 | pushState: function pushState(condition) {
|
6632 | this.begin(condition);
|
6633 | },
|
6634 |
|
6635 |
|
6636 | stateStackSize: function stateStackSize() {
|
6637 | return this.conditionStack.length;
|
6638 | },
|
6639 | options: {},
|
6640 | performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
|
6641 | var YYSTATE = YY_START;
|
6642 | switch ($avoiding_name_collisions) {
|
6643 | case 0:
|
6644 |
|
6645 | break;
|
6646 | case 1:
|
6647 | return 6;
|
6648 | break;
|
6649 | case 2:
|
6650 |
|
6651 | break;
|
6652 | case 3:
|
6653 | return 5;
|
6654 | break;
|
6655 | case 4:
|
6656 | this.begin("struct"); return 17;
|
6657 | break;
|
6658 | case 5:
|
6659 | this.popState();return 19;
|
6660 | break;
|
6661 | case 6:
|
6662 |
|
6663 | break;
|
6664 | case 7:
|
6665 | return "MEMBER";
|
6666 | break;
|
6667 | case 8:
|
6668 | return 16;
|
6669 | break;
|
6670 | case 9:
|
6671 | this.begin("string");
|
6672 | break;
|
6673 | case 10:
|
6674 | this.popState();
|
6675 | break;
|
6676 | case 11:
|
6677 | return "STR";
|
6678 | break;
|
6679 | case 12:
|
6680 | return 27;
|
6681 | break;
|
6682 | case 13:
|
6683 | return 27;
|
6684 | break;
|
6685 | case 14:
|
6686 | return 29;
|
6687 | break;
|
6688 | case 15:
|
6689 | return 29;
|
6690 | break;
|
6691 | case 16:
|
6692 | return 28;
|
6693 | break;
|
6694 | case 17:
|
6695 | return 26;
|
6696 | break;
|
6697 | case 18:
|
6698 | return 30;
|
6699 | break;
|
6700 | case 19:
|
6701 | return 31;
|
6702 | break;
|
6703 | case 20:
|
6704 | return 13;
|
6705 | break;
|
6706 | case 21:
|
6707 | return 43;
|
6708 | break;
|
6709 | case 22:
|
6710 | return 'DOT';
|
6711 | break;
|
6712 | case 23:
|
6713 | return 'PLUS';
|
6714 | break;
|
6715 | case 24:
|
6716 | return 40;
|
6717 | break;
|
6718 | case 25:
|
6719 | return 'EQUALS';
|
6720 | break;
|
6721 | case 26:
|
6722 | return 'EQUALS';
|
6723 | break;
|
6724 | case 27:
|
6725 | return 47;
|
6726 | break;
|
6727 | case 28:
|
6728 | return 'PUNCTUATION';
|
6729 | break;
|
6730 | case 29:
|
6731 | return 46;
|
6732 | break;
|
6733 | case 30:
|
6734 | return 45;
|
6735 | break;
|
6736 | case 31:
|
6737 | return 42;
|
6738 | break;
|
6739 | case 32:
|
6740 | return 8;
|
6741 | break;
|
6742 | }
|
6743 | },
|
6744 | rules: [/^(?:%%[^\n]*)/, /^(?:\n+)/, /^(?:\s+)/, /^(?:classDiagram\b)/, /^(?:[\{])/, /^(?:\})/, /^(?:[\n])/, /^(?:[^\{\}\n]*)/, /^(?:class\b)/, /^(?:["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:\s*<\|)/, /^(?:\s*\|>)/, /^(?:\s*>)/, /^(?:\s*<)/, /^(?:\s*\*)/, /^(?:\s*o\b)/, /^(?:--)/, /^(?:\.\.)/, /^(?::[^#\n;]+)/, /^(?:-)/, /^(?:\.)/, /^(?:\+)/, /^(?:%)/, /^(?:=)/, /^(?:=)/, /^(?:[A-Za-z]+)/, /^(?:[!"#$%&'*+,-.`?\\_\/])/, /^(?:[0-9]+)/, /^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/, /^(?:\s)/, /^(?:$)/],
|
6745 | conditions: { "string": { "rules": [10, 11], "inclusive": false }, "struct": { "rules": [5, 6, 7], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 8, 9, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32], "inclusive": true } }
|
6746 | };
|
6747 | return lexer;
|
6748 | }();
|
6749 | parser.lexer = lexer;
|
6750 | function Parser() {
|
6751 | this.yy = {};
|
6752 | }
|
6753 | Parser.prototype = parser;parser.Parser = Parser;
|
6754 | return new Parser();
|
6755 | }();
|
6756 |
|
6757 | if (true) {
|
6758 | exports.parser = parser;
|
6759 | exports.Parser = parser.Parser;
|
6760 | exports.parse = function () {
|
6761 | return parser.parse.apply(parser, arguments);
|
6762 | };
|
6763 | exports.main = function commonjsMain(args) {
|
6764 | if (!args[1]) {
|
6765 | console.log('Usage: ' + args[0] + ' FILE');
|
6766 | process.exit(1);
|
6767 | }
|
6768 | var source = __webpack_require__(3).readFileSync(__webpack_require__(4).normalize(args[1]), "utf8");
|
6769 | return exports.parser.parse(source);
|
6770 | };
|
6771 | if (typeof module !== 'undefined' && __webpack_require__.c[__webpack_require__.s] === module) {
|
6772 | exports.main(process.argv.slice(1));
|
6773 | }
|
6774 | }
|
6775 | }.call(exports, __webpack_require__(2)(module)))
|
6776 |
|
6777 | }),
|
6778 |
|
6779 | (function(module, exports, __webpack_require__) {
|
6780 |
|
6781 | "use strict";
|
6782 |
|
6783 |
|
6784 | var Logger = __webpack_require__(0);
|
6785 | var log = Logger.Log;
|
6786 | var relations = [];
|
6787 |
|
6788 | var classes;
|
6789 | classes = {};
|
6790 |
|
6791 |
|
6792 |
|
6793 |
|
6794 |
|
6795 |
|
6796 |
|
6797 |
|
6798 | exports.addClass = function (id) {
|
6799 | if (typeof classes[id] === 'undefined') {
|
6800 | classes[id] = {
|
6801 | id: id,
|
6802 | methods: [],
|
6803 | members: []
|
6804 | };
|
6805 | }
|
6806 | };
|
6807 |
|
6808 | exports.clear = function () {
|
6809 | relations = [];
|
6810 | classes = {};
|
6811 | };
|
6812 |
|
6813 | module.exports.getClass = function (id) {
|
6814 | return classes[id];
|
6815 | };
|
6816 | module.exports.getClasses = function () {
|
6817 | return classes;
|
6818 | };
|
6819 |
|
6820 | module.exports.getRelations = function () {
|
6821 | return relations;
|
6822 | };
|
6823 |
|
6824 | exports.addRelation = function (relation) {
|
6825 | log.warn('Adding relation: ' + JSON.stringify(relation));
|
6826 | exports.addClass(relation.id1);
|
6827 | exports.addClass(relation.id2);
|
6828 |
|
6829 | relations.push(relation);
|
6830 | };
|
6831 |
|
6832 | exports.addMembers = function (className, MembersArr) {
|
6833 | var theClass = classes[className];
|
6834 | if (typeof MembersArr === 'string') {
|
6835 | if (MembersArr.substr(-1) === ')') {
|
6836 | theClass.methods.push(MembersArr);
|
6837 | } else {
|
6838 | theClass.members.push(MembersArr);
|
6839 | }
|
6840 | }
|
6841 | };
|
6842 |
|
6843 | exports.cleanupLabel = function (label) {
|
6844 | if (label.substring(0, 1) === ':') {
|
6845 | return label.substr(2).trim();
|
6846 | } else {
|
6847 | return label.trim();
|
6848 | }
|
6849 | };
|
6850 |
|
6851 | exports.lineType = {
|
6852 | LINE: 0,
|
6853 | DOTTED_LINE: 1
|
6854 | };
|
6855 |
|
6856 | exports.relationType = {
|
6857 | AGGREGATION: 0,
|
6858 | EXTENSION: 1,
|
6859 | COMPOSITION: 2,
|
6860 | DEPENDENCY: 3
|
6861 | };
|
6862 |
|
6863 | }),
|
6864 |
|
6865 | (function(module, exports, __webpack_require__) {
|
6866 |
|
6867 | "use strict";
|
6868 | (function(module) {
|
6869 |
|
6870 |
|
6871 |
|
6872 |
|
6873 |
|
6874 |
|
6875 |
|
6876 |
|
6877 |
|
6878 |
|
6879 |
|
6880 |
|
6881 |
|
6882 |
|
6883 |
|
6884 |
|
6885 |
|
6886 |
|
6887 |
|
6888 |
|
6889 |
|
6890 |
|
6891 |
|
6892 |
|
6893 |
|
6894 |
|
6895 |
|
6896 |
|
6897 |
|
6898 |
|
6899 |
|
6900 |
|
6901 |
|
6902 |
|
6903 |
|
6904 |
|
6905 |
|
6906 |
|
6907 |
|
6908 |
|
6909 |
|
6910 |
|
6911 |
|
6912 |
|
6913 |
|
6914 |
|
6915 |
|
6916 |
|
6917 |
|
6918 |
|
6919 |
|
6920 |
|
6921 |
|
6922 |
|
6923 |
|
6924 |
|
6925 |
|
6926 |
|
6927 |
|
6928 |
|
6929 |
|
6930 |
|
6931 |
|
6932 |
|
6933 |
|
6934 |
|
6935 |
|
6936 |
|
6937 |
|
6938 |
|
6939 |
|
6940 |
|
6941 |
|
6942 |
|
6943 | var parser = function () {
|
6944 | var o = function o(k, v, _o, l) {
|
6945 | for (_o = _o || {}, l = k.length; l--; _o[k[l]] = v) {}return _o;
|
6946 | },
|
6947 | $V0 = [2, 3],
|
6948 | $V1 = [1, 7],
|
6949 | $V2 = [7, 12, 15, 17, 19, 20, 21],
|
6950 | $V3 = [7, 11, 12, 15, 17, 19, 20, 21],
|
6951 | $V4 = [2, 20],
|
6952 | $V5 = [1, 32];
|
6953 | var parser = { trace: function trace() {},
|
6954 | yy: {},
|
6955 | symbols_: { "error": 2, "start": 3, "GG": 4, ":": 5, "document": 6, "EOF": 7, "DIR": 8, "options": 9, "body": 10, "OPT": 11, "NL": 12, "line": 13, "statement": 14, "COMMIT": 15, "commit_arg": 16, "BRANCH": 17, "ID": 18, "CHECKOUT": 19, "MERGE": 20, "RESET": 21, "reset_arg": 22, "STR": 23, "HEAD": 24, "reset_parents": 25, "CARET": 26, "$accept": 0, "$end": 1 },
|
6956 | terminals_: { 2: "error", 4: "GG", 5: ":", 7: "EOF", 8: "DIR", 11: "OPT", 12: "NL", 15: "COMMIT", 17: "BRANCH", 18: "ID", 19: "CHECKOUT", 20: "MERGE", 21: "RESET", 23: "STR", 24: "HEAD", 26: "CARET" },
|
6957 | productions_: [0, [3, 4], [3, 5], [6, 0], [6, 2], [9, 2], [9, 1], [10, 0], [10, 2], [13, 2], [13, 1], [14, 2], [14, 2], [14, 2], [14, 2], [14, 2], [16, 0], [16, 1], [22, 2], [22, 2], [25, 0], [25, 2]],
|
6958 | performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
|
6959 |
|
6960 |
|
6961 | var $0 = $$.length - 1;
|
6962 | switch (yystate) {
|
6963 | case 1:
|
6964 | return $$[$0 - 1];
|
6965 | break;
|
6966 | case 2:
|
6967 | yy.setDirection($$[$0 - 3]);return $$[$0 - 1];
|
6968 | break;
|
6969 | case 4:
|
6970 | yy.setOptions($$[$0 - 1]);this.$ = $$[$0];
|
6971 | break;
|
6972 | case 5:
|
6973 | $$[$0 - 1] += $$[$0];this.$ = $$[$0 - 1];
|
6974 | break;
|
6975 | case 7:
|
6976 | this.$ = [];
|
6977 | break;
|
6978 | case 8:
|
6979 | $$[$0 - 1].push($$[$0]);this.$ = $$[$0 - 1];
|
6980 | break;
|
6981 | case 9:
|
6982 | this.$ = $$[$0 - 1];
|
6983 | break;
|
6984 | case 11:
|
6985 | yy.commit($$[$0]);
|
6986 | break;
|
6987 | case 12:
|
6988 | yy.branch($$[$0]);
|
6989 | break;
|
6990 | case 13:
|
6991 | yy.checkout($$[$0]);
|
6992 | break;
|
6993 | case 14:
|
6994 | yy.merge($$[$0]);
|
6995 | break;
|
6996 | case 15:
|
6997 | yy.reset($$[$0]);
|
6998 | break;
|
6999 | case 16:
|
7000 | this.$ = "";
|
7001 | break;
|
7002 | case 17:
|
7003 | this.$ = $$[$0];
|
7004 | break;
|
7005 | case 18:
|
7006 | this.$ = $$[$0 - 1] + ":" + $$[$0];
|
7007 | break;
|
7008 | case 19:
|
7009 | this.$ = $$[$0 - 1] + ":" + yy.count;yy.count = 0;
|
7010 | break;
|
7011 | case 20:
|
7012 | yy.count = 0;
|
7013 | break;
|
7014 | case 21:
|
7015 | yy.count += 1;
|
7016 | break;
|
7017 | }
|
7018 | },
|
7019 | table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, { 5: [1, 3], 8: [1, 4] }, { 6: 5, 7: $V0, 9: 6, 12: $V1 }, { 5: [1, 8] }, { 7: [1, 9] }, o($V2, [2, 7], { 10: 10, 11: [1, 11] }), o($V3, [2, 6]), { 6: 12, 7: $V0, 9: 6, 12: $V1 }, { 1: [2, 1] }, { 7: [2, 4], 12: [1, 15], 13: 13, 14: 14, 15: [1, 16], 17: [1, 17], 19: [1, 18], 20: [1, 19], 21: [1, 20] }, o($V3, [2, 5]), { 7: [1, 21] }, o($V2, [2, 8]), { 12: [1, 22] }, o($V2, [2, 10]), { 12: [2, 16], 16: 23, 23: [1, 24] }, { 18: [1, 25] }, { 18: [1, 26] }, { 18: [1, 27] }, { 18: [1, 30], 22: 28, 24: [1, 29] }, { 1: [2, 2] }, o($V2, [2, 9]), { 12: [2, 11] }, { 12: [2, 17] }, { 12: [2, 12] }, { 12: [2, 13] }, { 12: [2, 14] }, { 12: [2, 15] }, { 12: $V4, 25: 31, 26: $V5 }, { 12: $V4, 25: 33, 26: $V5 }, { 12: [2, 18] }, { 12: $V4, 25: 34, 26: $V5 }, { 12: [2, 19] }, { 12: [2, 21] }],
|
7020 | defaultActions: { 9: [2, 1], 21: [2, 2], 23: [2, 11], 24: [2, 17], 25: [2, 12], 26: [2, 13], 27: [2, 14], 28: [2, 15], 31: [2, 18], 33: [2, 19], 34: [2, 21] },
|
7021 | parseError: function parseError(str, hash) {
|
7022 | if (hash.recoverable) {
|
7023 | this.trace(str);
|
7024 | } else {
|
7025 | var _parseError = function _parseError(msg, hash) {
|
7026 | this.message = msg;
|
7027 | this.hash = hash;
|
7028 | };
|
7029 |
|
7030 | _parseError.prototype = Error;
|
7031 |
|
7032 | throw new _parseError(str, hash);
|
7033 | }
|
7034 | },
|
7035 | parse: function parse(input) {
|
7036 | var self = this,
|
7037 | stack = [0],
|
7038 | tstack = [],
|
7039 | vstack = [null],
|
7040 | lstack = [],
|
7041 | table = this.table,
|
7042 | yytext = '',
|
7043 | yylineno = 0,
|
7044 | yyleng = 0,
|
7045 | recovering = 0,
|
7046 | TERROR = 2,
|
7047 | EOF = 1;
|
7048 | var args = lstack.slice.call(arguments, 1);
|
7049 | var lexer = Object.create(this.lexer);
|
7050 | var sharedState = { yy: {} };
|
7051 | for (var k in this.yy) {
|
7052 | if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
|
7053 | sharedState.yy[k] = this.yy[k];
|
7054 | }
|
7055 | }
|
7056 | lexer.setInput(input, sharedState.yy);
|
7057 | sharedState.yy.lexer = lexer;
|
7058 | sharedState.yy.parser = this;
|
7059 | if (typeof lexer.yylloc == 'undefined') {
|
7060 | lexer.yylloc = {};
|
7061 | }
|
7062 | var yyloc = lexer.yylloc;
|
7063 | lstack.push(yyloc);
|
7064 | var ranges = lexer.options && lexer.options.ranges;
|
7065 | if (typeof sharedState.yy.parseError === 'function') {
|
7066 | this.parseError = sharedState.yy.parseError;
|
7067 | } else {
|
7068 | this.parseError = Object.getPrototypeOf(this).parseError;
|
7069 | }
|
7070 | function popStack(n) {
|
7071 | stack.length = stack.length - 2 * n;
|
7072 | vstack.length = vstack.length - n;
|
7073 | lstack.length = lstack.length - n;
|
7074 | }
|
7075 | function lex() {
|
7076 | var token;
|
7077 | token = tstack.pop() || lexer.lex() || EOF;
|
7078 | if (typeof token !== 'number') {
|
7079 | if (token instanceof Array) {
|
7080 | tstack = token;
|
7081 | token = tstack.pop();
|
7082 | }
|
7083 | token = self.symbols_[token] || token;
|
7084 | }
|
7085 | return token;
|
7086 | }
|
7087 | var symbol,
|
7088 | preErrorSymbol,
|
7089 | state,
|
7090 | action,
|
7091 | a,
|
7092 | r,
|
7093 | yyval = {},
|
7094 | p,
|
7095 | len,
|
7096 | newState,
|
7097 | expected;
|
7098 | while (true) {
|
7099 | state = stack[stack.length - 1];
|
7100 | if (this.defaultActions[state]) {
|
7101 | action = this.defaultActions[state];
|
7102 | } else {
|
7103 | if (symbol === null || typeof symbol == 'undefined') {
|
7104 | symbol = lex();
|
7105 | }
|
7106 | action = table[state] && table[state][symbol];
|
7107 | }
|
7108 | if (typeof action === 'undefined' || !action.length || !action[0]) {
|
7109 | var errStr = '';
|
7110 | expected = [];
|
7111 | for (p in table[state]) {
|
7112 | if (this.terminals_[p] && p > TERROR) {
|
7113 | expected.push('\'' + this.terminals_[p] + '\'');
|
7114 | }
|
7115 | }
|
7116 | if (lexer.showPosition) {
|
7117 | errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
|
7118 | } else {
|
7119 | errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
|
7120 | }
|
7121 | this.parseError(errStr, {
|
7122 | text: lexer.match,
|
7123 | token: this.terminals_[symbol] || symbol,
|
7124 | line: lexer.yylineno,
|
7125 | loc: yyloc,
|
7126 | expected: expected
|
7127 | });
|
7128 | }
|
7129 | if (action[0] instanceof Array && action.length > 1) {
|
7130 | throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
|
7131 | }
|
7132 | switch (action[0]) {
|
7133 | case 1:
|
7134 | stack.push(symbol);
|
7135 | vstack.push(lexer.yytext);
|
7136 | lstack.push(lexer.yylloc);
|
7137 | stack.push(action[1]);
|
7138 | symbol = null;
|
7139 | if (!preErrorSymbol) {
|
7140 | yyleng = lexer.yyleng;
|
7141 | yytext = lexer.yytext;
|
7142 | yylineno = lexer.yylineno;
|
7143 | yyloc = lexer.yylloc;
|
7144 | if (recovering > 0) {
|
7145 | recovering--;
|
7146 | }
|
7147 | } else {
|
7148 | symbol = preErrorSymbol;
|
7149 | preErrorSymbol = null;
|
7150 | }
|
7151 | break;
|
7152 | case 2:
|
7153 | len = this.productions_[action[1]][1];
|
7154 | yyval.$ = vstack[vstack.length - len];
|
7155 | yyval._$ = {
|
7156 | first_line: lstack[lstack.length - (len || 1)].first_line,
|
7157 | last_line: lstack[lstack.length - 1].last_line,
|
7158 | first_column: lstack[lstack.length - (len || 1)].first_column,
|
7159 | last_column: lstack[lstack.length - 1].last_column
|
7160 | };
|
7161 | if (ranges) {
|
7162 | yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
|
7163 | }
|
7164 | r = this.performAction.apply(yyval, [yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack].concat(args));
|
7165 | if (typeof r !== 'undefined') {
|
7166 | return r;
|
7167 | }
|
7168 | if (len) {
|
7169 | stack = stack.slice(0, -1 * len * 2);
|
7170 | vstack = vstack.slice(0, -1 * len);
|
7171 | lstack = lstack.slice(0, -1 * len);
|
7172 | }
|
7173 | stack.push(this.productions_[action[1]][0]);
|
7174 | vstack.push(yyval.$);
|
7175 | lstack.push(yyval._$);
|
7176 | newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
|
7177 | stack.push(newState);
|
7178 | break;
|
7179 | case 3:
|
7180 | return true;
|
7181 | }
|
7182 | }
|
7183 | return true;
|
7184 | } };
|
7185 |
|
7186 | var lexer = function () {
|
7187 | var lexer = {
|
7188 |
|
7189 | EOF: 1,
|
7190 |
|
7191 | parseError: function parseError(str, hash) {
|
7192 | if (this.yy.parser) {
|
7193 | this.yy.parser.parseError(str, hash);
|
7194 | } else {
|
7195 | throw new Error(str);
|
7196 | }
|
7197 | },
|
7198 |
|
7199 |
|
7200 | setInput: function setInput(input, yy) {
|
7201 | this.yy = yy || this.yy || {};
|
7202 | this._input = input;
|
7203 | this._more = this._backtrack = this.done = false;
|
7204 | this.yylineno = this.yyleng = 0;
|
7205 | this.yytext = this.matched = this.match = '';
|
7206 | this.conditionStack = ['INITIAL'];
|
7207 | this.yylloc = {
|
7208 | first_line: 1,
|
7209 | first_column: 0,
|
7210 | last_line: 1,
|
7211 | last_column: 0
|
7212 | };
|
7213 | if (this.options.ranges) {
|
7214 | this.yylloc.range = [0, 0];
|
7215 | }
|
7216 | this.offset = 0;
|
7217 | return this;
|
7218 | },
|
7219 |
|
7220 |
|
7221 | input: function input() {
|
7222 | var ch = this._input[0];
|
7223 | this.yytext += ch;
|
7224 | this.yyleng++;
|
7225 | this.offset++;
|
7226 | this.match += ch;
|
7227 | this.matched += ch;
|
7228 | var lines = ch.match(/(?:\r\n?|\n).*/g);
|
7229 | if (lines) {
|
7230 | this.yylineno++;
|
7231 | this.yylloc.last_line++;
|
7232 | } else {
|
7233 | this.yylloc.last_column++;
|
7234 | }
|
7235 | if (this.options.ranges) {
|
7236 | this.yylloc.range[1]++;
|
7237 | }
|
7238 |
|
7239 | this._input = this._input.slice(1);
|
7240 | return ch;
|
7241 | },
|
7242 |
|
7243 |
|
7244 | unput: function unput(ch) {
|
7245 | var len = ch.length;
|
7246 | var lines = ch.split(/(?:\r\n?|\n)/g);
|
7247 |
|
7248 | this._input = ch + this._input;
|
7249 | this.yytext = this.yytext.substr(0, this.yytext.length - len);
|
7250 |
|
7251 | this.offset -= len;
|
7252 | var oldLines = this.match.split(/(?:\r\n?|\n)/g);
|
7253 | this.match = this.match.substr(0, this.match.length - 1);
|
7254 | this.matched = this.matched.substr(0, this.matched.length - 1);
|
7255 |
|
7256 | if (lines.length - 1) {
|
7257 | this.yylineno -= lines.length - 1;
|
7258 | }
|
7259 | var r = this.yylloc.range;
|
7260 |
|
7261 | this.yylloc = {
|
7262 | first_line: this.yylloc.first_line,
|
7263 | last_line: this.yylineno + 1,
|
7264 | first_column: this.yylloc.first_column,
|
7265 | 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
|
7266 | };
|
7267 |
|
7268 | if (this.options.ranges) {
|
7269 | this.yylloc.range = [r[0], r[0] + this.yyleng - len];
|
7270 | }
|
7271 | this.yyleng = this.yytext.length;
|
7272 | return this;
|
7273 | },
|
7274 |
|
7275 |
|
7276 | more: function more() {
|
7277 | this._more = true;
|
7278 | return this;
|
7279 | },
|
7280 |
|
7281 |
|
7282 | reject: function reject() {
|
7283 | if (this.options.backtrack_lexer) {
|
7284 | this._backtrack = true;
|
7285 | } else {
|
7286 | 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(), {
|
7287 | text: "",
|
7288 | token: null,
|
7289 | line: this.yylineno
|
7290 | });
|
7291 | }
|
7292 | return this;
|
7293 | },
|
7294 |
|
7295 |
|
7296 | less: function less(n) {
|
7297 | this.unput(this.match.slice(n));
|
7298 | },
|
7299 |
|
7300 |
|
7301 | pastInput: function pastInput() {
|
7302 | var past = this.matched.substr(0, this.matched.length - this.match.length);
|
7303 | return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, "");
|
7304 | },
|
7305 |
|
7306 |
|
7307 | upcomingInput: function upcomingInput() {
|
7308 | var next = this.match;
|
7309 | if (next.length < 20) {
|
7310 | next += this._input.substr(0, 20 - next.length);
|
7311 | }
|
7312 | return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
|
7313 | },
|
7314 |
|
7315 |
|
7316 | showPosition: function showPosition() {
|
7317 | var pre = this.pastInput();
|
7318 | var c = new Array(pre.length + 1).join("-");
|
7319 | return pre + this.upcomingInput() + "\n" + c + "^";
|
7320 | },
|
7321 |
|
7322 |
|
7323 | test_match: function test_match(match, indexed_rule) {
|
7324 | var token, lines, backup;
|
7325 |
|
7326 | if (this.options.backtrack_lexer) {
|
7327 |
|
7328 | backup = {
|
7329 | yylineno: this.yylineno,
|
7330 | yylloc: {
|
7331 | first_line: this.yylloc.first_line,
|
7332 | last_line: this.last_line,
|
7333 | first_column: this.yylloc.first_column,
|
7334 | last_column: this.yylloc.last_column
|
7335 | },
|
7336 | yytext: this.yytext,
|
7337 | match: this.match,
|
7338 | matches: this.matches,
|
7339 | matched: this.matched,
|
7340 | yyleng: this.yyleng,
|
7341 | offset: this.offset,
|
7342 | _more: this._more,
|
7343 | _input: this._input,
|
7344 | yy: this.yy,
|
7345 | conditionStack: this.conditionStack.slice(0),
|
7346 | done: this.done
|
7347 | };
|
7348 | if (this.options.ranges) {
|
7349 | backup.yylloc.range = this.yylloc.range.slice(0);
|
7350 | }
|
7351 | }
|
7352 |
|
7353 | lines = match[0].match(/(?:\r\n?|\n).*/g);
|
7354 | if (lines) {
|
7355 | this.yylineno += lines.length;
|
7356 | }
|
7357 | this.yylloc = {
|
7358 | first_line: this.yylloc.last_line,
|
7359 | last_line: this.yylineno + 1,
|
7360 | first_column: this.yylloc.last_column,
|
7361 | last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
|
7362 | };
|
7363 | this.yytext += match[0];
|
7364 | this.match += match[0];
|
7365 | this.matches = match;
|
7366 | this.yyleng = this.yytext.length;
|
7367 | if (this.options.ranges) {
|
7368 | this.yylloc.range = [this.offset, this.offset += this.yyleng];
|
7369 | }
|
7370 | this._more = false;
|
7371 | this._backtrack = false;
|
7372 | this._input = this._input.slice(match[0].length);
|
7373 | this.matched += match[0];
|
7374 | token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
|
7375 | if (this.done && this._input) {
|
7376 | this.done = false;
|
7377 | }
|
7378 | if (token) {
|
7379 | return token;
|
7380 | } else if (this._backtrack) {
|
7381 |
|
7382 | for (var k in backup) {
|
7383 | this[k] = backup[k];
|
7384 | }
|
7385 | return false;
|
7386 | }
|
7387 | return false;
|
7388 | },
|
7389 |
|
7390 |
|
7391 | next: function next() {
|
7392 | if (this.done) {
|
7393 | return this.EOF;
|
7394 | }
|
7395 | if (!this._input) {
|
7396 | this.done = true;
|
7397 | }
|
7398 |
|
7399 | var token, match, tempMatch, index;
|
7400 | if (!this._more) {
|
7401 | this.yytext = '';
|
7402 | this.match = '';
|
7403 | }
|
7404 | var rules = this._currentRules();
|
7405 | for (var i = 0; i < rules.length; i++) {
|
7406 | tempMatch = this._input.match(this.rules[rules[i]]);
|
7407 | if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
|
7408 | match = tempMatch;
|
7409 | index = i;
|
7410 | if (this.options.backtrack_lexer) {
|
7411 | token = this.test_match(tempMatch, rules[i]);
|
7412 | if (token !== false) {
|
7413 | return token;
|
7414 | } else if (this._backtrack) {
|
7415 | match = false;
|
7416 | continue;
|
7417 | } else {
|
7418 |
|
7419 | return false;
|
7420 | }
|
7421 | } else if (!this.options.flex) {
|
7422 | break;
|
7423 | }
|
7424 | }
|
7425 | }
|
7426 | if (match) {
|
7427 | token = this.test_match(match, rules[index]);
|
7428 | if (token !== false) {
|
7429 | return token;
|
7430 | }
|
7431 |
|
7432 | return false;
|
7433 | }
|
7434 | if (this._input === "") {
|
7435 | return this.EOF;
|
7436 | } else {
|
7437 | return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
|
7438 | text: "",
|
7439 | token: null,
|
7440 | line: this.yylineno
|
7441 | });
|
7442 | }
|
7443 | },
|
7444 |
|
7445 |
|
7446 | lex: function lex() {
|
7447 | var r = this.next();
|
7448 | if (r) {
|
7449 | return r;
|
7450 | } else {
|
7451 | return this.lex();
|
7452 | }
|
7453 | },
|
7454 |
|
7455 |
|
7456 | begin: function begin(condition) {
|
7457 | this.conditionStack.push(condition);
|
7458 | },
|
7459 |
|
7460 |
|
7461 | popState: function popState() {
|
7462 | var n = this.conditionStack.length - 1;
|
7463 | if (n > 0) {
|
7464 | return this.conditionStack.pop();
|
7465 | } else {
|
7466 | return this.conditionStack[0];
|
7467 | }
|
7468 | },
|
7469 |
|
7470 |
|
7471 | _currentRules: function _currentRules() {
|
7472 | if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
|
7473 | return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
|
7474 | } else {
|
7475 | return this.conditions["INITIAL"].rules;
|
7476 | }
|
7477 | },
|
7478 |
|
7479 |
|
7480 | topState: function topState(n) {
|
7481 | n = this.conditionStack.length - 1 - Math.abs(n || 0);
|
7482 | if (n >= 0) {
|
7483 | return this.conditionStack[n];
|
7484 | } else {
|
7485 | return "INITIAL";
|
7486 | }
|
7487 | },
|
7488 |
|
7489 |
|
7490 | pushState: function pushState(condition) {
|
7491 | this.begin(condition);
|
7492 | },
|
7493 |
|
7494 |
|
7495 | stateStackSize: function stateStackSize() {
|
7496 | return this.conditionStack.length;
|
7497 | },
|
7498 | options: { "case-insensitive": true },
|
7499 | performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
|
7500 | var YYSTATE = YY_START;
|
7501 | switch ($avoiding_name_collisions) {
|
7502 | case 0:
|
7503 | return 12;
|
7504 | break;
|
7505 | case 1:
|
7506 |
|
7507 | break;
|
7508 | case 2:
|
7509 |
|
7510 | break;
|
7511 | case 3:
|
7512 |
|
7513 | break;
|
7514 | case 4:
|
7515 | return 4;
|
7516 | break;
|
7517 | case 5:
|
7518 | return 15;
|
7519 | break;
|
7520 | case 6:
|
7521 | return 17;
|
7522 | break;
|
7523 | case 7:
|
7524 | return 20;
|
7525 | break;
|
7526 | case 8:
|
7527 | return 21;
|
7528 | break;
|
7529 | case 9:
|
7530 | return 19;
|
7531 | break;
|
7532 | case 10:
|
7533 | return 8;
|
7534 | break;
|
7535 | case 11:
|
7536 | return 8;
|
7537 | break;
|
7538 | case 12:
|
7539 | return 5;
|
7540 | break;
|
7541 | case 13:
|
7542 | return 26;
|
7543 | break;
|
7544 | case 14:
|
7545 | this.begin("options");
|
7546 | break;
|
7547 | case 15:
|
7548 | this.popState();
|
7549 | break;
|
7550 | case 16:
|
7551 | return 11;
|
7552 | break;
|
7553 | case 17:
|
7554 | this.begin("string");
|
7555 | break;
|
7556 | case 18:
|
7557 | this.popState();
|
7558 | break;
|
7559 | case 19:
|
7560 | return 23;
|
7561 | break;
|
7562 | case 20:
|
7563 | return 18;
|
7564 | break;
|
7565 | case 21:
|
7566 | return 7;
|
7567 | break;
|
7568 | }
|
7569 | },
|
7570 | rules: [/^(?:(\r?\n)+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:gitGraph\b)/i, /^(?:commit\b)/i, /^(?:branch\b)/i, /^(?:merge\b)/i, /^(?:reset\b)/i, /^(?:checkout\b)/i, /^(?:LR\b)/i, /^(?:BT\b)/i, /^(?::)/i, /^(?:\^)/i, /^(?:options\r?\n)/i, /^(?:end\r?\n)/i, /^(?:[^\n]+\r?\n)/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[a-zA-Z][a-zA-Z0-9_]+)/i, /^(?:$)/i],
|
7571 | conditions: { "options": { "rules": [15, 16], "inclusive": false }, "string": { "rules": [18, 19], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, 20, 21], "inclusive": true } }
|
7572 | };
|
7573 | return lexer;
|
7574 | }();
|
7575 | parser.lexer = lexer;
|
7576 | function Parser() {
|
7577 | this.yy = {};
|
7578 | }
|
7579 | Parser.prototype = parser;parser.Parser = Parser;
|
7580 | return new Parser();
|
7581 | }();
|
7582 |
|
7583 | if (true) {
|
7584 | exports.parser = parser;
|
7585 | exports.Parser = parser.Parser;
|
7586 | exports.parse = function () {
|
7587 | return parser.parse.apply(parser, arguments);
|
7588 | };
|
7589 | exports.main = function commonjsMain(args) {
|
7590 | if (!args[1]) {
|
7591 | console.log('Usage: ' + args[0] + ' FILE');
|
7592 | process.exit(1);
|
7593 | }
|
7594 | var source = __webpack_require__(3).readFileSync(__webpack_require__(4).normalize(args[1]), "utf8");
|
7595 | return exports.parser.parse(source);
|
7596 | };
|
7597 | if (typeof module !== 'undefined' && __webpack_require__.c[__webpack_require__.s] === module) {
|
7598 | exports.main(process.argv.slice(1));
|
7599 | }
|
7600 | }
|
7601 | }.call(exports, __webpack_require__(2)(module)))
|
7602 |
|
7603 | }),
|
7604 |
|
7605 | (function(module, exports) {
|
7606 |
|
7607 | module.exports = require("lodash");
|
7608 |
|
7609 | }),
|
7610 |
|
7611 | (function(module, exports, __webpack_require__) {
|
7612 |
|
7613 | "use strict";
|
7614 |
|
7615 |
|
7616 | var _lodash = __webpack_require__(19);
|
7617 |
|
7618 | var _lodash2 = _interopRequireDefault(_lodash);
|
7619 |
|
7620 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
7621 |
|
7622 | var Logger = __webpack_require__(0);
|
7623 | var log = Logger.Log;
|
7624 |
|
7625 | var commits = {};
|
7626 | var head = null;
|
7627 | var branches = { 'master': head };
|
7628 | var curBranch = 'master';
|
7629 | var direction = 'LR';
|
7630 | var seq = 0;
|
7631 |
|
7632 | function getRandomInt(min, max) {
|
7633 | return Math.floor(Math.random() * (max - min)) + min;
|
7634 | }
|
7635 |
|
7636 | function getId() {
|
7637 | var pool = '0123456789abcdef';
|
7638 | var id = '';
|
7639 | for (var i = 0; i < 7; i++) {
|
7640 | id += pool[getRandomInt(0, 16)];
|
7641 | }
|
7642 | return id;
|
7643 | }
|
7644 |
|
7645 | function isfastforwardable(currentCommit, otherCommit) {
|
7646 | log.debug('Entering isfastforwardable:', currentCommit.id, otherCommit.id);
|
7647 | while (currentCommit.seq <= otherCommit.seq && currentCommit !== otherCommit) {
|
7648 |
|
7649 | if (otherCommit.parent == null) break;
|
7650 | if (Array.isArray(otherCommit.parent)) {
|
7651 | log.debug('In merge commit:', otherCommit.parent);
|
7652 | return isfastforwardable(currentCommit, commits[otherCommit.parent[0]]) || isfastforwardable(currentCommit, commits[otherCommit.parent[1]]);
|
7653 | } else {
|
7654 | otherCommit = commits[otherCommit.parent];
|
7655 | }
|
7656 | }
|
7657 | log.debug(currentCommit.id, otherCommit.id);
|
7658 | return currentCommit.id === otherCommit.id;
|
7659 | }
|
7660 |
|
7661 | function isReachableFrom(currentCommit, otherCommit) {
|
7662 | var currentSeq = currentCommit.seq;
|
7663 | var otherSeq = otherCommit.seq;
|
7664 | if (currentSeq > otherSeq) return isfastforwardable(otherCommit, currentCommit);
|
7665 | return false;
|
7666 | }
|
7667 |
|
7668 | exports.setDirection = function (dir) {
|
7669 | direction = dir;
|
7670 | };
|
7671 | var options = {};
|
7672 | exports.setOptions = function (rawOptString) {
|
7673 | log.debug('options str', rawOptString);
|
7674 | rawOptString = rawOptString && rawOptString.trim();
|
7675 | rawOptString = rawOptString || '{}';
|
7676 | try {
|
7677 | options = JSON.parse(rawOptString);
|
7678 | } catch (e) {
|
7679 | log.error('error while parsing gitGraph options', e.message);
|
7680 | }
|
7681 | };
|
7682 |
|
7683 | exports.getOptions = function () {
|
7684 | return options;
|
7685 | };
|
7686 |
|
7687 | exports.commit = function (msg) {
|
7688 | var commit = {
|
7689 | id: getId(),
|
7690 | message: msg,
|
7691 | seq: seq++,
|
7692 | parent: head == null ? null : head.id
|
7693 | };
|
7694 | head = commit;
|
7695 | commits[commit.id] = commit;
|
7696 | branches[curBranch] = commit.id;
|
7697 | log.debug('in pushCommit ' + commit.id);
|
7698 | };
|
7699 |
|
7700 | exports.branch = function (name) {
|
7701 | branches[name] = head != null ? head.id : null;
|
7702 | log.debug('in createBranch');
|
7703 | };
|
7704 |
|
7705 | exports.merge = function (otherBranch) {
|
7706 | var currentCommit = commits[branches[curBranch]];
|
7707 | var otherCommit = commits[branches[otherBranch]];
|
7708 | if (isReachableFrom(currentCommit, otherCommit)) {
|
7709 | log.debug('Already merged');
|
7710 | return;
|
7711 | }
|
7712 | if (isfastforwardable(currentCommit, otherCommit)) {
|
7713 | branches[curBranch] = branches[otherBranch];
|
7714 | head = commits[branches[curBranch]];
|
7715 | } else {
|
7716 |
|
7717 | var commit = {
|
7718 | id: getId(),
|
7719 | message: 'merged branch ' + otherBranch + ' into ' + curBranch,
|
7720 | seq: seq++,
|
7721 | parent: [head == null ? null : head.id, branches[otherBranch]]
|
7722 | };
|
7723 | head = commit;
|
7724 | commits[commit.id] = commit;
|
7725 | branches[curBranch] = commit.id;
|
7726 | }
|
7727 | log.debug(branches);
|
7728 | log.debug('in mergeBranch');
|
7729 | };
|
7730 |
|
7731 | exports.checkout = function (branch) {
|
7732 | log.debug('in checkout');
|
7733 | curBranch = branch;
|
7734 | var id = branches[curBranch];
|
7735 | head = commits[id];
|
7736 | };
|
7737 |
|
7738 | exports.reset = function (commitRef) {
|
7739 | log.debug('in reset', commitRef);
|
7740 | var ref = commitRef.split(':')[0];
|
7741 | var parentCount = parseInt(commitRef.split(':')[1]);
|
7742 | var commit = ref === 'HEAD' ? head : commits[branches[ref]];
|
7743 | log.debug(commit, parentCount);
|
7744 | while (parentCount > 0) {
|
7745 | commit = commits[commit.parent];
|
7746 | parentCount--;
|
7747 | if (!commit) {
|
7748 | var err = 'Critical error - unique parent commit not found during reset';
|
7749 | log.error(err);
|
7750 | throw err;
|
7751 | }
|
7752 | }
|
7753 | head = commit;
|
7754 | branches[curBranch] = commit.id;
|
7755 | };
|
7756 |
|
7757 | function upsert(arr, key, newval) {
|
7758 | var index = arr.indexOf(key);
|
7759 | if (index === -1) {
|
7760 | arr.push(newval);
|
7761 | } else {
|
7762 | arr.splice(index, 1, newval);
|
7763 | }
|
7764 | }
|
7765 |
|
7766 | function prettyPrintCommitHistory(commitArr) {
|
7767 | var commit = _lodash2.default.maxBy(commitArr, 'seq');
|
7768 | var line = '';
|
7769 | commitArr.forEach(function (c) {
|
7770 | if (c === commit) {
|
7771 | line += '\t*';
|
7772 | } else {
|
7773 | line += '\t|';
|
7774 | }
|
7775 | });
|
7776 | var label = [line, commit.id, commit.seq];
|
7777 | _lodash2.default.each(branches, function (value, key) {
|
7778 | if (value === commit.id) label.push(key);
|
7779 | });
|
7780 | log.debug(label.join(' '));
|
7781 | if (Array.isArray(commit.parent)) {
|
7782 | var newCommit = commits[commit.parent[0]];
|
7783 | upsert(commitArr, commit, newCommit);
|
7784 | commitArr.push(commits[commit.parent[1]]);
|
7785 | } else if (commit.parent == null) {
|
7786 | return;
|
7787 | } else {
|
7788 | var nextCommit = commits[commit.parent];
|
7789 | upsert(commitArr, commit, nextCommit);
|
7790 | }
|
7791 | commitArr = _lodash2.default.uniqBy(commitArr, 'id');
|
7792 | prettyPrintCommitHistory(commitArr);
|
7793 | }
|
7794 |
|
7795 | exports.prettyPrint = function () {
|
7796 | log.debug(commits);
|
7797 | var node = exports.getCommitsArray()[0];
|
7798 | prettyPrintCommitHistory([node]);
|
7799 | };
|
7800 |
|
7801 | exports.clear = function () {
|
7802 | commits = {};
|
7803 | head = null;
|
7804 | branches = { 'master': head };
|
7805 | curBranch = 'master';
|
7806 | seq = 0;
|
7807 | };
|
7808 |
|
7809 | exports.getBranchesAsObjArray = function () {
|
7810 | var branchArr = _lodash2.default.map(branches, function (value, key) {
|
7811 | return { 'name': key, 'commit': commits[value] };
|
7812 | });
|
7813 | return branchArr;
|
7814 | };
|
7815 |
|
7816 | exports.getBranches = function () {
|
7817 | return branches;
|
7818 | };
|
7819 | exports.getCommits = function () {
|
7820 | return commits;
|
7821 | };
|
7822 | exports.getCommitsArray = function () {
|
7823 | var commitArr = Object.keys(commits).map(function (key) {
|
7824 | return commits[key];
|
7825 | });
|
7826 | commitArr.forEach(function (o) {
|
7827 | log.debug(o.id);
|
7828 | });
|
7829 | return _lodash2.default.orderBy(commitArr, ['seq'], ['desc']);
|
7830 | };
|
7831 | exports.getCurrentBranch = function () {
|
7832 | return curBranch;
|
7833 | };
|
7834 | exports.getDirection = function () {
|
7835 | return direction;
|
7836 | };
|
7837 | exports.getHead = function () {
|
7838 | return head;
|
7839 | };
|
7840 |
|
7841 | }),
|
7842 |
|
7843 | (function(module, exports, __webpack_require__) {
|
7844 |
|
7845 | "use strict";
|
7846 |
|
7847 |
|
7848 | var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
7849 |
|
7850 |
|
7851 |
|
7852 |
|
7853 |
|
7854 |
|
7855 |
|
7856 |
|
7857 |
|
7858 |
|
7859 |
|
7860 |
|
7861 |
|
7862 |
|
7863 | var Logger = __webpack_require__(0);
|
7864 | var log = Logger.Log;
|
7865 |
|
7866 | var graph = __webpack_require__(5);
|
7867 | var utils = __webpack_require__(6);
|
7868 | var flowRenderer = __webpack_require__(23);
|
7869 | var seq = __webpack_require__(25);
|
7870 | var info = __webpack_require__(27);
|
7871 | var infoParser = __webpack_require__(12);
|
7872 | var flowParser = __webpack_require__(7);
|
7873 | var dotParser = __webpack_require__(8);
|
7874 | var sequenceParser = __webpack_require__(9);
|
7875 | var sequenceDb = __webpack_require__(10);
|
7876 | var infoDb = __webpack_require__(11);
|
7877 | var gantt = __webpack_require__(28);
|
7878 | var ganttParser = __webpack_require__(13);
|
7879 | var ganttDb = __webpack_require__(14);
|
7880 | var classParser = __webpack_require__(16);
|
7881 | var classRenderer = __webpack_require__(29);
|
7882 | var classDb = __webpack_require__(17);
|
7883 | var gitGraphParser = __webpack_require__(18);
|
7884 | var gitGraphRenderer = __webpack_require__(31);
|
7885 | var gitGraphAst = __webpack_require__(20);
|
7886 | var d3 = __webpack_require__(1);
|
7887 |
|
7888 |
|
7889 |
|
7890 |
|
7891 |
|
7892 |
|
7893 |
|
7894 |
|
7895 |
|
7896 |
|
7897 |
|
7898 |
|
7899 | var config = {
|
7900 | |
7901 |
|
7902 |
|
7903 |
|
7904 |
|
7905 |
|
7906 |
|
7907 |
|
7908 | logLevel: 5,
|
7909 | |
7910 |
|
7911 |
|
7912 | cloneCssStyles: true,
|
7913 |
|
7914 | |
7915 |
|
7916 |
|
7917 | startOnLoad: true,
|
7918 |
|
7919 | |
7920 |
|
7921 |
|
7922 |
|
7923 | arrowMarkerAbsolute: false,
|
7924 |
|
7925 | |
7926 |
|
7927 |
|
7928 |
|
7929 | flowchart: {
|
7930 | |
7931 |
|
7932 |
|
7933 |
|
7934 | htmlLabels: true,
|
7935 | |
7936 |
|
7937 |
|
7938 |
|
7939 | useMaxWidth: true
|
7940 | },
|
7941 |
|
7942 | |
7943 |
|
7944 |
|
7945 |
|
7946 | sequenceDiagram: {
|
7947 |
|
7948 | |
7949 |
|
7950 |
|
7951 | diagramMarginX: 50,
|
7952 |
|
7953 | |
7954 |
|
7955 |
|
7956 | diagramMarginY: 10,
|
7957 |
|
7958 | |
7959 |
|
7960 |
|
7961 | actorMargin: 50,
|
7962 |
|
7963 | |
7964 |
|
7965 |
|
7966 | width: 150,
|
7967 |
|
7968 | |
7969 |
|
7970 |
|
7971 | height: 65,
|
7972 |
|
7973 | |
7974 |
|
7975 |
|
7976 | boxMargin: 10,
|
7977 |
|
7978 | |
7979 |
|
7980 |
|
7981 | boxTextMargin: 5,
|
7982 |
|
7983 | |
7984 |
|
7985 |
|
7986 | noteMargin: 10,
|
7987 |
|
7988 | |
7989 |
|
7990 |
|
7991 | messageMargin: 35,
|
7992 |
|
7993 | |
7994 |
|
7995 |
|
7996 | mirrorActors: true,
|
7997 |
|
7998 | |
7999 |
|
8000 |
|
8001 |
|
8002 | bottomMarginAdj: 1,
|
8003 |
|
8004 | |
8005 |
|
8006 |
|
8007 |
|
8008 | useMaxWidth: true
|
8009 | },
|
8010 |
|
8011 | |
8012 |
|
8013 |
|
8014 | gantt: {
|
8015 | |
8016 |
|
8017 |
|
8018 | titleTopMargin: 25,
|
8019 |
|
8020 | |
8021 |
|
8022 |
|
8023 | barHeight: 20,
|
8024 |
|
8025 | |
8026 |
|
8027 |
|
8028 | barGap: 4,
|
8029 |
|
8030 | |
8031 |
|
8032 |
|
8033 | topPadding: 50,
|
8034 |
|
8035 | |
8036 |
|
8037 |
|
8038 | leftPadding: 75,
|
8039 |
|
8040 | |
8041 |
|
8042 |
|
8043 | gridLineStartPadding: 35,
|
8044 |
|
8045 | |
8046 |
|
8047 |
|
8048 | fontSize: 11,
|
8049 |
|
8050 | |
8051 |
|
8052 |
|
8053 | fontFamily: '"Open-Sans", "sans-serif"',
|
8054 |
|
8055 | |
8056 |
|
8057 |
|
8058 | numberSectionStyles: 3,
|
8059 |
|
8060 | |
8061 |
|
8062 |
|
8063 | axisFormatter: [
|
8064 |
|
8065 |
|
8066 | ['%I:%M', function (d) {
|
8067 | return d.getHours();
|
8068 | }],
|
8069 |
|
8070 | ['w. %U', function (d) {
|
8071 | return d.getDay() === 1;
|
8072 | }],
|
8073 |
|
8074 | ['%a %d', function (d) {
|
8075 | return d.getDay() && d.getDate() !== 1;
|
8076 | }],
|
8077 |
|
8078 | ['%b %d', function (d) {
|
8079 | return d.getDate() !== 1;
|
8080 | }],
|
8081 |
|
8082 | ['%m-%y', function (d) {
|
8083 | return d.getMonth();
|
8084 | }]]
|
8085 | },
|
8086 | classDiagram: {},
|
8087 | gitGraph: {},
|
8088 | info: {}
|
8089 | };
|
8090 |
|
8091 | Logger.setLogLevel(config.logLevel);
|
8092 |
|
8093 |
|
8094 |
|
8095 |
|
8096 |
|
8097 |
|
8098 |
|
8099 | var parse = function parse(text) {
|
8100 | var graphType = utils.detectType(text);
|
8101 | var parser;
|
8102 |
|
8103 | switch (graphType) {
|
8104 | case 'gitGraph':
|
8105 | parser = gitGraphParser;
|
8106 | parser.parser.yy = gitGraphAst;
|
8107 | break;
|
8108 | case 'graph':
|
8109 | parser = flowParser;
|
8110 | parser.parser.yy = graph;
|
8111 | break;
|
8112 | case 'dotGraph':
|
8113 | parser = dotParser;
|
8114 | parser.parser.yy = graph;
|
8115 | break;
|
8116 | case 'sequenceDiagram':
|
8117 | parser = sequenceParser;
|
8118 | parser.parser.yy = sequenceDb;
|
8119 | break;
|
8120 | case 'info':
|
8121 | parser = infoParser;
|
8122 | parser.parser.yy = infoDb;
|
8123 | break;
|
8124 | case 'gantt':
|
8125 | parser = ganttParser;
|
8126 | parser.parser.yy = ganttDb;
|
8127 | break;
|
8128 | case 'classDiagram':
|
8129 | parser = classParser;
|
8130 | parser.parser.yy = classDb;
|
8131 | break;
|
8132 | }
|
8133 |
|
8134 | try {
|
8135 | parser.parse(text);
|
8136 | return true;
|
8137 | } catch (err) {
|
8138 | return false;
|
8139 | }
|
8140 | };
|
8141 | exports.parse = parse;
|
8142 |
|
8143 |
|
8144 |
|
8145 |
|
8146 |
|
8147 |
|
8148 | exports.version = function () {
|
8149 | return __webpack_require__(32).version;
|
8150 | };
|
8151 |
|
8152 | exports.encodeEntities = function (text) {
|
8153 | var txt = text;
|
8154 |
|
8155 | txt = txt.replace(/style.*:\S*#.*;/g, function (s) {
|
8156 | var innerTxt = s.substring(0, s.length - 1);
|
8157 | return innerTxt;
|
8158 | });
|
8159 | txt = txt.replace(/classDef.*:\S*#.*;/g, function (s) {
|
8160 | var innerTxt = s.substring(0, s.length - 1);
|
8161 | return innerTxt;
|
8162 | });
|
8163 |
|
8164 | txt = txt.replace(/#\w+;/g, function (s) {
|
8165 | var innerTxt = s.substring(1, s.length - 1);
|
8166 |
|
8167 | var isInt = /^\+?\d+$/.test(innerTxt);
|
8168 | if (isInt) {
|
8169 | return 'fl°°' + innerTxt + '¶ß';
|
8170 | } else {
|
8171 | return 'fl°' + innerTxt + '¶ß';
|
8172 | }
|
8173 | });
|
8174 |
|
8175 | return txt;
|
8176 | };
|
8177 |
|
8178 | exports.decodeEntities = function (text) {
|
8179 | var txt = text;
|
8180 |
|
8181 | txt = txt.replace(/fl°°/g, function () {
|
8182 | return '&#';
|
8183 | });
|
8184 | txt = txt.replace(/fl°/g, function () {
|
8185 | return '&';
|
8186 | });
|
8187 | txt = txt.replace(/¶ß/g, function () {
|
8188 | return ';';
|
8189 | });
|
8190 |
|
8191 | return txt;
|
8192 | };
|
8193 |
|
8194 |
|
8195 |
|
8196 |
|
8197 |
|
8198 |
|
8199 |
|
8200 |
|
8201 |
|
8202 |
|
8203 |
|
8204 |
|
8205 |
|
8206 |
|
8207 |
|
8208 |
|
8209 |
|
8210 |
|
8211 |
|
8212 |
|
8213 |
|
8214 |
|
8215 |
|
8216 | var render = function render(id, txt, cb, container) {
|
8217 | if (typeof container !== 'undefined') {
|
8218 | container.innerHTML = '';
|
8219 |
|
8220 | d3.select(container).append('div').attr('id', 'd' + id).append('svg').attr('id', id).attr('width', '100%').attr('xmlns', 'http://www.w3.org/2000/svg').append('g');
|
8221 | } else {
|
8222 | var _element = document.querySelector('#' + 'd' + id);
|
8223 | if (_element) {
|
8224 | _element.innerHTML = '';
|
8225 | }
|
8226 |
|
8227 | d3.select('body').append('div').attr('id', 'd' + id).append('svg').attr('id', id).attr('width', '100%').attr('xmlns', 'http://www.w3.org/2000/svg').append('g');
|
8228 | }
|
8229 |
|
8230 | window.txt = txt;
|
8231 | txt = exports.encodeEntities(txt);
|
8232 |
|
8233 | var element = d3.select('#d' + id).node();
|
8234 | var graphType = utils.detectType(txt);
|
8235 | var classes = {};
|
8236 | switch (graphType) {
|
8237 | case 'gitGraph':
|
8238 | config.flowchart.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
8239 | gitGraphRenderer.setConf(config.gitGraph);
|
8240 | gitGraphRenderer.draw(txt, id, false);
|
8241 | break;
|
8242 | case 'graph':
|
8243 | config.flowchart.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
8244 | flowRenderer.setConf(config.flowchart);
|
8245 | flowRenderer.draw(txt, id, false);
|
8246 | if (config.cloneCssStyles) {
|
8247 | classes = flowRenderer.getClasses(txt, false);
|
8248 | utils.cloneCssStyles(element.firstChild, classes);
|
8249 | }
|
8250 | break;
|
8251 | case 'dotGraph':
|
8252 | config.flowchart.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
8253 | flowRenderer.setConf(config.flowchart);
|
8254 | flowRenderer.draw(txt, id, true);
|
8255 | if (config.cloneCssStyles) {
|
8256 | classes = flowRenderer.getClasses(txt, true);
|
8257 | utils.cloneCssStyles(element.firstChild, classes);
|
8258 | }
|
8259 | break;
|
8260 | case 'sequenceDiagram':
|
8261 | config.sequenceDiagram.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
8262 | seq.setConf(config.sequenceDiagram);
|
8263 | seq.draw(txt, id);
|
8264 | if (config.cloneCssStyles) {
|
8265 | utils.cloneCssStyles(element.firstChild, []);
|
8266 | }
|
8267 | break;
|
8268 | case 'gantt':
|
8269 | config.gantt.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
8270 | gantt.setConf(config.gantt);
|
8271 | gantt.draw(txt, id);
|
8272 | if (config.cloneCssStyles) {
|
8273 | utils.cloneCssStyles(element.firstChild, []);
|
8274 | }
|
8275 | break;
|
8276 | case 'classDiagram':
|
8277 | config.classDiagram.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
8278 | classRenderer.setConf(config.classDiagram);
|
8279 | classRenderer.draw(txt, id);
|
8280 | if (config.cloneCssStyles) {
|
8281 | utils.cloneCssStyles(element.firstChild, []);
|
8282 | }
|
8283 | break;
|
8284 | case 'info':
|
8285 | config.info.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
8286 | info.draw(txt, id, exports.version());
|
8287 | if (config.cloneCssStyles) {
|
8288 | utils.cloneCssStyles(element.firstChild, []);
|
8289 | }
|
8290 | break;
|
8291 | }
|
8292 |
|
8293 | d3.select('#d' + id).selectAll('foreignobject div').attr('xmlns', 'http://www.w3.org/1999/xhtml');
|
8294 |
|
8295 | var url = '';
|
8296 | if (config.arrowMarkerAbsolute) {
|
8297 | url = window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search;
|
8298 | url = url.replace(/\(/g, '\\(');
|
8299 | url = url.replace(/\)/g, '\\)');
|
8300 | }
|
8301 |
|
8302 |
|
8303 | var svgCode = d3.select('#d' + id).node().innerHTML.replace(/url\(#arrowhead/g, 'url(' + url + '#arrowhead', 'g');
|
8304 |
|
8305 | svgCode = exports.decodeEntities(svgCode);
|
8306 |
|
8307 | if (typeof cb !== 'undefined') {
|
8308 | cb(svgCode, graph.bindFunctions);
|
8309 | } else {
|
8310 | log.warn('CB = undefined!');
|
8311 | }
|
8312 |
|
8313 | var node = d3.select('#d' + id).node();
|
8314 | if (node !== null && typeof node.remove === 'function') {
|
8315 | d3.select('#d' + id).node().remove();
|
8316 | }
|
8317 |
|
8318 | return svgCode;
|
8319 | };
|
8320 |
|
8321 | exports.render = function (id, text, cb, containerElement) {
|
8322 | try {
|
8323 | if (arguments.length === 1) {
|
8324 | text = id;
|
8325 | id = 'mermaidId0';
|
8326 | }
|
8327 |
|
8328 | if (typeof document === 'undefined') {
|
8329 |
|
8330 | } else {
|
8331 |
|
8332 | return render(id, text, cb, containerElement);
|
8333 | }
|
8334 | } catch (e) {
|
8335 | log.warn(e);
|
8336 | }
|
8337 | };
|
8338 |
|
8339 | var setConf = function setConf(cnf) {
|
8340 |
|
8341 | var lvl1Keys = Object.keys(cnf);
|
8342 | var i;
|
8343 | for (i = 0; i < lvl1Keys.length; i++) {
|
8344 | if (_typeof(cnf[lvl1Keys[i]]) === 'object') {
|
8345 | var lvl2Keys = Object.keys(cnf[lvl1Keys[i]]);
|
8346 |
|
8347 | var j;
|
8348 | for (j = 0; j < lvl2Keys.length; j++) {
|
8349 | log.debug('Setting conf ', lvl1Keys[i], '-', lvl2Keys[j]);
|
8350 | if (typeof config[lvl1Keys[i]] === 'undefined') {
|
8351 | config[lvl1Keys[i]] = {};
|
8352 | }
|
8353 | log.debug('Setting config: ' + lvl1Keys[i] + ' ' + lvl2Keys[j] + ' to ' + cnf[lvl1Keys[i]][lvl2Keys[j]]);
|
8354 | config[lvl1Keys[i]][lvl2Keys[j]] = cnf[lvl1Keys[i]][lvl2Keys[j]];
|
8355 | }
|
8356 | } else {
|
8357 | config[lvl1Keys[i]] = cnf[lvl1Keys[i]];
|
8358 | }
|
8359 | }
|
8360 | };
|
8361 |
|
8362 | exports.initialize = function (options) {
|
8363 | log.debug('Initializing mermaidAPI');
|
8364 |
|
8365 | if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) === 'object') {
|
8366 | setConf(options);
|
8367 | }
|
8368 | Logger.setLogLevel(config.logLevel);
|
8369 | };
|
8370 | exports.getConfig = function () {
|
8371 | return config;
|
8372 | };
|
8373 |
|
8374 | exports.parseError = function (err, hash) {
|
8375 | if (typeof mermaid !== 'undefined') {
|
8376 | global.mermaid.parseError(err, hash);
|
8377 | } else {
|
8378 | log.debug('Mermaid Syntax error:');
|
8379 | log.debug(err);
|
8380 | }
|
8381 | };
|
8382 | global.mermaidAPI = {
|
8383 | render: exports.render,
|
8384 | parse: exports.parse,
|
8385 | initialize: exports.initialize,
|
8386 | detectType: utils.detectType,
|
8387 | parseError: exports.parseError,
|
8388 | getConfig: exports.getConfig
|
8389 | };
|
8390 |
|
8391 | }),
|
8392 |
|
8393 | (function(module, exports) {
|
8394 |
|
8395 | module.exports = require("d3");
|
8396 |
|
8397 | }),
|
8398 |
|
8399 | (function(module, exports, __webpack_require__) {
|
8400 |
|
8401 | "use strict";
|
8402 |
|
8403 |
|
8404 |
|
8405 |
|
8406 |
|
8407 | var graph = __webpack_require__(5);
|
8408 | var flow = __webpack_require__(7);
|
8409 | var dot = __webpack_require__(8);
|
8410 | var d3 = __webpack_require__(1);
|
8411 | var dagreD3 = __webpack_require__(24);
|
8412 | var Logger = __webpack_require__(0);
|
8413 | var log = Logger.Log;
|
8414 |
|
8415 | var conf = {};
|
8416 | module.exports.setConf = function (cnf) {
|
8417 | var keys = Object.keys(cnf);
|
8418 | var i;
|
8419 | for (i = 0; i < keys.length; i++) {
|
8420 | conf[keys[i]] = cnf[keys[i]];
|
8421 | }
|
8422 | };
|
8423 |
|
8424 |
|
8425 |
|
8426 |
|
8427 |
|
8428 |
|
8429 | exports.addVertices = function (vert, g) {
|
8430 | var keys = Object.keys(vert);
|
8431 |
|
8432 | var styleFromStyleArr = function styleFromStyleArr(styleStr, arr) {
|
8433 | var i;
|
8434 |
|
8435 | for (i = 0; i < arr.length; i++) {
|
8436 | if (typeof arr[i] !== 'undefined') {
|
8437 | styleStr = styleStr + arr[i] + ';';
|
8438 | }
|
8439 | }
|
8440 |
|
8441 | return styleStr;
|
8442 | };
|
8443 |
|
8444 |
|
8445 | keys.forEach(function (id) {
|
8446 | var vertice = vert[id];
|
8447 | var verticeText;
|
8448 |
|
8449 | |
8450 |
|
8451 |
|
8452 |
|
8453 | var classStr = '';
|
8454 |
|
8455 | if (vertice.classes.length > 0) {
|
8456 | classStr = vertice.classes.join(' ');
|
8457 | }
|
8458 |
|
8459 | |
8460 |
|
8461 |
|
8462 |
|
8463 | var style = '';
|
8464 |
|
8465 | style = styleFromStyleArr(style, vertice.styles);
|
8466 |
|
8467 |
|
8468 | if (typeof vertice.text === 'undefined') {
|
8469 | verticeText = vertice.id;
|
8470 | } else {
|
8471 | verticeText = vertice.text;
|
8472 | }
|
8473 |
|
8474 | var labelTypeStr = '';
|
8475 | if (conf.htmlLabels) {
|
8476 | labelTypeStr = 'html';
|
8477 | verticeText = verticeText.replace(/fa:fa[\w-]+/g, function (s) {
|
8478 | return '<i class="fa ' + s.substring(3) + '"></i>';
|
8479 | });
|
8480 | } else {
|
8481 | var svgLabel = document.createElementNS('http://www.w3.org/2000/svg', 'text');
|
8482 |
|
8483 | var rows = verticeText.split(/<br>/);
|
8484 |
|
8485 | var j = 0;
|
8486 | for (j = 0; j < rows.length; j++) {
|
8487 | var tspan = document.createElementNS('http://www.w3.org/2000/svg', 'tspan');
|
8488 | tspan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve');
|
8489 | tspan.setAttribute('dy', '1em');
|
8490 | tspan.setAttribute('x', '1');
|
8491 | tspan.textContent = rows[j];
|
8492 | svgLabel.appendChild(tspan);
|
8493 | }
|
8494 |
|
8495 | labelTypeStr = 'svg';
|
8496 | verticeText = svgLabel;
|
8497 | }
|
8498 |
|
8499 | var radious = 0;
|
8500 | var _shape = '';
|
8501 |
|
8502 |
|
8503 | switch (vertice.type) {
|
8504 | case 'round':
|
8505 | radious = 5;
|
8506 | _shape = 'rect';
|
8507 | break;
|
8508 | case 'square':
|
8509 | _shape = 'rect';
|
8510 | break;
|
8511 | case 'diamond':
|
8512 | _shape = 'question';
|
8513 | break;
|
8514 | case 'odd':
|
8515 | _shape = 'rect_left_inv_arrow';
|
8516 | break;
|
8517 | case 'odd_right':
|
8518 | _shape = 'rect_left_inv_arrow';
|
8519 | break;
|
8520 | case 'circle':
|
8521 | _shape = 'circle';
|
8522 | break;
|
8523 | case 'ellipse':
|
8524 | _shape = 'ellipse';
|
8525 | break;
|
8526 | case 'group':
|
8527 | _shape = 'rect';
|
8528 |
|
8529 | verticeText = conf.htmlLabels ? '' : document.createElementNS('http://www.w3.org/2000/svg', 'text');
|
8530 | break;
|
8531 | default:
|
8532 | _shape = 'rect';
|
8533 | }
|
8534 |
|
8535 | g.setNode(vertice.id, { labelType: labelTypeStr, shape: _shape, label: verticeText, rx: radious, ry: radious, 'class': classStr, style: style, id: vertice.id });
|
8536 | });
|
8537 | };
|
8538 |
|
8539 |
|
8540 |
|
8541 |
|
8542 |
|
8543 |
|
8544 | exports.addEdges = function (edges, g) {
|
8545 | var cnt = 0;
|
8546 |
|
8547 | var defaultStyle;
|
8548 | if (typeof edges.defaultStyle !== 'undefined') {
|
8549 | defaultStyle = edges.defaultStyle.toString().replace(/,/g, ';');
|
8550 | }
|
8551 |
|
8552 | edges.forEach(function (edge) {
|
8553 | cnt++;
|
8554 | var edgeData = {};
|
8555 |
|
8556 |
|
8557 | if (edge.type === 'arrow_open') {
|
8558 | edgeData.arrowhead = 'none';
|
8559 | } else {
|
8560 | edgeData.arrowhead = 'normal';
|
8561 | }
|
8562 |
|
8563 | var style = '';
|
8564 |
|
8565 | if (typeof edge.style !== 'undefined') {
|
8566 | edge.style.forEach(function (s) {
|
8567 | style = style + s + ';';
|
8568 | });
|
8569 | } else {
|
8570 | switch (edge.stroke) {
|
8571 | case 'normal':
|
8572 | style = 'fill:none';
|
8573 | if (typeof defaultStyle !== 'undefined') {
|
8574 | style = defaultStyle;
|
8575 | }
|
8576 | break;
|
8577 | case 'dotted':
|
8578 | style = 'stroke: #333; fill:none;stroke-width:2px;stroke-dasharray:3;';
|
8579 | break;
|
8580 | case 'thick':
|
8581 | style = 'stroke: #333; stroke-width: 3.5px;fill:none';
|
8582 | break;
|
8583 | }
|
8584 | }
|
8585 | edgeData.style = style;
|
8586 |
|
8587 | if (typeof edge.interpolate !== 'undefined') {
|
8588 | edgeData.lineInterpolate = edge.interpolate;
|
8589 | } else {
|
8590 | if (typeof edges.defaultInterpolate !== 'undefined') {
|
8591 | edgeData.lineInterpolate = edges.defaultInterpolate;
|
8592 | }
|
8593 | }
|
8594 |
|
8595 | if (typeof edge.text === 'undefined') {
|
8596 | if (typeof edge.style !== 'undefined') {
|
8597 | edgeData.arrowheadStyle = 'fill: #333';
|
8598 | }
|
8599 | } else {
|
8600 | edgeData.arrowheadStyle = 'fill: #333';
|
8601 | if (typeof edge.style === 'undefined') {
|
8602 | edgeData.labelpos = 'c';
|
8603 | if (conf.htmlLabels) {
|
8604 | edgeData.labelType = 'html';
|
8605 | edgeData.label = '<span class="edgeLabel">' + edge.text + '</span>';
|
8606 | } else {
|
8607 | edgeData.labelType = 'text';
|
8608 | edgeData.style = 'stroke: #333; stroke-width: 1.5px;fill:none';
|
8609 | edgeData.label = edge.text.replace(/<br>/g, '\n');
|
8610 | }
|
8611 | } else {
|
8612 | edgeData.label = edge.text.replace(/<br>/g, '\n');
|
8613 | }
|
8614 | }
|
8615 |
|
8616 | g.setEdge(edge.start, edge.end, edgeData, cnt);
|
8617 | });
|
8618 | };
|
8619 |
|
8620 |
|
8621 |
|
8622 |
|
8623 |
|
8624 | exports.getClasses = function (text, isDot) {
|
8625 | var parser;
|
8626 | graph.clear();
|
8627 | if (isDot) {
|
8628 | parser = dot.parser;
|
8629 | } else {
|
8630 | parser = flow.parser;
|
8631 | }
|
8632 | parser.yy = graph;
|
8633 |
|
8634 |
|
8635 | parser.parse(text);
|
8636 |
|
8637 | var classes = graph.getClasses();
|
8638 |
|
8639 |
|
8640 | if (typeof classes.default === 'undefined') {
|
8641 | classes.default = { id: 'default' };
|
8642 | classes.default.styles = [];
|
8643 | classes.default.clusterStyles = ['rx:4px', 'fill: rgb(255, 255, 222)', 'rx: 4px', 'stroke: rgb(170, 170, 51)', 'stroke-width: 1px'];
|
8644 | classes.default.nodeLabelStyles = ['fill:#000', 'stroke:none', 'font-weight:300', 'font-family:"Helvetica Neue",Helvetica,Arial,sans-serf', 'font-size:14px'];
|
8645 | classes.default.edgeLabelStyles = ['fill:#000', 'stroke:none', 'font-weight:300', 'font-family:"Helvetica Neue",Helvetica,Arial,sans-serf', 'font-size:14px'];
|
8646 | }
|
8647 | return classes;
|
8648 | };
|
8649 |
|
8650 |
|
8651 |
|
8652 |
|
8653 |
|
8654 |
|
8655 | exports.draw = function (text, id, isDot) {
|
8656 | log.debug('Drawing flowchart');
|
8657 | var parser;
|
8658 | graph.clear();
|
8659 | if (isDot) {
|
8660 | parser = dot.parser;
|
8661 | } else {
|
8662 | parser = flow.parser;
|
8663 | }
|
8664 | parser.yy = graph;
|
8665 |
|
8666 |
|
8667 | try {
|
8668 | parser.parse(text);
|
8669 | } catch (err) {
|
8670 | log.debug('Parsing failed');
|
8671 | }
|
8672 |
|
8673 |
|
8674 | var dir;
|
8675 | dir = graph.getDirection();
|
8676 | if (typeof dir === 'undefined') {
|
8677 | dir = 'TD';
|
8678 | }
|
8679 |
|
8680 |
|
8681 | var g = new dagreD3.graphlib.Graph({
|
8682 | multigraph: true,
|
8683 | compound: true
|
8684 | }).setGraph({
|
8685 | rankdir: dir,
|
8686 | marginx: 20,
|
8687 | marginy: 20
|
8688 |
|
8689 | }).setDefaultEdgeLabel(function () {
|
8690 | return {};
|
8691 | });
|
8692 |
|
8693 | var subG;
|
8694 | var subGraphs = graph.getSubGraphs();
|
8695 | var i = 0;
|
8696 | for (i = subGraphs.length - 1; i >= 0; i--) {
|
8697 | subG = subGraphs[i];
|
8698 | graph.addVertex(subG.id, subG.title, 'group', undefined);
|
8699 | }
|
8700 |
|
8701 |
|
8702 | var vert = graph.getVertices();
|
8703 |
|
8704 | var edges = graph.getEdges();
|
8705 |
|
8706 | i = 0;
|
8707 | var j;
|
8708 | for (i = subGraphs.length - 1; i >= 0; i--) {
|
8709 | subG = subGraphs[i];
|
8710 |
|
8711 | d3.selectAll('cluster').append('text');
|
8712 |
|
8713 | for (j = 0; j < subG.nodes.length; j++) {
|
8714 | g.setParent(subG.nodes[j], subG.id);
|
8715 | }
|
8716 | }
|
8717 | exports.addVertices(vert, g);
|
8718 | exports.addEdges(edges, g);
|
8719 |
|
8720 |
|
8721 | var Render = dagreD3.render;
|
8722 | var render = new Render();
|
8723 |
|
8724 |
|
8725 | render.shapes().question = function (parent, bbox, node) {
|
8726 | var w = bbox.width;
|
8727 | var h = bbox.height;
|
8728 | var s = (w + h) * 0.8;
|
8729 | var points = [{ x: s / 2, y: 0 }, { x: s, y: -s / 2 }, { x: s / 2, y: -s }, { x: 0, y: -s / 2 }];
|
8730 | var shapeSvg = parent.insert('polygon', ':first-child').attr('points', points.map(function (d) {
|
8731 | return d.x + ',' + d.y;
|
8732 | }).join(' ')).attr('rx', 5).attr('ry', 5).attr('transform', 'translate(' + -s / 2 + ',' + s * 2 / 4 + ')');
|
8733 | node.intersect = function (point) {
|
8734 | return dagreD3.intersect.polygon(node, points, point);
|
8735 | };
|
8736 | return shapeSvg;
|
8737 | };
|
8738 |
|
8739 |
|
8740 | render.shapes().rect_left_inv_arrow = function (parent, bbox, node) {
|
8741 | var w = bbox.width;
|
8742 | var h = bbox.height;
|
8743 | var points = [{ x: -h / 2, y: 0 }, { x: w, y: 0 }, { x: w, y: -h }, { x: -h / 2, y: -h }, { x: 0, y: -h / 2 }];
|
8744 | var shapeSvg = parent.insert('polygon', ':first-child').attr('points', points.map(function (d) {
|
8745 | return d.x + ',' + d.y;
|
8746 | }).join(' ')).attr('transform', 'translate(' + -w / 2 + ',' + h * 2 / 4 + ')');
|
8747 | node.intersect = function (point) {
|
8748 | return dagreD3.intersect.polygon(node, points, point);
|
8749 | };
|
8750 | return shapeSvg;
|
8751 | };
|
8752 |
|
8753 |
|
8754 | render.shapes().rect_right_inv_arrow = function (parent, bbox, node) {
|
8755 | var w = bbox.width;
|
8756 | var h = bbox.height;
|
8757 | var points = [{ x: 0, y: 0 }, { x: w + h / 2, y: 0 }, { x: w, y: -h / 2 }, { x: w + h / 2, y: -h }, { x: 0, y: -h }];
|
8758 | var shapeSvg = parent.insert('polygon', ':first-child').attr('points', points.map(function (d) {
|
8759 | return d.x + ',' + d.y;
|
8760 | }).join(' ')).attr('transform', 'translate(' + -w / 2 + ',' + h * 2 / 4 + ')');
|
8761 | node.intersect = function (point) {
|
8762 | return dagreD3.intersect.polygon(node, points, point);
|
8763 | };
|
8764 | return shapeSvg;
|
8765 | };
|
8766 |
|
8767 |
|
8768 | render.arrows().none = function normal(parent, id, edge, type) {
|
8769 | var marker = parent.append('marker').attr('id', id).attr('viewBox', '0 0 10 10').attr('refX', 9).attr('refY', 5).attr('markerUnits', 'strokeWidth').attr('markerWidth', 8).attr('markerHeight', 6).attr('orient', 'auto');
|
8770 |
|
8771 | var path = marker.append('path').attr('d', 'M 0 0 L 0 0 L 0 0 z');
|
8772 | dagreD3.util.applyStyle(path, edge[type + 'Style']);
|
8773 | };
|
8774 |
|
8775 |
|
8776 | render.arrows().normal = function normal(parent, id, edge, type) {
|
8777 | var marker = parent.append('marker').attr('id', id).attr('viewBox', '0 0 10 10').attr('refX', 9).attr('refY', 5).attr('markerUnits', 'strokeWidth').attr('markerWidth', 8).attr('markerHeight', 6).attr('orient', 'auto');
|
8778 |
|
8779 | marker.append('path').attr('d', 'M 0 0 L 10 5 L 0 10 z').attr('class', 'arrowheadPath').style('stroke-width', 1).style('stroke-dasharray', '1,0');
|
8780 | };
|
8781 |
|
8782 |
|
8783 | var svg = d3.select('#' + id);
|
8784 |
|
8785 |
|
8786 | var element = d3.select('#' + id + ' g');
|
8787 | render(element, g);
|
8788 |
|
8789 | element.selectAll('g.node').attr('title', function () {
|
8790 | return graph.getTooltip(this.id);
|
8791 | });
|
8792 |
|
8793 | if (conf.useMaxWidth) {
|
8794 |
|
8795 | svg.attr('height', '100%');
|
8796 | svg.attr('width', conf.width);
|
8797 | svg.attr('viewBox', '0 0 ' + (g.graph().width + 20) + ' ' + (g.graph().height + 20));
|
8798 | svg.attr('style', 'max-width:' + (g.graph().width + 20) + 'px;');
|
8799 | } else {
|
8800 |
|
8801 | svg.attr('height', g.graph().height);
|
8802 | if (typeof conf.width === 'undefined') {
|
8803 | svg.attr('width', g.graph().width);
|
8804 | } else {
|
8805 | svg.attr('width', conf.width);
|
8806 | }
|
8807 | svg.attr('viewBox', '0 0 ' + (g.graph().width + 20) + ' ' + (g.graph().height + 20));
|
8808 | }
|
8809 |
|
8810 |
|
8811 | graph.indexNodes('subGraph' + i);
|
8812 |
|
8813 | for (i = 0; i < subGraphs.length; i++) {
|
8814 | subG = subGraphs[i];
|
8815 |
|
8816 | if (subG.title !== 'undefined') {
|
8817 | var clusterRects = document.querySelectorAll('#' + id + ' #' + subG.id + ' rect');
|
8818 | var clusterEl = document.querySelectorAll('#' + id + ' #' + subG.id);
|
8819 |
|
8820 | var xPos = clusterRects[0].x.baseVal.value;
|
8821 | var yPos = clusterRects[0].y.baseVal.value;
|
8822 | var width = clusterRects[0].width.baseVal.value;
|
8823 | var cluster = d3.select(clusterEl[0]);
|
8824 | var te = cluster.append('text');
|
8825 | te.attr('x', xPos + width / 2);
|
8826 | te.attr('y', yPos + 14);
|
8827 | te.attr('fill', 'black');
|
8828 | te.attr('stroke', 'none');
|
8829 | te.attr('id', id + 'Text');
|
8830 | te.style('text-anchor', 'middle');
|
8831 |
|
8832 | if (typeof subG.title === 'undefined') {
|
8833 | te.text('Undef');
|
8834 | } else {
|
8835 | te.text(subG.title);
|
8836 | }
|
8837 | }
|
8838 | }
|
8839 |
|
8840 |
|
8841 | if (!conf.htmlLabels) {
|
8842 | var labels = document.querySelectorAll('#' + id + ' .edgeLabel .label');
|
8843 | var k;
|
8844 | for (k = 0; k < labels.length; k++) {
|
8845 | var label = labels[i];
|
8846 |
|
8847 |
|
8848 | var dim = label.getBBox();
|
8849 |
|
8850 | var rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
|
8851 | rect.setAttribute('rx', 0);
|
8852 | rect.setAttribute('ry', 0);
|
8853 | rect.setAttribute('width', dim.width);
|
8854 | rect.setAttribute('height', dim.height);
|
8855 | rect.setAttribute('style', 'fill:#e8e8e8;');
|
8856 |
|
8857 | label.insertBefore(rect, label.firstChild);
|
8858 | }
|
8859 | }
|
8860 | };
|
8861 |
|
8862 | }),
|
8863 |
|
8864 | (function(module, exports) {
|
8865 |
|
8866 | module.exports = require("dagre-d3-renderer");
|
8867 |
|
8868 | }),
|
8869 |
|
8870 | (function(module, exports, __webpack_require__) {
|
8871 |
|
8872 | "use strict";
|
8873 |
|
8874 |
|
8875 |
|
8876 |
|
8877 |
|
8878 |
|
8879 | var sq = __webpack_require__(9).parser;
|
8880 | sq.yy = __webpack_require__(10);
|
8881 | var svgDraw = __webpack_require__(26);
|
8882 | var d3 = __webpack_require__(1);
|
8883 | var Logger = __webpack_require__(0);
|
8884 | var log = Logger.Log;
|
8885 |
|
8886 | var conf = {
|
8887 |
|
8888 | diagramMarginX: 50,
|
8889 | diagramMarginY: 30,
|
8890 |
|
8891 | actorMargin: 50,
|
8892 |
|
8893 | width: 150,
|
8894 |
|
8895 | height: 65,
|
8896 |
|
8897 | boxMargin: 10,
|
8898 | boxTextMargin: 5,
|
8899 | noteMargin: 10,
|
8900 |
|
8901 | messageMargin: 35,
|
8902 |
|
8903 | mirrorActors: false,
|
8904 |
|
8905 |
|
8906 | bottomMarginAdj: 1,
|
8907 |
|
8908 |
|
8909 | activationWidth: 10,
|
8910 |
|
8911 |
|
8912 | textPlacement: 'tspan'
|
8913 | };
|
8914 |
|
8915 | exports.bounds = {
|
8916 | data: {
|
8917 | startx: undefined,
|
8918 | stopx: undefined,
|
8919 | starty: undefined,
|
8920 | stopy: undefined
|
8921 | },
|
8922 | verticalPos: 0,
|
8923 |
|
8924 | sequenceItems: [],
|
8925 | activations: [],
|
8926 | init: function init() {
|
8927 | this.sequenceItems = [];
|
8928 | this.activations = [];
|
8929 | this.data = {
|
8930 | startx: undefined,
|
8931 | stopx: undefined,
|
8932 | starty: undefined,
|
8933 | stopy: undefined
|
8934 | };
|
8935 | this.verticalPos = 0;
|
8936 | },
|
8937 | updateVal: function updateVal(obj, key, val, fun) {
|
8938 | if (typeof obj[key] === 'undefined') {
|
8939 | obj[key] = val;
|
8940 | } else {
|
8941 | obj[key] = fun(val, obj[key]);
|
8942 | }
|
8943 | },
|
8944 | updateBounds: function updateBounds(startx, starty, stopx, stopy) {
|
8945 | var _self = this;
|
8946 | var cnt = 0;
|
8947 | function updateFn(type) {
|
8948 | return function updateItemBounds(item) {
|
8949 | cnt++;
|
8950 |
|
8951 | var n = _self.sequenceItems.length - cnt + 1;
|
8952 |
|
8953 | _self.updateVal(item, 'starty', starty - n * conf.boxMargin, Math.min);
|
8954 | _self.updateVal(item, 'stopy', stopy + n * conf.boxMargin, Math.max);
|
8955 |
|
8956 | _self.updateVal(exports.bounds.data, 'startx', startx - n * conf.boxMargin, Math.min);
|
8957 | _self.updateVal(exports.bounds.data, 'stopx', stopx + n * conf.boxMargin, Math.max);
|
8958 |
|
8959 | if (!(type === 'activation')) {
|
8960 | _self.updateVal(item, 'startx', startx - n * conf.boxMargin, Math.min);
|
8961 | _self.updateVal(item, 'stopx', stopx + n * conf.boxMargin, Math.max);
|
8962 |
|
8963 | _self.updateVal(exports.bounds.data, 'starty', starty - n * conf.boxMargin, Math.min);
|
8964 | _self.updateVal(exports.bounds.data, 'stopy', stopy + n * conf.boxMargin, Math.max);
|
8965 | }
|
8966 | };
|
8967 | }
|
8968 |
|
8969 | this.sequenceItems.forEach(updateFn());
|
8970 | this.activations.forEach(updateFn('activation'));
|
8971 | },
|
8972 | insert: function insert(startx, starty, stopx, stopy) {
|
8973 | var _startx, _starty, _stopx, _stopy;
|
8974 |
|
8975 | _startx = Math.min(startx, stopx);
|
8976 | _stopx = Math.max(startx, stopx);
|
8977 | _starty = Math.min(starty, stopy);
|
8978 | _stopy = Math.max(starty, stopy);
|
8979 |
|
8980 | this.updateVal(exports.bounds.data, 'startx', _startx, Math.min);
|
8981 | this.updateVal(exports.bounds.data, 'starty', _starty, Math.min);
|
8982 | this.updateVal(exports.bounds.data, 'stopx', _stopx, Math.max);
|
8983 | this.updateVal(exports.bounds.data, 'stopy', _stopy, Math.max);
|
8984 |
|
8985 | this.updateBounds(_startx, _starty, _stopx, _stopy);
|
8986 | },
|
8987 | newActivation: function newActivation(message, diagram) {
|
8988 | var actorRect = sq.yy.getActors()[message.from.actor];
|
8989 | var stackedSize = actorActivations(message.from.actor).length;
|
8990 | var x = actorRect.x + conf.width / 2 + (stackedSize - 1) * conf.activationWidth / 2;
|
8991 | this.activations.push({
|
8992 | startx: x,
|
8993 | starty: this.verticalPos + 2,
|
8994 | stopx: x + conf.activationWidth,
|
8995 | stopy: undefined,
|
8996 | actor: message.from.actor,
|
8997 | anchored: svgDraw.anchorElement(diagram)
|
8998 | });
|
8999 | },
|
9000 | endActivation: function endActivation(message) {
|
9001 |
|
9002 | var lastActorActivationIdx = this.activations.map(function (activation) {
|
9003 | return activation.actor;
|
9004 | }).lastIndexOf(message.from.actor);
|
9005 | var activation = this.activations.splice(lastActorActivationIdx, 1)[0];
|
9006 | return activation;
|
9007 | },
|
9008 | newLoop: function newLoop(title) {
|
9009 | this.sequenceItems.push({ startx: undefined, starty: this.verticalPos, stopx: undefined, stopy: undefined, title: title });
|
9010 | },
|
9011 | endLoop: function endLoop() {
|
9012 | var loop = this.sequenceItems.pop();
|
9013 | return loop;
|
9014 | },
|
9015 | addSectionToLoop: function addSectionToLoop(message) {
|
9016 | var loop = this.sequenceItems.pop();
|
9017 | loop.sections = loop.sections || [];
|
9018 | loop.sectionTitles = loop.sectionTitles || [];
|
9019 | loop.sections.push(exports.bounds.getVerticalPos());
|
9020 | loop.sectionTitles.push(message);
|
9021 | this.sequenceItems.push(loop);
|
9022 | },
|
9023 | bumpVerticalPos: function bumpVerticalPos(bump) {
|
9024 | this.verticalPos = this.verticalPos + bump;
|
9025 | this.data.stopy = this.verticalPos;
|
9026 | },
|
9027 | getVerticalPos: function getVerticalPos() {
|
9028 | return this.verticalPos;
|
9029 | },
|
9030 | getBounds: function getBounds() {
|
9031 | return this.data;
|
9032 | }
|
9033 |
|
9034 | |
9035 |
|
9036 |
|
9037 |
|
9038 |
|
9039 |
|
9040 | };var drawNote = function drawNote(elem, startx, verticalPos, msg, forceWidth) {
|
9041 | var rect = svgDraw.getNoteRect();
|
9042 | rect.x = startx;
|
9043 | rect.y = verticalPos;
|
9044 | rect.width = forceWidth || conf.width;
|
9045 | rect.class = 'note';
|
9046 |
|
9047 | var g = elem.append('g');
|
9048 | var rectElem = svgDraw.drawRect(g, rect);
|
9049 |
|
9050 | var textObj = svgDraw.getTextObj();
|
9051 | textObj.x = startx - 4;
|
9052 | textObj.y = verticalPos - 13;
|
9053 | textObj.textMargin = conf.noteMargin;
|
9054 | textObj.dy = '1em';
|
9055 | textObj.text = msg.message;
|
9056 | textObj.class = 'noteText';
|
9057 |
|
9058 | var textElem = svgDraw.drawText(g, textObj, rect.width - conf.noteMargin);
|
9059 |
|
9060 | var textHeight = textElem[0][0].getBBox().height;
|
9061 | if (!forceWidth && textHeight > conf.width) {
|
9062 | textElem.remove();
|
9063 | g = elem.append('g');
|
9064 |
|
9065 | textElem = svgDraw.drawText(g, textObj, 2 * rect.width - conf.noteMargin);
|
9066 | textHeight = textElem[0][0].getBBox().height;
|
9067 | rectElem.attr('width', 2 * rect.width);
|
9068 | exports.bounds.insert(startx, verticalPos, startx + 2 * rect.width, verticalPos + 2 * conf.noteMargin + textHeight);
|
9069 | } else {
|
9070 | exports.bounds.insert(startx, verticalPos, startx + rect.width, verticalPos + 2 * conf.noteMargin + textHeight);
|
9071 | }
|
9072 |
|
9073 | rectElem.attr('height', textHeight + 2 * conf.noteMargin);
|
9074 | exports.bounds.bumpVerticalPos(textHeight + 2 * conf.noteMargin);
|
9075 | };
|
9076 |
|
9077 |
|
9078 |
|
9079 |
|
9080 |
|
9081 |
|
9082 |
|
9083 |
|
9084 |
|
9085 |
|
9086 | var drawMessage = function drawMessage(elem, startx, stopx, verticalPos, msg) {
|
9087 | var g = elem.append('g');
|
9088 | var txtCenter = startx + (stopx - startx) / 2;
|
9089 |
|
9090 | var textElem = g.append('text')
|
9091 | .attr('x', txtCenter).attr('y', verticalPos - 7).style('text-anchor', 'middle').attr('class', 'messageText').text(msg.message);
|
9092 |
|
9093 | var textWidth;
|
9094 |
|
9095 | if (typeof textElem[0][0].getBBox !== 'undefined') {
|
9096 | textWidth = textElem[0][0].getBBox().width;
|
9097 | } else {
|
9098 | textWidth = textElem[0][0].getBoundingClientRect();
|
9099 | }
|
9100 |
|
9101 | var line;
|
9102 |
|
9103 | if (startx === stopx) {
|
9104 | line = g.append('path').attr('d', 'M ' + startx + ',' + verticalPos + ' C ' + (startx + 60) + ',' + (verticalPos - 10) + ' ' + (startx + 60) + ',' + (verticalPos + 30) + ' ' + startx + ',' + (verticalPos + 20));
|
9105 |
|
9106 | exports.bounds.bumpVerticalPos(30);
|
9107 | var dx = Math.max(textWidth / 2, 100);
|
9108 | exports.bounds.insert(startx - dx, exports.bounds.getVerticalPos() - 10, stopx + dx, exports.bounds.getVerticalPos());
|
9109 | } else {
|
9110 | line = g.append('line');
|
9111 | line.attr('x1', startx);
|
9112 | line.attr('y1', verticalPos);
|
9113 | line.attr('x2', stopx);
|
9114 | line.attr('y2', verticalPos);
|
9115 | exports.bounds.insert(startx, exports.bounds.getVerticalPos() - 10, stopx, exports.bounds.getVerticalPos());
|
9116 | }
|
9117 |
|
9118 |
|
9119 | if (msg.type === sq.yy.LINETYPE.DOTTED || msg.type === sq.yy.LINETYPE.DOTTED_CROSS || msg.type === sq.yy.LINETYPE.DOTTED_OPEN) {
|
9120 | line.style('stroke-dasharray', '3, 3');
|
9121 | line.attr('class', 'messageLine1');
|
9122 | } else {
|
9123 | line.attr('class', 'messageLine0');
|
9124 | }
|
9125 |
|
9126 | var url = '';
|
9127 | if (conf.arrowMarkerAbsolute) {
|
9128 | url = window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search;
|
9129 | url = url.replace(/\(/g, '\\(');
|
9130 | url = url.replace(/\)/g, '\\)');
|
9131 | }
|
9132 |
|
9133 | line.attr('stroke-width', 2);
|
9134 | line.attr('stroke', 'black');
|
9135 | line.style('fill', 'none');
|
9136 | if (msg.type === sq.yy.LINETYPE.SOLID || msg.type === sq.yy.LINETYPE.DOTTED) {
|
9137 | line.attr('marker-end', 'url(' + url + '#arrowhead)');
|
9138 | }
|
9139 |
|
9140 | if (msg.type === sq.yy.LINETYPE.SOLID_CROSS || msg.type === sq.yy.LINETYPE.DOTTED_CROSS) {
|
9141 | line.attr('marker-end', 'url(' + url + '#crosshead)');
|
9142 | }
|
9143 | };
|
9144 |
|
9145 | module.exports.drawActors = function (diagram, actors, actorKeys, verticalPos) {
|
9146 | var i;
|
9147 |
|
9148 | for (i = 0; i < actorKeys.length; i++) {
|
9149 | var key = actorKeys[i];
|
9150 |
|
9151 |
|
9152 | actors[key].x = i * conf.actorMargin + i * conf.width;
|
9153 | actors[key].y = verticalPos;
|
9154 | actors[key].width = conf.diagramMarginX;
|
9155 | actors[key].height = conf.diagramMarginY;
|
9156 |
|
9157 |
|
9158 | svgDraw.drawActor(diagram, actors[key].x, verticalPos, actors[key].description, conf);
|
9159 | exports.bounds.insert(actors[key].x, verticalPos, actors[key].x + conf.width, conf.height);
|
9160 | }
|
9161 |
|
9162 |
|
9163 | exports.bounds.bumpVerticalPos(conf.height);
|
9164 | };
|
9165 |
|
9166 | module.exports.setConf = function (cnf) {
|
9167 | var keys = Object.keys(cnf);
|
9168 |
|
9169 | keys.forEach(function (key) {
|
9170 | conf[key] = cnf[key];
|
9171 | });
|
9172 | };
|
9173 |
|
9174 | var actorActivations = function actorActivations(actor) {
|
9175 | return module.exports.bounds.activations.filter(function (activation) {
|
9176 | return activation.actor === actor;
|
9177 | });
|
9178 | };
|
9179 |
|
9180 | var actorFlowVerticaBounds = function actorFlowVerticaBounds(actor) {
|
9181 |
|
9182 | var actors = sq.yy.getActors();
|
9183 | var activations = actorActivations(actor);
|
9184 |
|
9185 | var left = activations.reduce(function (acc, activation) {
|
9186 | return Math.min(acc, activation.startx);
|
9187 | }, actors[actor].x + conf.width / 2);
|
9188 | var right = activations.reduce(function (acc, activation) {
|
9189 | return Math.max(acc, activation.stopx);
|
9190 | }, actors[actor].x + conf.width / 2);
|
9191 | return [left, right];
|
9192 | };
|
9193 |
|
9194 |
|
9195 |
|
9196 |
|
9197 |
|
9198 |
|
9199 | module.exports.draw = function (text, id) {
|
9200 | sq.yy.clear();
|
9201 | sq.parse(text + '\n');
|
9202 |
|
9203 | exports.bounds.init();
|
9204 | var diagram = d3.select('#' + id);
|
9205 |
|
9206 | var startx;
|
9207 | var stopx;
|
9208 | var forceWidth;
|
9209 |
|
9210 |
|
9211 | var actors = sq.yy.getActors();
|
9212 | var actorKeys = sq.yy.getActorKeys();
|
9213 | var messages = sq.yy.getMessages();
|
9214 | var title = sq.yy.getTitle();
|
9215 | module.exports.drawActors(diagram, actors, actorKeys, 0);
|
9216 |
|
9217 |
|
9218 | svgDraw.insertArrowHead(diagram);
|
9219 | svgDraw.insertArrowCrossHead(diagram);
|
9220 |
|
9221 | function activeEnd(msg, verticalPos) {
|
9222 | var activationData = exports.bounds.endActivation(msg);
|
9223 | if (activationData.starty + 18 > verticalPos) {
|
9224 | activationData.starty = verticalPos - 6;
|
9225 | verticalPos += 12;
|
9226 | }
|
9227 | svgDraw.drawActivation(diagram, activationData, verticalPos, conf);
|
9228 |
|
9229 | exports.bounds.insert(activationData.startx, verticalPos - 10, activationData.stopx, verticalPos);
|
9230 | }
|
9231 |
|
9232 |
|
9233 |
|
9234 |
|
9235 | messages.forEach(function (msg) {
|
9236 | var loopData;
|
9237 |
|
9238 | switch (msg.type) {
|
9239 | case sq.yy.LINETYPE.NOTE:
|
9240 | exports.bounds.bumpVerticalPos(conf.boxMargin);
|
9241 |
|
9242 | startx = actors[msg.from].x;
|
9243 | stopx = actors[msg.to].x;
|
9244 |
|
9245 | if (msg.placement === sq.yy.PLACEMENT.RIGHTOF) {
|
9246 | drawNote(diagram, startx + (conf.width + conf.actorMargin) / 2, exports.bounds.getVerticalPos(), msg);
|
9247 | } else if (msg.placement === sq.yy.PLACEMENT.LEFTOF) {
|
9248 | drawNote(diagram, startx - (conf.width + conf.actorMargin) / 2, exports.bounds.getVerticalPos(), msg);
|
9249 | } else if (msg.to === msg.from) {
|
9250 |
|
9251 | drawNote(diagram, startx, exports.bounds.getVerticalPos(), msg);
|
9252 | } else {
|
9253 |
|
9254 | forceWidth = Math.abs(startx - stopx) + conf.actorMargin;
|
9255 | drawNote(diagram, (startx + stopx + conf.width - forceWidth) / 2, exports.bounds.getVerticalPos(), msg, forceWidth);
|
9256 | }
|
9257 | break;
|
9258 | case sq.yy.LINETYPE.ACTIVE_START:
|
9259 | exports.bounds.newActivation(msg, diagram);
|
9260 | break;
|
9261 | case sq.yy.LINETYPE.ACTIVE_END:
|
9262 | activeEnd(msg, exports.bounds.getVerticalPos());
|
9263 | break;
|
9264 | case sq.yy.LINETYPE.LOOP_START:
|
9265 | exports.bounds.bumpVerticalPos(conf.boxMargin);
|
9266 | exports.bounds.newLoop(msg.message);
|
9267 | exports.bounds.bumpVerticalPos(conf.boxMargin + conf.boxTextMargin);
|
9268 | break;
|
9269 | case sq.yy.LINETYPE.LOOP_END:
|
9270 | loopData = exports.bounds.endLoop();
|
9271 |
|
9272 | svgDraw.drawLoop(diagram, loopData, 'loop', conf);
|
9273 | exports.bounds.bumpVerticalPos(conf.boxMargin);
|
9274 | break;
|
9275 | case sq.yy.LINETYPE.OPT_START:
|
9276 | exports.bounds.bumpVerticalPos(conf.boxMargin);
|
9277 | exports.bounds.newLoop(msg.message);
|
9278 | exports.bounds.bumpVerticalPos(conf.boxMargin + conf.boxTextMargin);
|
9279 | break;
|
9280 | case sq.yy.LINETYPE.OPT_END:
|
9281 | loopData = exports.bounds.endLoop();
|
9282 |
|
9283 | svgDraw.drawLoop(diagram, loopData, 'opt', conf);
|
9284 | exports.bounds.bumpVerticalPos(conf.boxMargin);
|
9285 | break;
|
9286 | case sq.yy.LINETYPE.ALT_START:
|
9287 | exports.bounds.bumpVerticalPos(conf.boxMargin);
|
9288 | exports.bounds.newLoop(msg.message);
|
9289 | exports.bounds.bumpVerticalPos(conf.boxMargin + conf.boxTextMargin);
|
9290 | break;
|
9291 | case sq.yy.LINETYPE.ALT_ELSE:
|
9292 | exports.bounds.bumpVerticalPos(conf.boxMargin);
|
9293 | loopData = exports.bounds.addSectionToLoop(msg.message);
|
9294 | exports.bounds.bumpVerticalPos(conf.boxMargin);
|
9295 | break;
|
9296 | case sq.yy.LINETYPE.ALT_END:
|
9297 | loopData = exports.bounds.endLoop();
|
9298 |
|
9299 | svgDraw.drawLoop(diagram, loopData, 'alt', conf);
|
9300 | exports.bounds.bumpVerticalPos(conf.boxMargin);
|
9301 | break;
|
9302 | case sq.yy.LINETYPE.PAR_START:
|
9303 | exports.bounds.bumpVerticalPos(conf.boxMargin);
|
9304 | exports.bounds.newLoop(msg.message);
|
9305 | exports.bounds.bumpVerticalPos(conf.boxMargin + conf.boxTextMargin);
|
9306 | break;
|
9307 | case sq.yy.LINETYPE.PAR_AND:
|
9308 | exports.bounds.bumpVerticalPos(conf.boxMargin);
|
9309 | loopData = exports.bounds.addSectionToLoop(msg.message);
|
9310 | exports.bounds.bumpVerticalPos(conf.boxMargin);
|
9311 | break;
|
9312 | case sq.yy.LINETYPE.PAR_END:
|
9313 | loopData = exports.bounds.endLoop();
|
9314 | svgDraw.drawLoop(diagram, loopData, 'par', conf);
|
9315 | exports.bounds.bumpVerticalPos(conf.boxMargin);
|
9316 | break;
|
9317 | default:
|
9318 | try {
|
9319 |
|
9320 | exports.bounds.bumpVerticalPos(conf.messageMargin);
|
9321 | var fromBounds = actorFlowVerticaBounds(msg.from);
|
9322 | var toBounds = actorFlowVerticaBounds(msg.to);
|
9323 | var fromIdx = fromBounds[0] <= toBounds[0] ? 1 : 0;
|
9324 | var toIdx = fromBounds[0] < toBounds[0] ? 0 : 1;
|
9325 | startx = fromBounds[fromIdx];
|
9326 | stopx = toBounds[toIdx];
|
9327 |
|
9328 | var verticalPos = exports.bounds.getVerticalPos();
|
9329 | drawMessage(diagram, startx, stopx, verticalPos, msg);
|
9330 | var allBounds = fromBounds.concat(toBounds);
|
9331 | exports.bounds.insert(Math.min.apply(null, allBounds), verticalPos, Math.max.apply(null, allBounds), verticalPos);
|
9332 | } catch (e) {
|
9333 | console.error('error while drawing message', e);
|
9334 | }
|
9335 | }
|
9336 | });
|
9337 |
|
9338 | if (conf.mirrorActors) {
|
9339 |
|
9340 | exports.bounds.bumpVerticalPos(conf.boxMargin * 2);
|
9341 | module.exports.drawActors(diagram, actors, actorKeys, exports.bounds.getVerticalPos());
|
9342 | }
|
9343 |
|
9344 | var box = exports.bounds.getBounds();
|
9345 |
|
9346 |
|
9347 | log.debug('For line height fix Querying: #' + id + ' .actor-line');
|
9348 | var actorLines = d3.selectAll('#' + id + ' .actor-line');
|
9349 | actorLines.attr('y2', box.stopy);
|
9350 |
|
9351 | var height = box.stopy - box.starty + 2 * conf.diagramMarginY;
|
9352 |
|
9353 | if (conf.mirrorActors) {
|
9354 | height = height - conf.boxMargin + conf.bottomMarginAdj;
|
9355 | }
|
9356 |
|
9357 | var width = box.stopx - box.startx + 2 * conf.diagramMarginX;
|
9358 |
|
9359 | if (title) {
|
9360 | diagram.append('text').text(title).attr('x', (box.stopx - box.startx) / 2 - 2 * conf.diagramMarginX).attr('y', -25);
|
9361 | }
|
9362 |
|
9363 | if (conf.useMaxWidth) {
|
9364 | diagram.attr('height', '100%');
|
9365 | diagram.attr('width', '100%');
|
9366 | diagram.attr('style', 'max-width:' + width + 'px;');
|
9367 | } else {
|
9368 | diagram.attr('height', height);
|
9369 | diagram.attr('width', width);
|
9370 | }
|
9371 | var extraVertForTitle = title ? 40 : 0;
|
9372 | diagram.attr('viewBox', box.startx - conf.diagramMarginX + ' -' + (conf.diagramMarginY + extraVertForTitle) + ' ' + width + ' ' + (height + extraVertForTitle));
|
9373 | };
|
9374 |
|
9375 | }),
|
9376 |
|
9377 | (function(module, exports, __webpack_require__) {
|
9378 |
|
9379 | "use strict";
|
9380 |
|
9381 |
|
9382 |
|
9383 |
|
9384 |
|
9385 | exports.drawRect = function (elem, rectData) {
|
9386 | var rectElem = elem.append('rect');
|
9387 | rectElem.attr('x', rectData.x);
|
9388 | rectElem.attr('y', rectData.y);
|
9389 | rectElem.attr('fill', rectData.fill);
|
9390 | rectElem.attr('stroke', rectData.stroke);
|
9391 | rectElem.attr('width', rectData.width);
|
9392 | rectElem.attr('height', rectData.height);
|
9393 | rectElem.attr('rx', rectData.rx);
|
9394 | rectElem.attr('ry', rectData.ry);
|
9395 |
|
9396 | if (typeof rectData.class !== 'undefined') {
|
9397 | rectElem.attr('class', rectData.class);
|
9398 | }
|
9399 |
|
9400 | return rectElem;
|
9401 | };
|
9402 |
|
9403 | exports.drawText = function (elem, textData, width) {
|
9404 |
|
9405 | var nText = textData.text.replace(/<br\/?>/ig, ' ');
|
9406 |
|
9407 | var textElem = elem.append('text');
|
9408 | textElem.attr('x', textData.x);
|
9409 | textElem.attr('y', textData.y);
|
9410 | textElem.style('text-anchor', textData.anchor);
|
9411 | textElem.attr('fill', textData.fill);
|
9412 | if (typeof textData.class !== 'undefined') {
|
9413 | textElem.attr('class', textData.class);
|
9414 | }
|
9415 |
|
9416 | var span = textElem.append('tspan');
|
9417 | span.attr('x', textData.x + textData.textMargin * 2);
|
9418 | span.attr('fill', textData.fill);
|
9419 | span.text(nText);
|
9420 | if (typeof textElem.textwrap !== 'undefined') {
|
9421 | textElem.textwrap({
|
9422 | x: textData.x,
|
9423 | y: textData.y,
|
9424 | width: width,
|
9425 | height: 1800
|
9426 | }, textData.textMargin);
|
9427 | }
|
9428 |
|
9429 | return textElem;
|
9430 | };
|
9431 |
|
9432 | exports.drawLabel = function (elem, txtObject) {
|
9433 | function genPoints(x, y, width, height, cut) {
|
9434 | return x + ',' + y + ' ' + (x + width) + ',' + y + ' ' + (x + width) + ',' + (y + height - cut) + ' ' + (x + width - cut * 1.2) + ',' + (y + height) + ' ' + x + ',' + (y + height);
|
9435 | }
|
9436 | var polygon = elem.append('polygon');
|
9437 | polygon.attr('points', genPoints(txtObject.x, txtObject.y, 50, 20, 7));
|
9438 | polygon.attr('class', 'labelBox');
|
9439 |
|
9440 | txtObject.y = txtObject.y + txtObject.labelMargin;
|
9441 | txtObject.x = txtObject.x + 0.5 * txtObject.labelMargin;
|
9442 | exports.drawText(elem, txtObject);
|
9443 | };
|
9444 | var actorCnt = -1;
|
9445 |
|
9446 |
|
9447 |
|
9448 |
|
9449 |
|
9450 |
|
9451 | exports.drawActor = function (elem, left, verticalPos, description, conf) {
|
9452 | var center = left + conf.width / 2;
|
9453 | var g = elem.append('g');
|
9454 | if (verticalPos === 0) {
|
9455 | actorCnt++;
|
9456 | g.append('line').attr('id', 'actor' + actorCnt).attr('x1', center).attr('y1', 5).attr('x2', center).attr('y2', 2000).attr('class', 'actor-line').attr('stroke-width', '0.5px').attr('stroke', '#999');
|
9457 | }
|
9458 |
|
9459 | var rect = exports.getNoteRect();
|
9460 | rect.x = left;
|
9461 | rect.y = verticalPos;
|
9462 | rect.fill = '#eaeaea';
|
9463 | rect.width = conf.width;
|
9464 | rect.height = conf.height;
|
9465 | rect.class = 'actor';
|
9466 | rect.rx = 3;
|
9467 | rect.ry = 3;
|
9468 | exports.drawRect(g, rect);
|
9469 |
|
9470 | _drawTextCandidateFunc(conf)(description, g, rect.x, rect.y, rect.width, rect.height, { 'class': 'actor' });
|
9471 | };
|
9472 |
|
9473 | exports.anchorElement = function (elem) {
|
9474 | return elem.append('g');
|
9475 | };
|
9476 |
|
9477 |
|
9478 |
|
9479 |
|
9480 |
|
9481 |
|
9482 | exports.drawActivation = function (elem, bounds, verticalPos) {
|
9483 | var rect = exports.getNoteRect();
|
9484 | var g = bounds.anchored;
|
9485 | rect.x = bounds.startx;
|
9486 | rect.y = bounds.starty;
|
9487 | rect.fill = '#f4f4f4';
|
9488 | rect.width = bounds.stopx - bounds.startx;
|
9489 | rect.height = verticalPos - bounds.starty;
|
9490 | exports.drawRect(g, rect);
|
9491 | };
|
9492 |
|
9493 |
|
9494 |
|
9495 |
|
9496 |
|
9497 |
|
9498 |
|
9499 | exports.drawLoop = function (elem, bounds, labelText, conf) {
|
9500 | var g = elem.append('g');
|
9501 | var drawLoopLine = function drawLoopLine(startx, starty, stopx, stopy) {
|
9502 | return g.append('line').attr('x1', startx).attr('y1', starty).attr('x2', stopx).attr('y2', stopy).attr('class', 'loopLine');
|
9503 | };
|
9504 | drawLoopLine(bounds.startx, bounds.starty, bounds.stopx, bounds.starty);
|
9505 | drawLoopLine(bounds.stopx, bounds.starty, bounds.stopx, bounds.stopy);
|
9506 | drawLoopLine(bounds.startx, bounds.stopy, bounds.stopx, bounds.stopy);
|
9507 | drawLoopLine(bounds.startx, bounds.starty, bounds.startx, bounds.stopy);
|
9508 | if (typeof bounds.sections !== 'undefined') {
|
9509 | bounds.sections.forEach(function (item) {
|
9510 | drawLoopLine(bounds.startx, item, bounds.stopx, item).style('stroke-dasharray', '3, 3');
|
9511 | });
|
9512 | }
|
9513 |
|
9514 | var txt = exports.getTextObj();
|
9515 | txt.text = labelText;
|
9516 | txt.x = bounds.startx;
|
9517 | txt.y = bounds.starty;
|
9518 | txt.labelMargin = 1.5 * 10;
|
9519 | txt.class = 'labelText';
|
9520 |
|
9521 | exports.drawLabel(g, txt);
|
9522 |
|
9523 | txt = exports.getTextObj();
|
9524 | txt.text = '[ ' + bounds.title + ' ]';
|
9525 | txt.x = bounds.startx + (bounds.stopx - bounds.startx) / 2;
|
9526 | txt.y = bounds.starty + 1.5 * conf.boxMargin;
|
9527 | txt.anchor = 'middle';
|
9528 | txt.class = 'loopText';
|
9529 |
|
9530 | exports.drawText(g, txt);
|
9531 |
|
9532 | if (typeof bounds.sectionTitles !== 'undefined') {
|
9533 | bounds.sectionTitles.forEach(function (item, idx) {
|
9534 | if (item !== '') {
|
9535 | txt.text = '[ ' + item + ' ]';
|
9536 | txt.y = bounds.sections[idx] + 1.5 * conf.boxMargin;
|
9537 | exports.drawText(g, txt);
|
9538 | }
|
9539 | });
|
9540 | }
|
9541 | };
|
9542 |
|
9543 |
|
9544 |
|
9545 |
|
9546 | exports.insertArrowHead = function (elem) {
|
9547 | elem.append('defs').append('marker').attr('id', 'arrowhead').attr('refX', 5).attr('refY', 2).attr('markerWidth', 6).attr('markerHeight', 4).attr('orient', 'auto').append('path').attr('d', 'M 0,0 V 4 L6,2 Z');
|
9548 | };
|
9549 |
|
9550 |
|
9551 |
|
9552 | exports.insertArrowCrossHead = function (elem) {
|
9553 | var defs = elem.append('defs');
|
9554 | var marker = defs.append('marker').attr('id', 'crosshead').attr('markerWidth', 15).attr('markerHeight', 8).attr('orient', 'auto').attr('refX', 16).attr('refY', 4);
|
9555 |
|
9556 |
|
9557 | marker.append('path').attr('fill', 'black').attr('stroke', '#000000').style('stroke-dasharray', '0, 0').attr('stroke-width', '1px').attr('d', 'M 9,2 V 6 L16,4 Z');
|
9558 |
|
9559 |
|
9560 | marker.append('path').attr('fill', 'none').attr('stroke', '#000000').style('stroke-dasharray', '0, 0').attr('stroke-width', '1px').attr('d', 'M 0,1 L 6,7 M 6,1 L 0,7');
|
9561 |
|
9562 | };
|
9563 |
|
9564 | exports.getTextObj = function () {
|
9565 | var txt = {
|
9566 | x: 0,
|
9567 | y: 0,
|
9568 | 'fill': 'black',
|
9569 | 'text-anchor': 'start',
|
9570 | style: '#666',
|
9571 | width: 100,
|
9572 | height: 100,
|
9573 | textMargin: 0,
|
9574 | rx: 0,
|
9575 | ry: 0
|
9576 | };
|
9577 | return txt;
|
9578 | };
|
9579 |
|
9580 | exports.getNoteRect = function () {
|
9581 | var rect = {
|
9582 | x: 0,
|
9583 | y: 0,
|
9584 | fill: '#EDF2AE',
|
9585 | stroke: '#666',
|
9586 | width: 100,
|
9587 | anchor: 'start',
|
9588 | height: 100,
|
9589 | rx: 0,
|
9590 | ry: 0
|
9591 | };
|
9592 | return rect;
|
9593 | };
|
9594 |
|
9595 | var _drawTextCandidateFunc = function () {
|
9596 | function byText(content, g, x, y, width, height, textAttrs) {
|
9597 | var text = g.append('text').attr('x', x + width / 2).attr('y', y + height / 2 + 5).style('text-anchor', 'middle').text(content);
|
9598 | _setTextAttrs(text, textAttrs);
|
9599 | }
|
9600 |
|
9601 | function byTspan(content, g, x, y, width, height, textAttrs) {
|
9602 | var text = g.append('text').attr('x', x + width / 2).attr('y', y).style('text-anchor', 'middle');
|
9603 | text.append('tspan').attr('x', x + width / 2).attr('dy', '0').text(content);
|
9604 |
|
9605 | if (typeof text.textwrap !== 'undefined') {
|
9606 | text.textwrap({
|
9607 | x: x + width / 2, y: y, width: width, height: height
|
9608 | }, 0);
|
9609 |
|
9610 | var tspans = text.selectAll('tspan');
|
9611 | if (tspans.length > 0 && tspans[0].length > 0) {
|
9612 | tspans = tspans[0];
|
9613 |
|
9614 | text.attr('y', y + (height / 2.0 - text[0][0].getBBox().height * (1 - 1.0 / tspans.length) / 2.0)).attr('dominant-baseline', 'central').attr('alignment-baseline', 'central');
|
9615 | }
|
9616 | }
|
9617 | _setTextAttrs(text, textAttrs);
|
9618 | }
|
9619 |
|
9620 | function byFo(content, g, x, y, width, height, textAttrs) {
|
9621 | var s = g.append('switch');
|
9622 | var f = s.append('foreignObject').attr('x', x).attr('y', y).attr('width', width).attr('height', height);
|
9623 |
|
9624 | var text = f.append('div').style('display', 'table').style('height', '100%').style('width', '100%');
|
9625 |
|
9626 | text.append('div').style('display', 'table-cell').style('text-align', 'center').style('vertical-align', 'middle').text(content);
|
9627 |
|
9628 | byTspan(content, s, x, y, width, height, textAttrs);
|
9629 | _setTextAttrs(text, textAttrs);
|
9630 | }
|
9631 |
|
9632 | function _setTextAttrs(toText, fromTextAttrsDict) {
|
9633 | for (var key in fromTextAttrsDict) {
|
9634 | if (fromTextAttrsDict.hasOwnProperty(key)) {
|
9635 | toText.attr(key, fromTextAttrsDict[key]);
|
9636 | }
|
9637 | }
|
9638 | }
|
9639 |
|
9640 | return function (conf) {
|
9641 | return conf.textPlacement === 'fo' ? byFo : conf.textPlacement === 'old' ? byText : byTspan;
|
9642 | };
|
9643 | }();
|
9644 |
|
9645 | }),
|
9646 |
|
9647 | (function(module, exports, __webpack_require__) {
|
9648 |
|
9649 | "use strict";
|
9650 |
|
9651 |
|
9652 |
|
9653 |
|
9654 |
|
9655 | var db = __webpack_require__(11);
|
9656 | var exampleParser = __webpack_require__(12);
|
9657 | var d3 = __webpack_require__(1);
|
9658 |
|
9659 | var Logger = __webpack_require__(0);
|
9660 | var log = Logger.Log;
|
9661 |
|
9662 |
|
9663 |
|
9664 |
|
9665 |
|
9666 |
|
9667 | exports.draw = function (txt, id, ver) {
|
9668 | var parser;
|
9669 | parser = exampleParser.parser;
|
9670 | parser.yy = db;
|
9671 | log.debug('Renering example diagram');
|
9672 |
|
9673 | parser.parse(txt);
|
9674 |
|
9675 |
|
9676 | var svg = d3.select('#' + id);
|
9677 |
|
9678 | var g = svg.append('g');
|
9679 |
|
9680 | g.append('text')
|
9681 | .attr('x', 100).attr('y', 40).attr('class', 'version').attr('font-size', '32px').style('text-anchor', 'middle').text('mermaid ' + ver);
|
9682 |
|
9683 | svg.attr('height', 100);
|
9684 | svg.attr('width', 400);
|
9685 | };
|
9686 |
|
9687 | }),
|
9688 |
|
9689 | (function(module, exports, __webpack_require__) {
|
9690 |
|
9691 | "use strict";
|
9692 |
|
9693 |
|
9694 | var gantt = __webpack_require__(13).parser;
|
9695 | gantt.yy = __webpack_require__(14);
|
9696 | var d3 = __webpack_require__(1);
|
9697 | var moment = __webpack_require__(15);
|
9698 |
|
9699 | var daysInChart;
|
9700 | var conf = {
|
9701 | titleTopMargin: 25,
|
9702 | barHeight: 20,
|
9703 | barGap: 4,
|
9704 | topPadding: 50,
|
9705 | rightPadding: 75,
|
9706 | leftPadding: 75,
|
9707 | gridLineStartPadding: 35,
|
9708 | fontSize: 11,
|
9709 | fontFamily: '"Open-Sans", "sans-serif"'
|
9710 | };
|
9711 | module.exports.setConf = function (cnf) {
|
9712 | var keys = Object.keys(cnf);
|
9713 |
|
9714 | keys.forEach(function (key) {
|
9715 | conf[key] = cnf[key];
|
9716 | });
|
9717 | };
|
9718 | var w;
|
9719 | module.exports.draw = function (text, id) {
|
9720 | gantt.yy.clear();
|
9721 | gantt.parse(text);
|
9722 |
|
9723 | var elem = document.getElementById(id);
|
9724 | w = elem.parentElement.offsetWidth;
|
9725 |
|
9726 | if (typeof w === 'undefined') {
|
9727 | w = 1200;
|
9728 | }
|
9729 |
|
9730 | if (typeof conf.useWidth !== 'undefined') {
|
9731 | w = conf.useWidth;
|
9732 | }
|
9733 |
|
9734 | var taskArray = gantt.yy.getTasks();
|
9735 |
|
9736 |
|
9737 | var h = taskArray.length * (conf.barHeight + conf.barGap) + 2 * conf.topPadding;
|
9738 |
|
9739 | elem.setAttribute('height', '100%');
|
9740 |
|
9741 | elem.setAttribute('viewBox', '0 0 ' + w + ' ' + h);
|
9742 | var svg = d3.select('#' + id);
|
9743 |
|
9744 | var startDate = d3.min(taskArray, function (d) {
|
9745 | return d.startTime;
|
9746 | });
|
9747 | var endDate = d3.max(taskArray, function (d) {
|
9748 | return d.endTime;
|
9749 | });
|
9750 |
|
9751 |
|
9752 | var timeScale = d3.time.scale().domain([d3.min(taskArray, function (d) {
|
9753 | return d.startTime;
|
9754 | }), d3.max(taskArray, function (d) {
|
9755 | return d.endTime;
|
9756 | })]).rangeRound([0, w - conf.leftPadding - conf.rightPadding]);
|
9757 |
|
9758 | var categories = [];
|
9759 |
|
9760 | daysInChart = moment.duration(endDate - startDate).asDays();
|
9761 |
|
9762 | for (var i = 0; i < taskArray.length; i++) {
|
9763 | categories.push(taskArray[i].type);
|
9764 | }
|
9765 |
|
9766 | var catsUnfiltered = categories;
|
9767 |
|
9768 | categories = checkUnique(categories);
|
9769 |
|
9770 | makeGant(taskArray, w, h);
|
9771 | if (typeof conf.useWidth !== 'undefined') {
|
9772 | elem.setAttribute('width', w);
|
9773 | }
|
9774 |
|
9775 | svg.append('text').text(gantt.yy.getTitle()).attr('x', w / 2).attr('y', conf.titleTopMargin).attr('class', 'titleText');
|
9776 |
|
9777 | function makeGant(tasks, pageWidth, pageHeight) {
|
9778 | var barHeight = conf.barHeight;
|
9779 | var gap = barHeight + conf.barGap;
|
9780 | var topPadding = conf.topPadding;
|
9781 | var leftPadding = conf.leftPadding;
|
9782 |
|
9783 | var colorScale = d3.scale.linear().domain([0, categories.length]).range(['#00B9FA', '#F95002']).interpolate(d3.interpolateHcl);
|
9784 |
|
9785 | makeGrid(leftPadding, topPadding, pageWidth, pageHeight);
|
9786 | drawRects(tasks, gap, topPadding, leftPadding, barHeight, colorScale, pageWidth, pageHeight);
|
9787 | vertLabels(gap, topPadding, leftPadding, barHeight, colorScale);
|
9788 | drawToday(leftPadding, topPadding, pageWidth, pageHeight);
|
9789 | }
|
9790 |
|
9791 | function drawRects(theArray, theGap, theTopPad, theSidePad, theBarHeight, theColorScale, w, h) {
|
9792 | svg.append('g').selectAll('rect').data(theArray).enter().append('rect').attr('x', 0).attr('y', function (d, i) {
|
9793 | return i * theGap + theTopPad - 2;
|
9794 | }).attr('width', function () {
|
9795 | return w - conf.rightPadding / 2;
|
9796 | }).attr('height', theGap).attr('class', function (d) {
|
9797 | for (var i = 0; i < categories.length; i++) {
|
9798 | if (d.type === categories[i]) {
|
9799 | return 'section section' + i % conf.numberSectionStyles;
|
9800 | }
|
9801 | }
|
9802 | return 'section section0';
|
9803 | });
|
9804 |
|
9805 | var rectangles = svg.append('g').selectAll('rect').data(theArray).enter();
|
9806 |
|
9807 | rectangles.append('rect').attr('rx', 3).attr('ry', 3).attr('x', function (d) {
|
9808 | return timeScale(d.startTime) + theSidePad;
|
9809 | }).attr('y', function (d, i) {
|
9810 | return i * theGap + theTopPad;
|
9811 | }).attr('width', function (d) {
|
9812 | return timeScale(d.endTime) - timeScale(d.startTime);
|
9813 | }).attr('height', theBarHeight).attr('class', function (d) {
|
9814 | var res = 'task ';
|
9815 |
|
9816 | var secNum = 0;
|
9817 | for (var i = 0; i < categories.length; i++) {
|
9818 | if (d.type === categories[i]) {
|
9819 | secNum = i % conf.numberSectionStyles;
|
9820 | }
|
9821 | }
|
9822 |
|
9823 | if (d.active) {
|
9824 | if (d.crit) {
|
9825 | return res + ' activeCrit' + secNum;
|
9826 | } else {
|
9827 | return res + ' active' + secNum;
|
9828 | }
|
9829 | }
|
9830 |
|
9831 | if (d.done) {
|
9832 | if (d.crit) {
|
9833 | return res + ' doneCrit' + secNum;
|
9834 | } else {
|
9835 | return res + ' done' + secNum;
|
9836 | }
|
9837 | }
|
9838 |
|
9839 | if (d.crit) {
|
9840 | return res + ' crit' + secNum;
|
9841 | }
|
9842 |
|
9843 | return res + ' task' + secNum;
|
9844 | });
|
9845 |
|
9846 | rectangles.append('text').text(function (d) {
|
9847 | return d.task;
|
9848 | }).attr('font-size', conf.fontSize).attr('x', function (d) {
|
9849 | var startX = timeScale(d.startTime);
|
9850 | var endX = timeScale(d.endTime);
|
9851 | var textWidth = this.getBBox().width;
|
9852 |
|
9853 |
|
9854 | if (textWidth > endX - startX) {
|
9855 | if (endX + textWidth + 1.5 * conf.leftPadding > w) {
|
9856 | return startX + theSidePad - 5;
|
9857 | } else {
|
9858 | return endX + theSidePad + 5;
|
9859 | }
|
9860 | } else {
|
9861 | return (endX - startX) / 2 + startX + theSidePad;
|
9862 | }
|
9863 | }).attr('y', function (d, i) {
|
9864 | return i * theGap + conf.barHeight / 2 + (conf.fontSize / 2 - 2) + theTopPad;
|
9865 | }).attr('text-height', theBarHeight).attr('class', function (d) {
|
9866 | var startX = timeScale(d.startTime);
|
9867 | var endX = timeScale(d.endTime);
|
9868 | var textWidth = this.getBBox().width;
|
9869 | var secNum = 0;
|
9870 | for (var i = 0; i < categories.length; i++) {
|
9871 | if (d.type === categories[i]) {
|
9872 | secNum = i % conf.numberSectionStyles;
|
9873 | }
|
9874 | }
|
9875 |
|
9876 | var taskType = '';
|
9877 | if (d.active) {
|
9878 | if (d.crit) {
|
9879 | taskType = 'activeCritText' + secNum;
|
9880 | } else {
|
9881 | taskType = 'activeText' + secNum;
|
9882 | }
|
9883 | }
|
9884 |
|
9885 | if (d.done) {
|
9886 | if (d.crit) {
|
9887 | taskType = taskType + ' doneCritText' + secNum;
|
9888 | } else {
|
9889 | taskType = taskType + ' doneText' + secNum;
|
9890 | }
|
9891 | } else {
|
9892 | if (d.crit) {
|
9893 | taskType = taskType + ' critText' + secNum;
|
9894 | }
|
9895 | }
|
9896 |
|
9897 |
|
9898 | if (textWidth > endX - startX) {
|
9899 | if (endX + textWidth + 1.5 * conf.leftPadding > w) {
|
9900 | return 'taskTextOutsideLeft taskTextOutside' + secNum + ' ' + taskType;
|
9901 | } else {
|
9902 | return 'taskTextOutsideRight taskTextOutside' + secNum + ' ' + taskType;
|
9903 | }
|
9904 | } else {
|
9905 | return 'taskText taskText' + secNum + ' ' + taskType;
|
9906 | }
|
9907 | });
|
9908 | }
|
9909 |
|
9910 | function makeGrid(theSidePad, theTopPad, w, h) {
|
9911 | var pre = [['.%L', function (d) {
|
9912 | return d.getMilliseconds();
|
9913 | }], [':%S', function (d) {
|
9914 | return d.getSeconds();
|
9915 | }],
|
9916 |
|
9917 | ['h1 %I:%M', function (d) {
|
9918 | return d.getMinutes();
|
9919 | }]];
|
9920 | var post = [['%Y', function () {
|
9921 | return true;
|
9922 | }]];
|
9923 |
|
9924 | var mid = [
|
9925 |
|
9926 | ['%I:%M', function (d) {
|
9927 | return d.getHours();
|
9928 | }],
|
9929 |
|
9930 | ['%a %d', function (d) {
|
9931 | return d.getDay() && d.getDate() !== 1;
|
9932 | }],
|
9933 |
|
9934 | ['%b %d', function (d) {
|
9935 | return d.getDate() !== 1;
|
9936 | }],
|
9937 |
|
9938 | ['%B', function (d) {
|
9939 | return d.getMonth();
|
9940 | }]];
|
9941 | var formatter;
|
9942 | if (typeof conf.axisFormatter !== 'undefined') {
|
9943 | mid = [];
|
9944 | conf.axisFormatter.forEach(function (item) {
|
9945 | var n = [];
|
9946 | n[0] = item[0];
|
9947 | n[1] = item[1];
|
9948 | mid.push(n);
|
9949 | });
|
9950 | }
|
9951 | formatter = pre.concat(mid).concat(post);
|
9952 |
|
9953 | var xAxis = d3.svg.axis().scale(timeScale).orient('bottom').tickSize(-h + theTopPad + conf.gridLineStartPadding, 0, 0).tickFormat(d3.time.format.multi(formatter));
|
9954 |
|
9955 | if (daysInChart > 7 && daysInChart < 230) {
|
9956 | xAxis = xAxis.ticks(d3.time.monday.range);
|
9957 | }
|
9958 |
|
9959 | 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');
|
9960 | }
|
9961 |
|
9962 | function vertLabels(theGap, theTopPad) {
|
9963 | var numOccurances = [];
|
9964 | var prevGap = 0;
|
9965 |
|
9966 | for (var i = 0; i < categories.length; i++) {
|
9967 | numOccurances[i] = [categories[i], getCount(categories[i], catsUnfiltered)];
|
9968 | }
|
9969 |
|
9970 | svg.append('g')
|
9971 | .selectAll('text').data(numOccurances).enter().append('text').text(function (d) {
|
9972 | return d[0];
|
9973 | }).attr('x', 10).attr('y', function (d, i) {
|
9974 | if (i > 0) {
|
9975 | for (var j = 0; j < i; j++) {
|
9976 | prevGap += numOccurances[i - 1][1];
|
9977 | return d[1] * theGap / 2 + prevGap * theGap + theTopPad;
|
9978 | }
|
9979 | } else {
|
9980 | return d[1] * theGap / 2 + theTopPad;
|
9981 | }
|
9982 | }).attr('class', function (d) {
|
9983 | for (var i = 0; i < categories.length; i++) {
|
9984 | if (d[0] === categories[i]) {
|
9985 | return 'sectionTitle sectionTitle' + i % conf.numberSectionStyles;
|
9986 | }
|
9987 | }
|
9988 | return 'sectionTitle';
|
9989 | });
|
9990 | }
|
9991 |
|
9992 | function drawToday(theSidePad, theTopPad, w, h) {
|
9993 | var todayG = svg.append('g').attr('class', 'today');
|
9994 |
|
9995 | var today = new Date();
|
9996 |
|
9997 | todayG.append('line').attr('x1', timeScale(today) + theSidePad).attr('x2', timeScale(today) + theSidePad).attr('y1', conf.titleTopMargin).attr('y2', h - conf.titleTopMargin).attr('class', 'today');
|
9998 | }
|
9999 |
|
10000 |
|
10001 | function checkUnique(arr) {
|
10002 | var hash = {};
|
10003 | var result = [];
|
10004 | for (var i = 0, l = arr.length; i < l; ++i) {
|
10005 | if (!hash.hasOwnProperty(arr[i])) {
|
10006 |
|
10007 | hash[arr[i]] = true;
|
10008 | result.push(arr[i]);
|
10009 | }
|
10010 | }
|
10011 | return result;
|
10012 | }
|
10013 |
|
10014 |
|
10015 | function getCounts(arr) {
|
10016 | var i = arr.length;
|
10017 | var obj = {};
|
10018 | while (i) {
|
10019 | obj[arr[--i]] = (obj[arr[i]] || 0) + 1;
|
10020 | }
|
10021 | return obj;
|
10022 | }
|
10023 |
|
10024 |
|
10025 | function getCount(word, arr) {
|
10026 | return getCounts(arr)[word] || 0;
|
10027 | }
|
10028 | };
|
10029 |
|
10030 | }),
|
10031 |
|
10032 | (function(module, exports, __webpack_require__) {
|
10033 |
|
10034 | "use strict";
|
10035 |
|
10036 |
|
10037 |
|
10038 |
|
10039 |
|
10040 |
|
10041 | var cd = __webpack_require__(16).parser;
|
10042 | var cDDb = __webpack_require__(17);
|
10043 | cd.yy = cDDb;
|
10044 | var d3 = __webpack_require__(1);
|
10045 | var Logger = __webpack_require__(0);
|
10046 | var log = Logger.Log;
|
10047 | var dagre = __webpack_require__(30);
|
10048 |
|
10049 | var idCache;
|
10050 | idCache = {};
|
10051 |
|
10052 | var classCnt = 0;
|
10053 | var conf = {
|
10054 | dividerMargin: 10,
|
10055 | padding: 5,
|
10056 | textHeight: 10
|
10057 |
|
10058 |
|
10059 | };var getGraphId = function getGraphId(label) {
|
10060 | var keys = Object.keys(idCache);
|
10061 |
|
10062 | var i;
|
10063 | for (i = 0; i < keys.length; i++) {
|
10064 | if (idCache[keys[i]].label === label) {
|
10065 | return keys[i];
|
10066 | }
|
10067 | }
|
10068 |
|
10069 | return undefined;
|
10070 | };
|
10071 |
|
10072 |
|
10073 |
|
10074 |
|
10075 | var insertMarkers = function insertMarkers(elem) {
|
10076 | elem.append('defs').append('marker').attr('id', 'extensionStart').attr('class', 'extension').attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 1,7 L18,13 V 1 Z');
|
10077 |
|
10078 | elem.append('defs').append('marker').attr('id', 'extensionEnd').attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 1,1 V 13 L18,7 Z');
|
10079 |
|
10080 | elem.append('defs').append('marker').attr('id', 'compositionStart').attr('class', 'extension').attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');
|
10081 |
|
10082 | elem.append('defs').append('marker').attr('id', 'compositionEnd').attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');
|
10083 |
|
10084 | elem.append('defs').append('marker').attr('id', 'aggregationStart').attr('class', 'extension').attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');
|
10085 |
|
10086 | elem.append('defs').append('marker').attr('id', 'aggregationEnd').attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');
|
10087 |
|
10088 | elem.append('defs').append('marker').attr('id', 'dependencyStart').attr('class', 'extension').attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 5,7 L9,13 L1,7 L9,1 Z');
|
10089 |
|
10090 | elem.append('defs').append('marker').attr('id', 'dependencyEnd').attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L14,7 L9,1 Z');
|
10091 | };
|
10092 |
|
10093 | var edgeCount = 0;
|
10094 | var drawEdge = function drawEdge(elem, path, relation) {
|
10095 | var getRelationType = function getRelationType(type) {
|
10096 | switch (type) {
|
10097 | case cDDb.relationType.AGGREGATION:
|
10098 | return 'aggregation';
|
10099 | case cDDb.relationType.EXTENSION:
|
10100 | return 'extension';
|
10101 | case cDDb.relationType.COMPOSITION:
|
10102 | return 'composition';
|
10103 | case cDDb.relationType.DEPENDENCY:
|
10104 | return 'dependency';
|
10105 | }
|
10106 | };
|
10107 |
|
10108 |
|
10109 | var lineData = path.points;
|
10110 |
|
10111 |
|
10112 | var lineFunction = d3.svg.line().x(function (d) {
|
10113 | return d.x;
|
10114 | }).y(function (d) {
|
10115 | return d.y;
|
10116 | }).interpolate('basis');
|
10117 |
|
10118 | var svgPath = elem.append('path').attr('d', lineFunction(lineData)).attr('id', 'edge' + edgeCount).attr('class', 'relation');
|
10119 | var url = '';
|
10120 | if (conf.arrowMarkerAbsolute) {
|
10121 | url = window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search;
|
10122 | url = url.replace(/\(/g, '\\(');
|
10123 | url = url.replace(/\)/g, '\\)');
|
10124 | }
|
10125 |
|
10126 | if (relation.relation.type1 !== 'none') {
|
10127 | svgPath.attr('marker-start', 'url(' + url + '#' + getRelationType(relation.relation.type1) + 'Start' + ')');
|
10128 | }
|
10129 | if (relation.relation.type2 !== 'none') {
|
10130 | svgPath.attr('marker-end', 'url(' + url + '#' + getRelationType(relation.relation.type2) + 'End' + ')');
|
10131 | }
|
10132 |
|
10133 | var x, y;
|
10134 | var l = path.points.length;
|
10135 | if (l % 2 !== 0) {
|
10136 | var p1 = path.points[Math.floor(l / 2)];
|
10137 | var p2 = path.points[Math.ceil(l / 2)];
|
10138 | x = (p1.x + p2.x) / 2;
|
10139 | y = (p1.y + p2.y) / 2;
|
10140 | } else {
|
10141 | var p = path.points[Math.floor(l / 2)];
|
10142 | x = p.x;
|
10143 | y = p.y;
|
10144 | }
|
10145 |
|
10146 | if (typeof relation.title !== 'undefined') {
|
10147 | var g = elem.append('g').attr('class', 'classLabel');
|
10148 | var label = g.append('text').attr('class', 'label').attr('x', x).attr('y', y).attr('fill', 'red').attr('text-anchor', 'middle').text(relation.title);
|
10149 |
|
10150 | window.label = label;
|
10151 | var bounds = label.node().getBBox();
|
10152 |
|
10153 | g.insert('rect', ':first-child').attr('class', 'box').attr('x', bounds.x - conf.padding / 2).attr('y', bounds.y - conf.padding / 2).attr('width', bounds.width + conf.padding).attr('height', bounds.height + conf.padding);
|
10154 | }
|
10155 |
|
10156 | edgeCount++;
|
10157 | };
|
10158 |
|
10159 | var drawClass = function drawClass(elem, classDef) {
|
10160 | log.info('Rendering class ' + classDef);
|
10161 |
|
10162 | var addTspan = function addTspan(textEl, txt, isFirst) {
|
10163 | var tSpan = textEl.append('tspan').attr('x', conf.padding).text(txt);
|
10164 | if (!isFirst) {
|
10165 | tSpan.attr('dy', conf.textHeight);
|
10166 | }
|
10167 | };
|
10168 |
|
10169 | var id = 'classId' + classCnt;
|
10170 | var classInfo = {
|
10171 | id: id,
|
10172 | label: classDef.id,
|
10173 | width: 0,
|
10174 | height: 0
|
10175 | };
|
10176 |
|
10177 | var g = elem.append('g').attr('id', id).attr('class', 'classGroup');
|
10178 | var title = g.append('text').attr('x', conf.padding).attr('y', conf.textHeight + conf.padding).text(classDef.id);
|
10179 |
|
10180 | var titleHeight = title.node().getBBox().height;
|
10181 |
|
10182 | var membersLine = g.append('line')
|
10183 | .attr('x1', 0).attr('y1', conf.padding + titleHeight + conf.dividerMargin / 2).attr('y2', conf.padding + titleHeight + conf.dividerMargin / 2);
|
10184 |
|
10185 | var members = g.append('text')
|
10186 | .attr('x', conf.padding).attr('y', titleHeight + conf.dividerMargin + conf.textHeight).attr('fill', 'white').attr('class', 'classText');
|
10187 |
|
10188 | var isFirst = true;
|
10189 |
|
10190 | classDef.members.forEach(function (member) {
|
10191 | addTspan(members, member, isFirst);
|
10192 | isFirst = false;
|
10193 | });
|
10194 |
|
10195 | var membersBox = members.node().getBBox();
|
10196 |
|
10197 | var methodsLine = g.append('line')
|
10198 | .attr('x1', 0).attr('y1', conf.padding + titleHeight + conf.dividerMargin + membersBox.height).attr('y2', conf.padding + titleHeight + conf.dividerMargin + membersBox.height);
|
10199 |
|
10200 | var methods = g.append('text')
|
10201 | .attr('x', conf.padding).attr('y', titleHeight + 2 * conf.dividerMargin + membersBox.height + conf.textHeight).attr('fill', 'white').attr('class', 'classText');
|
10202 |
|
10203 | isFirst = true;
|
10204 |
|
10205 | classDef.methods.forEach(function (method) {
|
10206 | addTspan(methods, method, isFirst);
|
10207 | isFirst = false;
|
10208 | });
|
10209 |
|
10210 | var classBox = g.node().getBBox();
|
10211 | g.insert('rect', ':first-child').attr('x', 0).attr('y', 0).attr('width', classBox.width + 2 * conf.padding).attr('height', classBox.height + conf.padding + 0.5 * conf.dividerMargin);
|
10212 |
|
10213 | membersLine.attr('x2', classBox.width + 2 * conf.padding);
|
10214 | methodsLine.attr('x2', classBox.width + 2 * conf.padding);
|
10215 |
|
10216 | classInfo.width = classBox.width + 2 * conf.padding;
|
10217 | classInfo.height = classBox.height + conf.padding + 0.5 * conf.dividerMargin;
|
10218 |
|
10219 | idCache[id] = classInfo;
|
10220 | classCnt++;
|
10221 | return classInfo;
|
10222 | };
|
10223 |
|
10224 | module.exports.setConf = function (cnf) {
|
10225 | var keys = Object.keys(cnf);
|
10226 |
|
10227 | keys.forEach(function (key) {
|
10228 | conf[key] = cnf[key];
|
10229 | });
|
10230 | };
|
10231 |
|
10232 |
|
10233 |
|
10234 |
|
10235 |
|
10236 | module.exports.draw = function (text, id) {
|
10237 | cd.yy.clear();
|
10238 | cd.parse(text);
|
10239 |
|
10240 | log.info('Rendering diagram ' + text);
|
10241 |
|
10242 |
|
10243 | var diagram = d3.select('#' + id);
|
10244 | insertMarkers(diagram);
|
10245 |
|
10246 |
|
10247 | var g = new dagre.graphlib.Graph({
|
10248 | multigraph: true
|
10249 | });
|
10250 |
|
10251 |
|
10252 | g.setGraph({
|
10253 | isMultiGraph: true
|
10254 | });
|
10255 |
|
10256 |
|
10257 | g.setDefaultEdgeLabel(function () {
|
10258 | return {};
|
10259 | });
|
10260 |
|
10261 | var classes = cDDb.getClasses();
|
10262 | var keys = Object.keys(classes);
|
10263 | var i;
|
10264 | for (i = 0; i < keys.length; i++) {
|
10265 | var classDef = classes[keys[i]];
|
10266 | var node = drawClass(diagram, classDef);
|
10267 |
|
10268 |
|
10269 |
|
10270 | g.setNode(node.id, node);
|
10271 | log.info('Org height: ' + node.height);
|
10272 | }
|
10273 |
|
10274 | var relations = cDDb.getRelations();
|
10275 | relations.forEach(function (relation) {
|
10276 | log.info('tjoho' + getGraphId(relation.id1) + getGraphId(relation.id2) + JSON.stringify(relation));
|
10277 | g.setEdge(getGraphId(relation.id1), getGraphId(relation.id2), { relation: relation });
|
10278 | });
|
10279 | dagre.layout(g);
|
10280 | g.nodes().forEach(function (v) {
|
10281 | if (typeof v !== 'undefined') {
|
10282 | log.debug('Node ' + v + ': ' + JSON.stringify(g.node(v)));
|
10283 | d3.select('#' + v).attr('transform', 'translate(' + (g.node(v).x - g.node(v).width / 2) + ',' + (g.node(v).y - g.node(v).height / 2) + ' )');
|
10284 | }
|
10285 | });
|
10286 | g.edges().forEach(function (e) {
|
10287 | log.debug('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(g.edge(e)));
|
10288 | drawEdge(diagram, g.edge(e), g.edge(e).relation);
|
10289 | });
|
10290 |
|
10291 | diagram.attr('height', '100%');
|
10292 | diagram.attr('width', '100%');
|
10293 | diagram.attr('viewBox', '0 0 ' + (g.graph().width + 20) + ' ' + (g.graph().height + 20));
|
10294 | };
|
10295 |
|
10296 | }),
|
10297 |
|
10298 | (function(module, exports) {
|
10299 |
|
10300 | module.exports = require("dagre-layout");
|
10301 |
|
10302 | }),
|
10303 |
|
10304 | (function(module, exports, __webpack_require__) {
|
10305 |
|
10306 | "use strict";
|
10307 |
|
10308 |
|
10309 | var _lodash = __webpack_require__(19);
|
10310 |
|
10311 | var _lodash2 = _interopRequireDefault(_lodash);
|
10312 |
|
10313 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
10314 |
|
10315 | var db = __webpack_require__(20);
|
10316 | var gitGraphParser = __webpack_require__(18);
|
10317 | var d3 = __webpack_require__(1);
|
10318 | var Logger = __webpack_require__(0);
|
10319 | var log = Logger.Log;
|
10320 |
|
10321 | var allCommitsDict = {};
|
10322 | var branchNum;
|
10323 | var config = {
|
10324 | nodeSpacing: 150,
|
10325 | nodeFillColor: 'yellow',
|
10326 | nodeStrokeWidth: 2,
|
10327 | nodeStrokeColor: 'grey',
|
10328 | lineStrokeWidth: 4,
|
10329 | branchOffset: 50,
|
10330 | lineColor: 'grey',
|
10331 | leftMargin: 50,
|
10332 | branchColors: ['#442f74', '#983351', '#609732', '#AA9A39'],
|
10333 | nodeRadius: 10,
|
10334 | nodeLabel: {
|
10335 | width: 75,
|
10336 | height: 100,
|
10337 | x: -25,
|
10338 | y: 0
|
10339 | }
|
10340 | };
|
10341 | var apiConfig = {};
|
10342 | exports.setConf = function (c) {
|
10343 | apiConfig = c;
|
10344 | };
|
10345 |
|
10346 | function svgCreateDefs(svg) {
|
10347 | svg.append('defs').append('g').attr('id', 'def-commit').append('circle').attr('r', config.nodeRadius).attr('cx', 0).attr('cy', 0);
|
10348 | svg.select('#def-commit').append('foreignObject').attr('width', config.nodeLabel.width).attr('height', config.nodeLabel.height).attr('x', config.nodeLabel.x).attr('y', config.nodeLabel.y).attr('class', 'node-label').attr('requiredFeatures', 'http://www.w3.org/TR/SVG11/feature#Extensibility').append('xhtml:p').html('');
|
10349 | }
|
10350 |
|
10351 | function svgDrawLine(svg, points, colorIdx, interpolate) {
|
10352 | interpolate = interpolate || 'basis';
|
10353 | var color = config.branchColors[colorIdx % config.branchColors.length];
|
10354 | var lineGen = d3.svg.line().x(function (d) {
|
10355 | return Math.round(d.x);
|
10356 | }).y(function (d) {
|
10357 | return Math.round(d.y);
|
10358 | }).interpolate(interpolate);
|
10359 |
|
10360 | svg.append('svg:path').attr('d', lineGen(points)).style('stroke', color).style('stroke-width', config.lineStrokeWidth).style('fill', 'none');
|
10361 | }
|
10362 |
|
10363 | function getElementCoords(element, coords) {
|
10364 | coords = coords || element.node().getBBox();
|
10365 | var ctm = element.node().getCTM();
|
10366 | var xn = ctm.e + coords.x * ctm.a;
|
10367 | var yn = ctm.f + coords.y * ctm.d;
|
10368 | return {
|
10369 | left: xn,
|
10370 | top: yn,
|
10371 | width: coords.width,
|
10372 | height: coords.height
|
10373 | };
|
10374 | }
|
10375 |
|
10376 | function svgDrawLineForCommits(svg, fromId, toId, direction, color) {
|
10377 | log.debug('svgDrawLineForCommits: ', fromId, toId);
|
10378 | var fromBbox = getElementCoords(svg.select('#node-' + fromId + ' circle'));
|
10379 | var toBbox = getElementCoords(svg.select('#node-' + toId + ' circle'));
|
10380 | switch (direction) {
|
10381 | case 'LR':
|
10382 |
|
10383 |
|
10384 |
|
10385 | if (fromBbox.left - toBbox.left > config.nodeSpacing) {
|
10386 | var lineStart = { x: fromBbox.left - config.nodeSpacing, y: toBbox.top + toBbox.height / 2 };
|
10387 | var lineEnd = { x: toBbox.left + toBbox.width, y: toBbox.top + toBbox.height / 2 };
|
10388 | svgDrawLine(svg, [lineStart, lineEnd], color, 'linear');
|
10389 | svgDrawLine(svg, [{ x: fromBbox.left, y: fromBbox.top + fromBbox.height / 2 }, { x: fromBbox.left - config.nodeSpacing / 2, y: fromBbox.top + fromBbox.height / 2 }, { x: fromBbox.left - config.nodeSpacing / 2, y: lineStart.y }, lineStart], color);
|
10390 | } else {
|
10391 | svgDrawLine(svg, [{
|
10392 | 'x': fromBbox.left,
|
10393 | 'y': fromBbox.top + fromBbox.height / 2
|
10394 | }, {
|
10395 | 'x': fromBbox.left - config.nodeSpacing / 2,
|
10396 | 'y': fromBbox.top + fromBbox.height / 2
|
10397 | }, {
|
10398 | 'x': fromBbox.left - config.nodeSpacing / 2,
|
10399 | 'y': toBbox.top + toBbox.height / 2
|
10400 | }, {
|
10401 | 'x': toBbox.left + toBbox.width,
|
10402 | 'y': toBbox.top + toBbox.height / 2
|
10403 | }], color);
|
10404 | }
|
10405 | break;
|
10406 | case 'BT':
|
10407 |
|
10408 |
|
10409 |
|
10410 |
|
10411 | if (toBbox.top - fromBbox.top > config.nodeSpacing) {
|
10412 | lineStart = { x: toBbox.left + toBbox.width / 2, y: fromBbox.top + fromBbox.height + config.nodeSpacing };
|
10413 | lineEnd = { x: toBbox.left + toBbox.width / 2, y: toBbox.top };
|
10414 | svgDrawLine(svg, [lineStart, lineEnd], color, 'linear');
|
10415 | svgDrawLine(svg, [{ x: fromBbox.left + fromBbox.width / 2, y: fromBbox.top + fromBbox.height }, { x: fromBbox.left + fromBbox.width / 2, y: fromBbox.top + fromBbox.height + config.nodeSpacing / 2 }, { x: toBbox.left + toBbox.width / 2, y: lineStart.y - config.nodeSpacing / 2 }, lineStart], color);
|
10416 | } else {
|
10417 | svgDrawLine(svg, [{
|
10418 | 'x': fromBbox.left + fromBbox.width / 2,
|
10419 | 'y': fromBbox.top + fromBbox.height
|
10420 | }, {
|
10421 | 'x': fromBbox.left + fromBbox.width / 2,
|
10422 | 'y': fromBbox.top + config.nodeSpacing / 2
|
10423 | }, {
|
10424 | 'x': toBbox.left + toBbox.width / 2,
|
10425 | 'y': toBbox.top - config.nodeSpacing / 2
|
10426 | }, {
|
10427 | 'x': toBbox.left + toBbox.width / 2,
|
10428 | 'y': toBbox.top
|
10429 | }], color);
|
10430 | }
|
10431 | break;
|
10432 | }
|
10433 | }
|
10434 |
|
10435 | function cloneNode(svg, selector) {
|
10436 | return svg.select(selector).node().cloneNode(true);
|
10437 | }
|
10438 |
|
10439 | function renderCommitHistory(svg, commitid, branches, direction) {
|
10440 | var commit;
|
10441 | var numCommits = Object.keys(allCommitsDict).length;
|
10442 | if (_lodash2.default.isString(commitid)) {
|
10443 | do {
|
10444 | commit = allCommitsDict[commitid];
|
10445 | log.debug('in renderCommitHistory', commit.id, commit.seq);
|
10446 | if (svg.select('#node-' + commitid).size() > 0) {
|
10447 | return;
|
10448 | }
|
10449 | svg.append(function () {
|
10450 | return cloneNode(svg, '#def-commit');
|
10451 | }).attr('class', 'commit').attr('id', function () {
|
10452 | return 'node-' + commit.id;
|
10453 | }).attr('transform', function () {
|
10454 | switch (direction) {
|
10455 | case 'LR':
|
10456 | return 'translate(' + (commit.seq * config.nodeSpacing + config.leftMargin) + ', ' + branchNum * config.branchOffset + ')';
|
10457 | case 'BT':
|
10458 | return 'translate(' + (branchNum * config.branchOffset + config.leftMargin) + ', ' + (numCommits - commit.seq) * config.nodeSpacing + ')';
|
10459 | }
|
10460 | }).attr('fill', config.nodeFillColor).attr('stroke', config.nodeStrokeColor).attr('stroke-width', config.nodeStrokeWidth);
|
10461 |
|
10462 | var branch = _lodash2.default.find(branches, ['commit', commit]);
|
10463 | if (branch) {
|
10464 | log.debug('found branch ', branch.name);
|
10465 | svg.select('#node-' + commit.id + ' p').append('xhtml:span').attr('class', 'branch-label').text(branch.name + ', ');
|
10466 | }
|
10467 | svg.select('#node-' + commit.id + ' p').append('xhtml:span').attr('class', 'commit-id').text(commit.id);
|
10468 | if (commit.message !== '' && direction === 'BT') {
|
10469 | svg.select('#node-' + commit.id + ' p').append('xhtml:span').attr('class', 'commit-msg').text(', ' + commit.message);
|
10470 | }
|
10471 | commitid = commit.parent;
|
10472 | } while (commitid && allCommitsDict[commitid]);
|
10473 | }
|
10474 |
|
10475 | if (_lodash2.default.isArray(commitid)) {
|
10476 | log.debug('found merge commmit', commitid);
|
10477 | renderCommitHistory(svg, commitid[0], branches, direction);
|
10478 | branchNum++;
|
10479 | renderCommitHistory(svg, commitid[1], branches, direction);
|
10480 | branchNum--;
|
10481 | }
|
10482 | }
|
10483 |
|
10484 | function renderLines(svg, commit, direction, branchColor) {
|
10485 | branchColor = branchColor || 0;
|
10486 | while (commit.seq > 0 && !commit.lineDrawn) {
|
10487 | if (_lodash2.default.isString(commit.parent)) {
|
10488 | svgDrawLineForCommits(svg, commit.id, commit.parent, direction, branchColor);
|
10489 | commit.lineDrawn = true;
|
10490 | commit = allCommitsDict[commit.parent];
|
10491 | } else if (_lodash2.default.isArray(commit.parent)) {
|
10492 | svgDrawLineForCommits(svg, commit.id, commit.parent[0], direction, branchColor);
|
10493 | svgDrawLineForCommits(svg, commit.id, commit.parent[1], direction, branchColor + 1);
|
10494 | renderLines(svg, allCommitsDict[commit.parent[1]], direction, branchColor + 1);
|
10495 | commit.lineDrawn = true;
|
10496 | commit = allCommitsDict[commit.parent[0]];
|
10497 | }
|
10498 | }
|
10499 | }
|
10500 |
|
10501 | exports.draw = function (txt, id, ver) {
|
10502 | try {
|
10503 | var parser;
|
10504 | parser = gitGraphParser.parser;
|
10505 | parser.yy = db;
|
10506 |
|
10507 | log.debug('in gitgraph renderer', txt, id, ver);
|
10508 |
|
10509 | parser.parse(txt + '\n');
|
10510 |
|
10511 | config = _lodash2.default.extend(config, apiConfig, db.getOptions());
|
10512 | log.debug('effective options', config);
|
10513 | var direction = db.getDirection();
|
10514 | allCommitsDict = db.getCommits();
|
10515 | var branches = db.getBranchesAsObjArray();
|
10516 | if (direction === 'BT') {
|
10517 | config.nodeLabel.x = branches.length * config.branchOffset;
|
10518 | config.nodeLabel.width = '100%';
|
10519 | config.nodeLabel.y = -1 * 2 * config.nodeRadius;
|
10520 | }
|
10521 | var svg = d3.select('#' + id);
|
10522 | svgCreateDefs(svg);
|
10523 | branchNum = 1;
|
10524 | _lodash2.default.each(branches, function (v) {
|
10525 | renderCommitHistory(svg, v.commit.id, branches, direction);
|
10526 | renderLines(svg, v.commit, direction);
|
10527 | branchNum++;
|
10528 | });
|
10529 | svg.attr('height', function () {
|
10530 | if (direction === 'BT') return Object.keys(allCommitsDict).length * config.nodeSpacing;
|
10531 | return (branches.length + 1) * config.branchOffset;
|
10532 | });
|
10533 | } catch (e) {
|
10534 | log.error('Error while rendering gitgraph');
|
10535 | log.error(e.message);
|
10536 | }
|
10537 | };
|
10538 |
|
10539 | }),
|
10540 |
|
10541 | (function(module, exports) {
|
10542 |
|
10543 | module.exports = {"name":"mermaid","version":"7.0.10","description":"Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.","main":"src/mermaid.js","keywords":["diagram","markdown","flowchart","sequence diagram","gantt","class diagram","git graph"],"bin":{"mermaid":"./bin/mermaid.js"},"scripts":{"build":"node -r babel-register ./node_modules/.bin/webpack --progress --colors","build:watch":"yarn build --watch","release":"yarn build -p --config webpack.config.prod.js","upgrade":"yarn upgrade --latest && yarn remove d3 && yarn add d3@3.5.17","lint":"standard","karma":"node -r babel-register node_modules/.bin/karma start karma.conf.js --single-run","tape":"node -r babel-register node_modules/.bin/tape test/cli_test-*.js","test":"yarn lint && yarn tape && yarn karma","jison":"gulp jison","prepublishOnly":"yarn build && yarn release && yarn test"},"repository":{"type":"git","url":"https://github.com/knsv/mermaid"},"author":"Knut Sveidqvist","license":"MIT","standard":{"ignore":["**/parser/*.js","dist/**/*.js"]},"dependencies":{"chalk":"^2.1.0","d3":"3.5.17","dagre-d3-renderer":"^0.4.23","dagre-layout":"^0.8.0","he":"^1.1.1","lodash":"^4.17.4","minimist":"^1.2.0","mkdirp":"^0.5.1","moment":"^2.18.1","semver":"^5.4.1","which":"^1.3.0"},"devDependencies":{"async":"^2.5.0","babel-core":"^6.26.0","babel-loader":"^7.1.2","babel-plugin-lodash":"^3.2.11","babel-preset-env":"^1.6.0","babel-preset-es2015":"^6.24.1","clone":"^2.1.1","codeclimate-test-reporter":"^0.5.0","css-loader":"^0.28.7","extract-text-webpack-plugin":"^3.0.0","gulp":"^3.9.1","gulp-filelog":"^0.4.1","gulp-jison":"^1.2.0","inject-loader":"^3.0.1","jasmine":"^2.8.0","jasmine-es6":"^0.4.1","jison":"^0.4.18","karma":"^1.7.1","karma-chrome-launcher":"^2.2.0","karma-jasmine":"^1.1.0","karma-webpack":"^2.0.4","less":"^2.7.2","less-loader":"^4.0.5","phantomjs-prebuilt":"^2.1.15","rimraf":"^2.6.1","standard":"^10.0.3","style-loader":"^0.18.2","tape":"^4.8.0","webpack":"^3.5.6","webpack-node-externals":"^1.6.0"},"files":["bin","dist","lib","src"]}
|
10544 |
|
10545 | })
|
10546 | ]); |
\ | No newline at end of file |