racc 1.4.9-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. data/.gemtest +0 -0
  2. data/COPYING +515 -0
  3. data/ChangeLog +846 -0
  4. data/DEPENDS +4 -0
  5. data/Manifest.txt +105 -0
  6. data/README.ja.rdoc +96 -0
  7. data/README.rdoc +86 -0
  8. data/Rakefile +51 -0
  9. data/TODO +5 -0
  10. data/bin/racc +308 -0
  11. data/bin/racc2y +195 -0
  12. data/bin/y2racc +339 -0
  13. data/ext/racc/MANIFEST +4 -0
  14. data/ext/racc/cparse.c +824 -0
  15. data/ext/racc/depend +1 -0
  16. data/ext/racc/extconf.rb +5 -0
  17. data/fastcache/extconf.rb +2 -0
  18. data/fastcache/fastcache.c +185 -0
  19. data/lib/racc.rb +6 -0
  20. data/lib/racc/compat.rb +40 -0
  21. data/lib/racc/debugflags.rb +59 -0
  22. data/lib/racc/exception.rb +15 -0
  23. data/lib/racc/grammar.rb +1115 -0
  24. data/lib/racc/grammarfileparser.rb +559 -0
  25. data/lib/racc/info.rb +16 -0
  26. data/lib/racc/iset.rb +91 -0
  27. data/lib/racc/logfilegenerator.rb +211 -0
  28. data/lib/racc/parser-text.rb +479 -0
  29. data/lib/racc/parser.rb +474 -0
  30. data/lib/racc/parserfilegenerator.rb +512 -0
  31. data/lib/racc/pre-setup +13 -0
  32. data/lib/racc/sourcetext.rb +34 -0
  33. data/lib/racc/state.rb +971 -0
  34. data/lib/racc/statetransitiontable.rb +316 -0
  35. data/lib/racc/static.rb +5 -0
  36. data/misc/dist.sh +31 -0
  37. data/rdoc/en/NEWS.en.rdoc +282 -0
  38. data/rdoc/en/command.en.html +78 -0
  39. data/rdoc/en/debug.en.rdoc +20 -0
  40. data/rdoc/en/grammar.en.rdoc +230 -0
  41. data/rdoc/en/index.en.html +10 -0
  42. data/rdoc/en/parser.en.rdoc +74 -0
  43. data/rdoc/en/usage.en.rdoc +83 -0
  44. data/rdoc/ja/NEWS.ja.rdoc +307 -0
  45. data/rdoc/ja/command.ja.html +94 -0
  46. data/rdoc/ja/debug.ja.rdoc +36 -0
  47. data/rdoc/ja/grammar.ja.rdoc +348 -0
  48. data/rdoc/ja/index.ja.html +10 -0
  49. data/rdoc/ja/parser.ja.rdoc +125 -0
  50. data/rdoc/ja/usage.ja.html +414 -0
  51. data/sample/array.y +67 -0
  52. data/sample/array2.y +59 -0
  53. data/sample/calc-ja.y +66 -0
  54. data/sample/calc.y +65 -0
  55. data/sample/conflict.y +15 -0
  56. data/sample/hash.y +60 -0
  57. data/sample/lalr.y +17 -0
  58. data/sample/lists.y +57 -0
  59. data/sample/syntax.y +46 -0
  60. data/sample/yyerr.y +46 -0
  61. data/setup.rb +1587 -0
  62. data/tasks/doc.rb +12 -0
  63. data/tasks/email.rb +55 -0
  64. data/test/assets/chk.y +126 -0
  65. data/test/assets/conf.y +16 -0
  66. data/test/assets/digraph.y +29 -0
  67. data/test/assets/echk.y +118 -0
  68. data/test/assets/err.y +60 -0
  69. data/test/assets/expect.y +7 -0
  70. data/test/assets/firstline.y +4 -0
  71. data/test/assets/ichk.y +102 -0
  72. data/test/assets/intp.y +546 -0
  73. data/test/assets/mailp.y +437 -0
  74. data/test/assets/newsyn.y +25 -0
  75. data/test/assets/noend.y +4 -0
  76. data/test/assets/nonass.y +41 -0
  77. data/test/assets/normal.y +27 -0
  78. data/test/assets/norule.y +4 -0
  79. data/test/assets/nullbug1.y +25 -0
  80. data/test/assets/nullbug2.y +15 -0
  81. data/test/assets/opt.y +123 -0
  82. data/test/assets/percent.y +35 -0
  83. data/test/assets/recv.y +97 -0
  84. data/test/assets/rrconf.y +14 -0
  85. data/test/assets/scan.y +72 -0
  86. data/test/assets/syntax.y +50 -0
  87. data/test/assets/unterm.y +5 -0
  88. data/test/assets/useless.y +12 -0
  89. data/test/assets/yyerr.y +46 -0
  90. data/test/bench.y +36 -0
  91. data/test/helper.rb +91 -0
  92. data/test/infini.y +8 -0
  93. data/test/scandata/brace +7 -0
  94. data/test/scandata/gvar +1 -0
  95. data/test/scandata/normal +4 -0
  96. data/test/scandata/percent +18 -0
  97. data/test/scandata/slash +10 -0
  98. data/test/src.intp +34 -0
  99. data/test/start.y +20 -0
  100. data/test/test_chk_y.rb +51 -0
  101. data/test/test_grammar_file_parser.rb +15 -0
  102. data/test/test_racc_command.rb +155 -0
  103. data/test/test_scan_y.rb +51 -0
  104. data/test/testscanner.rb +51 -0
  105. data/web/racc.en.rhtml +42 -0
  106. data/web/racc.ja.rhtml +51 -0
  107. metadata +233 -0
@@ -0,0 +1,51 @@
1
+ require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
2
+
3
+ module Racc
4
+ class TestScanY < TestCase
5
+ def setup
6
+ file = File.join(ASSET_DIR, 'scan.y')
7
+ @debug_flags = Racc::DebugFlags.parse_option_string('o')
8
+ parser = Racc::GrammarFileParser.new(@debug_flags)
9
+ @result = parser.parse(File.read(file), File.basename(file))
10
+ @states = Racc::States.new(@result.grammar).nfa
11
+ @states.dfa
12
+ end
13
+
14
+ def test_compile
15
+ generator = Racc::ParserFileGenerator.new(@states, @result.params.dup)
16
+
17
+ # it generates valid ruby
18
+ assert Module.new {
19
+ self.class_eval(generator.generate_parser)
20
+ }
21
+
22
+ grammar = @states.grammar
23
+
24
+ assert_equal 0, @states.n_srconflicts
25
+ assert_equal 0, @states.n_rrconflicts
26
+ assert_equal 0, grammar.n_useless_nonterminals
27
+ assert_equal 0, grammar.n_useless_rules
28
+ assert_nil grammar.n_expected_srconflicts
29
+ end
30
+
31
+ def test_compile_line_convert
32
+ params = @result.params.dup
33
+ params.convert_line_all = true
34
+
35
+ generator = Racc::ParserFileGenerator.new(@states, @result.params.dup)
36
+
37
+ # it generates valid ruby
38
+ assert Module.new {
39
+ self.class_eval(generator.generate_parser)
40
+ }
41
+
42
+ grammar = @states.grammar
43
+
44
+ assert_equal 0, @states.n_srconflicts
45
+ assert_equal 0, @states.n_rrconflicts
46
+ assert_equal 0, grammar.n_useless_nonterminals
47
+ assert_equal 0, grammar.n_useless_rules
48
+ assert_nil grammar.n_expected_srconflicts
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,51 @@
1
+ #
2
+ # racc scanner tester
3
+ #
4
+
5
+ require 'racc/raccs'
6
+
7
+
8
+ class ScanError < StandardError; end
9
+
10
+ def testdata( dir, argv )
11
+ if argv.empty? then
12
+ Dir.glob( dir + '/*' ) -
13
+ Dir.glob( dir + '/*.swp' ) -
14
+ [ dir + '/CVS' ]
15
+ else
16
+ argv.collect {|i| dir + '/' + i }
17
+ end
18
+ end
19
+
20
+
21
+ if ARGV.delete '--print' then
22
+ $raccs_print_type = true
23
+ printonly = true
24
+ else
25
+ printonly = false
26
+ end
27
+
28
+ testdata( File.dirname($0) + '/scandata', ARGV ).each do |file|
29
+ $stderr.print File.basename(file) + ': '
30
+ begin
31
+ ok = File.read(file)
32
+ s = Racc::GrammarFileScanner.new( ok )
33
+ sym, (val, lineno) = s.scan
34
+ if printonly then
35
+ $stderr.puts
36
+ $stderr.puts val
37
+ next
38
+ end
39
+
40
+ val = '{' + val + "}\n"
41
+ sym == :ACTION or raise ScanError, 'is not action!'
42
+ val == ok or raise ScanError, "\n>>>\n#{ok}----\n#{val}<<<"
43
+
44
+ $stderr.puts 'ok'
45
+ rescue => err
46
+ $stderr.puts 'fail (' + err.type.to_s + ')'
47
+ $stderr.puts err.message
48
+ $stderr.puts err.backtrace
49
+ $stderr.puts
50
+ end
51
+ end
data/web/racc.en.rhtml ADDED
@@ -0,0 +1,42 @@
1
+ % require 'makefile'
2
+ % version = Makefile.get_parameter('Makefile', 'version')
3
+ <h1>Racc</h1>
4
+ <p>
5
+ $Id$
6
+ </p>
7
+
8
+ <table summary="package descriptor">
9
+ <tr><th>Version</th><td><%= version %></td></tr>
10
+ <tr><th>Type</th><td>Parser Generator</td></tr>
11
+ <tr><th>Format</th><td>Ruby script + Ruby extention</td></tr>
12
+ <tr><th>Requirement</th><td>ruby (&gt;=1.6)</td></tr>
13
+ <tr><th>License</th><td>LGPL</td></tr>
14
+ </table>
15
+ <p>
16
+ -- <a href="/archive/racc/racc-<%= version %>-all.tar.gz">Download (.tar.gz)</a>
17
+ -- <a href="/archive/racc/">Old Versions</a>
18
+ -- <a href="doc/">Online Manual</a>
19
+ --
20
+ </p>
21
+
22
+ <p>
23
+ Racc (Ruby yACC) is a LALR(1) parser generator for Ruby.
24
+ Version 1.4.x is stable release.
25
+ </p>
26
+ <p>
27
+ Parsers generated by Racc requires "Racc Runtime Module".
28
+ Ruby 1.8.x comes with this runtime.
29
+ If you want to run your parsers with ruby 1.6.x,
30
+ use "racc -E" command. For details, see <a href="doc/">online manual</a>.
31
+ </p>
32
+
33
+ <h2>Anonymous CVS</h2>
34
+ <p>
35
+ You can true latest version of Racc via anonymous CVS.
36
+ To check out working copy, type:
37
+ </p>
38
+ <pre>
39
+ $ cvs -d :pserver:anonymous@cvs.loveruby.net:/src login
40
+ Password: (Just hit [Enter])
41
+ $ cvs -d :pserver:anonymous@cvs.loveruby.net:/src co racc
42
+ </pre>
data/web/racc.ja.rhtml ADDED
@@ -0,0 +1,51 @@
1
+ % require 'makefile'
2
+ % version = Makefile.get_parameter('Makefile', 'version')
3
+ <h1>Racc</h1>
4
+ <p>
5
+ $Id$
6
+ </p>
7
+ <table summary="package descriptor">
8
+ <tr><th>�ǿ���</th><td><%= version %></td></tr>
9
+ <tr><th>����</th><td>parser generator</td></tr>
10
+ <tr><th>����</th><td>ruby script, ruby extention</td></tr>
11
+ <tr><th>ɬ�״Ķ�</th><td>ruby (&gt;=1.6)</td></tr>
12
+ <tr><th>���۾��</th><td>LGPL</td></tr>
13
+ </table>
14
+ <ul>
15
+ <li><a href="/archive/racc/racc-<%= version %>-all.tar.gz">�����������</a></li>
16
+ <li><a href="/archive/racc/">��С������ꥹ��</a></li>
17
+ <li><a href="doc/">����饤��ޥ˥奢��</a></li>
18
+ </ul>
19
+ </p>
20
+ <p>
21
+ Ruby �Ѥ� LALR(1) �ѡ��������ͥ졼���Ǥ���
22
+ ���������ѡ����Ϥ���ʤ�˹�®��ư��ޤ���
23
+ </p>
24
+ <p>
25
+ Racc �����������ѡ�����ư����˥�󥿥���⥸�塼�뤬ɬ�פǤ���
26
+ Ruby 1.8 �ˤϤ��Υ�󥿥��ब�ǽ餫��ź�դ���Ƥ���Τ�
27
+ ����ͤ��ʤ�������פǤ�����Ruby 1.6 �������оݤˤ���Ȥ���
28
+ racc -E �ǥѡ�������������ɬ�פ�����ޤ���
29
+ </p>
30
+ <p>
31
+ �ʤ���Racc 1.4.x �Υ�󥿥���� Ruby 1.8 ź�դ� Racc ��󥿥���ϡ�
32
+ �����������ɾ�Ǥ���̯�˰㤤������ޤ����������˸ߴ���������ޤ���
33
+ </p>
34
+
35
+ <h2>����</h2>
36
+ <p>
37
+ �⤦����Ū����ʬ�ϸϤ�Ƥ���Ϥ��Ǥ���
38
+ TODO �Ϥޤ������Ĥ�����ޤ�������������¾�ˤ��äƤ�Τ�
39
+ ��ʬ���礭���ѹ�����Ĥ��Ϥ���ޤ���
40
+ </p>
41
+
42
+ <h2>CVS ��ݥ��ȥ�</h2>
43
+ <p>
44
+ CVS ��Ȥ��� Racc �ο��κǿ��Ǥ�����Ǥ��ޤ���
45
+ ���ޥ�ɥ饤��Ǽ��Τ褦���ǤäƤ���������
46
+ </p>
47
+ <pre>
48
+ $ cvs -d :pserver:anonymous@cvs.loveruby.net:/src login
49
+ Password: (������Enter���Ǥ�)
50
+ $ cvs -d :pserver:anonymous@cvs.loveruby.net:/src co racc
51
+ </pre>
metadata ADDED
@@ -0,0 +1,233 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: racc
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 1.4.9
6
+ platform: java
7
+ authors:
8
+ - Aaron Patterson
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-04-03 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rdoc
16
+ version_requirements: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: '3.10'
21
+ none: false
22
+ requirement: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.10'
27
+ none: false
28
+ prerelease: false
29
+ type: :development
30
+ - !ruby/object:Gem::Dependency
31
+ name: rake-compiler
32
+ version_requirements: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: 0.4.1
37
+ none: false
38
+ requirement: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 0.4.1
43
+ none: false
44
+ prerelease: false
45
+ type: :development
46
+ - !ruby/object:Gem::Dependency
47
+ name: hoe
48
+ version_requirements: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - "~>"
51
+ - !ruby/object:Gem::Version
52
+ version: '3.3'
53
+ none: false
54
+ requirement: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - "~>"
57
+ - !ruby/object:Gem::Version
58
+ version: '3.3'
59
+ none: false
60
+ prerelease: false
61
+ type: :development
62
+ description: |-
63
+ Racc is a LALR(1) parser generator.
64
+ It is written in Ruby itself, and generates Ruby program.
65
+
66
+ NOTE: Ruby 1.8.x comes with Racc runtime module. You
67
+ can run your parsers generated by racc 1.4.x out of the
68
+ box.
69
+ email:
70
+ - aaron@tenderlovemaking.com
71
+ executables:
72
+ - racc
73
+ - racc2y
74
+ - y2racc
75
+ extensions: []
76
+ extra_rdoc_files:
77
+ - Manifest.txt
78
+ - README.ja.rdoc
79
+ - README.rdoc
80
+ - rdoc/en/NEWS.en.rdoc
81
+ - rdoc/en/debug.en.rdoc
82
+ - rdoc/en/grammar.en.rdoc
83
+ - rdoc/en/parser.en.rdoc
84
+ - rdoc/en/usage.en.rdoc
85
+ - rdoc/ja/NEWS.ja.rdoc
86
+ - rdoc/ja/debug.ja.rdoc
87
+ - rdoc/ja/grammar.ja.rdoc
88
+ - rdoc/ja/parser.ja.rdoc
89
+ files:
90
+ - COPYING
91
+ - ChangeLog
92
+ - DEPENDS
93
+ - Manifest.txt
94
+ - README.ja.rdoc
95
+ - README.rdoc
96
+ - Rakefile
97
+ - TODO
98
+ - bin/racc
99
+ - bin/racc2y
100
+ - bin/y2racc
101
+ - ext/racc/MANIFEST
102
+ - ext/racc/cparse.c
103
+ - ext/racc/depend
104
+ - ext/racc/extconf.rb
105
+ - fastcache/extconf.rb
106
+ - fastcache/fastcache.c
107
+ - lib/racc.rb
108
+ - lib/racc/compat.rb
109
+ - lib/racc/debugflags.rb
110
+ - lib/racc/exception.rb
111
+ - lib/racc/grammar.rb
112
+ - lib/racc/grammarfileparser.rb
113
+ - lib/racc/info.rb
114
+ - lib/racc/iset.rb
115
+ - lib/racc/logfilegenerator.rb
116
+ - lib/racc/parser-text.rb
117
+ - lib/racc/parser.rb
118
+ - lib/racc/parserfilegenerator.rb
119
+ - lib/racc/pre-setup
120
+ - lib/racc/sourcetext.rb
121
+ - lib/racc/state.rb
122
+ - lib/racc/statetransitiontable.rb
123
+ - lib/racc/static.rb
124
+ - misc/dist.sh
125
+ - rdoc/en/NEWS.en.rdoc
126
+ - rdoc/en/command.en.html
127
+ - rdoc/en/debug.en.rdoc
128
+ - rdoc/en/grammar.en.rdoc
129
+ - rdoc/en/index.en.html
130
+ - rdoc/en/parser.en.rdoc
131
+ - rdoc/en/usage.en.rdoc
132
+ - rdoc/ja/NEWS.ja.rdoc
133
+ - rdoc/ja/command.ja.html
134
+ - rdoc/ja/debug.ja.rdoc
135
+ - rdoc/ja/grammar.ja.rdoc
136
+ - rdoc/ja/index.ja.html
137
+ - rdoc/ja/parser.ja.rdoc
138
+ - rdoc/ja/usage.ja.html
139
+ - sample/array.y
140
+ - sample/array2.y
141
+ - sample/calc-ja.y
142
+ - sample/calc.y
143
+ - sample/conflict.y
144
+ - sample/hash.y
145
+ - sample/lalr.y
146
+ - sample/lists.y
147
+ - sample/syntax.y
148
+ - sample/yyerr.y
149
+ - setup.rb
150
+ - tasks/doc.rb
151
+ - tasks/email.rb
152
+ - test/assets/chk.y
153
+ - test/assets/conf.y
154
+ - test/assets/digraph.y
155
+ - test/assets/echk.y
156
+ - test/assets/err.y
157
+ - test/assets/expect.y
158
+ - test/assets/firstline.y
159
+ - test/assets/ichk.y
160
+ - test/assets/intp.y
161
+ - test/assets/mailp.y
162
+ - test/assets/newsyn.y
163
+ - test/assets/noend.y
164
+ - test/assets/nonass.y
165
+ - test/assets/normal.y
166
+ - test/assets/norule.y
167
+ - test/assets/nullbug1.y
168
+ - test/assets/nullbug2.y
169
+ - test/assets/opt.y
170
+ - test/assets/percent.y
171
+ - test/assets/recv.y
172
+ - test/assets/rrconf.y
173
+ - test/assets/scan.y
174
+ - test/assets/syntax.y
175
+ - test/assets/unterm.y
176
+ - test/assets/useless.y
177
+ - test/assets/yyerr.y
178
+ - test/bench.y
179
+ - test/helper.rb
180
+ - test/infini.y
181
+ - test/scandata/brace
182
+ - test/scandata/gvar
183
+ - test/scandata/normal
184
+ - test/scandata/percent
185
+ - test/scandata/slash
186
+ - test/src.intp
187
+ - test/start.y
188
+ - test/test_chk_y.rb
189
+ - test/test_grammar_file_parser.rb
190
+ - test/test_racc_command.rb
191
+ - test/test_scan_y.rb
192
+ - test/testscanner.rb
193
+ - web/racc.en.rhtml
194
+ - web/racc.ja.rhtml
195
+ - ".gemtest"
196
+ homepage: http://i.loveruby.net/en/projects/racc/
197
+ licenses: []
198
+ post_install_message:
199
+ rdoc_options:
200
+ - "--main"
201
+ - README.rdoc
202
+ require_paths:
203
+ - !binary |-
204
+ bGli
205
+ required_ruby_version: !ruby/object:Gem::Requirement
206
+ requirements:
207
+ - - ">="
208
+ - !ruby/object:Gem::Version
209
+ version: !binary |-
210
+ MA==
211
+ none: false
212
+ required_rubygems_version: !ruby/object:Gem::Requirement
213
+ requirements:
214
+ - - ">="
215
+ - !ruby/object:Gem::Version
216
+ version: !binary |-
217
+ MA==
218
+ none: false
219
+ requirements: []
220
+ rubyforge_project: racc
221
+ rubygems_version: 1.8.24
222
+ signing_key:
223
+ specification_version: 3
224
+ summary: Racc is a LALR(1) parser generator
225
+ test_files:
226
+ - !binary |-
227
+ dGVzdC90ZXN0X2Noa195LnJi
228
+ - !binary |-
229
+ dGVzdC90ZXN0X2dyYW1tYXJfZmlsZV9wYXJzZXIucmI=
230
+ - !binary |-
231
+ dGVzdC90ZXN0X3JhY2NfY29tbWFuZC5yYg==
232
+ - !binary |-
233
+ dGVzdC90ZXN0X3NjYW5feS5yYg==