treetop 1.4.9 → 1.4.10
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +26 -9
- data/doc/semantic_interpretation.markdown +2 -2
- data/doc/site/semantic_interpretation.html +2 -2
- data/doc/site/syntactic_recognition.html +12 -5
- data/doc/syntactic_recognition.markdown +12 -3
- data/lib/treetop/compiler/metagrammar.rb +153 -62
- data/lib/treetop/compiler/metagrammar.treetop +10 -2
- data/lib/treetop/compiler/node_classes/grammar.rb +2 -2
- data/lib/treetop/compiler/node_classes/terminal.rb +2 -2
- data/lib/treetop/version.rb +1 -1
- data/spec/compiler/multibyte_chars_spec.rb +7 -6
- data/spec/compiler/namespace_spec.rb +42 -0
- data/spec/compiler/occurrence_range_spec.rb +0 -2
- data/spec/runtime/interval_skip_list/delete_spec.rb +2 -2
- data/spec/runtime/interval_skip_list/expire_range_spec.rb +3 -3
- data/spec/runtime/interval_skip_list/{insert_and_delete_node.rb → insert_and_delete_node_spec.rb} +13 -13
- data/spec/runtime/interval_skip_list/insert_spec.rb +2 -2
- data/spec/runtime/interval_skip_list/palindromic_fixture.rb +25 -13
- data/spec/runtime/interval_skip_list/palindromic_fixture_spec.rb +2 -2
- data/spec/runtime/interval_skip_list/spec_helper.rb +9 -2
- data/spec/spec_helper.rb +16 -12
- data/treetop.gemspec +184 -16
- metadata +195 -92
- data/lib/treetop/runtime/terminal_parse_failure_debug.rb +0 -21
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: treetop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 19
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 1.4.
|
9
|
+
- 10
|
10
|
+
version: 1.4.10
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Nathan Sobo
|
@@ -15,13 +15,114 @@ autorequire: treetop
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
19
|
-
default_executable:
|
18
|
+
date: 2011-07-27 00:00:00 Z
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
21
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
22
|
+
none: false
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
hash: 3
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
version: "0"
|
30
|
+
prerelease: false
|
31
|
+
type: :runtime
|
32
|
+
requirement: *id001
|
22
33
|
name: polyglot
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
36
|
+
none: false
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
hash: 3
|
41
|
+
segments:
|
42
|
+
- 0
|
43
|
+
version: "0"
|
44
|
+
prerelease: false
|
45
|
+
type: :development
|
46
|
+
requirement: *id002
|
47
|
+
name: jeweler
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
hash: 3
|
55
|
+
segments:
|
56
|
+
- 0
|
57
|
+
version: "0"
|
58
|
+
prerelease: false
|
59
|
+
type: :development
|
60
|
+
requirement: *id003
|
61
|
+
name: activesupport
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
64
|
+
none: false
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
hash: 11
|
69
|
+
segments:
|
70
|
+
- 0
|
71
|
+
- 5
|
72
|
+
- 0
|
73
|
+
version: 0.5.0
|
74
|
+
prerelease: false
|
75
|
+
type: :development
|
76
|
+
requirement: *id004
|
77
|
+
name: i18n
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
80
|
+
none: false
|
81
|
+
requirements:
|
82
|
+
- - ~>
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
hash: 51
|
85
|
+
segments:
|
86
|
+
- 0
|
87
|
+
- 10
|
88
|
+
- 2
|
89
|
+
version: 0.10.2
|
23
90
|
prerelease: false
|
24
|
-
|
91
|
+
type: :development
|
92
|
+
requirement: *id005
|
93
|
+
name: rr
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
96
|
+
none: false
|
97
|
+
requirements:
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
hash: 15
|
101
|
+
segments:
|
102
|
+
- 2
|
103
|
+
- 0
|
104
|
+
- 0
|
105
|
+
version: 2.0.0
|
106
|
+
prerelease: false
|
107
|
+
type: :development
|
108
|
+
requirement: *id006
|
109
|
+
name: rspec
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
version_requirements: &id007 !ruby/object:Gem::Requirement
|
112
|
+
none: false
|
113
|
+
requirements:
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
hash: 3
|
117
|
+
segments:
|
118
|
+
- 0
|
119
|
+
version: "0"
|
120
|
+
prerelease: false
|
121
|
+
type: :development
|
122
|
+
requirement: *id007
|
123
|
+
name: rake
|
124
|
+
- !ruby/object:Gem::Dependency
|
125
|
+
version_requirements: &id008 !ruby/object:Gem::Requirement
|
25
126
|
none: false
|
26
127
|
requirements:
|
27
128
|
- - ">="
|
@@ -32,21 +133,97 @@ dependencies:
|
|
32
133
|
- 3
|
33
134
|
- 1
|
34
135
|
version: 0.3.1
|
136
|
+
prerelease: false
|
35
137
|
type: :runtime
|
36
|
-
|
138
|
+
requirement: *id008
|
139
|
+
name: polyglot
|
37
140
|
description:
|
38
|
-
email:
|
141
|
+
email: cliffordheath@gmail.com
|
39
142
|
executables:
|
40
143
|
- tt
|
41
144
|
extensions: []
|
42
145
|
|
43
|
-
extra_rdoc_files:
|
44
|
-
|
146
|
+
extra_rdoc_files:
|
147
|
+
- LICENSE
|
148
|
+
- README.md
|
45
149
|
files:
|
46
150
|
- LICENSE
|
47
151
|
- README.md
|
48
152
|
- Rakefile
|
49
|
-
-
|
153
|
+
- bin/tt
|
154
|
+
- doc/contributing_and_planned_features.markdown
|
155
|
+
- doc/grammar_composition.markdown
|
156
|
+
- doc/index.markdown
|
157
|
+
- doc/pitfalls_and_advanced_techniques.markdown
|
158
|
+
- doc/semantic_interpretation.markdown
|
159
|
+
- doc/site.rb
|
160
|
+
- doc/site/contribute.html
|
161
|
+
- doc/site/images/bottom_background.png
|
162
|
+
- doc/site/images/middle_background.png
|
163
|
+
- doc/site/images/paren_language_output.png
|
164
|
+
- doc/site/images/pivotal.gif
|
165
|
+
- doc/site/images/top_background.png
|
166
|
+
- doc/site/index.html
|
167
|
+
- doc/site/pitfalls_and_advanced_techniques.html
|
168
|
+
- doc/site/robots.txt
|
169
|
+
- doc/site/screen.css
|
170
|
+
- doc/site/semantic_interpretation.html
|
171
|
+
- doc/site/syntactic_recognition.html
|
172
|
+
- doc/site/using_in_ruby.html
|
173
|
+
- doc/sitegen.rb
|
174
|
+
- doc/syntactic_recognition.markdown
|
175
|
+
- doc/using_in_ruby.markdown
|
176
|
+
- examples/lambda_calculus/arithmetic.rb
|
177
|
+
- examples/lambda_calculus/arithmetic.treetop
|
178
|
+
- examples/lambda_calculus/arithmetic_node_classes.rb
|
179
|
+
- examples/lambda_calculus/arithmetic_test.rb
|
180
|
+
- examples/lambda_calculus/lambda_calculus
|
181
|
+
- examples/lambda_calculus/lambda_calculus.rb
|
182
|
+
- examples/lambda_calculus/lambda_calculus.treetop
|
183
|
+
- examples/lambda_calculus/lambda_calculus_node_classes.rb
|
184
|
+
- examples/lambda_calculus/lambda_calculus_test.rb
|
185
|
+
- examples/lambda_calculus/test_helper.rb
|
186
|
+
- lib/treetop.rb
|
187
|
+
- lib/treetop/bootstrap_gen_1_metagrammar.rb
|
188
|
+
- lib/treetop/compiler.rb
|
189
|
+
- lib/treetop/compiler/grammar_compiler.rb
|
190
|
+
- lib/treetop/compiler/lexical_address_space.rb
|
191
|
+
- lib/treetop/compiler/metagrammar.rb
|
192
|
+
- lib/treetop/compiler/metagrammar.treetop
|
193
|
+
- lib/treetop/compiler/node_classes.rb
|
194
|
+
- lib/treetop/compiler/node_classes/anything_symbol.rb
|
195
|
+
- lib/treetop/compiler/node_classes/atomic_expression.rb
|
196
|
+
- lib/treetop/compiler/node_classes/character_class.rb
|
197
|
+
- lib/treetop/compiler/node_classes/choice.rb
|
198
|
+
- lib/treetop/compiler/node_classes/declaration_sequence.rb
|
199
|
+
- lib/treetop/compiler/node_classes/grammar.rb
|
200
|
+
- lib/treetop/compiler/node_classes/inline_module.rb
|
201
|
+
- lib/treetop/compiler/node_classes/nonterminal.rb
|
202
|
+
- lib/treetop/compiler/node_classes/optional.rb
|
203
|
+
- lib/treetop/compiler/node_classes/parenthesized_expression.rb
|
204
|
+
- lib/treetop/compiler/node_classes/parsing_expression.rb
|
205
|
+
- lib/treetop/compiler/node_classes/parsing_rule.rb
|
206
|
+
- lib/treetop/compiler/node_classes/predicate.rb
|
207
|
+
- lib/treetop/compiler/node_classes/predicate_block.rb
|
208
|
+
- lib/treetop/compiler/node_classes/repetition.rb
|
209
|
+
- lib/treetop/compiler/node_classes/sequence.rb
|
210
|
+
- lib/treetop/compiler/node_classes/terminal.rb
|
211
|
+
- lib/treetop/compiler/node_classes/transient_prefix.rb
|
212
|
+
- lib/treetop/compiler/node_classes/treetop_file.rb
|
213
|
+
- lib/treetop/compiler/ruby_builder.rb
|
214
|
+
- lib/treetop/polyglot.rb
|
215
|
+
- lib/treetop/ruby_extensions.rb
|
216
|
+
- lib/treetop/ruby_extensions/string.rb
|
217
|
+
- lib/treetop/runtime.rb
|
218
|
+
- lib/treetop/runtime/compiled_parser.rb
|
219
|
+
- lib/treetop/runtime/interval_skip_list.rb
|
220
|
+
- lib/treetop/runtime/interval_skip_list/head_node.rb
|
221
|
+
- lib/treetop/runtime/interval_skip_list/interval_skip_list.rb
|
222
|
+
- lib/treetop/runtime/interval_skip_list/node.rb
|
223
|
+
- lib/treetop/runtime/syntax_node.rb
|
224
|
+
- lib/treetop/runtime/terminal_parse_failure.rb
|
225
|
+
- lib/treetop/runtime/terminal_syntax_node.rb
|
226
|
+
- lib/treetop/version.rb
|
50
227
|
- spec/compiler/and_predicate_spec.rb
|
51
228
|
- spec/compiler/anything_symbol_spec.rb
|
52
229
|
- spec/compiler/character_class_spec.rb
|
@@ -56,6 +233,7 @@ files:
|
|
56
233
|
- spec/compiler/grammar_compiler_spec.rb
|
57
234
|
- spec/compiler/grammar_spec.rb
|
58
235
|
- spec/compiler/multibyte_chars_spec.rb
|
236
|
+
- spec/compiler/namespace_spec.rb
|
59
237
|
- spec/compiler/nonterminal_symbol_spec.rb
|
60
238
|
- spec/compiler/not_predicate_spec.rb
|
61
239
|
- spec/compiler/occurrence_range_spec.rb
|
@@ -84,7 +262,7 @@ files:
|
|
84
262
|
- spec/runtime/compiled_parser_spec.rb
|
85
263
|
- spec/runtime/interval_skip_list/delete_spec.rb
|
86
264
|
- spec/runtime/interval_skip_list/expire_range_spec.rb
|
87
|
-
- spec/runtime/interval_skip_list/
|
265
|
+
- spec/runtime/interval_skip_list/insert_and_delete_node_spec.rb
|
88
266
|
- spec/runtime/interval_skip_list/insert_spec.rb
|
89
267
|
- spec/runtime/interval_skip_list/interval_skip_list_spec.graffle
|
90
268
|
- spec/runtime/interval_skip_list/interval_skip_list_spec.rb
|
@@ -93,85 +271,10 @@ files:
|
|
93
271
|
- spec/runtime/interval_skip_list/spec_helper.rb
|
94
272
|
- spec/runtime/syntax_node_spec.rb
|
95
273
|
- spec/spec_helper.rb
|
96
|
-
-
|
97
|
-
- lib/treetop/compiler/grammar_compiler.rb
|
98
|
-
- lib/treetop/compiler/lexical_address_space.rb
|
99
|
-
- lib/treetop/compiler/metagrammar.rb
|
100
|
-
- lib/treetop/compiler/metagrammar.treetop
|
101
|
-
- lib/treetop/compiler/node_classes/anything_symbol.rb
|
102
|
-
- lib/treetop/compiler/node_classes/atomic_expression.rb
|
103
|
-
- lib/treetop/compiler/node_classes/character_class.rb
|
104
|
-
- lib/treetop/compiler/node_classes/choice.rb
|
105
|
-
- lib/treetop/compiler/node_classes/declaration_sequence.rb
|
106
|
-
- lib/treetop/compiler/node_classes/grammar.rb
|
107
|
-
- lib/treetop/compiler/node_classes/inline_module.rb
|
108
|
-
- lib/treetop/compiler/node_classes/nonterminal.rb
|
109
|
-
- lib/treetop/compiler/node_classes/optional.rb
|
110
|
-
- lib/treetop/compiler/node_classes/parenthesized_expression.rb
|
111
|
-
- lib/treetop/compiler/node_classes/parsing_expression.rb
|
112
|
-
- lib/treetop/compiler/node_classes/parsing_rule.rb
|
113
|
-
- lib/treetop/compiler/node_classes/predicate.rb
|
114
|
-
- lib/treetop/compiler/node_classes/predicate_block.rb
|
115
|
-
- lib/treetop/compiler/node_classes/repetition.rb
|
116
|
-
- lib/treetop/compiler/node_classes/sequence.rb
|
117
|
-
- lib/treetop/compiler/node_classes/terminal.rb
|
118
|
-
- lib/treetop/compiler/node_classes/transient_prefix.rb
|
119
|
-
- lib/treetop/compiler/node_classes/treetop_file.rb
|
120
|
-
- lib/treetop/compiler/node_classes.rb
|
121
|
-
- lib/treetop/compiler/ruby_builder.rb
|
122
|
-
- lib/treetop/compiler.rb
|
123
|
-
- lib/treetop/polyglot.rb
|
124
|
-
- lib/treetop/ruby_extensions/string.rb
|
125
|
-
- lib/treetop/ruby_extensions.rb
|
126
|
-
- lib/treetop/runtime/compiled_parser.rb
|
127
|
-
- lib/treetop/runtime/interval_skip_list/head_node.rb
|
128
|
-
- lib/treetop/runtime/interval_skip_list/interval_skip_list.rb
|
129
|
-
- lib/treetop/runtime/interval_skip_list/node.rb
|
130
|
-
- lib/treetop/runtime/interval_skip_list.rb
|
131
|
-
- lib/treetop/runtime/syntax_node.rb
|
132
|
-
- lib/treetop/runtime/terminal_parse_failure.rb
|
133
|
-
- lib/treetop/runtime/terminal_parse_failure_debug.rb
|
134
|
-
- lib/treetop/runtime/terminal_syntax_node.rb
|
135
|
-
- lib/treetop/runtime.rb
|
136
|
-
- lib/treetop/version.rb
|
137
|
-
- lib/treetop.rb
|
138
|
-
- bin/tt
|
139
|
-
- doc/contributing_and_planned_features.markdown
|
140
|
-
- doc/grammar_composition.markdown
|
141
|
-
- doc/index.markdown
|
142
|
-
- doc/pitfalls_and_advanced_techniques.markdown
|
143
|
-
- doc/semantic_interpretation.markdown
|
144
|
-
- doc/site/contribute.html
|
145
|
-
- doc/site/images/bottom_background.png
|
146
|
-
- doc/site/images/middle_background.png
|
147
|
-
- doc/site/images/paren_language_output.png
|
148
|
-
- doc/site/images/pivotal.gif
|
149
|
-
- doc/site/images/top_background.png
|
150
|
-
- doc/site/index.html
|
151
|
-
- doc/site/pitfalls_and_advanced_techniques.html
|
152
|
-
- doc/site/robots.txt
|
153
|
-
- doc/site/screen.css
|
154
|
-
- doc/site/semantic_interpretation.html
|
155
|
-
- doc/site/syntactic_recognition.html
|
156
|
-
- doc/site/using_in_ruby.html
|
157
|
-
- doc/site.rb
|
158
|
-
- doc/sitegen.rb
|
159
|
-
- doc/syntactic_recognition.markdown
|
160
|
-
- doc/using_in_ruby.markdown
|
161
|
-
- examples/lambda_calculus/arithmetic.rb
|
162
|
-
- examples/lambda_calculus/arithmetic.treetop
|
163
|
-
- examples/lambda_calculus/arithmetic_node_classes.rb
|
164
|
-
- examples/lambda_calculus/arithmetic_test.rb
|
165
|
-
- examples/lambda_calculus/lambda_calculus
|
166
|
-
- examples/lambda_calculus/lambda_calculus.rb
|
167
|
-
- examples/lambda_calculus/lambda_calculus.treetop
|
168
|
-
- examples/lambda_calculus/lambda_calculus_node_classes.rb
|
169
|
-
- examples/lambda_calculus/lambda_calculus_test.rb
|
170
|
-
- examples/lambda_calculus/test_helper.rb
|
171
|
-
has_rdoc: true
|
274
|
+
- treetop.gemspec
|
172
275
|
homepage: http://functionalform.blogspot.com
|
173
|
-
licenses:
|
174
|
-
|
276
|
+
licenses:
|
277
|
+
- MIT
|
175
278
|
post_install_message:
|
176
279
|
rdoc_options: []
|
177
280
|
|
@@ -198,7 +301,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
198
301
|
requirements: []
|
199
302
|
|
200
303
|
rubyforge_project:
|
201
|
-
rubygems_version: 1.
|
304
|
+
rubygems_version: 1.8.5
|
202
305
|
signing_key:
|
203
306
|
specification_version: 3
|
204
307
|
summary: A Ruby-based text parsing and interpretation DSL
|
@@ -1,21 +0,0 @@
|
|
1
|
-
module Treetop
|
2
|
-
module Runtime
|
3
|
-
class TerminalParseFailure
|
4
|
-
attr_reader :index
|
5
|
-
|
6
|
-
def initialize(index, expected_string)
|
7
|
-
@index = index
|
8
|
-
@caller = caller
|
9
|
-
@expected_string = expected_string
|
10
|
-
end
|
11
|
-
|
12
|
-
def expected_string
|
13
|
-
"#{@expected_string} from #{@caller.map{|s| s.sub(/\A.*:([0-9]+):in `([^']*)'.*/,'\2:\1')}*" from "}\n\t"
|
14
|
-
end
|
15
|
-
|
16
|
-
def to_s
|
17
|
-
"String matching #{expected_string} expected."
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|