tla2dot 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 50c54151b6154f68628b515e39cfc4a2b9714914
4
- data.tar.gz: de102d5ee02409b0c686b1bc7b50d2aa2e4a357d
3
+ metadata.gz: f80765c73e0fc6c509bb821af1e2424e0a9b8eb6
4
+ data.tar.gz: e740a7b2d7ebb1dde475f58166d7916ef6498d0d
5
5
  SHA512:
6
- metadata.gz: ccffaaf96aa5082d680e00e33260f89ba73a8794ab2adb897e3433821ff2554cb25f3aa02b58b4c3e5320dcad68744bf3d042d24073a75e98a2e4aa49bae66d5
7
- data.tar.gz: 58794be3c9fce175ca81d0bd18d55a6fe574e211a7537cf255f387255da21c77008e82c57dc07fee25462d30ac6cf57343f3f7cc67f0975a98180fb36f60b54a
6
+ metadata.gz: 2d5f77428dae12807d0a005c6baac6e4c46d66ec4d48f5509a20d1a2768fa2f7637ca91bf54cf4b03c07ddb9d6ffdb409f5ec8c8ab3830bce781b3ca3ce9f05d
7
+ data.tar.gz: f4ca627377c9dda54e69f32c3e8a4486b501f0bf417451386394abeddd19762eff19722b94584b2061ef0f5558248114fda4bc8caf6683690e529a0a8e84d6ce
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
  [Up](../index.php) [Readme](README.html) [Releases](RELEASES.html) [Todo](TODO.html)
3
3
 
4
4
 
5
- # tladot - Utility to convert tlc/tlaplus state space to graphviz - $Release:0.0.5$
5
+ # tladot - Utility to convert tlc/tlaplus state space to graphviz - $Release:0.0.6$
6
6
 
7
7
  A utility to convert state space dump created by
8
8
  [patched](https://github.com/jarjuk/tla2dot/blob/master/tla2dot.patch)
@@ -14,28 +14,36 @@ to [graphviz](http://www.graphviz.org) dot format.
14
14
 
15
15
  ## Usage
16
16
 
17
+
17
18
  ## Obtain the patched TLC version
18
19
 
19
20
  Clone github model
20
21
 
21
22
 
22
- https://github.com/jarjuk/tla2dot
23
+ git clone https://github.com/jarjuk/tla2dot
23
24
 
24
25
  and change the working directory
25
26
 
26
- cd tla2dot
27
+ cd tla2dot
28
+
29
+ ### Run Ruby bundler
30
+
31
+ The tool uses Ruby 2, and to have the required Gems installed run
32
+
33
+ bundle install
34
+
27
35
 
28
36
  ### Running the patced TLC version to create state dump
29
37
 
30
- Create a TLA model files. The example below uses files `DieHard.tla`, and
31
- `DieHard.cfg`, in directory `model`
38
+ The example below uses TLA model in files `DieHard.tla`, and
39
+ `DieHard.cfg` under directory `model`.
32
40
 
33
- Set up environment variable CP to poinnt the patched `tla2tools.jar`
34
- in directory `java`
41
+ Set up an environment variable `CP` to poinnt the patched
42
+ `tla2tools.jar` found in directory `java`
35
43
 
36
44
  export CP=$(pwd)/java/org.lamport.tlatools-1.0.1-SNAPSHOT.jar
37
45
 
38
- Run the TLA model, and generate a dump file
46
+ Run TLA model, and generate a dump file
39
47
  `../examples/DieHard-patched.dump` using the command
40
48
 
41
49
  (cd model; java -cp $CP tlc2.TLC -dump ../examples/DieHard-patched.dump DieHard)
@@ -49,7 +57,7 @@ file. For example, to show the difference of
49
57
 
50
58
  diff examples/DieHard-orig.dump examples/DieHard-patched.dump
51
59
 
52
- and observe diff starting
60
+ and observe diff output starting
53
61
 
54
62
  ```
55
63
  1c1
@@ -81,36 +89,41 @@ and observe diff starting
81
89
  To create a dot file for a patched state-dump in
82
90
  `examples/customer1-patched.dump`, run
83
91
 
84
- bin/tla2dot.rb graph examples/DieHard-patched.dump >tmp/dump.dot
92
+ bin/tla2dot.rb graph examples/DieHard-patched.dump >tmp/dump.dot
85
93
 
86
- and to convert it to a svg diagran, run
94
+ and to convert it to a svg picture, run
87
95
 
88
96
  dot -T svg tmp/dump.dot >tmp/dump.svg
89
97
 
90
- Command `graph` accepts optionally a list of variables to include in
91
- state nodes. For example, to show variables `big,small` in the example,
92
- use the command
98
+ Command `graph` accepts optionally a list of variables to show in
99
+ state nodes. For example, to show model variables `big,small` in the
100
+ DieHard example, use the command
93
101
 
94
- bin/tla2dot.rb graph examples/DieHard-patched.dump big,small >tmp/dump.dot
102
+ bin/tla2dot.rb graph examples/DieHard-patched.dump big,small >tmp/dump.dot
95
103
 
96
- State identity is referenced using a pseudo variable `ID`:
104
+ State identity may be included a pseudo variable `ID`:
97
105
 
98
106
  bin/tla2dot.rb graph examples/DieHard-patched.dump ID,big,small >tmp/dump.dot
99
107
 
100
108
  and all variables can be included in the graph using value `TRUE` for
101
- variable list
109
+ the variable list
102
110
 
103
111
  bin/tla2dot.rb graph examples/DieHard-patched.dump TRUE >tmp/dump.dot
104
112
 
105
113
 
106
114
  ## <a id="INSTALLATION">Installation</a>
107
115
 
108
- Add following lines to `Gemfile`
116
+ Add following the lines to `Gemfile`
109
117
 
110
118
  source 'https://rubygems.org'
111
119
  gem 'tla2dot'
112
120
 
113
- and to get help on using tla2tools
121
+ and run
122
+
123
+ bundle install
124
+
125
+ To validate that installation was successful, and to get help on using
126
+ `tla2dot.rb` run
114
127
 
115
128
  bundle exec tla2dot.rb help
116
129
 
@@ -7,7 +7,7 @@
7
7
  require 'racc/parser.rb'
8
8
  class Tla2DotParser < Racc::Parser
9
9
 
10
- module_eval(<<'...end parser.y/module_eval...', 'parser.y', 89)
10
+ module_eval(<<'...end parser.y/module_eval...', 'parser.y', 101)
11
11
 
12
12
  class Node
13
13
 
@@ -310,6 +310,20 @@ def scan
310
310
  when /\A=/
311
311
  yield [ $&, $& ]
312
312
  str = $'
313
+ when /\A\(/
314
+ yield [ $&, $& ]
315
+ str = $'
316
+ when /\A\)/
317
+ # puts $'
318
+ yield [ $&, $& ]
319
+ str = $'
320
+ when /\A:>/
321
+ yield [ $&, $& ]
322
+ str = $'
323
+ when /@@/
324
+ # puts $'
325
+ yield [ $&, $& ]
326
+ str = $'
313
327
  else
314
328
  c = str[0,1]
315
329
  yield [ c, c ]
@@ -324,113 +338,125 @@ end
324
338
  ##### State transition tables begin ###
325
339
 
326
340
  racc_action_table = [
327
- 32, 22, 39, 58, 34, 51, 52, 41, 33, 38,
328
- 50, 57, 40, 46, 32, 27, 39, 45, 34, 25,
329
- 26, 6, 33, 38, 9, 32, 40, 39, 6, 34,
330
- 62, 9, 63, 33, 38, 17, 32, 40, 39, 19,
331
- 34, 18, 15, 12, 33, 38, 22, 32, 40, 39,
332
- 53, 34, 28, 61, 22, 33, 38, 10, 32, 40,
333
- 39, 65, 34, 15, nil, nil, 33, 38, 27, nil,
334
- 40, 29, 25, 26 ]
341
+ 32, 67, 41, 50, 34, 59, 60, 47, 33, 39,
342
+ 32, 40, 41, 66, 34, 22, 42, 52, 33, 39,
343
+ 32, 40, 41, 73, 34, 74, 42, 22, 33, 39,
344
+ 32, 40, 41, 43, 34, 19, 42, 58, 33, 39,
345
+ 32, 40, 41, 28, 34, 61, 42, 18, 33, 39,
346
+ 32, 40, 41, 62, 34, 17, 42, 15, 33, 39,
347
+ 32, 40, 41, 15, 34, 50, 42, 57, 33, 39,
348
+ 27, 40, 56, 12, 25, 26, 42, 27, 72, 22,
349
+ 29, 25, 26, 6, 6, 10, 9, 9, 76, 51 ]
335
350
 
336
351
  racc_action_check = [
337
- 40, 38, 40, 47, 40, 42, 44, 38, 40, 40,
338
- 42, 47, 40, 40, 52, 17, 52, 39, 52, 17,
339
- 17, 2, 52, 52, 2, 58, 52, 58, 0, 58,
340
- 54, 0, 54, 58, 58, 8, 63, 58, 63, 12,
341
- 63, 10, 7, 6, 63, 63, 51, 45, 63, 45,
342
- 45, 45, 21, 53, 15, 45, 45, 1, 28, 45,
343
- 28, 62, 28, 13, nil, nil, 28, 28, 23, nil,
344
- 28, 23, 23, 23 ]
352
+ 42, 53, 42, 40, 42, 48, 48, 40, 42, 42,
353
+ 61, 42, 61, 53, 61, 57, 42, 42, 61, 61,
354
+ 74, 61, 74, 63, 74, 63, 61, 39, 74, 74,
355
+ 67, 74, 67, 39, 67, 12, 74, 46, 67, 67,
356
+ 58, 67, 58, 21, 58, 50, 67, 10, 58, 58,
357
+ 51, 58, 51, 51, 51, 8, 58, 13, 51, 51,
358
+ 28, 51, 28, 7, 28, 60, 51, 44, 28, 28,
359
+ 17, 28, 44, 6, 17, 17, 28, 23, 62, 15,
360
+ 23, 23, 23, 2, 0, 1, 2, 0, 73, 41 ]
345
361
 
346
362
  racc_action_pointer = [
347
- 26, 57, 19, nil, nil, nil, 40, 32, 29, nil,
348
- 41, nil, 35, 53, nil, 46, nil, 11, nil, nil,
349
- nil, 41, nil, 64, nil, nil, nil, nil, 54, nil,
350
- nil, nil, nil, nil, nil, nil, nil, nil, -7, 11,
351
- -4, nil, -4, nil, -9, 43, nil, -6, nil, nil,
352
- nil, 38, 10, 46, 23, nil, nil, nil, 21, nil,
353
- nil, nil, 54, 32, nil, nil, nil ]
363
+ 82, 85, 81, nil, nil, nil, 70, 53, 49, nil,
364
+ 47, nil, 31, 47, nil, 71, nil, 66, nil, nil,
365
+ nil, 32, nil, 73, nil, nil, nil, nil, 56, nil,
366
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, 19,
367
+ -9, 83, -4, nil, 58, nil, 18, nil, -11, nil,
368
+ 27, 46, nil, -8, nil, nil, nil, 7, 36, nil,
369
+ 53, 6, 71, 16, nil, nil, nil, 26, nil, nil,
370
+ nil, nil, nil, 81, 16, nil, nil, nil ]
354
371
 
355
372
  racc_action_default = [
356
- -43, -43, -1, -2, -4, -5, -43, -8, -9, -11,
357
- -43, -3, -43, -7, -18, -43, -10, -43, 67, -6,
358
- -19, -43, -21, -43, -13, -15, -16, -17, -43, -12,
359
- -14, -20, -22, -23, -24, -25, -26, -27, -43, -43,
360
- -43, -28, -43, -30, -43, -43, -38, -43, -40, -42,
361
- -29, -43, -43, -43, -43, -35, -37, -39, -43, -31,
362
- -32, -33, -43, -43, -41, -34, -36 ]
373
+ -49, -49, -1, -2, -4, -5, -49, -8, -9, -11,
374
+ -49, -3, -49, -7, -18, -49, -10, -49, 78, -6,
375
+ -19, -49, -21, -49, -13, -15, -16, -17, -49, -12,
376
+ -14, -20, -22, -23, -24, -25, -26, -27, -28, -49,
377
+ -49, -49, -49, -29, -49, -36, -49, -31, -49, -33,
378
+ -49, -49, -44, -49, -46, -48, -30, -49, -49, -32,
379
+ -49, -49, -49, -49, -41, -43, -45, -49, -37, -38,
380
+ -34, -35, -39, -49, -49, -47, -40, -42 ]
363
381
 
364
382
  racc_goto_table = [
365
- 31, 55, 48, 43, 24, 14, 3, 21, 11, 23,
366
- 30, 20, 16, 42, 13, 54, 59, 56, 2, 66,
367
- 64, 47, 1, nil, 60, nil, nil, nil, nil, nil,
368
- nil, nil, nil, nil, nil, 56 ]
383
+ 31, 54, 64, 45, 49, 24, 14, 3, 44, 11,
384
+ 2, 30, 20, 21, 48, 23, 16, 63, 13, 53,
385
+ 1, 68, nil, 65, 70, 77, 75, nil, nil, nil,
386
+ 69, nil, nil, 71, nil, nil, nil, nil, nil, nil,
387
+ nil, nil, nil, nil, nil, nil, 65 ]
369
388
 
370
389
  racc_goto_check = [
371
- 14, 21, 23, 19, 11, 12, 3, 13, 3, 10,
372
- 11, 12, 9, 18, 7, 20, 19, 14, 2, 21,
373
- 23, 22, 1, nil, 14, nil, nil, nil, nil, nil,
374
- nil, nil, nil, nil, nil, 14 ]
390
+ 14, 26, 24, 22, 21, 11, 12, 3, 19, 3,
391
+ 2, 11, 12, 13, 20, 10, 9, 23, 7, 25,
392
+ 1, 22, nil, 14, 21, 24, 26, nil, nil, nil,
393
+ 14, nil, nil, 14, nil, nil, nil, nil, nil, nil,
394
+ nil, nil, nil, nil, nil, nil, 14 ]
375
395
 
376
396
  racc_goto_pointer = [
377
- nil, 22, 18, 6, nil, nil, nil, 7, nil, 4,
378
- -8, -13, -2, -8, -28, nil, nil, nil, -25, -35,
379
- -30, -44, -19, -38 ]
397
+ nil, 20, 10, 7, nil, nil, nil, 11, nil, 8,
398
+ -2, -12, -1, -2, -28, nil, nil, nil, nil, -31,
399
+ -26, -36, -36, -34, -49, -23, -41 ]
380
400
 
381
401
  racc_goto_default = [
382
402
  nil, nil, nil, nil, 4, 5, 7, nil, 8, nil,
383
- nil, nil, nil, 44, 49, 35, 36, 37, nil, nil,
384
- nil, nil, nil, nil ]
403
+ nil, nil, nil, 46, 55, 35, 36, 37, 38, nil,
404
+ nil, nil, nil, nil, nil, nil, nil ]
385
405
 
386
406
  racc_reduce_table = [
387
407
  0, 0, :racc_error,
388
- 1, 19, :_reduce_1,
389
- 1, 20, :_reduce_none,
390
- 2, 20, :_reduce_none,
391
- 1, 21, :_reduce_4,
392
- 1, 21, :_reduce_none,
393
- 3, 23, :_reduce_6,
394
- 2, 22, :_reduce_7,
395
- 1, 22, :_reduce_none,
408
+ 1, 23, :_reduce_1,
396
409
  1, 24, :_reduce_none,
397
410
  2, 24, :_reduce_none,
398
- 1, 26, :_reduce_11,
399
- 3, 27, :_reduce_none,
411
+ 1, 25, :_reduce_4,
412
+ 1, 25, :_reduce_none,
413
+ 3, 27, :_reduce_6,
414
+ 2, 26, :_reduce_7,
415
+ 1, 26, :_reduce_none,
400
416
  1, 28, :_reduce_none,
401
417
  2, 28, :_reduce_none,
402
- 1, 29, :_reduce_none,
403
- 1, 29, :_reduce_none,
404
- 1, 29, :_reduce_none,
405
- 1, 25, :_reduce_none,
406
- 2, 25, :_reduce_19,
407
- 4, 30, :_reduce_20,
408
- 1, 31, :_reduce_none,
409
- 1, 32, :_reduce_22,
410
- 1, 32, :_reduce_none,
411
- 1, 32, :_reduce_none,
412
- 1, 32, :_reduce_none,
418
+ 1, 30, :_reduce_11,
419
+ 3, 31, :_reduce_none,
413
420
  1, 32, :_reduce_none,
414
- 1, 32, :_reduce_none,
415
- 2, 33, :_reduce_28,
416
- 3, 33, :_reduce_29,
417
- 1, 36, :_reduce_30,
418
- 3, 36, :_reduce_31,
419
- 3, 37, :_reduce_32,
420
- 4, 35, :_reduce_33,
421
- 5, 35, :_reduce_34,
422
- 1, 38, :_reduce_none,
423
- 3, 38, :_reduce_36,
424
- 1, 39, :_reduce_37,
425
- 2, 34, :_reduce_38,
426
- 3, 34, :_reduce_39,
427
- 1, 40, :_reduce_none,
428
- 3, 40, :_reduce_41,
429
- 1, 41, :_reduce_42 ]
430
-
431
- racc_reduce_n = 43
432
-
433
- racc_shift_n = 67
421
+ 2, 32, :_reduce_none,
422
+ 1, 33, :_reduce_none,
423
+ 1, 33, :_reduce_none,
424
+ 1, 33, :_reduce_none,
425
+ 1, 29, :_reduce_none,
426
+ 2, 29, :_reduce_19,
427
+ 4, 34, :_reduce_20,
428
+ 1, 35, :_reduce_none,
429
+ 1, 36, :_reduce_22,
430
+ 1, 36, :_reduce_none,
431
+ 1, 36, :_reduce_none,
432
+ 1, 36, :_reduce_none,
433
+ 1, 36, :_reduce_none,
434
+ 1, 36, :_reduce_none,
435
+ 1, 36, :_reduce_none,
436
+ 2, 37, :_reduce_29,
437
+ 3, 37, :_reduce_30,
438
+ 2, 40, :_reduce_31,
439
+ 3, 40, :_reduce_32,
440
+ 1, 42, :_reduce_none,
441
+ 3, 42, :_reduce_34,
442
+ 3, 43, :_reduce_35,
443
+ 1, 41, :_reduce_36,
444
+ 3, 41, :_reduce_37,
445
+ 3, 44, :_reduce_38,
446
+ 4, 39, :_reduce_39,
447
+ 5, 39, :_reduce_40,
448
+ 1, 45, :_reduce_none,
449
+ 3, 45, :_reduce_42,
450
+ 1, 46, :_reduce_43,
451
+ 2, 38, :_reduce_44,
452
+ 3, 38, :_reduce_45,
453
+ 1, 47, :_reduce_none,
454
+ 3, 47, :_reduce_47,
455
+ 1, 48, :_reduce_48 ]
456
+
457
+ racc_reduce_n = 49
458
+
459
+ racc_shift_n = 78
434
460
 
435
461
  racc_token_table = {
436
462
  false => 0,
@@ -448,11 +474,15 @@ racc_token_table = {
448
474
  :STRING => 12,
449
475
  "[" => 13,
450
476
  "]" => 14,
451
- "|->" => 15,
452
- "{" => 16,
453
- "}" => 17 }
477
+ "(" => 15,
478
+ ")" => 16,
479
+ "@@" => 17,
480
+ ":>" => 18,
481
+ "|->" => 19,
482
+ "{" => 20,
483
+ "}" => 21 }
454
484
 
455
- racc_nt_base = 18
485
+ racc_nt_base = 22
456
486
 
457
487
  racc_use_result_var = false
458
488
 
@@ -488,6 +518,10 @@ Racc_token_to_s_table = [
488
518
  "STRING",
489
519
  "\"[\"",
490
520
  "\"]\"",
521
+ "\"(\"",
522
+ "\")\"",
523
+ "\"@@\"",
524
+ "\":>\"",
491
525
  "\"|->\"",
492
526
  "\"{\"",
493
527
  "\"}\"",
@@ -509,7 +543,10 @@ Racc_token_to_s_table = [
509
543
  "record",
510
544
  "set",
511
545
  "seq",
546
+ "func",
512
547
  "rlist",
548
+ "flist",
549
+ "fitem",
513
550
  "ritem",
514
551
  "seqlist",
515
552
  "seqitem",
@@ -608,84 +645,112 @@ module_eval(<<'.,.,', 'parser.y', 52)
608
645
 
609
646
  # reduce 27 omitted
610
647
 
611
- module_eval(<<'.,.,', 'parser.y', 59)
612
- def _reduce_28(val, _values)
613
- {}
614
- end
615
- .,.,
648
+ # reduce 28 omitted
616
649
 
617
650
  module_eval(<<'.,.,', 'parser.y', 60)
618
651
  def _reduce_29(val, _values)
619
- val[1]
652
+ {}
620
653
  end
621
654
  .,.,
622
655
 
623
- module_eval(<<'.,.,', 'parser.y', 62)
656
+ module_eval(<<'.,.,', 'parser.y', 61)
624
657
  def _reduce_30(val, _values)
625
- val[0]
658
+ val[1]
626
659
  end
627
660
  .,.,
628
661
 
629
662
  module_eval(<<'.,.,', 'parser.y', 63)
630
663
  def _reduce_31(val, _values)
631
- k=val[2].keys.first; val[0][k] = val[2][k]; val[0]
664
+ {}
632
665
  end
633
666
  .,.,
634
667
 
635
- module_eval(<<'.,.,', 'parser.y', 65)
668
+ module_eval(<<'.,.,', 'parser.y', 64)
636
669
  def _reduce_32(val, _values)
637
- { val[0] => val[2] }
670
+ val[1]
638
671
  end
639
672
  .,.,
640
673
 
674
+ # reduce 33 omitted
675
+
641
676
  module_eval(<<'.,.,', 'parser.y', 68)
642
- def _reduce_33(val, _values)
677
+ def _reduce_34(val, _values)
678
+ h = val[0].merge(val[2]); h
679
+ end
680
+ .,.,
681
+
682
+ module_eval(<<'.,.,', 'parser.y', 71)
683
+ def _reduce_35(val, _values)
684
+ { val[0] => val[2] }
685
+ end
686
+ .,.,
687
+
688
+ module_eval(<<'.,.,', 'parser.y', 73)
689
+ def _reduce_36(val, _values)
690
+ val[0]
691
+ end
692
+ .,.,
693
+
694
+ module_eval(<<'.,.,', 'parser.y', 74)
695
+ def _reduce_37(val, _values)
696
+ k=val[2].keys.first; val[0][k] = val[2][k]; val[0]
697
+ end
698
+ .,.,
699
+
700
+ module_eval(<<'.,.,', 'parser.y', 76)
701
+ def _reduce_38(val, _values)
702
+ { val[0] => val[2] }
703
+ end
704
+ .,.,
705
+
706
+ module_eval(<<'.,.,', 'parser.y', 79)
707
+ def _reduce_39(val, _values)
643
708
  []
644
709
  end
645
710
  .,.,
646
711
 
647
- module_eval(<<'.,.,', 'parser.y', 69)
648
- def _reduce_34(val, _values)
712
+ module_eval(<<'.,.,', 'parser.y', 80)
713
+ def _reduce_40(val, _values)
649
714
  val[2]
650
715
  end
651
716
  .,.,
652
717
 
653
- # reduce 35 omitted
718
+ # reduce 41 omitted
654
719
 
655
- module_eval(<<'.,.,', 'parser.y', 72)
656
- def _reduce_36(val, _values)
720
+ module_eval(<<'.,.,', 'parser.y', 84)
721
+ def _reduce_42(val, _values)
657
722
  val[0].push( val[2][0] ); val[0]
658
723
  end
659
724
  .,.,
660
725
 
661
- module_eval(<<'.,.,', 'parser.y', 74)
662
- def _reduce_37(val, _values)
726
+ module_eval(<<'.,.,', 'parser.y', 86)
727
+ def _reduce_43(val, _values)
663
728
  [ val[0] ]
664
729
  end
665
730
  .,.,
666
731
 
667
- module_eval(<<'.,.,', 'parser.y', 77)
668
- def _reduce_38(val, _values)
732
+ module_eval(<<'.,.,', 'parser.y', 89)
733
+ def _reduce_44(val, _values)
669
734
  []
670
735
  end
671
736
  .,.,
672
737
 
673
- module_eval(<<'.,.,', 'parser.y', 78)
674
- def _reduce_39(val, _values)
738
+ module_eval(<<'.,.,', 'parser.y', 90)
739
+ def _reduce_45(val, _values)
675
740
  val[1]
676
741
  end
677
742
  .,.,
678
743
 
679
- # reduce 40 omitted
744
+ # reduce 46 omitted
680
745
 
681
- module_eval(<<'.,.,', 'parser.y', 81)
682
- def _reduce_41(val, _values)
746
+ module_eval(<<'.,.,', 'parser.y', 93)
747
+ def _reduce_47(val, _values)
683
748
  val[0].push( val[2][0] ); val[0]
684
749
  end
685
750
  .,.,
686
751
 
687
- module_eval(<<'.,.,', 'parser.y', 83)
688
- def _reduce_42(val, _values)
752
+ module_eval(<<'.,.,', 'parser.y', 95)
753
+ def _reduce_48(val, _values)
689
754
  [ val[0] ]
690
755
  end
691
756
  .,.,
@@ -56,10 +56,21 @@ rule
56
56
  | record
57
57
  | set
58
58
  | seq
59
+ | func
59
60
 
60
61
  record : '[' ']' { {} }
61
62
  | '[' rlist ']' { val[1] }
62
63
 
64
+ func : '(' ')' { {} }
65
+ | '(' flist ')' { val[1] }
66
+
67
+
68
+ flist : fitem
69
+ | flist "@@" fitem { h = val[0].merge(val[2]); h }
70
+
71
+
72
+ fitem : STRING ":>" value { { val[0] => val[2] } }
73
+
63
74
  rlist : ritem { val[0] }
64
75
  | rlist ',' ritem { k=val[2].keys.first; val[0][k] = val[2][k]; val[0] }
65
76
 
@@ -69,7 +80,8 @@ rule
69
80
  seq : '<' '<' '>' '>' { [] }
70
81
  | '<' '<' seqlist '>' '>' { val[2] }
71
82
 
72
- seqlist : seqitem
83
+
84
+ seqlist : seqitem
73
85
  | seqlist ',' seqitem { val[0].push( val[2][0] ); val[0] }
74
86
 
75
87
  seqitem : value { [ val[0] ] }
@@ -388,6 +400,20 @@ def scan
388
400
  when /\A=/
389
401
  yield [ $&, $& ]
390
402
  str = $'
403
+ when /\A\(/
404
+ yield [ $&, $& ]
405
+ str = $'
406
+ when /\A\)/
407
+ # puts $'
408
+ yield [ $&, $& ]
409
+ str = $'
410
+ when /\A:>/
411
+ yield [ $&, $& ]
412
+ str = $'
413
+ when /@@/
414
+ # puts $'
415
+ yield [ $&, $& ]
416
+ str = $'
391
417
  else
392
418
  c = str[0,1]
393
419
  yield [ c, c ]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tla2dot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - jarjuk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-25 00:00:00.000000000 Z
11
+ date: 2016-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mustache