lrama 0.5.9 → 0.5.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yaml +5 -0
  3. data/.gitignore +7 -4
  4. data/Gemfile +9 -5
  5. data/Rakefile +13 -0
  6. data/Steepfile +9 -3
  7. data/lib/lrama/context.rb +1 -3
  8. data/lib/lrama/counterexamples/path.rb +0 -46
  9. data/lib/lrama/counterexamples/production_path.rb +17 -0
  10. data/lib/lrama/counterexamples/start_path.rb +21 -0
  11. data/lib/lrama/counterexamples/transition_path.rb +17 -0
  12. data/lib/lrama/counterexamples.rb +3 -0
  13. data/lib/lrama/grammar/code/initial_action_code.rb +28 -0
  14. data/lib/lrama/grammar/code/no_reference_code.rb +24 -0
  15. data/lib/lrama/grammar/code/printer_code.rb +34 -0
  16. data/lib/lrama/grammar/code/rule_action.rb +62 -0
  17. data/lib/lrama/grammar/code.rb +9 -93
  18. data/lib/lrama/grammar/counter.rb +15 -0
  19. data/lib/lrama/grammar/error_token.rb +3 -3
  20. data/lib/lrama/grammar/parameterizing_rules/builder/base.rb +28 -0
  21. data/lib/lrama/grammar/parameterizing_rules/builder/list.rb +20 -0
  22. data/lib/lrama/grammar/parameterizing_rules/builder/nonempty_list.rb +20 -0
  23. data/lib/lrama/grammar/parameterizing_rules/builder/option.rb +20 -0
  24. data/lib/lrama/grammar/parameterizing_rules/builder/separated_list.rb +28 -0
  25. data/lib/lrama/grammar/parameterizing_rules/builder/separated_nonempty_list.rb +27 -0
  26. data/lib/lrama/grammar/parameterizing_rules/builder.rb +43 -0
  27. data/lib/lrama/grammar/printer.rb +3 -3
  28. data/lib/lrama/grammar/reference.rb +7 -16
  29. data/lib/lrama/grammar/rule.rb +18 -2
  30. data/lib/lrama/grammar/rule_builder.rb +179 -0
  31. data/lib/lrama/grammar.rb +109 -324
  32. data/lib/lrama/lexer/location.rb +22 -0
  33. data/lib/lrama/lexer/token/parameterizing.rb +18 -3
  34. data/lib/lrama/lexer/token/tag.rb +4 -0
  35. data/lib/lrama/lexer/token/user_code.rb +54 -4
  36. data/lib/lrama/lexer/token.rb +22 -4
  37. data/lib/lrama/lexer.rb +31 -29
  38. data/lib/lrama/options.rb +1 -2
  39. data/lib/lrama/output.rb +2 -2
  40. data/lib/lrama/parser.rb +420 -343
  41. data/lib/lrama/report/profile.rb +1 -12
  42. data/lib/lrama/version.rb +1 -1
  43. data/parser.y +106 -49
  44. data/rbs_collection.lock.yaml +5 -1
  45. data/rbs_collection.yaml +1 -0
  46. data/sig/lrama/grammar/code/printer_code.rbs +15 -0
  47. data/sig/lrama/grammar/code.rbs +24 -0
  48. data/sig/lrama/grammar/counter.rbs +11 -0
  49. data/sig/lrama/grammar/parameterizing_rules/builder.rbs +10 -0
  50. data/sig/lrama/grammar/precedence.rbs +11 -0
  51. data/sig/lrama/grammar/printer.rbs +11 -0
  52. data/sig/lrama/grammar/reference.rbs +5 -5
  53. data/sig/lrama/grammar/rule.rbs +13 -0
  54. data/sig/lrama/grammar/rule_builder.rbs +41 -0
  55. data/sig/lrama/lexer/location.rbs +14 -0
  56. data/sig/lrama/lexer/token/parameterizing.rbs +7 -0
  57. data/sig/lrama/lexer/token/tag.rbs +1 -0
  58. data/sig/lrama/lexer/token/user_code.rbs +8 -1
  59. data/sig/lrama/lexer/token.rbs +8 -3
  60. data/sig/stdlib/strscan/string_scanner.rbs +5 -0
  61. data/template/bison/yacc.c +5 -0
  62. metadata +29 -2
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lrama
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.9
4
+ version: 0.5.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuichiro Kaneko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-05 00:00:00.000000000 Z
11
+ date: 2023-11-18 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: LALR (1) parser generator written by Ruby
14
14
  email:
@@ -40,21 +40,38 @@ files:
40
40
  - lib/lrama/counterexamples/derivation.rb
41
41
  - lib/lrama/counterexamples/example.rb
42
42
  - lib/lrama/counterexamples/path.rb
43
+ - lib/lrama/counterexamples/production_path.rb
44
+ - lib/lrama/counterexamples/start_path.rb
43
45
  - lib/lrama/counterexamples/state_item.rb
46
+ - lib/lrama/counterexamples/transition_path.rb
44
47
  - lib/lrama/counterexamples/triple.rb
45
48
  - lib/lrama/digraph.rb
46
49
  - lib/lrama/grammar.rb
47
50
  - lib/lrama/grammar/auxiliary.rb
48
51
  - lib/lrama/grammar/code.rb
52
+ - lib/lrama/grammar/code/initial_action_code.rb
53
+ - lib/lrama/grammar/code/no_reference_code.rb
54
+ - lib/lrama/grammar/code/printer_code.rb
55
+ - lib/lrama/grammar/code/rule_action.rb
56
+ - lib/lrama/grammar/counter.rb
49
57
  - lib/lrama/grammar/error_token.rb
58
+ - lib/lrama/grammar/parameterizing_rules/builder.rb
59
+ - lib/lrama/grammar/parameterizing_rules/builder/base.rb
60
+ - lib/lrama/grammar/parameterizing_rules/builder/list.rb
61
+ - lib/lrama/grammar/parameterizing_rules/builder/nonempty_list.rb
62
+ - lib/lrama/grammar/parameterizing_rules/builder/option.rb
63
+ - lib/lrama/grammar/parameterizing_rules/builder/separated_list.rb
64
+ - lib/lrama/grammar/parameterizing_rules/builder/separated_nonempty_list.rb
50
65
  - lib/lrama/grammar/percent_code.rb
51
66
  - lib/lrama/grammar/precedence.rb
52
67
  - lib/lrama/grammar/printer.rb
53
68
  - lib/lrama/grammar/reference.rb
54
69
  - lib/lrama/grammar/rule.rb
70
+ - lib/lrama/grammar/rule_builder.rb
55
71
  - lib/lrama/grammar/symbol.rb
56
72
  - lib/lrama/grammar/union.rb
57
73
  - lib/lrama/lexer.rb
74
+ - lib/lrama/lexer/location.rb
58
75
  - lib/lrama/lexer/token.rb
59
76
  - lib/lrama/lexer/token/char.rb
60
77
  - lib/lrama/lexer/token/ident.rb
@@ -90,8 +107,17 @@ files:
90
107
  - sig/lrama/bitmap.rbs
91
108
  - sig/lrama/digraph.rbs
92
109
  - sig/lrama/grammar.rbs
110
+ - sig/lrama/grammar/code.rbs
111
+ - sig/lrama/grammar/code/printer_code.rbs
112
+ - sig/lrama/grammar/counter.rbs
113
+ - sig/lrama/grammar/parameterizing_rules/builder.rbs
93
114
  - sig/lrama/grammar/percent_code.rbs
115
+ - sig/lrama/grammar/precedence.rbs
116
+ - sig/lrama/grammar/printer.rbs
94
117
  - sig/lrama/grammar/reference.rbs
118
+ - sig/lrama/grammar/rule.rbs
119
+ - sig/lrama/grammar/rule_builder.rbs
120
+ - sig/lrama/lexer/location.rbs
95
121
  - sig/lrama/lexer/token.rbs
96
122
  - sig/lrama/lexer/token/char.rbs
97
123
  - sig/lrama/lexer/token/ident.rbs
@@ -101,6 +127,7 @@ files:
101
127
  - sig/lrama/report/duration.rbs
102
128
  - sig/lrama/report/profile.rbs
103
129
  - sig/lrama/warning.rbs
130
+ - sig/stdlib/strscan/string_scanner.rbs
104
131
  - template/bison/_yacc.h
105
132
  - template/bison/yacc.c
106
133
  - template/bison/yacc.h