php-serialization 0.5.3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +14 -5
- data/.travis.yml +12 -0
- data/Gemfile +4 -0
- data/{LICENSE → LICENSE.txt} +3 -1
- data/README.md +31 -0
- data/Rakefile +5 -67
- data/bin/racc +16 -0
- data/bin/racc2y +16 -0
- data/bin/rake +16 -0
- data/bin/rspec +16 -0
- data/bin/y2racc +16 -0
- data/lib/php_serialization/serializer.rb +7 -7
- data/lib/php_serialization/tokenizer.rb +5 -5
- data/lib/php_serialization/unserializer.output +503 -0
- data/lib/php_serialization/unserializer.rb +67 -64
- data/lib/php_serialization/unserializer.y +39 -27
- data/lib/php_serialization/version.rb +3 -0
- data/ruby-php-serialization.gemspec +26 -0
- data/spec/functional/session_serialization_spec.rb +23 -0
- data/spec/unit/serializer_spec.rb +49 -0
- data/spec/unit/unserializer_spec.rb +67 -0
- metadata +100 -81
- data/.document +0 -5
- data/README.rdoc +0 -72
- data/VERSION +0 -1
- data/features/ruby_php_serialization.feature +0 -9
- data/features/step_definitions/ruby_php_serialization_steps.rb +0 -0
- data/features/support/env.rb +0 -4
- data/php-serialization.gemspec +0 -72
- data/spec/serialization_spec.rb +0 -49
- data/spec/session_serialization_spec.rb +0 -21
- data/spec/spec.opts +0 -3
- data/spec/spec_helper.rb +0 -9
- data/spec/unserialization_spec.rb +0 -51
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 878d053b35ff09699f75c0df1b04ec2dee1b8ce4
|
4
|
+
data.tar.gz: 0ffa397bc3c17f8f3804631c0aa3d8db17e2ea44
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9bf6130c5a40dd1a550cd3b8b13a70a2845e2413369960812429408f5480913f5096caa0ba72a13bc3c557ec69911909cbd5feab86e4a572365731d4b31672c5
|
7
|
+
data.tar.gz: 96414fc84ef3115f2895ec54dd3e8449504dfa24ce90560478899c79ff33cccc7467917ac497d11342c6ee7869930dfda7c67031ceb721b61cdd5d69eb5ed3a6
|
data/.gitignore
CHANGED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/{LICENSE → LICENSE.txt}
RENAMED
data/README.md
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# Ruby::Php::Serialization
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'php-serialization'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install php-serialization
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
TODO: Write usage instructions here
|
24
|
+
|
25
|
+
## Contributing
|
26
|
+
|
27
|
+
1. Fork it ( https://github.com/[my-github-username]/ruby-php-serialization/fork )
|
28
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
29
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
30
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
31
|
+
5. Create a new Pull Request
|
data/Rakefile
CHANGED
@@ -1,72 +1,10 @@
|
|
1
|
-
require
|
2
|
-
require 'rake'
|
1
|
+
require "bundler/gem_tasks"
|
3
2
|
|
4
|
-
|
5
|
-
require 'jeweler'
|
6
|
-
Jeweler::Tasks.new do |gem|
|
7
|
-
gem.name = "php-serialization"
|
8
|
-
gem.summary = %Q{PHP's serialization implementation for ruby}
|
9
|
-
gem.description = %Q{Pure Ruby implementation of php's methods: serialize() and unserializer()}
|
10
|
-
gem.email = "divoxx@gmail.com"
|
11
|
-
gem.homepage = "http://github.com/divoxx/ruby-php-serialization"
|
12
|
-
gem.authors = ["Rodrigo Kochenburger"]
|
13
|
-
gem.add_development_dependency "rspec"
|
14
|
-
gem.add_development_dependency "cucumber"
|
15
|
-
gem.add_dependency "racc"
|
16
|
-
|
17
|
-
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
18
|
-
end
|
19
|
-
Jeweler::GemcutterTasks.new
|
20
|
-
rescue LoadError
|
21
|
-
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
22
|
-
end
|
23
|
-
|
24
|
-
require 'spec/rake/spectask'
|
25
|
-
Spec::Rake::SpecTask.new(:spec) do |spec|
|
26
|
-
spec.libs << 'lib' << 'spec'
|
27
|
-
spec.spec_files = FileList['spec/**/*_spec.rb']
|
28
|
-
spec.spec_opts = ["--options spec/spec.opts"]
|
29
|
-
end
|
30
|
-
|
31
|
-
Spec::Rake::SpecTask.new(:rcov) do |spec|
|
32
|
-
spec.libs << 'lib' << 'spec'
|
33
|
-
spec.pattern = 'spec/**/*_spec.rb'
|
34
|
-
spec.rcov = true
|
35
|
-
end
|
36
|
-
|
37
|
-
task :spec => :check_dependencies
|
38
|
-
|
39
|
-
begin
|
40
|
-
require 'cucumber/rake/task'
|
41
|
-
Cucumber::Rake::Task.new(:features)
|
42
|
-
|
43
|
-
task :features => :check_dependencies
|
44
|
-
rescue LoadError
|
45
|
-
task :features do
|
46
|
-
abort "Cucumber is not available. In order to run features, you must: sudo gem install cucumber"
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
task :default => :spec
|
51
|
-
|
52
|
-
require 'rake/rdoctask'
|
53
|
-
Rake::RDocTask.new do |rdoc|
|
54
|
-
if File.exist?('VERSION')
|
55
|
-
version = File.read('VERSION')
|
56
|
-
else
|
57
|
-
version = ""
|
58
|
-
end
|
59
|
-
|
60
|
-
rdoc.rdoc_dir = 'rdoc'
|
61
|
-
rdoc.title = "Ruby's PhpSerialization #{version}"
|
62
|
-
rdoc.rdoc_files.include('README*')
|
63
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
64
|
-
end
|
3
|
+
task default: [:compile]
|
65
4
|
|
5
|
+
desc "Compile all the necessary files, such as .y grammar files"
|
6
|
+
task compile: ['lib/php_serialization/unserializer.rb']
|
66
7
|
|
67
8
|
file 'lib/php_serialization/unserializer.rb' => 'lib/php_serialization/unserializer.y' do |t|
|
68
|
-
|
9
|
+
`./bin/racc -o #{t.name} #{t.prerequisites[0]}`
|
69
10
|
end
|
70
|
-
|
71
|
-
desc "Compile all the necessary files, such as .y grammar files"
|
72
|
-
task :compile => ['lib/php_serialization/unserializer.rb']
|
data/bin/racc
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'racc' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
load Gem.bin_path('racc', 'racc')
|
data/bin/racc2y
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'racc2y' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
load Gem.bin_path('racc', 'racc2y')
|
data/bin/rake
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'rake' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
load Gem.bin_path('rake', 'rake')
|
data/bin/rspec
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'rspec' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
load Gem.bin_path('rspec-core', 'rspec')
|
data/bin/y2racc
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'y2racc' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
load Gem.bin_path('racc', 'y2racc')
|
@@ -13,7 +13,7 @@ module PhpSerialization
|
|
13
13
|
when Float then
|
14
14
|
"d:#{object};"
|
15
15
|
when String, Symbol then
|
16
|
-
"s:#{object.to_s.
|
16
|
+
"s:#{object.to_s.bytesize}:\"#{object}\";"
|
17
17
|
when Array then
|
18
18
|
idx = -1
|
19
19
|
items = object.map { |item| "#{run(idx += 1)}#{run(item)}" }.join
|
@@ -23,14 +23,14 @@ module PhpSerialization
|
|
23
23
|
"a:#{object.length}:{#{items}}"
|
24
24
|
else
|
25
25
|
klass_name = object.class.name
|
26
|
-
|
26
|
+
|
27
27
|
if klass_name =~ /^Struct::/ && php_klass = object.instance_variable_get("@_php_class")
|
28
28
|
klass_name = php_klass
|
29
29
|
end
|
30
|
-
|
31
|
-
attributes = object.instance_variables.map { |var_name| "#{run(var_name.gsub(/^@/, ''))}#{run(object.instance_variable_get(var_name))}" }
|
32
|
-
"O:#{klass_name.length}:\"#{klass_name}\":#{object.instance_variables.length}:{#{attributes}}"
|
30
|
+
|
31
|
+
attributes = object.instance_variables.sort.map { |var_name| "#{run(var_name.to_s.gsub(/^@/, ''))}#{run(object.instance_variable_get(var_name))}" }
|
32
|
+
"O:#{klass_name.length}:\"#{klass_name}\":#{object.instance_variables.length}:{#{attributes.join}}"
|
33
33
|
end
|
34
|
-
end
|
34
|
+
end
|
35
35
|
end
|
36
|
-
end
|
36
|
+
end
|
@@ -7,15 +7,15 @@ module PhpSerialization
|
|
7
7
|
def each
|
8
8
|
while !@string.empty?
|
9
9
|
token = case @string
|
10
|
-
when /\A[0-9]+(\.[0-9]+)?/m then yield([:NUMBER, $&])
|
11
|
-
when /\A"([^"]*)"/m
|
10
|
+
when /\A-?[0-9]+(\.[0-9]+)?/m then yield([:NUMBER, $&])
|
11
|
+
when /\A"((?:(?:"(?![;:]))*|(?:[^"]))*)"(?=[:;])/m then yield([:STRING, $1])
|
12
12
|
when /\A[^\s]/m then yield([$&, $&])
|
13
13
|
end
|
14
|
-
|
14
|
+
|
15
15
|
@string = $'
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
18
|
yield([false, '$'])
|
19
19
|
end
|
20
20
|
end
|
21
|
-
end
|
21
|
+
end
|
@@ -0,0 +1,503 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
-------- Grammar --------
|
4
|
+
|
5
|
+
rule 1 data: null ";"
|
6
|
+
rule 2 data: bool ";"
|
7
|
+
rule 3 data: integer ";"
|
8
|
+
rule 4 data: double ";"
|
9
|
+
rule 5 data: string ";"
|
10
|
+
rule 6 data: assoc_array
|
11
|
+
rule 7 data: object
|
12
|
+
rule 8 null: "N"
|
13
|
+
rule 9 bool: "b" ":" NUMBER
|
14
|
+
rule 10 integer: "i" ":" NUMBER
|
15
|
+
rule 11 double: "d" ":" NUMBER
|
16
|
+
rule 12 string: "s" ":" NUMBER ":" STRING
|
17
|
+
rule 13 object: "O" ":" NUMBER ":" STRING ":" NUMBER ":" "{" attribute_list "}"
|
18
|
+
rule 14 attribute_list: attribute_list attribute
|
19
|
+
rule 15 attribute_list:
|
20
|
+
rule 16 attribute: data data
|
21
|
+
rule 17 assoc_array: "a" ":" NUMBER ":" "{" attribute_list "}"
|
22
|
+
|
23
|
+
------- Symbols -------
|
24
|
+
|
25
|
+
**Nonterminals, with rules where they appear
|
26
|
+
|
27
|
+
$start (15)
|
28
|
+
on right:
|
29
|
+
on left :
|
30
|
+
data (16)
|
31
|
+
on right: 16
|
32
|
+
on left : 1 2 3 4 5 6 7
|
33
|
+
null (17)
|
34
|
+
on right: 1
|
35
|
+
on left : 8
|
36
|
+
bool (18)
|
37
|
+
on right: 2
|
38
|
+
on left : 9
|
39
|
+
integer (19)
|
40
|
+
on right: 3
|
41
|
+
on left : 10
|
42
|
+
double (20)
|
43
|
+
on right: 4
|
44
|
+
on left : 11
|
45
|
+
string (21)
|
46
|
+
on right: 5
|
47
|
+
on left : 12
|
48
|
+
assoc_array (22)
|
49
|
+
on right: 6
|
50
|
+
on left : 17
|
51
|
+
object (23)
|
52
|
+
on right: 7
|
53
|
+
on left : 13
|
54
|
+
attribute_list (24)
|
55
|
+
on right: 13 14 17
|
56
|
+
on left : 14 15
|
57
|
+
attribute (25)
|
58
|
+
on right: 14
|
59
|
+
on left : 16
|
60
|
+
|
61
|
+
**Terminals, with rules where they appear
|
62
|
+
|
63
|
+
$end (0)
|
64
|
+
error (1)
|
65
|
+
";" (2) 1 2 3 4 5
|
66
|
+
"N" (3) 8
|
67
|
+
"b" (4) 9
|
68
|
+
":" (5) 9 10 11 12 13 17
|
69
|
+
NUMBER (6) 9 10 11 12 13 17
|
70
|
+
"i" (7) 10
|
71
|
+
"d" (8) 11
|
72
|
+
"s" (9) 12
|
73
|
+
STRING (10) 12 13
|
74
|
+
"O" (11) 13
|
75
|
+
"{" (12) 13 17
|
76
|
+
"}" (13) 13 17
|
77
|
+
"a" (14) 17
|
78
|
+
|
79
|
+
--------- State ---------
|
80
|
+
|
81
|
+
state 0
|
82
|
+
|
83
|
+
|
84
|
+
"N" shift, and go to state 9
|
85
|
+
"b" shift, and go to state 10
|
86
|
+
"i" shift, and go to state 11
|
87
|
+
"d" shift, and go to state 12
|
88
|
+
"s" shift, and go to state 13
|
89
|
+
"O" shift, and go to state 14
|
90
|
+
"a" shift, and go to state 15
|
91
|
+
|
92
|
+
data go to state 1
|
93
|
+
null go to state 2
|
94
|
+
bool go to state 3
|
95
|
+
integer go to state 4
|
96
|
+
double go to state 5
|
97
|
+
string go to state 6
|
98
|
+
assoc_array go to state 7
|
99
|
+
object go to state 8
|
100
|
+
|
101
|
+
state 1
|
102
|
+
|
103
|
+
|
104
|
+
$end shift, and go to state 16
|
105
|
+
|
106
|
+
|
107
|
+
state 2
|
108
|
+
|
109
|
+
1) data : null _ ";"
|
110
|
+
|
111
|
+
";" shift, and go to state 17
|
112
|
+
|
113
|
+
|
114
|
+
state 3
|
115
|
+
|
116
|
+
2) data : bool _ ";"
|
117
|
+
|
118
|
+
";" shift, and go to state 18
|
119
|
+
|
120
|
+
|
121
|
+
state 4
|
122
|
+
|
123
|
+
3) data : integer _ ";"
|
124
|
+
|
125
|
+
";" shift, and go to state 19
|
126
|
+
|
127
|
+
|
128
|
+
state 5
|
129
|
+
|
130
|
+
4) data : double _ ";"
|
131
|
+
|
132
|
+
";" shift, and go to state 20
|
133
|
+
|
134
|
+
|
135
|
+
state 6
|
136
|
+
|
137
|
+
5) data : string _ ";"
|
138
|
+
|
139
|
+
";" shift, and go to state 21
|
140
|
+
|
141
|
+
|
142
|
+
state 7
|
143
|
+
|
144
|
+
6) data : assoc_array _
|
145
|
+
|
146
|
+
$default reduce using rule 6 (data)
|
147
|
+
|
148
|
+
|
149
|
+
state 8
|
150
|
+
|
151
|
+
7) data : object _
|
152
|
+
|
153
|
+
$default reduce using rule 7 (data)
|
154
|
+
|
155
|
+
|
156
|
+
state 9
|
157
|
+
|
158
|
+
8) null : "N" _
|
159
|
+
|
160
|
+
$default reduce using rule 8 (null)
|
161
|
+
|
162
|
+
|
163
|
+
state 10
|
164
|
+
|
165
|
+
9) bool : "b" _ ":" NUMBER
|
166
|
+
|
167
|
+
":" shift, and go to state 22
|
168
|
+
|
169
|
+
|
170
|
+
state 11
|
171
|
+
|
172
|
+
10) integer : "i" _ ":" NUMBER
|
173
|
+
|
174
|
+
":" shift, and go to state 23
|
175
|
+
|
176
|
+
|
177
|
+
state 12
|
178
|
+
|
179
|
+
11) double : "d" _ ":" NUMBER
|
180
|
+
|
181
|
+
":" shift, and go to state 24
|
182
|
+
|
183
|
+
|
184
|
+
state 13
|
185
|
+
|
186
|
+
12) string : "s" _ ":" NUMBER ":" STRING
|
187
|
+
|
188
|
+
":" shift, and go to state 25
|
189
|
+
|
190
|
+
|
191
|
+
state 14
|
192
|
+
|
193
|
+
13) object : "O" _ ":" NUMBER ":" STRING ":" NUMBER ":" "{" attribute_list "}"
|
194
|
+
|
195
|
+
":" shift, and go to state 26
|
196
|
+
|
197
|
+
|
198
|
+
state 15
|
199
|
+
|
200
|
+
17) assoc_array : "a" _ ":" NUMBER ":" "{" attribute_list "}"
|
201
|
+
|
202
|
+
":" shift, and go to state 27
|
203
|
+
|
204
|
+
|
205
|
+
state 16
|
206
|
+
|
207
|
+
|
208
|
+
$end shift, and go to state 28
|
209
|
+
|
210
|
+
|
211
|
+
state 17
|
212
|
+
|
213
|
+
1) data : null ";" _
|
214
|
+
|
215
|
+
$default reduce using rule 1 (data)
|
216
|
+
|
217
|
+
|
218
|
+
state 18
|
219
|
+
|
220
|
+
2) data : bool ";" _
|
221
|
+
|
222
|
+
$default reduce using rule 2 (data)
|
223
|
+
|
224
|
+
|
225
|
+
state 19
|
226
|
+
|
227
|
+
3) data : integer ";" _
|
228
|
+
|
229
|
+
$default reduce using rule 3 (data)
|
230
|
+
|
231
|
+
|
232
|
+
state 20
|
233
|
+
|
234
|
+
4) data : double ";" _
|
235
|
+
|
236
|
+
$default reduce using rule 4 (data)
|
237
|
+
|
238
|
+
|
239
|
+
state 21
|
240
|
+
|
241
|
+
5) data : string ";" _
|
242
|
+
|
243
|
+
$default reduce using rule 5 (data)
|
244
|
+
|
245
|
+
|
246
|
+
state 22
|
247
|
+
|
248
|
+
9) bool : "b" ":" _ NUMBER
|
249
|
+
|
250
|
+
NUMBER shift, and go to state 29
|
251
|
+
|
252
|
+
|
253
|
+
state 23
|
254
|
+
|
255
|
+
10) integer : "i" ":" _ NUMBER
|
256
|
+
|
257
|
+
NUMBER shift, and go to state 30
|
258
|
+
|
259
|
+
|
260
|
+
state 24
|
261
|
+
|
262
|
+
11) double : "d" ":" _ NUMBER
|
263
|
+
|
264
|
+
NUMBER shift, and go to state 31
|
265
|
+
|
266
|
+
|
267
|
+
state 25
|
268
|
+
|
269
|
+
12) string : "s" ":" _ NUMBER ":" STRING
|
270
|
+
|
271
|
+
NUMBER shift, and go to state 32
|
272
|
+
|
273
|
+
|
274
|
+
state 26
|
275
|
+
|
276
|
+
13) object : "O" ":" _ NUMBER ":" STRING ":" NUMBER ":" "{" attribute_list "}"
|
277
|
+
|
278
|
+
NUMBER shift, and go to state 33
|
279
|
+
|
280
|
+
|
281
|
+
state 27
|
282
|
+
|
283
|
+
17) assoc_array : "a" ":" _ NUMBER ":" "{" attribute_list "}"
|
284
|
+
|
285
|
+
NUMBER shift, and go to state 34
|
286
|
+
|
287
|
+
|
288
|
+
state 28
|
289
|
+
|
290
|
+
|
291
|
+
$default accept
|
292
|
+
|
293
|
+
|
294
|
+
state 29
|
295
|
+
|
296
|
+
9) bool : "b" ":" NUMBER _
|
297
|
+
|
298
|
+
$default reduce using rule 9 (bool)
|
299
|
+
|
300
|
+
|
301
|
+
state 30
|
302
|
+
|
303
|
+
10) integer : "i" ":" NUMBER _
|
304
|
+
|
305
|
+
$default reduce using rule 10 (integer)
|
306
|
+
|
307
|
+
|
308
|
+
state 31
|
309
|
+
|
310
|
+
11) double : "d" ":" NUMBER _
|
311
|
+
|
312
|
+
$default reduce using rule 11 (double)
|
313
|
+
|
314
|
+
|
315
|
+
state 32
|
316
|
+
|
317
|
+
12) string : "s" ":" NUMBER _ ":" STRING
|
318
|
+
|
319
|
+
":" shift, and go to state 35
|
320
|
+
|
321
|
+
|
322
|
+
state 33
|
323
|
+
|
324
|
+
13) object : "O" ":" NUMBER _ ":" STRING ":" NUMBER ":" "{" attribute_list "}"
|
325
|
+
|
326
|
+
":" shift, and go to state 36
|
327
|
+
|
328
|
+
|
329
|
+
state 34
|
330
|
+
|
331
|
+
17) assoc_array : "a" ":" NUMBER _ ":" "{" attribute_list "}"
|
332
|
+
|
333
|
+
":" shift, and go to state 37
|
334
|
+
|
335
|
+
|
336
|
+
state 35
|
337
|
+
|
338
|
+
12) string : "s" ":" NUMBER ":" _ STRING
|
339
|
+
|
340
|
+
STRING shift, and go to state 38
|
341
|
+
|
342
|
+
|
343
|
+
state 36
|
344
|
+
|
345
|
+
13) object : "O" ":" NUMBER ":" _ STRING ":" NUMBER ":" "{" attribute_list "}"
|
346
|
+
|
347
|
+
STRING shift, and go to state 39
|
348
|
+
|
349
|
+
|
350
|
+
state 37
|
351
|
+
|
352
|
+
17) assoc_array : "a" ":" NUMBER ":" _ "{" attribute_list "}"
|
353
|
+
|
354
|
+
"{" shift, and go to state 40
|
355
|
+
|
356
|
+
|
357
|
+
state 38
|
358
|
+
|
359
|
+
12) string : "s" ":" NUMBER ":" STRING _
|
360
|
+
|
361
|
+
$default reduce using rule 12 (string)
|
362
|
+
|
363
|
+
|
364
|
+
state 39
|
365
|
+
|
366
|
+
13) object : "O" ":" NUMBER ":" STRING _ ":" NUMBER ":" "{" attribute_list "}"
|
367
|
+
|
368
|
+
":" shift, and go to state 41
|
369
|
+
|
370
|
+
|
371
|
+
state 40
|
372
|
+
|
373
|
+
17) assoc_array : "a" ":" NUMBER ":" "{" _ attribute_list "}"
|
374
|
+
|
375
|
+
$default reduce using rule 15 (attribute_list)
|
376
|
+
|
377
|
+
attribute_list go to state 42
|
378
|
+
|
379
|
+
state 41
|
380
|
+
|
381
|
+
13) object : "O" ":" NUMBER ":" STRING ":" _ NUMBER ":" "{" attribute_list "}"
|
382
|
+
|
383
|
+
NUMBER shift, and go to state 43
|
384
|
+
|
385
|
+
|
386
|
+
state 42
|
387
|
+
|
388
|
+
14) attribute_list : attribute_list _ attribute
|
389
|
+
17) assoc_array : "a" ":" NUMBER ":" "{" attribute_list _ "}"
|
390
|
+
|
391
|
+
"N" shift, and go to state 9
|
392
|
+
"b" shift, and go to state 10
|
393
|
+
"i" shift, and go to state 11
|
394
|
+
"d" shift, and go to state 12
|
395
|
+
"s" shift, and go to state 13
|
396
|
+
"O" shift, and go to state 14
|
397
|
+
"}" shift, and go to state 46
|
398
|
+
"a" shift, and go to state 15
|
399
|
+
|
400
|
+
null go to state 2
|
401
|
+
bool go to state 3
|
402
|
+
integer go to state 4
|
403
|
+
double go to state 5
|
404
|
+
string go to state 6
|
405
|
+
assoc_array go to state 7
|
406
|
+
object go to state 8
|
407
|
+
attribute go to state 44
|
408
|
+
data go to state 45
|
409
|
+
|
410
|
+
state 43
|
411
|
+
|
412
|
+
13) object : "O" ":" NUMBER ":" STRING ":" NUMBER _ ":" "{" attribute_list "}"
|
413
|
+
|
414
|
+
":" shift, and go to state 47
|
415
|
+
|
416
|
+
|
417
|
+
state 44
|
418
|
+
|
419
|
+
14) attribute_list : attribute_list attribute _
|
420
|
+
|
421
|
+
$default reduce using rule 14 (attribute_list)
|
422
|
+
|
423
|
+
|
424
|
+
state 45
|
425
|
+
|
426
|
+
16) attribute : data _ data
|
427
|
+
|
428
|
+
"N" shift, and go to state 9
|
429
|
+
"b" shift, and go to state 10
|
430
|
+
"i" shift, and go to state 11
|
431
|
+
"d" shift, and go to state 12
|
432
|
+
"s" shift, and go to state 13
|
433
|
+
"O" shift, and go to state 14
|
434
|
+
"a" shift, and go to state 15
|
435
|
+
|
436
|
+
null go to state 2
|
437
|
+
bool go to state 3
|
438
|
+
integer go to state 4
|
439
|
+
double go to state 5
|
440
|
+
string go to state 6
|
441
|
+
assoc_array go to state 7
|
442
|
+
object go to state 8
|
443
|
+
data go to state 48
|
444
|
+
|
445
|
+
state 46
|
446
|
+
|
447
|
+
17) assoc_array : "a" ":" NUMBER ":" "{" attribute_list "}" _
|
448
|
+
|
449
|
+
$default reduce using rule 17 (assoc_array)
|
450
|
+
|
451
|
+
|
452
|
+
state 47
|
453
|
+
|
454
|
+
13) object : "O" ":" NUMBER ":" STRING ":" NUMBER ":" _ "{" attribute_list "}"
|
455
|
+
|
456
|
+
"{" shift, and go to state 49
|
457
|
+
|
458
|
+
|
459
|
+
state 48
|
460
|
+
|
461
|
+
16) attribute : data data _
|
462
|
+
|
463
|
+
$default reduce using rule 16 (attribute)
|
464
|
+
|
465
|
+
|
466
|
+
state 49
|
467
|
+
|
468
|
+
13) object : "O" ":" NUMBER ":" STRING ":" NUMBER ":" "{" _ attribute_list "}"
|
469
|
+
|
470
|
+
$default reduce using rule 15 (attribute_list)
|
471
|
+
|
472
|
+
attribute_list go to state 50
|
473
|
+
|
474
|
+
state 50
|
475
|
+
|
476
|
+
13) object : "O" ":" NUMBER ":" STRING ":" NUMBER ":" "{" attribute_list _ "}"
|
477
|
+
14) attribute_list : attribute_list _ attribute
|
478
|
+
|
479
|
+
"N" shift, and go to state 9
|
480
|
+
"b" shift, and go to state 10
|
481
|
+
"i" shift, and go to state 11
|
482
|
+
"d" shift, and go to state 12
|
483
|
+
"s" shift, and go to state 13
|
484
|
+
"O" shift, and go to state 14
|
485
|
+
"}" shift, and go to state 51
|
486
|
+
"a" shift, and go to state 15
|
487
|
+
|
488
|
+
null go to state 2
|
489
|
+
bool go to state 3
|
490
|
+
integer go to state 4
|
491
|
+
double go to state 5
|
492
|
+
string go to state 6
|
493
|
+
assoc_array go to state 7
|
494
|
+
object go to state 8
|
495
|
+
attribute go to state 44
|
496
|
+
data go to state 45
|
497
|
+
|
498
|
+
state 51
|
499
|
+
|
500
|
+
13) object : "O" ":" NUMBER ":" STRING ":" NUMBER ":" "{" attribute_list "}" _
|
501
|
+
|
502
|
+
$default reduce using rule 13 (object)
|
503
|
+
|