swissparser 0.11.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +9 -0
- data/CHANGELOG.rdoc +9 -0
- data/README.rdoc +28 -17
- data/Rakefile +2 -2
- data/Rakefile.compiled.rbc +622 -0
- data/examples/kegg_demo.rb +39 -63
- data/examples/uniprot.rb +85 -0
- data/features/basic_parsing.feature +79 -30
- data/features/extra.feature +52 -0
- data/features/step_definitions/basic_steps.rb +84 -0
- data/features/step_definitions/sugar_steps.rb +71 -0
- data/lib/swissparser.rb +39 -194
- data/lib/swissparser.rbc +928 -0
- data/lib/swissparser/entries.rb +137 -0
- data/lib/swissparser/entries.rbc +2360 -0
- data/lib/swissparser/rules.rb +112 -0
- data/lib/swissparser/rules.rbc +1699 -0
- metadata +55 -32
- data/benchmarks/whole_uniprot.txt +0 -7
- data/examples/parse_from_uri.rb +0 -88
- data/examples/signal_demo.rb +0 -100
- data/examples/tutorial_1.rb +0 -88
- data/examples/tutorial_2.rb +0 -65
- data/examples/uniprot_param_demo.rb +0 -85
- data/features/parser_extension.feature +0 -83
- data/features/parsing_context.feature +0 -48
- data/features/polite.feature +0 -16
- data/features/step_definitions/core.rb +0 -71
- data/features/step_definitions/definitions.rb +0 -68
- data/features/step_definitions/extra.rb +0 -56
- data/lib/swiss_parser.rb +0 -13
- data/lib/swissparser/parsing_context.rb +0 -60
- data/lib/swissparser/parsing_rules.rb +0 -39
@@ -0,0 +1,71 @@
|
|
1
|
+
require 'rspec'
|
2
|
+
require 'rspec/mocks'
|
3
|
+
|
4
|
+
Given /^I define a simple rule to return option "([^\"]*)" with "([^\"]*)"$/ do |opt_key, key|
|
5
|
+
@rules = @rules.refine do
|
6
|
+
with( key ) do |content|
|
7
|
+
@text = option( opt_key )
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
Given /^I set option "([^\"]*)" = "([^\"]*)"$/ do |key, val|
|
13
|
+
if @opt.nil?
|
14
|
+
@opt = {}
|
15
|
+
end
|
16
|
+
@opt[key] = val
|
17
|
+
end
|
18
|
+
|
19
|
+
Given /^I define a simple rule to return "bar" via helper with "([^\"]*)"$/ do |key|
|
20
|
+
@rules = @rules.refine do
|
21
|
+
helpers do
|
22
|
+
def foo( )
|
23
|
+
"bar"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
with( key ) do |content|
|
27
|
+
@text = foo
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
Given /^I define and helper "foo" which returns "([^\"]*)"$/ do |value|
|
34
|
+
@rules = @rules.refine do
|
35
|
+
helpers do
|
36
|
+
def foob( )
|
37
|
+
value
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
When /^I run the parser on file "([^\"]*)"$/ do |filename|
|
44
|
+
RSpec::Mocks::setup(File)
|
45
|
+
File.stub(:open){ @data }
|
46
|
+
if @opt
|
47
|
+
@result = @parser.parse_file( filename, @opt )
|
48
|
+
else
|
49
|
+
@result = @parser.parse_file( filename )
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
|
54
|
+
When /^I run it on remote file "([^\"]*)"$/ do |uri|
|
55
|
+
RSpec::Mocks::setup(OpenURI)
|
56
|
+
OpenURI.stub(:open_uri) { @data }
|
57
|
+
if @opt
|
58
|
+
@result = @parser.parse_uri( uri, @opt )
|
59
|
+
else
|
60
|
+
@result = @parser.parse_uri( uri )
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
Then /^File\.open should be called with "([^\"]*)"$/ do |filename|
|
65
|
+
File.should_receive(:open).with(filename,'w')
|
66
|
+
end
|
67
|
+
|
68
|
+
Then /^OpenUri\.open should be called with "([^\"]*)"$/ do |uri|
|
69
|
+
OpenURI.should_receive(:open).with(uri)
|
70
|
+
end
|
71
|
+
|
data/lib/swissparser.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
=begin
|
2
|
-
Copyright (C) 2009 Paradigmatic
|
2
|
+
Copyright (C) 2009,2010 Paradigmatic
|
3
3
|
|
4
4
|
This file is part of SwissParser.
|
5
5
|
|
@@ -18,216 +18,61 @@ along with SwissParser. If not, see <http://www.gnu.org/licenses/>.
|
|
18
18
|
=end
|
19
19
|
|
20
20
|
require 'open-uri'
|
21
|
-
require 'swissparser/
|
22
|
-
require 'swissparser/
|
21
|
+
require 'swissparser/entries'
|
22
|
+
require 'swissparser/rules'
|
23
23
|
|
24
24
|
module Swiss
|
25
25
|
|
26
|
-
VERSION = "0.
|
26
|
+
VERSION = "1.0.0"
|
27
27
|
|
28
|
-
|
29
|
-
#
|
28
|
+
# Parser for a typical bioinformatic flat file, like
|
29
|
+
# SwissProt/Uniprot, KEGG, etc.
|
30
30
|
class Parser
|
31
|
-
|
32
|
-
#Default entry separator
|
33
|
-
DEFAULT_SEPARATOR = "//"
|
34
|
-
|
35
|
-
#*Do* *not* *use* this method to instatiate a parser. Use rather
|
36
|
-
#the +define+ class method.
|
37
|
-
def initialize(*args)
|
38
|
-
if args.size == 0
|
39
|
-
@separator = DEFAULT_SEPARATOR
|
40
|
-
@actions = {}
|
41
|
-
@actions[:text] = {}
|
42
|
-
@helpers = {}
|
43
|
-
elsif args.size == 7
|
44
|
-
actions,separator,before,the_begin,the_end,after,helpers = *args
|
45
|
-
@actions = actions.clone
|
46
|
-
@actions[:text] = actions[:text].clone
|
47
|
-
@separator = separator
|
48
|
-
@before = before
|
49
|
-
@end = the_end
|
50
|
-
@begin = the_begin
|
51
|
-
@after = after
|
52
|
-
@helpers = helpers
|
53
|
-
else
|
54
|
-
raise "Wrong arg number, either 0 or 7."
|
55
|
-
end
|
56
|
-
@ctx = nil
|
57
|
-
end
|
58
|
-
|
59
|
-
# Defines how to create the _entry_ _object_. The +proc+
|
60
|
-
# does not take arguments, but it must return a new
|
61
|
-
# _entry_ _object_.
|
62
|
-
# Default:: creates an empty hash.
|
63
|
-
def new_entry(&proc)
|
64
|
-
@begin = proc
|
65
|
-
end
|
66
|
-
|
67
|
-
# Defines how to finalize an _entry_ _object_. The +proc+
|
68
|
-
# takes two arguments:
|
69
|
-
# * The entry object ready to be finalized
|
70
|
-
# * The context object
|
71
|
-
# Default:: Adds the entry object to the context object using +<<+ method.
|
72
|
-
def finish_entry(&proc)
|
73
|
-
@end = proc
|
74
|
-
end
|
75
|
-
|
76
|
-
# Defines how to set the context before using the parser.
|
77
|
-
# The +proc+ does not take arguments. It must return a _context_ object.
|
78
|
-
# Default:: creates an empty array
|
79
|
-
def before (&proc)
|
80
|
-
@before = proc
|
81
|
-
end
|
82
|
-
|
83
|
-
# Defines how to finalize the whole parsing.
|
84
|
-
# The +proc+ takes a single argument:
|
85
|
-
# * The context object
|
86
|
-
# The value returned by the +proc+ is then returned by the parsing method.
|
87
|
-
# Default:: just returns the context object.
|
88
|
-
def after(&proc)
|
89
|
-
@after = proc
|
90
|
-
end
|
91
|
-
|
92
|
-
# Define an helper method accessible to rules and actions.
|
93
|
-
# This method tales two argument:
|
94
|
-
# * A symbol which will be the method name
|
95
|
-
# * A block which is the method implementation. The block can take parameters.
|
96
|
-
# The helper method can then be called as a regular method.
|
97
|
-
def helper(name, &proc)
|
98
|
-
@helpers[name] = proc
|
99
|
-
end
|
100
|
-
|
101
|
-
# Defines parsing rules inside a parser definition. The ParsingRules
|
102
|
-
# methods can then be called inside the proc.
|
103
|
-
def rules(&proc)
|
104
|
-
r = ParsingRules.new
|
105
|
-
r.instance_eval(&proc)
|
106
|
-
r.actions.each do |k,v|
|
107
|
-
@actions[k] = v
|
108
|
-
end
|
109
|
-
if r.separator
|
110
|
-
@separator = r.separator
|
111
|
-
end
|
112
|
-
end
|
113
|
-
|
114
31
|
|
115
|
-
|
116
|
-
#
|
117
|
-
#
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
clone = Parser.new( @actions, @separator, @before, @begin, @end, @after, @helpers )
|
122
|
-
clone.instance_eval( &proc )
|
123
|
-
clone
|
124
|
-
end
|
125
|
-
|
126
|
-
# Defines a new parser.
|
127
|
-
def self.define( &proc )
|
128
|
-
PROTOTYPE.extend( &proc )
|
32
|
+
#Create a new parser from a set of rules.
|
33
|
+
# The method needs a block taking a single parameter which
|
34
|
+
# holds the parsed entries.
|
35
|
+
def initialize( rules, &body )
|
36
|
+
@rules = rules
|
37
|
+
@body = body
|
129
38
|
end
|
130
39
|
|
131
|
-
# Parses
|
132
|
-
#
|
133
|
-
# passed to the workflow methods
|
134
|
-
#
|
135
|
-
#
|
136
|
-
|
40
|
+
# Parses any input that accepts the +each_line+ method. Works for
|
41
|
+
# string, open files, etc. An optional hash of arbitrary arguments
|
42
|
+
# (+opt+) can be specified. It is passed to the workflow methods
|
43
|
+
# blocks (+before+, +new_entry+, ...) It executes the block
|
44
|
+
# defined when creating the parser and returns its last expression
|
45
|
+
# result.
|
46
|
+
def parse( input, opt={} )
|
47
|
+
entries = Entries.new( @rules, input, opt )
|
48
|
+
@body.call( entries )
|
49
|
+
end
|
50
|
+
|
51
|
+
# Parses a file specified by +filename+. An optional hash of
|
52
|
+
# arbitrary arguments (+opt+) can be specified. It is passed to
|
53
|
+
# the workflow methods blocks (+before+, +new_entry+, ...) It
|
54
|
+
# executes the block defined when creating the parser and returns
|
55
|
+
# its last expression result.
|
56
|
+
def parse_file( filename, opt={} )
|
137
57
|
File.open( filename, 'r' ) do |file|
|
138
|
-
parse( file,
|
58
|
+
parse( file, opt )
|
139
59
|
end
|
140
60
|
end
|
141
61
|
|
142
62
|
# Parses a file specified by an +URI+. Both http and ftp are
|
143
|
-
# supported. An optional hash of arbitrary arguments (+
|
144
|
-
#
|
145
|
-
# (+before+, +new_entry+, ...)
|
146
|
-
# the
|
147
|
-
|
148
|
-
def parse_URI( uri, params={} )
|
63
|
+
# supported. An optional hash of arbitrary arguments (+opt+) can
|
64
|
+
# be specified. It is passed to the workflow methods blocks
|
65
|
+
# (+before+, +new_entry+, ...) It executes the block defined when
|
66
|
+
# creating the parser and returns its last expression result.
|
67
|
+
def parse_uri( uri, opt={} )
|
149
68
|
open( uri ) do |file|
|
150
|
-
parse( file,
|
69
|
+
parse( file, opt )
|
151
70
|
end
|
152
71
|
end
|
153
|
-
|
154
|
-
# Parses any input that accepts the +each_line+ method. Works for
|
155
|
-
# string, open files, etc. An optional hash of arbitrary arguments
|
156
|
-
# (+params+) can be specified. It is passed to the workflow
|
157
|
-
# methods blocks (+before+, +new_entry+, ...) It returns the
|
158
|
-
# value specified in the +after+ block. By default, it returns an
|
159
|
-
# array containing _entry_ objects.
|
160
|
-
def parse( data, params={} )
|
161
|
-
@ctx = init_context( params )
|
162
|
-
state = :begin
|
163
|
-
container = @ctx.instance_exec( &@before )
|
164
|
-
entry = @ctx.instance_exec( &@begin )
|
165
|
-
data.each_line do |line|
|
166
|
-
if @ctx.should_skip?
|
167
|
-
if line.include? @separator
|
168
|
-
state = :end
|
169
|
-
entry = init_entry
|
170
|
-
end
|
171
|
-
else
|
172
|
-
state = parse_line( line, entry )
|
173
|
-
if state == :end
|
174
|
-
@ctx.instance_exec( entry, container, &@end )
|
175
|
-
entry = init_entry
|
176
|
-
end
|
177
|
-
end
|
178
|
-
end
|
179
|
-
if state == :parsing
|
180
|
-
raise("No separator at end of file")
|
181
|
-
end
|
182
|
-
@ctx.instance_exec( container, &@after )
|
183
|
-
end
|
184
|
-
|
185
|
-
PROTOTYPE = Parser.new
|
186
|
-
PROTOTYPE.instance_eval do
|
187
|
-
before { || [] }
|
188
|
-
new_entry { || {} }
|
189
|
-
finish_entry {|e,c| c << e }
|
190
|
-
after {|c| c }
|
191
|
-
end
|
192
|
-
PROTOTYPE.freeze
|
193
72
|
|
194
|
-
private
|
195
|
-
|
196
|
-
def init_entry()
|
197
|
-
@ctx.reset_skip
|
198
|
-
@ctx.instance_exec( &@begin )
|
199
|
-
end
|
200
|
-
|
201
|
-
def init_context(params)
|
202
|
-
ctx = ParsingContext.new( params )
|
203
|
-
helperModule = Module.new
|
204
|
-
@helpers.each do |name, proc|
|
205
|
-
helperModule.send( :define_method, name, proc )
|
206
|
-
end
|
207
|
-
ctx.extend( helperModule )
|
208
|
-
ctx
|
209
|
-
end
|
210
|
-
|
211
|
-
|
212
|
-
def parse_line( line, holder )
|
213
|
-
line.chomp!
|
214
|
-
if line.include? @separator
|
215
|
-
:end
|
216
|
-
elsif line =~ /^(\S+)\s+(.*)$/
|
217
|
-
key,value = $1,$2
|
218
|
-
@last_key = key
|
219
|
-
if @actions[key]
|
220
|
-
@ctx.instance_exec( value, holder, &@actions[key] )
|
221
|
-
end
|
222
|
-
:parsing
|
223
|
-
else
|
224
|
-
if @actions[:text][@last_key]
|
225
|
-
@ctx.instance_exec( line, holder, &@actions[:text][@last_key] )
|
226
|
-
end
|
227
|
-
:parsing
|
228
|
-
end
|
229
|
-
end
|
230
|
-
|
231
73
|
end
|
232
74
|
|
75
|
+
DefaultRules = Rules.new
|
76
|
+
DefaultRules.freeze
|
77
|
+
|
233
78
|
end
|
data/lib/swissparser.rbc
ADDED
@@ -0,0 +1,928 @@
|
|
1
|
+
!RBIX
|
2
|
+
0
|
3
|
+
x
|
4
|
+
M
|
5
|
+
1
|
6
|
+
n
|
7
|
+
n
|
8
|
+
x
|
9
|
+
10
|
10
|
+
__script__
|
11
|
+
i
|
12
|
+
58
|
13
|
+
5
|
14
|
+
7
|
15
|
+
0
|
16
|
+
64
|
17
|
+
47
|
18
|
+
49
|
19
|
+
1
|
20
|
+
1
|
21
|
+
15
|
22
|
+
5
|
23
|
+
7
|
24
|
+
2
|
25
|
+
64
|
26
|
+
47
|
27
|
+
49
|
28
|
+
1
|
29
|
+
1
|
30
|
+
15
|
31
|
+
5
|
32
|
+
7
|
33
|
+
3
|
34
|
+
64
|
35
|
+
47
|
36
|
+
49
|
37
|
+
1
|
38
|
+
1
|
39
|
+
15
|
40
|
+
45
|
41
|
+
4
|
42
|
+
5
|
43
|
+
7
|
44
|
+
6
|
45
|
+
65
|
46
|
+
49
|
47
|
+
7
|
48
|
+
2
|
49
|
+
13
|
50
|
+
45
|
51
|
+
4
|
52
|
+
8
|
53
|
+
12
|
54
|
+
7
|
55
|
+
9
|
56
|
+
12
|
57
|
+
7
|
58
|
+
10
|
59
|
+
12
|
60
|
+
65
|
61
|
+
12
|
62
|
+
49
|
63
|
+
11
|
64
|
+
4
|
65
|
+
15
|
66
|
+
48
|
67
|
+
9
|
68
|
+
15
|
69
|
+
2
|
70
|
+
11
|
71
|
+
I
|
72
|
+
6
|
73
|
+
I
|
74
|
+
0
|
75
|
+
I
|
76
|
+
0
|
77
|
+
I
|
78
|
+
0
|
79
|
+
n
|
80
|
+
p
|
81
|
+
12
|
82
|
+
s
|
83
|
+
8
|
84
|
+
open-uri
|
85
|
+
x
|
86
|
+
7
|
87
|
+
require
|
88
|
+
s
|
89
|
+
19
|
90
|
+
swissparser/entries
|
91
|
+
s
|
92
|
+
17
|
93
|
+
swissparser/rules
|
94
|
+
x
|
95
|
+
8
|
96
|
+
Rubinius
|
97
|
+
n
|
98
|
+
x
|
99
|
+
5
|
100
|
+
Swiss
|
101
|
+
x
|
102
|
+
11
|
103
|
+
open_module
|
104
|
+
n
|
105
|
+
x
|
106
|
+
15
|
107
|
+
__module_init__
|
108
|
+
M
|
109
|
+
1
|
110
|
+
n
|
111
|
+
n
|
112
|
+
x
|
113
|
+
5
|
114
|
+
Swiss
|
115
|
+
i
|
116
|
+
76
|
117
|
+
5
|
118
|
+
66
|
119
|
+
65
|
120
|
+
7
|
121
|
+
0
|
122
|
+
7
|
123
|
+
1
|
124
|
+
64
|
125
|
+
49
|
126
|
+
2
|
127
|
+
2
|
128
|
+
15
|
129
|
+
45
|
130
|
+
3
|
131
|
+
4
|
132
|
+
7
|
133
|
+
5
|
134
|
+
1
|
135
|
+
65
|
136
|
+
49
|
137
|
+
6
|
138
|
+
3
|
139
|
+
13
|
140
|
+
45
|
141
|
+
3
|
142
|
+
7
|
143
|
+
12
|
144
|
+
7
|
145
|
+
8
|
146
|
+
12
|
147
|
+
7
|
148
|
+
9
|
149
|
+
12
|
150
|
+
65
|
151
|
+
12
|
152
|
+
49
|
153
|
+
10
|
154
|
+
4
|
155
|
+
15
|
156
|
+
48
|
157
|
+
8
|
158
|
+
15
|
159
|
+
65
|
160
|
+
7
|
161
|
+
11
|
162
|
+
45
|
163
|
+
12
|
164
|
+
13
|
165
|
+
13
|
166
|
+
71
|
167
|
+
14
|
168
|
+
47
|
169
|
+
9
|
170
|
+
64
|
171
|
+
47
|
172
|
+
48
|
173
|
+
15
|
174
|
+
13
|
175
|
+
47
|
176
|
+
48
|
177
|
+
16
|
178
|
+
15
|
179
|
+
8
|
180
|
+
66
|
181
|
+
48
|
182
|
+
14
|
183
|
+
49
|
184
|
+
2
|
185
|
+
2
|
186
|
+
15
|
187
|
+
45
|
188
|
+
11
|
189
|
+
17
|
190
|
+
48
|
191
|
+
18
|
192
|
+
11
|
193
|
+
I
|
194
|
+
6
|
195
|
+
I
|
196
|
+
0
|
197
|
+
I
|
198
|
+
0
|
199
|
+
I
|
200
|
+
0
|
201
|
+
n
|
202
|
+
p
|
203
|
+
19
|
204
|
+
x
|
205
|
+
7
|
206
|
+
VERSION
|
207
|
+
s
|
208
|
+
5
|
209
|
+
1.0.0
|
210
|
+
x
|
211
|
+
9
|
212
|
+
const_set
|
213
|
+
x
|
214
|
+
8
|
215
|
+
Rubinius
|
216
|
+
n
|
217
|
+
x
|
218
|
+
6
|
219
|
+
Parser
|
220
|
+
x
|
221
|
+
10
|
222
|
+
open_class
|
223
|
+
n
|
224
|
+
x
|
225
|
+
14
|
226
|
+
__class_init__
|
227
|
+
M
|
228
|
+
1
|
229
|
+
n
|
230
|
+
n
|
231
|
+
x
|
232
|
+
6
|
233
|
+
Parser
|
234
|
+
i
|
235
|
+
62
|
236
|
+
5
|
237
|
+
66
|
238
|
+
45
|
239
|
+
0
|
240
|
+
1
|
241
|
+
7
|
242
|
+
2
|
243
|
+
7
|
244
|
+
3
|
245
|
+
65
|
246
|
+
67
|
247
|
+
48
|
248
|
+
4
|
249
|
+
49
|
250
|
+
5
|
251
|
+
4
|
252
|
+
15
|
253
|
+
45
|
254
|
+
0
|
255
|
+
6
|
256
|
+
7
|
257
|
+
7
|
258
|
+
7
|
259
|
+
8
|
260
|
+
65
|
261
|
+
67
|
262
|
+
48
|
263
|
+
4
|
264
|
+
49
|
265
|
+
5
|
266
|
+
4
|
267
|
+
15
|
268
|
+
45
|
269
|
+
0
|
270
|
+
9
|
271
|
+
7
|
272
|
+
10
|
273
|
+
7
|
274
|
+
11
|
275
|
+
65
|
276
|
+
67
|
277
|
+
48
|
278
|
+
4
|
279
|
+
49
|
280
|
+
5
|
281
|
+
4
|
282
|
+
15
|
283
|
+
45
|
284
|
+
0
|
285
|
+
12
|
286
|
+
7
|
287
|
+
13
|
288
|
+
7
|
289
|
+
14
|
290
|
+
65
|
291
|
+
67
|
292
|
+
48
|
293
|
+
4
|
294
|
+
49
|
295
|
+
5
|
296
|
+
4
|
297
|
+
11
|
298
|
+
I
|
299
|
+
5
|
300
|
+
I
|
301
|
+
0
|
302
|
+
I
|
303
|
+
0
|
304
|
+
I
|
305
|
+
0
|
306
|
+
n
|
307
|
+
p
|
308
|
+
15
|
309
|
+
x
|
310
|
+
8
|
311
|
+
Rubinius
|
312
|
+
n
|
313
|
+
x
|
314
|
+
10
|
315
|
+
initialize
|
316
|
+
M
|
317
|
+
1
|
318
|
+
n
|
319
|
+
n
|
320
|
+
x
|
321
|
+
10
|
322
|
+
initialize
|
323
|
+
i
|
324
|
+
14
|
325
|
+
95
|
326
|
+
19
|
327
|
+
1
|
328
|
+
15
|
329
|
+
20
|
330
|
+
0
|
331
|
+
38
|
332
|
+
0
|
333
|
+
15
|
334
|
+
20
|
335
|
+
1
|
336
|
+
38
|
337
|
+
1
|
338
|
+
11
|
339
|
+
I
|
340
|
+
3
|
341
|
+
I
|
342
|
+
2
|
343
|
+
I
|
344
|
+
1
|
345
|
+
I
|
346
|
+
1
|
347
|
+
n
|
348
|
+
p
|
349
|
+
2
|
350
|
+
x
|
351
|
+
6
|
352
|
+
@rules
|
353
|
+
x
|
354
|
+
5
|
355
|
+
@body
|
356
|
+
p
|
357
|
+
7
|
358
|
+
I
|
359
|
+
0
|
360
|
+
I
|
361
|
+
23
|
362
|
+
I
|
363
|
+
4
|
364
|
+
I
|
365
|
+
24
|
366
|
+
I
|
367
|
+
9
|
368
|
+
I
|
369
|
+
25
|
370
|
+
I
|
371
|
+
e
|
372
|
+
x
|
373
|
+
48
|
374
|
+
/home/falcone/prg/SwissParser/lib/swissparser.rb
|
375
|
+
p
|
376
|
+
2
|
377
|
+
x
|
378
|
+
5
|
379
|
+
rules
|
380
|
+
x
|
381
|
+
4
|
382
|
+
body
|
383
|
+
x
|
384
|
+
17
|
385
|
+
method_visibility
|
386
|
+
x
|
387
|
+
15
|
388
|
+
add_defn_method
|
389
|
+
n
|
390
|
+
x
|
391
|
+
5
|
392
|
+
parse
|
393
|
+
M
|
394
|
+
1
|
395
|
+
n
|
396
|
+
n
|
397
|
+
x
|
398
|
+
5
|
399
|
+
parse
|
400
|
+
i
|
401
|
+
60
|
402
|
+
23
|
403
|
+
1
|
404
|
+
10
|
405
|
+
14
|
406
|
+
44
|
407
|
+
43
|
408
|
+
0
|
409
|
+
78
|
410
|
+
49
|
411
|
+
1
|
412
|
+
1
|
413
|
+
19
|
414
|
+
1
|
415
|
+
15
|
416
|
+
45
|
417
|
+
2
|
418
|
+
3
|
419
|
+
13
|
420
|
+
71
|
421
|
+
4
|
422
|
+
47
|
423
|
+
9
|
424
|
+
40
|
425
|
+
47
|
426
|
+
48
|
427
|
+
5
|
428
|
+
13
|
429
|
+
39
|
430
|
+
6
|
431
|
+
20
|
432
|
+
0
|
433
|
+
20
|
434
|
+
1
|
435
|
+
47
|
436
|
+
49
|
437
|
+
7
|
438
|
+
3
|
439
|
+
15
|
440
|
+
8
|
441
|
+
49
|
442
|
+
39
|
443
|
+
6
|
444
|
+
20
|
445
|
+
0
|
446
|
+
20
|
447
|
+
1
|
448
|
+
49
|
449
|
+
4
|
450
|
+
3
|
451
|
+
19
|
452
|
+
2
|
453
|
+
15
|
454
|
+
39
|
455
|
+
8
|
456
|
+
20
|
457
|
+
2
|
458
|
+
49
|
459
|
+
9
|
460
|
+
1
|
461
|
+
11
|
462
|
+
I
|
463
|
+
8
|
464
|
+
I
|
465
|
+
3
|
466
|
+
I
|
467
|
+
1
|
468
|
+
I
|
469
|
+
2
|
470
|
+
n
|
471
|
+
p
|
472
|
+
10
|
473
|
+
x
|
474
|
+
4
|
475
|
+
Hash
|
476
|
+
x
|
477
|
+
16
|
478
|
+
new_from_literal
|
479
|
+
x
|
480
|
+
7
|
481
|
+
Entries
|
482
|
+
n
|
483
|
+
x
|
484
|
+
3
|
485
|
+
new
|
486
|
+
x
|
487
|
+
8
|
488
|
+
allocate
|
489
|
+
x
|
490
|
+
6
|
491
|
+
@rules
|
492
|
+
x
|
493
|
+
10
|
494
|
+
initialize
|
495
|
+
x
|
496
|
+
5
|
497
|
+
@body
|
498
|
+
x
|
499
|
+
4
|
500
|
+
call
|
501
|
+
p
|
502
|
+
7
|
503
|
+
I
|
504
|
+
0
|
505
|
+
I
|
506
|
+
2e
|
507
|
+
I
|
508
|
+
e
|
509
|
+
I
|
510
|
+
2f
|
511
|
+
I
|
512
|
+
34
|
513
|
+
I
|
514
|
+
30
|
515
|
+
I
|
516
|
+
3c
|
517
|
+
x
|
518
|
+
48
|
519
|
+
/home/falcone/prg/SwissParser/lib/swissparser.rb
|
520
|
+
p
|
521
|
+
3
|
522
|
+
x
|
523
|
+
5
|
524
|
+
input
|
525
|
+
x
|
526
|
+
3
|
527
|
+
opt
|
528
|
+
x
|
529
|
+
7
|
530
|
+
entries
|
531
|
+
n
|
532
|
+
x
|
533
|
+
10
|
534
|
+
parse_file
|
535
|
+
M
|
536
|
+
1
|
537
|
+
n
|
538
|
+
n
|
539
|
+
x
|
540
|
+
10
|
541
|
+
parse_file
|
542
|
+
i
|
543
|
+
28
|
544
|
+
23
|
545
|
+
1
|
546
|
+
10
|
547
|
+
14
|
548
|
+
44
|
549
|
+
43
|
550
|
+
0
|
551
|
+
78
|
552
|
+
49
|
553
|
+
1
|
554
|
+
1
|
555
|
+
19
|
556
|
+
1
|
557
|
+
15
|
558
|
+
45
|
559
|
+
2
|
560
|
+
3
|
561
|
+
20
|
562
|
+
0
|
563
|
+
7
|
564
|
+
4
|
565
|
+
64
|
566
|
+
56
|
567
|
+
5
|
568
|
+
50
|
569
|
+
6
|
570
|
+
2
|
571
|
+
11
|
572
|
+
I
|
573
|
+
6
|
574
|
+
I
|
575
|
+
2
|
576
|
+
I
|
577
|
+
1
|
578
|
+
I
|
579
|
+
2
|
580
|
+
n
|
581
|
+
p
|
582
|
+
7
|
583
|
+
x
|
584
|
+
4
|
585
|
+
Hash
|
586
|
+
x
|
587
|
+
16
|
588
|
+
new_from_literal
|
589
|
+
x
|
590
|
+
4
|
591
|
+
File
|
592
|
+
n
|
593
|
+
s
|
594
|
+
1
|
595
|
+
r
|
596
|
+
M
|
597
|
+
1
|
598
|
+
p
|
599
|
+
2
|
600
|
+
x
|
601
|
+
9
|
602
|
+
for_block
|
603
|
+
t
|
604
|
+
n
|
605
|
+
x
|
606
|
+
10
|
607
|
+
parse_file
|
608
|
+
i
|
609
|
+
15
|
610
|
+
57
|
611
|
+
19
|
612
|
+
0
|
613
|
+
15
|
614
|
+
5
|
615
|
+
20
|
616
|
+
0
|
617
|
+
21
|
618
|
+
1
|
619
|
+
1
|
620
|
+
47
|
621
|
+
49
|
622
|
+
0
|
623
|
+
2
|
624
|
+
11
|
625
|
+
I
|
626
|
+
5
|
627
|
+
I
|
628
|
+
1
|
629
|
+
I
|
630
|
+
1
|
631
|
+
I
|
632
|
+
1
|
633
|
+
n
|
634
|
+
p
|
635
|
+
1
|
636
|
+
x
|
637
|
+
5
|
638
|
+
parse
|
639
|
+
p
|
640
|
+
5
|
641
|
+
I
|
642
|
+
0
|
643
|
+
I
|
644
|
+
39
|
645
|
+
I
|
646
|
+
4
|
647
|
+
I
|
648
|
+
3a
|
649
|
+
I
|
650
|
+
f
|
651
|
+
x
|
652
|
+
48
|
653
|
+
/home/falcone/prg/SwissParser/lib/swissparser.rb
|
654
|
+
p
|
655
|
+
1
|
656
|
+
x
|
657
|
+
4
|
658
|
+
file
|
659
|
+
x
|
660
|
+
4
|
661
|
+
open
|
662
|
+
p
|
663
|
+
5
|
664
|
+
I
|
665
|
+
0
|
666
|
+
I
|
667
|
+
38
|
668
|
+
I
|
669
|
+
e
|
670
|
+
I
|
671
|
+
39
|
672
|
+
I
|
673
|
+
1c
|
674
|
+
x
|
675
|
+
48
|
676
|
+
/home/falcone/prg/SwissParser/lib/swissparser.rb
|
677
|
+
p
|
678
|
+
2
|
679
|
+
x
|
680
|
+
8
|
681
|
+
filename
|
682
|
+
x
|
683
|
+
3
|
684
|
+
opt
|
685
|
+
n
|
686
|
+
x
|
687
|
+
9
|
688
|
+
parse_uri
|
689
|
+
M
|
690
|
+
1
|
691
|
+
n
|
692
|
+
n
|
693
|
+
x
|
694
|
+
9
|
695
|
+
parse_uri
|
696
|
+
i
|
697
|
+
24
|
698
|
+
23
|
699
|
+
1
|
700
|
+
10
|
701
|
+
14
|
702
|
+
44
|
703
|
+
43
|
704
|
+
0
|
705
|
+
78
|
706
|
+
49
|
707
|
+
1
|
708
|
+
1
|
709
|
+
19
|
710
|
+
1
|
711
|
+
15
|
712
|
+
5
|
713
|
+
20
|
714
|
+
0
|
715
|
+
56
|
716
|
+
2
|
717
|
+
47
|
718
|
+
50
|
719
|
+
3
|
720
|
+
1
|
721
|
+
11
|
722
|
+
I
|
723
|
+
5
|
724
|
+
I
|
725
|
+
2
|
726
|
+
I
|
727
|
+
1
|
728
|
+
I
|
729
|
+
2
|
730
|
+
n
|
731
|
+
p
|
732
|
+
4
|
733
|
+
x
|
734
|
+
4
|
735
|
+
Hash
|
736
|
+
x
|
737
|
+
16
|
738
|
+
new_from_literal
|
739
|
+
M
|
740
|
+
1
|
741
|
+
p
|
742
|
+
2
|
743
|
+
x
|
744
|
+
9
|
745
|
+
for_block
|
746
|
+
t
|
747
|
+
n
|
748
|
+
x
|
749
|
+
9
|
750
|
+
parse_uri
|
751
|
+
i
|
752
|
+
15
|
753
|
+
57
|
754
|
+
19
|
755
|
+
0
|
756
|
+
15
|
757
|
+
5
|
758
|
+
20
|
759
|
+
0
|
760
|
+
21
|
761
|
+
1
|
762
|
+
1
|
763
|
+
47
|
764
|
+
49
|
765
|
+
0
|
766
|
+
2
|
767
|
+
11
|
768
|
+
I
|
769
|
+
5
|
770
|
+
I
|
771
|
+
1
|
772
|
+
I
|
773
|
+
1
|
774
|
+
I
|
775
|
+
1
|
776
|
+
n
|
777
|
+
p
|
778
|
+
1
|
779
|
+
x
|
780
|
+
5
|
781
|
+
parse
|
782
|
+
p
|
783
|
+
5
|
784
|
+
I
|
785
|
+
0
|
786
|
+
I
|
787
|
+
44
|
788
|
+
I
|
789
|
+
4
|
790
|
+
I
|
791
|
+
45
|
792
|
+
I
|
793
|
+
f
|
794
|
+
x
|
795
|
+
48
|
796
|
+
/home/falcone/prg/SwissParser/lib/swissparser.rb
|
797
|
+
p
|
798
|
+
1
|
799
|
+
x
|
800
|
+
4
|
801
|
+
file
|
802
|
+
x
|
803
|
+
4
|
804
|
+
open
|
805
|
+
p
|
806
|
+
5
|
807
|
+
I
|
808
|
+
0
|
809
|
+
I
|
810
|
+
43
|
811
|
+
I
|
812
|
+
e
|
813
|
+
I
|
814
|
+
44
|
815
|
+
I
|
816
|
+
18
|
817
|
+
x
|
818
|
+
48
|
819
|
+
/home/falcone/prg/SwissParser/lib/swissparser.rb
|
820
|
+
p
|
821
|
+
2
|
822
|
+
x
|
823
|
+
3
|
824
|
+
uri
|
825
|
+
x
|
826
|
+
3
|
827
|
+
opt
|
828
|
+
p
|
829
|
+
9
|
830
|
+
I
|
831
|
+
2
|
832
|
+
I
|
833
|
+
23
|
834
|
+
I
|
835
|
+
11
|
836
|
+
I
|
837
|
+
2e
|
838
|
+
I
|
839
|
+
20
|
840
|
+
I
|
841
|
+
38
|
842
|
+
I
|
843
|
+
2f
|
844
|
+
I
|
845
|
+
43
|
846
|
+
I
|
847
|
+
3e
|
848
|
+
x
|
849
|
+
48
|
850
|
+
/home/falcone/prg/SwissParser/lib/swissparser.rb
|
851
|
+
p
|
852
|
+
0
|
853
|
+
x
|
854
|
+
13
|
855
|
+
attach_method
|
856
|
+
x
|
857
|
+
12
|
858
|
+
DefaultRules
|
859
|
+
x
|
860
|
+
5
|
861
|
+
Rules
|
862
|
+
n
|
863
|
+
x
|
864
|
+
3
|
865
|
+
new
|
866
|
+
x
|
867
|
+
8
|
868
|
+
allocate
|
869
|
+
x
|
870
|
+
10
|
871
|
+
initialize
|
872
|
+
n
|
873
|
+
x
|
874
|
+
6
|
875
|
+
freeze
|
876
|
+
p
|
877
|
+
9
|
878
|
+
I
|
879
|
+
2
|
880
|
+
I
|
881
|
+
1a
|
882
|
+
I
|
883
|
+
c
|
884
|
+
I
|
885
|
+
1e
|
886
|
+
I
|
887
|
+
2a
|
888
|
+
I
|
889
|
+
4b
|
890
|
+
I
|
891
|
+
46
|
892
|
+
I
|
893
|
+
4c
|
894
|
+
I
|
895
|
+
4c
|
896
|
+
x
|
897
|
+
48
|
898
|
+
/home/falcone/prg/SwissParser/lib/swissparser.rb
|
899
|
+
p
|
900
|
+
0
|
901
|
+
x
|
902
|
+
13
|
903
|
+
attach_method
|
904
|
+
p
|
905
|
+
9
|
906
|
+
I
|
907
|
+
0
|
908
|
+
I
|
909
|
+
14
|
910
|
+
I
|
911
|
+
9
|
912
|
+
I
|
913
|
+
15
|
914
|
+
I
|
915
|
+
12
|
916
|
+
I
|
917
|
+
16
|
918
|
+
I
|
919
|
+
1b
|
920
|
+
I
|
921
|
+
18
|
922
|
+
I
|
923
|
+
3a
|
924
|
+
x
|
925
|
+
48
|
926
|
+
/home/falcone/prg/SwissParser/lib/swissparser.rb
|
927
|
+
p
|
928
|
+
0
|