racc 1.4.8 → 1.4.9

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -29,12 +29,13 @@ Hoe.spec 'racc' do
29
29
  end
30
30
 
31
31
  file 'lib/racc/parser-text.rb' => ['lib/racc/parser.rb'] do |t|
32
- file = 'lib/racc/parser.rb'
33
- File.open(t.name, 'wb') { |file|
34
- file.write(<<-eorb)
32
+ source = 'lib/racc/parser.rb'
33
+
34
+ open(t.name, 'wb') { |io|
35
+ io.write(<<-eorb)
35
36
  module Racc
36
37
  PARSER_TEXT = <<'__end_of_file__'
37
- #{File.read(file)}"
38
+ #{File.read(source)}
38
39
  __end_of_file__
39
40
  end
40
41
  eorb
@@ -17,7 +17,7 @@
17
17
  Important Constants
18
18
  ----------------------------------------------------------------------- */
19
19
 
20
- #define RACC_VERSION "1.4.5"
20
+ #define RACC_VERSION "1.4.9"
21
21
 
22
22
  #define DEFAULT_TOKEN -1
23
23
  #define ERROR_TOKEN 1
@@ -1,5 +1,5 @@
1
1
  #
2
- # $Id: 59cb78bc6d79cb4801cea37e379c9ee58fae03b1 $
2
+ # $Id: 733f7084ff1dca50994cba55c8a05aba8d82eb31 $
3
3
  #
4
4
  # Copyright (c) 1999-2006 Minero Aoki
5
5
  #
@@ -503,7 +503,7 @@ module Racc
503
503
  set.update tmp
504
504
  return set
505
505
  end
506
- tok = h = nil
506
+ tok = nil
507
507
  set.update_a t.heads
508
508
  t.heads.each do |ptr|
509
509
  tok = ptr.dereference
@@ -10,7 +10,7 @@
10
10
  #
11
11
 
12
12
  module Racc
13
- VERSION = '1.4.8'
13
+ VERSION = '1.4.9'
14
14
  Version = VERSION
15
15
  Copyright = 'Copyright (c) 1999-2006 Minero Aoki'
16
16
  end
@@ -1,5 +1,5 @@
1
1
  #
2
- # $Id: e5067781f44dc04098421f5c717f2c1c3563a1ff $
2
+ # $Id: a7e9663605afdda065d305b250a9805e3bd3fa70 $
3
3
  #
4
4
  # Copyright (c) 1999-2006 Minero Aoki
5
5
  #
@@ -45,7 +45,6 @@ module Racc
45
45
  end
46
46
 
47
47
  def output_useless(out)
48
- used = []
49
48
  @grammar.each do |rl|
50
49
  if rl.useless?
51
50
  out.printf "rule %d (%s) never reduced\n",
@@ -90,8 +89,6 @@ module Racc
90
89
  end
91
90
 
92
91
  def action_out(f, state)
93
- r = ''
94
- e = ''
95
92
  sr = state.srconf && state.srconf.dup
96
93
  rr = state.rrconf && state.rrconf.dup
97
94
  acts = state.action
@@ -1,7 +1,7 @@
1
1
  module Racc
2
2
  PARSER_TEXT = <<'__end_of_file__'
3
- #
4
- # $Id: 3c2cf4b8b66a54ac219c7a6020e94b8668ec7e25 $
3
+ #
4
+ # $Id: ad1fffef443194fdfa1052d2eee6850552f94313 $
5
5
  #
6
6
  # Copyright (c) 1999-2006 Minero Aoki
7
7
  #
@@ -33,10 +33,10 @@ module Racc
33
33
  class Parser
34
34
 
35
35
  Racc_Runtime_Version = '1.4.6'
36
- Racc_Runtime_Revision = '$Id: 3c2cf4b8b66a54ac219c7a6020e94b8668ec7e25 $'
36
+ Racc_Runtime_Revision = '$Id: ad1fffef443194fdfa1052d2eee6850552f94313 $'
37
37
 
38
38
  Racc_Runtime_Core_Version_R = '1.4.6'
39
- Racc_Runtime_Core_Revision_R = '$Id: 3c2cf4b8b66a54ac219c7a6020e94b8668ec7e25 $'.split[1]
39
+ Racc_Runtime_Core_Revision_R = '$Id: ad1fffef443194fdfa1052d2eee6850552f94313 $'.split[1]
40
40
  begin
41
41
  require 'racc/cparse'
42
42
  # Racc_Runtime_Core_Version_C = (defined in extention)
@@ -107,13 +107,11 @@ module Racc
107
107
 
108
108
  def _racc_do_parse_rb(arg, in_debug)
109
109
  action_table, action_check, action_default, action_pointer,
110
- goto_table, goto_check, goto_default, goto_pointer,
111
- nt_base, reduce_table, token_table, shift_n,
112
- reduce_n, use_result, * = arg
110
+ _, _, _, _,
111
+ _, _, token_table, * = arg
113
112
 
114
113
  _racc_init_sysvars
115
114
  tok = act = i = nil
116
- nerr = 0
117
115
 
118
116
  catch(:racc_end_parse) {
119
117
  while true
@@ -156,12 +154,10 @@ module Racc
156
154
 
157
155
  def _racc_yyparse_rb(recv, mid, arg, c_debug)
158
156
  action_table, action_check, action_default, action_pointer,
159
- goto_table, goto_check, goto_default, goto_pointer,
160
- nt_base, reduce_table, token_table, shift_n,
161
- reduce_n, use_result, * = arg
157
+ _, _, _, _,
158
+ _, _, token_table, * = arg
162
159
 
163
160
  _racc_init_sysvars
164
- nerr = 0
165
161
 
166
162
  catch(:racc_end_parse) {
167
163
  until i = action_pointer[@racc_state[-1]]
@@ -210,10 +206,10 @@ module Racc
210
206
  ###
211
207
 
212
208
  def _racc_evalact(act, arg)
213
- action_table, action_check, action_default, action_pointer,
214
- goto_table, goto_check, goto_default, goto_pointer,
215
- nt_base, reduce_table, token_table, shift_n,
216
- reduce_n, use_result, * = arg
209
+ action_table, action_check, _, action_pointer,
210
+ _, _, _, _,
211
+ _, _, _, shift_n,
212
+ reduce_n, * = arg
217
213
  nerr = 0 # tmp
218
214
 
219
215
  if act > 0 and act < shift_n
@@ -305,10 +301,11 @@ module Racc
305
301
  end
306
302
 
307
303
  def _racc_do_reduce(arg, act)
308
- action_table, action_check, action_default, action_pointer,
309
- goto_table, goto_check, goto_default, goto_pointer,
310
- nt_base, reduce_table, token_table, shift_n,
311
- reduce_n, use_result, * = arg
304
+ _, _, _, _,
305
+ goto_table, goto_check, goto_default, goto_pointer,
306
+ nt_base, reduce_table, _, _,
307
+ _, use_result, * = arg
308
+
312
309
  state = @racc_state
313
310
  vstack = @racc_vstack
314
311
  tstack = @racc_tstack
@@ -1,5 +1,5 @@
1
1
  #
2
- # $Id: 3c2cf4b8b66a54ac219c7a6020e94b8668ec7e25 $
2
+ # $Id: ad1fffef443194fdfa1052d2eee6850552f94313 $
3
3
  #
4
4
  # Copyright (c) 1999-2006 Minero Aoki
5
5
  #
@@ -31,10 +31,10 @@ module Racc
31
31
  class Parser
32
32
 
33
33
  Racc_Runtime_Version = '1.4.6'
34
- Racc_Runtime_Revision = '$Id: 3c2cf4b8b66a54ac219c7a6020e94b8668ec7e25 $'
34
+ Racc_Runtime_Revision = '$Id: ad1fffef443194fdfa1052d2eee6850552f94313 $'
35
35
 
36
36
  Racc_Runtime_Core_Version_R = '1.4.6'
37
- Racc_Runtime_Core_Revision_R = '$Id: 3c2cf4b8b66a54ac219c7a6020e94b8668ec7e25 $'.split[1]
37
+ Racc_Runtime_Core_Revision_R = '$Id: ad1fffef443194fdfa1052d2eee6850552f94313 $'.split[1]
38
38
  begin
39
39
  require 'racc/cparse'
40
40
  # Racc_Runtime_Core_Version_C = (defined in extention)
@@ -105,13 +105,11 @@ module Racc
105
105
 
106
106
  def _racc_do_parse_rb(arg, in_debug)
107
107
  action_table, action_check, action_default, action_pointer,
108
- goto_table, goto_check, goto_default, goto_pointer,
109
- nt_base, reduce_table, token_table, shift_n,
110
- reduce_n, use_result, * = arg
108
+ _, _, _, _,
109
+ _, _, token_table, * = arg
111
110
 
112
111
  _racc_init_sysvars
113
112
  tok = act = i = nil
114
- nerr = 0
115
113
 
116
114
  catch(:racc_end_parse) {
117
115
  while true
@@ -154,12 +152,10 @@ module Racc
154
152
 
155
153
  def _racc_yyparse_rb(recv, mid, arg, c_debug)
156
154
  action_table, action_check, action_default, action_pointer,
157
- goto_table, goto_check, goto_default, goto_pointer,
158
- nt_base, reduce_table, token_table, shift_n,
159
- reduce_n, use_result, * = arg
155
+ _, _, _, _,
156
+ _, _, token_table, * = arg
160
157
 
161
158
  _racc_init_sysvars
162
- nerr = 0
163
159
 
164
160
  catch(:racc_end_parse) {
165
161
  until i = action_pointer[@racc_state[-1]]
@@ -208,10 +204,10 @@ module Racc
208
204
  ###
209
205
 
210
206
  def _racc_evalact(act, arg)
211
- action_table, action_check, action_default, action_pointer,
212
- goto_table, goto_check, goto_default, goto_pointer,
213
- nt_base, reduce_table, token_table, shift_n,
214
- reduce_n, use_result, * = arg
207
+ action_table, action_check, _, action_pointer,
208
+ _, _, _, _,
209
+ _, _, _, shift_n,
210
+ reduce_n, * = arg
215
211
  nerr = 0 # tmp
216
212
 
217
213
  if act > 0 and act < shift_n
@@ -303,10 +299,11 @@ module Racc
303
299
  end
304
300
 
305
301
  def _racc_do_reduce(arg, act)
306
- action_table, action_check, action_default, action_pointer,
307
- goto_table, goto_check, goto_default, goto_pointer,
308
- nt_base, reduce_table, token_table, shift_n,
309
- reduce_n, use_result, * = arg
302
+ _, _, _, _,
303
+ goto_table, goto_check, goto_default, goto_pointer,
304
+ nt_base, reduce_table, _, _,
305
+ _, use_result, * = arg
306
+
310
307
  state = @racc_state
311
308
  vstack = @racc_vstack
312
309
  tstack = @racc_tstack
@@ -1,5 +1,5 @@
1
1
  #
2
- # $Id: 3c349a9555848157adc107a876aaa77db47b6459 $
2
+ # $Id: 75aee0ac3cd6429e28eac511d78a717614123a89 $
3
3
  #
4
4
  # Copyright (c) 1999-2006 Minero Aoki
5
5
  #
@@ -114,7 +114,7 @@ module Racc
114
114
  footer
115
115
  end
116
116
 
117
- c = ::Config::CONFIG
117
+ c = ::RbConfig::CONFIG
118
118
  RUBY_PATH = "#{c['bindir']}/#{c['ruby_install_name']}#{c['EXEEXT']}"
119
119
 
120
120
  def shebang(path)
@@ -463,7 +463,7 @@ module Racc
463
463
  def remove_blank_lines(src)
464
464
  body = src.text.dup
465
465
  line = src.lineno
466
- while m = body.slice!(/\A[ \t\f]*(?:\n|\r\n|\r)/)
466
+ while body.slice!(/\A[ \t\f]*(?:\n|\r\n|\r)/)
467
467
  line += 1
468
468
  end
469
469
  SourceText.new(body, src.filename, line)
@@ -1,5 +1,5 @@
1
1
  #
2
- # $Id: ac1616603c3b544fd4a8922377cb566e4b64cfc9 $
2
+ # $Id: 4c5f4311663b6d03050953d64d6a0e7905ff2216 $
3
3
  #
4
4
  # Copyright (c) 1999-2006 Minero Aoki
5
5
  #
@@ -302,7 +302,7 @@ module Racc
302
302
  c.funcall(:alias_method, "_reduce_#{rule.ident}", :_reduce_none)
303
303
  else
304
304
  c.funcall(:define_method, "_racc_action_#{rule.ident}", &rule.action.proc)
305
- c.module_eval(s = <<-End, __FILE__, __LINE__ + 1)
305
+ c.module_eval(<<-End, __FILE__, __LINE__ + 1)
306
306
  def _reduce_#{rule.ident}(vals, vstack)
307
307
  _racc_action_#{rule.ident}(*vals)
308
308
  end
@@ -2,6 +2,7 @@ $VERBOSE = true
2
2
  require 'test/unit'
3
3
  require 'racc/static'
4
4
  require 'fileutils'
5
+ require 'tempfile'
5
6
 
6
7
  module Racc
7
8
  class TestCase < Test::Unit::TestCase
@@ -76,12 +77,14 @@ module Racc
76
77
  def racc arg
77
78
  ruby "-S #{RACC} #{arg}"
78
79
  end
79
-
80
+
80
81
  def ruby arg
81
82
  Dir.chdir(TEST_DIR) do
82
- cmd = "#{ENV['_']} -I #{INC} #{arg} 2>>/tmp/out"
83
- result = system(cmd)
84
- result ? assert(result) : raise(cmd)
83
+ Tempfile.open 'test' do |io|
84
+ cmd = "#{ENV['_']} -I #{INC} #{arg} 2>#{io.path}"
85
+ result = system(cmd)
86
+ assert(result, io.read)
87
+ end
85
88
  end
86
89
  end
87
90
  end
@@ -141,13 +141,13 @@ module Racc
141
141
  end
142
142
 
143
143
  def test_norule_y
144
- assert_raises(RuntimeError) {
144
+ assert_raises(MiniTest::Assertion) {
145
145
  assert_compile 'norule.y'
146
146
  }
147
147
  end
148
148
 
149
149
  def test_unterm_y
150
- assert_raises(RuntimeError) {
150
+ assert_raises(MiniTest::Assertion) {
151
151
  assert_compile 'unterm.y'
152
152
  }
153
153
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: racc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.8
4
+ version: 1.4.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,41 +9,56 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-02 00:00:00.000000000 Z
12
+ date: 2012-08-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: rake-compiler
16
- requirement: &70145906201240 !ruby/object:Gem::Requirement
15
+ name: rdoc
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
- - - ! '>='
19
+ - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 0.4.1
21
+ version: '3.10'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70145906201240
25
- - !ruby/object:Gem::Dependency
26
- name: rdoc
27
- requirement: &70145906200460 !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
28
25
  none: false
29
26
  requirements:
30
27
  - - ~>
31
28
  - !ruby/object:Gem::Version
32
29
  version: '3.10'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rake-compiler
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: 0.4.1
33
38
  type: :development
34
39
  prerelease: false
35
- version_requirements: *70145906200460
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: 0.4.1
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: hoe
38
- requirement: &70145906199740 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ~>
42
52
  - !ruby/object:Gem::Version
43
- version: '2.13'
53
+ version: '3.0'
44
54
  type: :development
45
55
  prerelease: false
46
- version_requirements: *70145906199740
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '3.0'
47
62
  description: ! "Racc is a LALR(1) parser generator.\n It is written in Ruby itself,
48
63
  and generates Ruby program.\n\n NOTE: Ruby 1.8.x comes with Racc runtime module.
49
64
  \ You\n can run your parsers generated by racc 1.4.x out of the\n box."
@@ -59,6 +74,14 @@ extra_rdoc_files:
59
74
  - Manifest.txt
60
75
  - README.ja.rdoc
61
76
  - README.rdoc
77
+ - rdoc/en/NEWS.en.rdoc
78
+ - rdoc/en/debug.en.rdoc
79
+ - rdoc/en/grammar.en.rdoc
80
+ - rdoc/en/parser.en.rdoc
81
+ - rdoc/ja/NEWS.ja.rdoc
82
+ - rdoc/ja/debug.ja.rdoc
83
+ - rdoc/ja/grammar.ja.rdoc
84
+ - rdoc/ja/parser.ja.rdoc
62
85
  files:
63
86
  - COPYING
64
87
  - ChangeLog
@@ -188,7 +211,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
188
211
  version: '0'
189
212
  requirements: []
190
213
  rubyforge_project: racc
191
- rubygems_version: 1.8.11
214
+ rubygems_version: 1.8.23
192
215
  signing_key:
193
216
  specification_version: 3
194
217
  summary: Racc is a LALR(1) parser generator