racc 1.4.16 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.ja.rdoc +0 -1
- data/README.rdoc +8 -11
- data/bin/racc +37 -23
- data/{rdoc → doc}/en/NEWS.en.rdoc +0 -0
- data/{rdoc → doc}/en/grammar.en.rdoc +27 -31
- data/doc/en/grammar2.en.rdoc +219 -0
- data/{rdoc → doc}/ja/NEWS.ja.rdoc +0 -0
- data/{rdoc → doc}/ja/command.ja.html +1 -1
- data/{rdoc → doc}/ja/debug.ja.rdoc +0 -0
- data/{rdoc → doc}/ja/grammar.ja.rdoc +0 -0
- data/{rdoc → doc}/ja/index.ja.html +0 -0
- data/{rdoc → doc}/ja/parser.ja.rdoc +0 -0
- data/{rdoc → doc}/ja/usage.ja.html +0 -0
- data/ext/racc/cparse/cparse.c +19 -17
- data/ext/racc/cparse/extconf.rb +2 -1
- data/lib/racc/compat.rb +5 -4
- data/lib/racc/debugflags.rb +5 -4
- data/lib/racc/exception.rb +4 -1
- data/lib/racc/grammar.rb +22 -17
- data/lib/racc/grammarfileparser.rb +7 -6
- data/lib/racc/info.rb +5 -2
- data/lib/racc/iset.rb +5 -4
- data/lib/racc/logfilegenerator.rb +5 -4
- data/lib/racc/parser-text.rb +10 -16
- data/lib/racc/parser.rb +10 -16
- data/lib/racc/parserfilegenerator.rb +5 -47
- data/lib/racc/sourcetext.rb +5 -4
- data/lib/racc/state.rb +4 -1
- data/lib/racc/statetransitiontable.rb +9 -14
- metadata +22 -140
- data/DEPENDS +0 -4
- data/Manifest.txt +0 -146
- data/Rakefile +0 -58
- data/bin/racc2y +0 -195
- data/bin/y2racc +0 -339
- data/ext/racc/com/headius/racc/Cparse.java +0 -849
- data/fastcache/extconf.rb +0 -2
- data/fastcache/fastcache.c +0 -185
- data/lib/racc/pre-setup +0 -13
- data/misc/dist.sh +0 -31
- data/sample/array.y +0 -67
- data/sample/array2.y +0 -59
- data/sample/calc-ja.y +0 -66
- data/sample/calc.y +0 -65
- data/sample/conflict.y +0 -15
- data/sample/hash.y +0 -60
- data/sample/lalr.y +0 -17
- data/sample/lists.y +0 -57
- data/sample/syntax.y +0 -46
- data/sample/yyerr.y +0 -46
- data/setup.rb +0 -1587
- data/tasks/doc.rb +0 -12
- data/tasks/email.rb +0 -55
- data/test/assets/cadenza.y +0 -170
- data/test/assets/cast.y +0 -926
- data/test/assets/chk.y +0 -126
- data/test/assets/conf.y +0 -16
- data/test/assets/csspool.y +0 -729
- data/test/assets/digraph.y +0 -29
- data/test/assets/echk.y +0 -118
- data/test/assets/edtf.y +0 -583
- data/test/assets/err.y +0 -60
- data/test/assets/error_recovery.y +0 -35
- data/test/assets/expect.y +0 -7
- data/test/assets/firstline.y +0 -4
- data/test/assets/huia.y +0 -318
- data/test/assets/ichk.y +0 -102
- data/test/assets/intp.y +0 -546
- data/test/assets/journey.y +0 -47
- data/test/assets/liquor.y +0 -313
- data/test/assets/machete.y +0 -423
- data/test/assets/macruby.y +0 -2197
- data/test/assets/mailp.y +0 -437
- data/test/assets/mediacloth.y +0 -599
- data/test/assets/mof.y +0 -649
- data/test/assets/namae.y +0 -302
- data/test/assets/nasl.y +0 -626
- data/test/assets/newsyn.y +0 -25
- data/test/assets/noend.y +0 -4
- data/test/assets/nokogiri-css.y +0 -255
- data/test/assets/nonass.y +0 -41
- data/test/assets/normal.y +0 -27
- data/test/assets/norule.y +0 -4
- data/test/assets/nullbug1.y +0 -25
- data/test/assets/nullbug2.y +0 -15
- data/test/assets/opal.y +0 -1807
- data/test/assets/opt.y +0 -123
- data/test/assets/percent.y +0 -35
- data/test/assets/php_serialization.y +0 -98
- data/test/assets/recv.y +0 -97
- data/test/assets/riml.y +0 -665
- data/test/assets/rrconf.y +0 -14
- data/test/assets/ruby18.y +0 -1943
- data/test/assets/ruby19.y +0 -2174
- data/test/assets/ruby20.y +0 -2350
- data/test/assets/ruby21.y +0 -2359
- data/test/assets/ruby22.y +0 -2381
- data/test/assets/scan.y +0 -72
- data/test/assets/syntax.y +0 -50
- data/test/assets/tp_plus.y +0 -622
- data/test/assets/twowaysql.y +0 -278
- data/test/assets/unterm.y +0 -5
- data/test/assets/useless.y +0 -12
- data/test/assets/yyerr.y +0 -46
- data/test/bench.y +0 -36
- data/test/helper.rb +0 -115
- data/test/infini.y +0 -8
- data/test/regress/cadenza +0 -796
- data/test/regress/cast +0 -3425
- data/test/regress/csspool +0 -2318
- data/test/regress/edtf +0 -1794
- data/test/regress/huia +0 -1392
- data/test/regress/journey +0 -222
- data/test/regress/liquor +0 -885
- data/test/regress/machete +0 -833
- data/test/regress/mediacloth +0 -1463
- data/test/regress/mof +0 -1368
- data/test/regress/namae +0 -634
- data/test/regress/nasl +0 -2058
- data/test/regress/nokogiri-css +0 -836
- data/test/regress/opal +0 -6429
- data/test/regress/php_serialization +0 -336
- data/test/regress/riml +0 -3297
- data/test/regress/ruby18 +0 -6351
- data/test/regress/ruby22 +0 -7456
- data/test/regress/tp_plus +0 -1933
- data/test/regress/twowaysql +0 -556
- data/test/scandata/brace +0 -7
- data/test/scandata/gvar +0 -1
- data/test/scandata/normal +0 -4
- data/test/scandata/percent +0 -18
- data/test/scandata/slash +0 -10
- data/test/src.intp +0 -34
- data/test/start.y +0 -20
- data/test/test_chk_y.rb +0 -52
- data/test/test_grammar_file_parser.rb +0 -15
- data/test/test_racc_command.rb +0 -322
- data/test/test_scan_y.rb +0 -52
- data/test/testscanner.rb +0 -51
- data/web/racc.en.rhtml +0 -42
- data/web/racc.ja.rhtml +0 -51
data/tasks/doc.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
require 'rake/rdoctask'
|
2
|
-
|
3
|
-
Rake::RDocTask.new(:docs) do |rd|
|
4
|
-
rd.main = "README.en.rdoc"
|
5
|
-
rd.rdoc_files.include(SPEC.files.find_all { |file_name|
|
6
|
-
file_name =~ /^(bin|lib|ext)/ || file_name !~ /\//
|
7
|
-
})
|
8
|
-
|
9
|
-
title = "#{SPEC.name}-#{SPEC.version} Documentation"
|
10
|
-
|
11
|
-
rd.options << "-t #{title}"
|
12
|
-
end
|
data/tasks/email.rb
DELETED
@@ -1,55 +0,0 @@
|
|
1
|
-
class EmailTask
|
2
|
-
def initialize language, readme, changelog
|
3
|
-
@language = language
|
4
|
-
@readme = readme
|
5
|
-
@changelog = changelog
|
6
|
-
@languages = {
|
7
|
-
:en => {
|
8
|
-
:release => 'release',
|
9
|
-
:released => 'has been released',
|
10
|
-
},
|
11
|
-
:ja => {
|
12
|
-
:release => 'リリース',
|
13
|
-
:released => 'はリリースしました',
|
14
|
-
}
|
15
|
-
}
|
16
|
-
define_tasks
|
17
|
-
end
|
18
|
-
|
19
|
-
private
|
20
|
-
def define_tasks
|
21
|
-
namespace :email do
|
22
|
-
task @language do
|
23
|
-
subject = "#{SPEC.name} #{SPEC.version} #{@languages[@language][:release]}"
|
24
|
-
title = "#{SPEC.name} #{SPEC.version} #{@languages[@language][:released]}!"
|
25
|
-
readme = Hash[*(File.read(@readme).split(/^(=+ .*)$/)[1..-1])]
|
26
|
-
description = readme[readme.keys.find { |x| x =~ /description/i }]
|
27
|
-
description = description.split(/\n\n+/).find { |x|
|
28
|
-
x.length > 0
|
29
|
-
}.gsub(/^\s*/, '')
|
30
|
-
urls = readme[readme.keys.find { |x| x =~ /#{SPEC.name}/i }]
|
31
|
-
urls = urls.strip.gsub(/\*\s/, '').split(/\n/).map { |s| "* <#{s}>" }
|
32
|
-
File.open("email.#{@language}.txt", "wb") { |file|
|
33
|
-
file.puts(<<-eomail)
|
34
|
-
Subject: [ANN] #{subject}
|
35
|
-
|
36
|
-
#{title}
|
37
|
-
|
38
|
-
#{urls.join("\n")}
|
39
|
-
|
40
|
-
#{description}
|
41
|
-
|
42
|
-
Changes:
|
43
|
-
|
44
|
-
#{File.read(@changelog).split(/^(===.*)/)[1..2].join.strip.gsub(/=/, '#')}
|
45
|
-
|
46
|
-
#{urls.join("\n")}
|
47
|
-
eomail
|
48
|
-
}
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
EmailTask.new(:en, 'README.en.rdoc', 'doc/en/NEWS.en.rdoc')
|
55
|
-
EmailTask.new(:ja, 'README.ja.rdoc', 'doc/ja/NEWS.ja.rdoc')
|
data/test/assets/cadenza.y
DELETED
@@ -1,170 +0,0 @@
|
|
1
|
-
# This grammar is released under an MIT license
|
2
|
-
# Author: William Howard (http://github.com/whoward)
|
3
|
-
# Source: https://github.com/whoward/cadenza/blob/master/src/cadenza.y
|
4
|
-
|
5
|
-
class Cadenza::RaccParser
|
6
|
-
|
7
|
-
/* expect this many shift/reduce conflicts */
|
8
|
-
expect 37
|
9
|
-
|
10
|
-
rule
|
11
|
-
target
|
12
|
-
: document
|
13
|
-
| /* none */ { result = nil }
|
14
|
-
;
|
15
|
-
|
16
|
-
parameter_list
|
17
|
-
: logical_expression { result = [val[0]] }
|
18
|
-
| parameter_list ',' logical_expression { result = val[0].push(val[2]) }
|
19
|
-
;
|
20
|
-
|
21
|
-
/* this has a shift/reduce conflict but since Racc will shift in this case it is the correct behavior */
|
22
|
-
primary_expression
|
23
|
-
: IDENTIFIER { result = VariableNode.new(val[0].value) }
|
24
|
-
| IDENTIFIER parameter_list { result = VariableNode.new(val[0].value, val[1]) }
|
25
|
-
| INTEGER { result = ConstantNode.new(val[0].value) }
|
26
|
-
| REAL { result = ConstantNode.new(val[0].value) }
|
27
|
-
| STRING { result = ConstantNode.new(val[0].value) }
|
28
|
-
| '(' filtered_expression ')' { result = val[1] }
|
29
|
-
;
|
30
|
-
|
31
|
-
multiplicative_expression
|
32
|
-
: primary_expression
|
33
|
-
| multiplicative_expression '*' primary_expression { result = OperationNode.new(val[0], "*", val[2]) }
|
34
|
-
| multiplicative_expression '/' primary_expression { result = OperationNode.new(val[0], "/", val[2]) }
|
35
|
-
;
|
36
|
-
|
37
|
-
additive_expression
|
38
|
-
: multiplicative_expression
|
39
|
-
| additive_expression '+' multiplicative_expression { result = OperationNode.new(val[0], "+", val[2]) }
|
40
|
-
| additive_expression '-' multiplicative_expression { result = OperationNode.new(val[0], "-", val[2]) }
|
41
|
-
;
|
42
|
-
|
43
|
-
boolean_expression
|
44
|
-
: additive_expression
|
45
|
-
| boolean_expression OP_EQ additive_expression { result = OperationNode.new(val[0], "==", val[2]) }
|
46
|
-
| boolean_expression OP_NEQ additive_expression { result = OperationNode.new(val[0], "!=", val[2]) }
|
47
|
-
| boolean_expression OP_LEQ additive_expression { result = OperationNode.new(val[0], "<=", val[2]) }
|
48
|
-
| boolean_expression OP_GEQ additive_expression { result = OperationNode.new(val[0], ">=", val[2]) }
|
49
|
-
| boolean_expression '>' additive_expression { result = OperationNode.new(val[0], ">", val[2]) }
|
50
|
-
| boolean_expression '<' additive_expression { result = OperationNode.new(val[0], "<", val[2]) }
|
51
|
-
;
|
52
|
-
|
53
|
-
inverse_expression
|
54
|
-
: boolean_expression
|
55
|
-
| NOT boolean_expression { result = BooleanInverseNode.new(val[1]) }
|
56
|
-
;
|
57
|
-
|
58
|
-
logical_expression
|
59
|
-
: inverse_expression
|
60
|
-
| logical_expression AND inverse_expression { result = OperationNode.new(val[0], "and", val[2]) }
|
61
|
-
| logical_expression OR inverse_expression { result = OperationNode.new(val[0], "or", val[2]) }
|
62
|
-
;
|
63
|
-
|
64
|
-
filter
|
65
|
-
: IDENTIFIER { result = FilterNode.new(val[0].value) }
|
66
|
-
| IDENTIFIER ':' parameter_list { result = FilterNode.new(val[0].value, val[2]) }
|
67
|
-
;
|
68
|
-
|
69
|
-
filter_list
|
70
|
-
: filter { result = [val[0]] }
|
71
|
-
| filter_list '|' filter { result = val[0].push(val[2]) }
|
72
|
-
;
|
73
|
-
|
74
|
-
filtered_expression
|
75
|
-
: logical_expression
|
76
|
-
| logical_expression '|' filter_list { result = FilteredValueNode.new(val[0], val[2]) }
|
77
|
-
;
|
78
|
-
|
79
|
-
inject_statement
|
80
|
-
: VAR_OPEN filtered_expression VAR_CLOSE { result = val[1] }
|
81
|
-
;
|
82
|
-
|
83
|
-
if_tag
|
84
|
-
: STMT_OPEN IF logical_expression STMT_CLOSE { open_scope!; result = val[2] }
|
85
|
-
| STMT_OPEN UNLESS logical_expression STMT_CLOSE { open_scope!; result = BooleanInverseNode.new(val[2]) }
|
86
|
-
;
|
87
|
-
|
88
|
-
else_tag
|
89
|
-
: STMT_OPEN ELSE STMT_CLOSE { result = close_scope!; open_scope! }
|
90
|
-
;
|
91
|
-
|
92
|
-
end_if_tag
|
93
|
-
: STMT_OPEN ENDIF STMT_CLOSE { result = close_scope! }
|
94
|
-
| STMT_OPEN ENDUNLESS STMT_CLOSE { result = close_scope! }
|
95
|
-
;
|
96
|
-
|
97
|
-
if_block
|
98
|
-
: if_tag end_if_tag { result = IfNode.new(val[0], val[1]) }
|
99
|
-
| if_tag document end_if_tag { result = IfNode.new(val[0], val[2]) }
|
100
|
-
| if_tag else_tag document end_if_tag { result = IfNode.new(val[0], val[1], val[3]) }
|
101
|
-
| if_tag document else_tag end_if_tag { result = IfNode.new(val[0], val[2], val[3]) }
|
102
|
-
| if_tag document else_tag document end_if_tag { result = IfNode.new(val[0], val[2], val[4]) }
|
103
|
-
;
|
104
|
-
|
105
|
-
for_tag
|
106
|
-
: STMT_OPEN FOR IDENTIFIER IN filtered_expression STMT_CLOSE { open_scope!; result = [val[2].value, val[4]] }
|
107
|
-
;
|
108
|
-
|
109
|
-
end_for_tag
|
110
|
-
: STMT_OPEN ENDFOR STMT_CLOSE { result = close_scope! }
|
111
|
-
;
|
112
|
-
|
113
|
-
/* this has a shift/reduce conflict but since Racc will shift in this case it is the correct behavior */
|
114
|
-
for_block
|
115
|
-
: for_tag end_for_tag { result = ForNode.new(VariableNode.new(val[0].first), val[0].last, val[1]) }
|
116
|
-
| for_tag document end_for_tag { result = ForNode.new(VariableNode.new(val[0].first), val[0].last, val[2]) }
|
117
|
-
;
|
118
|
-
|
119
|
-
block_tag
|
120
|
-
: STMT_OPEN BLOCK IDENTIFIER STMT_CLOSE { result = open_block_scope!(val[2].value) }
|
121
|
-
;
|
122
|
-
|
123
|
-
end_block_tag
|
124
|
-
: STMT_OPEN ENDBLOCK STMT_CLOSE { result = close_block_scope! }
|
125
|
-
;
|
126
|
-
|
127
|
-
/* this has a shift/reduce conflict but since Racc will shift in this case it is the correct behavior */
|
128
|
-
block_block
|
129
|
-
: block_tag end_block_tag { result = BlockNode.new(val[0], val[1]) }
|
130
|
-
| block_tag document end_block_tag { result = BlockNode.new(val[0], val[2]) }
|
131
|
-
;
|
132
|
-
|
133
|
-
generic_block_tag
|
134
|
-
: STMT_OPEN IDENTIFIER STMT_CLOSE { open_scope!; result = [val[1].value, []] }
|
135
|
-
| STMT_OPEN IDENTIFIER parameter_list STMT_CLOSE { open_scope!; result = [val[1].value, val[2]] }
|
136
|
-
;
|
137
|
-
|
138
|
-
end_generic_block_tag
|
139
|
-
: STMT_OPEN END STMT_CLOSE { result = close_scope! }
|
140
|
-
;
|
141
|
-
|
142
|
-
generic_block
|
143
|
-
: generic_block_tag document end_generic_block_tag { result = GenericBlockNode.new(val[0].first, val[2], val[0].last) }
|
144
|
-
;
|
145
|
-
|
146
|
-
extends_statement
|
147
|
-
: STMT_OPEN EXTENDS STRING STMT_CLOSE { result = val[2].value }
|
148
|
-
| STMT_OPEN EXTENDS IDENTIFIER STMT_CLOSE { result = VariableNode.new(val[2].value) }
|
149
|
-
;
|
150
|
-
|
151
|
-
document_component
|
152
|
-
: TEXT_BLOCK { result = TextNode.new(val[0].value) }
|
153
|
-
| inject_statement
|
154
|
-
| if_block
|
155
|
-
| for_block
|
156
|
-
| generic_block
|
157
|
-
| block_block
|
158
|
-
;
|
159
|
-
|
160
|
-
document
|
161
|
-
: document_component { push val[0] }
|
162
|
-
| document document_component { push val[1] }
|
163
|
-
| extends_statement { document.extends = val[0] }
|
164
|
-
| document extends_statement { document.extends = val[1] }
|
165
|
-
;
|
166
|
-
|
167
|
-
---- header ----
|
168
|
-
# racc_parser.rb : generated by racc
|
169
|
-
|
170
|
-
---- inner ----
|