AmberVM 0.0.19
Sign up to get free protection for your applications and to get access to all the features.
- data/README +38 -0
- data/bin/ambervm +278 -0
- data/lib/amber/acts_as_rvm_type.rb +157 -0
- data/lib/amber/classes/association.rb +36 -0
- data/lib/amber/classes/block.rb +52 -0
- data/lib/amber/classes/boolean.rb +40 -0
- data/lib/amber/classes/class.rb +50 -0
- data/lib/amber/classes/error.rb +22 -0
- data/lib/amber/classes/list.rb +96 -0
- data/lib/amber/classes/null.rb +35 -0
- data/lib/amber/classes/number.rb +95 -0
- data/lib/amber/classes/object.rb +56 -0
- data/lib/amber/classes/string.rb +79 -0
- data/lib/amber/classes.rb +113 -0
- data/lib/amber/environment.rb +251 -0
- data/lib/amber/fukubukuro/ecma_core.rb +409 -0
- data/lib/amber/fukubukuro.rb +866 -0
- data/lib/amber/functions/all.rb +3 -0
- data/lib/amber/functions/array/append.rb +50 -0
- data/lib/amber/functions/array/at.rb +50 -0
- data/lib/amber/functions/array/set_at.rb +50 -0
- data/lib/amber/functions/array.rb +30 -0
- data/lib/amber/functions/association/assoc_get.rb +55 -0
- data/lib/amber/functions/association/assoc_set.rb +56 -0
- data/lib/amber/functions/bitwise/bitwise_and.rb +41 -0
- data/lib/amber/functions/bitwise/bitwise_not.rb +41 -0
- data/lib/amber/functions/bitwise/bitwise_or.rb +41 -0
- data/lib/amber/functions/bitwise/bitwise_xor.rb +41 -0
- data/lib/amber/functions/bitwise.rb +3 -0
- data/lib/amber/functions/collection/get.rb +66 -0
- data/lib/amber/functions/collection/set.rb +67 -0
- data/lib/amber/functions/collection/size.rb +54 -0
- data/lib/amber/functions/general/cmp.rb +43 -0
- data/lib/amber/functions/general/eq.rb +45 -0
- data/lib/amber/functions/general/gt.rb +45 -0
- data/lib/amber/functions/general/gte.rb +45 -0
- data/lib/amber/functions/general/lt.rb +45 -0
- data/lib/amber/functions/general/lte.rb +45 -0
- data/lib/amber/functions/general/neq.rb +45 -0
- data/lib/amber/functions/general/type.rb +43 -0
- data/lib/amber/functions/general.rb +3 -0
- data/lib/amber/functions/io/print.rb +45 -0
- data/lib/amber/functions/io.rb +3 -0
- data/lib/amber/functions/list/align.rb +73 -0
- data/lib/amber/functions/list/join.rb +45 -0
- data/lib/amber/functions/list/map.rb +58 -0
- data/lib/amber/functions/list/split.rb +55 -0
- data/lib/amber/functions/list.rb +3 -0
- data/lib/amber/functions/logic/and.rb +55 -0
- data/lib/amber/functions/logic/not.rb +40 -0
- data/lib/amber/functions/logic/or.rb +50 -0
- data/lib/amber/functions/logic.rb +3 -0
- data/lib/amber/functions/math/abs.rb +39 -0
- data/lib/amber/functions/math/acos.rb +39 -0
- data/lib/amber/functions/math/add.rb +40 -0
- data/lib/amber/functions/math/asin.rb +39 -0
- data/lib/amber/functions/math/atan.rb +39 -0
- data/lib/amber/functions/math/ceil.rb +39 -0
- data/lib/amber/functions/math/cos.rb +39 -0
- data/lib/amber/functions/math/dec.rb +39 -0
- data/lib/amber/functions/math/div.rb +44 -0
- data/lib/amber/functions/math/exp.rb +39 -0
- data/lib/amber/functions/math/floor.rb +39 -0
- data/lib/amber/functions/math/inc.rb +39 -0
- data/lib/amber/functions/math/log.rb +39 -0
- data/lib/amber/functions/math/mod.rb +41 -0
- data/lib/amber/functions/math/mul.rb +43 -0
- data/lib/amber/functions/math/neg.rb +43 -0
- data/lib/amber/functions/math/power.rb +43 -0
- data/lib/amber/functions/math/rand.rb +36 -0
- data/lib/amber/functions/math/round.rb +39 -0
- data/lib/amber/functions/math/shl.rb +41 -0
- data/lib/amber/functions/math/shr.rb +41 -0
- data/lib/amber/functions/math/sin.rb +39 -0
- data/lib/amber/functions/math/sub.rb +43 -0
- data/lib/amber/functions/math/tan.rb +39 -0
- data/lib/amber/functions/math.rb +3 -0
- data/lib/amber/functions/objects/send.rb +22 -0
- data/lib/amber/functions/rails/print.rb +44 -0
- data/lib/amber/functions/rails.rb +3 -0
- data/lib/amber/functions/string/ansi.rb +24 -0
- data/lib/amber/functions/string/capstr.rb +23 -0
- data/lib/amber/functions/string/center.rb +25 -0
- data/lib/amber/functions/string/chr.rb +16 -0
- data/lib/amber/functions/string/ljust.rb +26 -0
- data/lib/amber/functions/string/regmatch.rb +34 -0
- data/lib/amber/functions/string/rjust.rb +26 -0
- data/lib/amber/functions/string.rb +3 -0
- data/lib/amber/functions.rb +103 -0
- data/lib/amber/interpreter.rb +1380 -0
- data/lib/amber/languages/brainfuck.rb +153 -0
- data/lib/amber/languages/ecma/compiler.rb +1661 -0
- data/lib/amber/languages/ecma/core-math.js +67 -0
- data/lib/amber/languages/ecma/core-objects.js +57 -0
- data/lib/amber/languages/ecma.rb +9 -0
- data/lib/amber/languages/ecma_fuku/compiler.rb +1622 -0
- data/lib/amber/languages/ecma_fuku/core-math.js +67 -0
- data/lib/amber/languages/ecma_fuku/core-objects.js +56 -0
- data/lib/amber/languages/ecma_fuku.rb +13 -0
- data/lib/amber/languages/math/compiler.rb +70 -0
- data/lib/amber/languages/math/tokenizer.rb +69 -0
- data/lib/amber/languages/math/tree.rb +110 -0
- data/lib/amber/languages/math.rb +26 -0
- data/lib/amber/languages.rb +99 -0
- data/lib/amber/library.rb +79 -0
- data/lib/amber/optimisation.rb +299 -0
- data/lib/amber/plugin.rb +337 -0
- data/lib/amber/rails.rb +90 -0
- data/lib/amber.rb +106 -0
- data/spec/amber/class_spec.rb +27 -0
- data/spec/amber/enviroment_spec.rb +61 -0
- data/spec/amber/function_spec.rb +25 -0
- data/spec/amber/functions/association/assoc_get_spec.rb +41 -0
- data/spec/amber/functions/association/assoc_set_spec.rb +43 -0
- data/spec/amber/functions/collection/get_spec.rb +12 -0
- data/spec/amber/functions/collection/set_spec.rb +10 -0
- data/spec/amber/functions/collection/size_spec.rb +10 -0
- data/spec/amber/functions/list/split_spec.rb +47 -0
- data/spec/amber/functions/string/ansi_spec.rb +44 -0
- data/spec/amber/functions/string/capstr_spec.rb +42 -0
- data/spec/amber/functions/string/center_spec.rb +49 -0
- data/spec/amber/functions/string/ljust_spec.rb +49 -0
- data/spec/amber/functions/string/regmatch_spec.rb +52 -0
- data/spec/amber/functions/string/rjust_spec.rb +49 -0
- data/spec/amber/interpreter/assignment_spec.rb +22 -0
- data/spec/amber/interpreter/condition_spec.rb +103 -0
- data/spec/amber/interpreter/constant_spec.rb +31 -0
- data/spec/amber/interpreter/core_call_spec.rb +72 -0
- data/spec/amber/interpreter/interpreter_spec.rb +11 -0
- data/spec/amber/interpreter/parameter_spec.rb +24 -0
- data/spec/amber/interpreter/sequence_spec.rb +47 -0
- data/spec/amber/interpreter/variable_spec.rb +24 -0
- data/spec/amber/plugin_spec.rb +10 -0
- data/spec/classes/atom/association_spec.rb +39 -0
- data/spec/classes/atom/block_spec.rb +25 -0
- data/spec/classes/atom/boolean_spec.rb +67 -0
- data/spec/classes/atom/error_spec.rb +43 -0
- data/spec/classes/atom/list_spec.rb +68 -0
- data/spec/classes/atom/number_spec.rb +132 -0
- data/spec/classes/atom/string_spec.rb +175 -0
- data/spec/languages/ecma/ecma_array_spec.rb +79 -0
- data/spec/languages/ecma/ecma_closure_spec.rb +38 -0
- data/spec/languages/ecma/ecma_literals_spec.rb +71 -0
- data/spec/languages/ecma/ecma_objects_spec.rb +165 -0
- data/spec/languages/ecma/ecma_old_spec.rb +540 -0
- data/spec/languages/ecma/ecma_spec.rb +64 -0
- data/spec/languages/ecma_fuku/ecma_array_spec.rb +61 -0
- data/spec/languages/ecma_fuku/ecma_closure_spec.rb +33 -0
- data/spec/languages/ecma_fuku/ecma_function_spec.rb +84 -0
- data/spec/languages/ecma_fuku/ecma_literals_spec.rb +55 -0
- data/spec/languages/ecma_fuku/ecma_objects_spec.rb +133 -0
- data/spec/languages/ecma_fuku/ecma_old_spec.rb +415 -0
- data/spec/languages/ecma_fuku/ecma_operator_spec.rb +33 -0
- data/spec/languages/ecma_fuku/ecma_spec.rb +52 -0
- data/spec/languages/math/compiler_spec.rb +49 -0
- data/spec/languages/math/tokenizer_spec.rb +73 -0
- data/spec/languages/math/tree_spec.rb +153 -0
- metadata +225 -0
@@ -0,0 +1,1661 @@
|
|
1
|
+
#
|
2
|
+
# DO NOT MODIFY!!!!
|
3
|
+
# This file is automatically generated by Racc 1.4.5
|
4
|
+
# from Racc grammer file "".
|
5
|
+
#
|
6
|
+
|
7
|
+
require 'racc/parser.rb'
|
8
|
+
|
9
|
+
|
10
|
+
require 'strscan'
|
11
|
+
require 'amber/functions/math'
|
12
|
+
require 'amber/functions/logic'
|
13
|
+
require 'amber/functions/array'
|
14
|
+
require 'amber/functions/general'
|
15
|
+
require 'amber/functions/bitwise'
|
16
|
+
require 'amber/functions/io'
|
17
|
+
require 'amber/classes/string'
|
18
|
+
require 'amber/classes/list'
|
19
|
+
require 'amber/classes/number'
|
20
|
+
require 'pp'
|
21
|
+
|
22
|
+
module AmberVM
|
23
|
+
module Languages
|
24
|
+
class ECMA
|
25
|
+
class Compiler < Racc::Parser
|
26
|
+
|
27
|
+
module_eval(<<'...end ecma.y/module_eval...', 'ecma.y', 351)
|
28
|
+
|
29
|
+
include AmberVM::Interpreter
|
30
|
+
|
31
|
+
|
32
|
+
def compile(str, include_core = false)
|
33
|
+
@variables = Environment.new
|
34
|
+
@q = []
|
35
|
+
str = str.chomp(';') + ';'
|
36
|
+
s = StringScanner.new(str)
|
37
|
+
pos = 0
|
38
|
+
line = 1
|
39
|
+
while not s.eos?
|
40
|
+
if s.scan(/\/\/.*/)
|
41
|
+
# ignore comments
|
42
|
+
elsif s.scan(/\n/)
|
43
|
+
line += 1
|
44
|
+
pos = s.pos
|
45
|
+
elsif s.scan(/\/\*.*?\*\//m)
|
46
|
+
line += s.matched.count("\n")
|
47
|
+
elsif s.scan(/' [^\\']* (?: \\ (?: u[a-zA-Z0-9]{4} | [a-tv-wyz1-9_\W] ) [^\\']* )* '/x)
|
48
|
+
m = s.matched[1..-2]
|
49
|
+
@q.push [:STRING, [m, [s.pos, line, s.pos - pos]]]
|
50
|
+
elsif s.scan(/" [^\\"]* (?: \\ (?: u[a-zA-Z0-9]{4} | [a-tv-wyz1-9_\W] ) [^\\"]* )* "/x)
|
51
|
+
m = s.matched[1..-2]
|
52
|
+
m.gsub!(/\\./) do |repl|
|
53
|
+
case repl[1]
|
54
|
+
when ?n
|
55
|
+
"\n"
|
56
|
+
when ?t
|
57
|
+
"\t"
|
58
|
+
when ?\\
|
59
|
+
'\\'
|
60
|
+
end
|
61
|
+
end
|
62
|
+
@q.push [:STRING, [m, [s.pos, line, s.pos - pos]]]
|
63
|
+
elsif s.scan(/ (?:\d*\.\d+) (?:e[-+]?\d+)? | \d+e[-+]?\d+ /ix)
|
64
|
+
@q.push [:FLOAT, [Float(s.matched), [s.pos, line, s.pos - pos]]]
|
65
|
+
elsif s.scan(/0x[0-9A-F]+ | \d+/ix)
|
66
|
+
@q.push [:INTEGER, [Integer(s.matched), [s.pos, line, s.pos - pos]]]
|
67
|
+
elsif s.scan(/\[/)
|
68
|
+
@q.push [:SBRACKET_OPEN, [s.matched, [s.pos, line, s.pos - pos]]]
|
69
|
+
elsif s.scan(/\]/)
|
70
|
+
@q.push [:SBRACKET_CLOSE, [s.matched, [s.pos, line, s.pos - pos]]]
|
71
|
+
elsif s.scan(/\{/)
|
72
|
+
@q.push [:CBRACKET_OPEN, [s.matched, [s.pos, line, s.pos - pos]]]
|
73
|
+
elsif s.scan(/\}/)
|
74
|
+
@q.push [:CBRACKET_CLOSE, [s.matched, [s.pos, line, s.pos - pos]]]
|
75
|
+
elsif s.scan(/\$?[a-z_][a-z_0-9]*/i)
|
76
|
+
m = s.matched
|
77
|
+
type = case m
|
78
|
+
when '__AmberVM__'
|
79
|
+
include_core ? :KW_CORE : :IDENT
|
80
|
+
when 'function'
|
81
|
+
:KW_FUNCTION
|
82
|
+
when 'typeof'
|
83
|
+
:KW_TYPEOF
|
84
|
+
when 'for'
|
85
|
+
:KW_FOR
|
86
|
+
when 'while'
|
87
|
+
:KW_WHILE
|
88
|
+
when 'do'
|
89
|
+
:KW_DO
|
90
|
+
when 'if'
|
91
|
+
:KW_IF
|
92
|
+
when 'return'
|
93
|
+
:KW_RETURN
|
94
|
+
when 'else'
|
95
|
+
:KW_ELSE
|
96
|
+
when 'new'
|
97
|
+
:KW_NEW
|
98
|
+
when 'this'
|
99
|
+
:KW_THIS
|
100
|
+
when 'var'
|
101
|
+
:KW_VAR
|
102
|
+
when 'true'
|
103
|
+
:KW_TRUE
|
104
|
+
when 'false'
|
105
|
+
:KW_FALSE
|
106
|
+
when 'null'
|
107
|
+
:KW_NULL
|
108
|
+
else
|
109
|
+
:IDENT
|
110
|
+
end
|
111
|
+
@q.push [type, [m, [s.pos, line, s.pos - pos]]]
|
112
|
+
elsif s.scan(/>>>?=?|<<=?|&&|\|\||[<>]=?|[!=]=?=?|[-+]{2}|[-+*\/%^|&~]=?|[.,()?:;]/)
|
113
|
+
m = s.matched
|
114
|
+
@q.push [m, [m, [s.pos, line, s.pos - pos]]]
|
115
|
+
elsif s.scan(/[ \t]+/)
|
116
|
+
# ignore white space
|
117
|
+
else c = s.getch
|
118
|
+
raise Exception, "Woops! I can't deal with char %p at #{line}:#{s.pos - pos}" % [c]
|
119
|
+
end
|
120
|
+
end
|
121
|
+
@q.push([false, '$end'])
|
122
|
+
|
123
|
+
Program.new(do_parse)
|
124
|
+
end
|
125
|
+
|
126
|
+
def version
|
127
|
+
"0.1.0"
|
128
|
+
end
|
129
|
+
|
130
|
+
def next_token
|
131
|
+
@q.shift
|
132
|
+
end
|
133
|
+
|
134
|
+
def const c, v, p = [0,0]
|
135
|
+
AmberVM::Interpreter.const(c,v,p)
|
136
|
+
end
|
137
|
+
|
138
|
+
def core_fun(fun)
|
139
|
+
VariableValue.new(ObjectVariable.new(VariableValue.new(SimpleVariable.new('Core')), fun))
|
140
|
+
end
|
141
|
+
...end ecma.y/module_eval...
|
142
|
+
##### State transition tables begin ###
|
143
|
+
|
144
|
+
clist = [
|
145
|
+
'26,30,34,39,46,199,199,133,8,14,-4,-3,-4,-3,95,-5,188,-5,85,156,167',
|
146
|
+
'205,-69,202,26,30,34,39,46,134,200,214,8,14,-69,94,189,85,204,19,132',
|
147
|
+
'10,17,19,24,28,33,156,44,50,1,5,9,16,21,23,121,36,40,48,122,2,206,12',
|
148
|
+
'15,10,17,19,24,28,33,56,44,50,1,5,9,16,21,23,86,36,40,48,-69,2,19,127',
|
149
|
+
'15,26,30,34,39,46,19,190,-69,8,14,86,36,81,63,64,66,67,209,188,36,81',
|
150
|
+
'63,64,123,26,30,34,39,46,81,63,64,8,14,81,63,64,66,67,186,19,10,17,58',
|
151
|
+
'24,28,33,212,44,50,1,5,9,16,21,23,130,36,40,48,131,2,57,12,15,10,17',
|
152
|
+
'19,24,28,33,100,44,50,1,5,9,16,21,23,99,36,40,48,97,2,132,127,15,26',
|
153
|
+
'30,34,39,46,156,108,157,8,14,81,63,64,66,67,68,70,72,74,76,78,80,212',
|
154
|
+
'221,26,30,222,223,46,161,19,165,8,14,81,63,64,66,67,227,56,10,17,19',
|
155
|
+
',,,,,,1,5,9,16,21,,,36,40,48,,82,,,15,10,17,19,,,,,,,,5,9,16,21,,,36',
|
156
|
+
'40,48,,82,,,15,26,30,34,39,46,,,,8,14,81,63,64,66,67,68,70,72,74,76',
|
157
|
+
'78,80,,,26,30,,,46,,,,8,14,,,,,,,,10,17,19,24,28,33,,44,50,1,5,9,16',
|
158
|
+
'21,23,,36,40,48,,2,57,12,15,10,17,19,,,,,,113,115,5,9,16,21,,,36,40',
|
159
|
+
'48,,82,,,15,26,30,34,39,46,,,,8,14,104,105,106,107,109,110,111,112,114',
|
160
|
+
'116,117,103,,,26,30,34,39,46,,,,8,14,,,,,,,,10,17,19,,,108,,,,,5,9,16',
|
161
|
+
'21,,,36,40,48,,82,,,15,10,17,19,24,,,,,,,5,9,16,21,,,36,40,48,,82,,',
|
162
|
+
'15,26,30,34,39,46,,,,8,14,81,63,64,66,67,68,70,72,,,,,,,26,30,,,46,',
|
163
|
+
',,8,14,,,,,,,,10,17,19,,,,,,,,5,9,16,21,,,36,40,48,,82,,,15,10,17,19',
|
164
|
+
',,,,,,,5,9,16,21,,,36,40,48,,82,,,15,26,30,34,39,46,,,,8,14,81,63,64',
|
165
|
+
'66,67,68,70,72,,,,,,,26,30,,,46,,,,8,14,,,,,,,,10,17,19,24,28,33,,44',
|
166
|
+
'50,1,5,9,16,21,23,,36,40,48,,2,,127,15,10,17,19,,,,,,,,5,9,16,21,,,36',
|
167
|
+
'40,48,,82,,,15,26,30,34,39,46,,,,8,14,81,63,64,66,67,68,70,72,,,,,,',
|
168
|
+
'26,30,34,39,46,,,,8,14,,,,,,,,10,17,19,,,,,,,,5,9,16,21,,,36,40,48,',
|
169
|
+
'82,,,15,10,17,19,24,28,33,,44,50,1,5,9,16,21,23,,36,40,48,,2,,127,15',
|
170
|
+
'26,30,34,39,46,,,,8,14,81,63,64,66,67,68,70,72,,,,,,,26,30,34,39,46',
|
171
|
+
',,,8,14,,,,,,,,10,17,19,,,,,,,1,5,9,16,21,,,36,40,48,,82,,,15,10,17',
|
172
|
+
'19,,,,,,,,5,9,16,21,,,36,40,48,,82,,,15,26,30,34,39,46,,,,8,14,,,,,',
|
173
|
+
',,,,,,,,,26,30,34,39,46,,,,8,14,,,,,,,,10,17,19,24,28,33,,44,50,1,5',
|
174
|
+
'9,16,21,23,,36,40,48,,2,,118,15,10,17,19,,,,,,,,5,9,16,21,,,36,40,48',
|
175
|
+
',82,,,15,26,30,34,39,46,,,,8,14,,,,,,,,,,,,,,,26,30,34,39,46,,,,8,14',
|
176
|
+
',,,,,,,10,17,19,24,,,,,,,5,9,16,21,,,36,40,48,,82,,,15,10,17,19,,,,',
|
177
|
+
',,,5,9,16,21,,,36,40,48,,82,,,15,26,30,34,39,46,,,,8,14,,,,,,,,,,,,',
|
178
|
+
',,26,30,34,39,46,,,,8,14,,,,,,,,10,17,19,,,,,,,,5,9,16,21,,,36,40,48',
|
179
|
+
',82,,,15,10,17,19,,,,,,,,5,9,16,21,,,36,40,48,,82,,,15,26,30,34,39,46',
|
180
|
+
',,,8,14,,,,,,,,,,,,,,,26,30,34,39,46,,,,8,14,,,,,,,,10,17,19,,,,,,,',
|
181
|
+
'5,9,16,21,,,36,40,48,,82,,,15,10,17,19,,,,,,,,5,9,16,21,,,36,40,48,',
|
182
|
+
'82,,,15,26,30,34,39,46,,,,8,14,,,,,,,,,,,,,,,26,30,34,39,46,,,,8,14',
|
183
|
+
',,,,,,,10,17,19,24,28,33,,44,50,1,5,9,16,21,23,,36,40,48,,2,,127,15',
|
184
|
+
'10,17,19,,,,,,,,5,9,16,21,,,36,40,48,,82,,,15,26,30,34,39,46,,,,8,14',
|
185
|
+
',,,,,,,,,,,,,,26,30,34,39,46,,,,8,14,,,,,,,,10,17,19,,,,,,,,5,9,16,21',
|
186
|
+
',,36,40,48,,82,,,15,10,17,19,,,,,,,,5,9,16,21,,,36,40,48,,82,,,15,26',
|
187
|
+
'30,34,39,46,,,,8,14,,,,,,,,,,,,,,,26,30,34,39,46,,,,8,14,,,,,,,,10,17',
|
188
|
+
'19,,,,,,,,5,9,16,21,,,36,40,48,,82,,,15,10,17,19,,,,,,,,5,9,16,21,,',
|
189
|
+
'36,40,48,,82,,,15,26,30,34,39,46,,,,8,14,,,,,,,,,,,,,,,26,30,34,39,46',
|
190
|
+
',,,8,14,,,,,,,,10,17,19,24,28,33,,44,50,1,5,9,16,21,23,,36,40,48,,2',
|
191
|
+
'135,118,15,10,17,19,,,,,,,,5,9,16,21,,,36,40,48,,82,,,15,26,30,34,39',
|
192
|
+
'46,,,,8,14,,,,,,,,,,,,,,,26,30,34,39,46,,,,8,14,,,,,,,,10,17,19,,,,',
|
193
|
+
',,,5,9,16,21,,,36,40,48,,82,,,15,10,17,19,,,,,,,,5,9,16,21,,,36,40,48',
|
194
|
+
',82,,,15,26,30,34,39,46,,,,8,14,,,,,,,,,,,,,,,26,30,34,39,46,,,,8,14',
|
195
|
+
',,,,,,,10,17,19,,,,,,,,5,9,16,21,,,36,40,48,,82,,,15,10,17,19,,,,,,',
|
196
|
+
',5,9,16,21,,,36,40,48,,82,,,15,26,30,34,39,46,,,,8,14,,,,,,,,,,,,,,',
|
197
|
+
'26,30,34,39,46,,,,8,14,,,,,,,,10,17,19,,,,,,,1,5,9,16,21,,,36,40,48',
|
198
|
+
',82,,,15,10,17,19,,,,,,,,5,9,16,21,,,36,40,48,,82,,,15,26,30,34,39,46',
|
199
|
+
',,,8,14,,,,,,,,,,,,,,,26,30,34,39,46,,,,8,14,,,,,,,,10,17,19,,,,,,,',
|
200
|
+
'5,9,16,21,,,36,40,48,,82,,,15,10,17,19,,,,,,,,5,9,16,21,,,36,40,48,',
|
201
|
+
'82,,,15,26,30,34,39,46,,,,8,14,,,,,,,,,,,,,,,26,30,34,39,46,,,,8,14',
|
202
|
+
',,,,,,,10,17,19,,,,,,,,5,9,16,21,,,36,40,48,,82,,,15,10,17,19,,,,,,',
|
203
|
+
',5,9,16,21,,,36,40,48,,82,,,15,26,30,34,39,46,,,,8,14,,,,,,,,,,,,,,',
|
204
|
+
'26,30,34,39,46,,,,8,14,,,,,,,,10,17,19,,,,,,,,5,9,16,21,,,36,40,48,',
|
205
|
+
'82,,,15,10,17,19,,,,,,,,5,9,16,21,,,36,40,48,,82,,,15,26,30,34,39,46',
|
206
|
+
',,,8,14,,,,,,,,,,,,,,,26,30,34,39,46,,,,8,14,,,,,,,,10,17,19,,,,,,,',
|
207
|
+
'5,9,16,21,,,36,40,48,,82,,,15,10,17,19,,,,,,,,5,9,16,21,,,36,40,48,',
|
208
|
+
'82,,,15,26,30,34,39,46,,,,8,14,,,,,,,,,,,,,,,26,30,34,39,46,,,,8,14',
|
209
|
+
',,,,,,,10,17,19,,,,,,,,5,9,16,21,,,36,40,48,,82,,,15,10,17,19,,,,,,',
|
210
|
+
',5,9,16,21,,,36,40,48,,82,,,15,26,30,34,39,46,,,,8,14,,,,,,,,,,,,,,',
|
211
|
+
'26,30,34,39,46,,,,8,14,,,,,,,,10,17,19,,,,,,,,5,9,16,21,,,36,40,48,',
|
212
|
+
'82,,,15,10,17,19,,,,,,,,5,9,16,21,,,36,40,48,,82,,,15,26,30,34,39,46',
|
213
|
+
',,,8,14,,,,,,,,,,,,,,,26,30,34,39,46,,,,8,14,,,,,,,,10,17,19,,,,,,,',
|
214
|
+
'5,9,16,21,,,36,40,48,,82,,,15,10,17,19,,,,,,,,5,9,16,21,,,36,40,48,',
|
215
|
+
'82,,,15,26,30,34,39,46,,,,8,14,,,,,,,,,,,,,,,26,30,34,39,46,,,,8,14',
|
216
|
+
',,,,,,,10,17,19,,,,,,,,5,9,16,21,,,36,40,48,,82,,,15,10,17,19,,,,,,',
|
217
|
+
',5,9,16,21,,,36,40,48,,82,,,15,26,30,34,39,46,,,,8,14,,,,,,,,,,,,,,',
|
218
|
+
'26,30,34,39,46,,,,8,14,,,,,,,,10,17,19,,,,,,,,5,9,16,21,,,36,40,48,',
|
219
|
+
'82,,,15,10,17,19,,,,,,,,5,9,16,21,,,36,40,48,,82,,,15,26,30,34,39,46',
|
220
|
+
',,,8,14,,,,,,,,,,,,,,,26,30,34,39,46,,,,8,14,,,,,,,,10,17,19,,,,,,,',
|
221
|
+
'5,9,16,21,,,36,40,48,,82,,,15,10,17,19,24,,,,,,,5,9,16,21,,,36,40,48',
|
222
|
+
',170,,,15,26,30,34,39,46,,,,8,14,,,,,,,,,,,,,,,26,30,34,39,46,,,,8,14',
|
223
|
+
',,,,,,,10,17,19,,,,,,,,5,9,16,21,,,36,40,48,,82,,,15,10,17,19,,,,,,',
|
224
|
+
',5,9,16,21,,,36,40,48,,82,,,15,26,30,34,39,46,,,,8,14,81,63,64,66,67',
|
225
|
+
'68,70,72,74,76,78,80,62,,65,,69,71,73,75,77,79,,,,,,,,,,10,17,19,,,',
|
226
|
+
',,,,5,9,16,21,,,36,40,48,,82,,,15,,,,,,224,81,63,64,66,67,68,70,72,74',
|
227
|
+
'76,78,80,62,,65,,69,71,73,75,77,79,81,63,64,66,67,68,70,72,74,76,78',
|
228
|
+
'80,62,,65,,69,71,73,75,77,79,,81,63,64,66,67,68,70,72,74,76,78,80,62',
|
229
|
+
',65,207,69,71,73,75,77,79,81,63,64,66,67,68,70,72,74,76,78,80,62,,65',
|
230
|
+
'203,69,71,73,75,77,79,,81,63,64,66,67,68,70,72,74,76,78,80,62,,65,159',
|
231
|
+
'69,71,73,75,77,79,81,63,64,66,67,68,70,72,74,76,78,80,62,160,65,,69',
|
232
|
+
'71,73,75,77,79,197,,,,,,,,,,,198,81,63,64,66,67,68,70,72,74,76,78,80',
|
233
|
+
'62,,65,,69,71,73,75,77,79,81,63,64,66,67,68,70,72,74,76,78,80,62,,65',
|
234
|
+
',69,71,73,75,77,79,81,63,64,66,67,68,70,72,74,76,78,80,62,,65,,69,71',
|
235
|
+
'73,75,77,79,81,63,64,66,67,68,70,72,74,76,78,80,62,,65,,69,71,73,75',
|
236
|
+
'77,79,81,63,64,66,67,68,70,72,74,76,78,80,62,,65,,69,71,73,75,77,79',
|
237
|
+
'81,63,64,66,67,68,70,72,74,76,78,80,62,,65,,69,71,73,75,77,79,81,63',
|
238
|
+
'64,66,67,68,70,72,74,76,78,80,62,,65,,69,71,73,75,77,79,81,63,64,66',
|
239
|
+
'67,68,70,72,74,76,78,80,62,,65,,69,71,73,75,77,79,81,63,64,66,67,68',
|
240
|
+
'70,72,74,76,78,80,62,,65,,69,71,73,75,77,79,81,63,64,66,67,68,70,72',
|
241
|
+
'74,76,78,80,62,,65,,69,71,73,75,77,79,81,63,64,66,67,68,70,72,74,76',
|
242
|
+
'78,80,62,,65,,69,71,73,75,77,79,81,63,64,66,67,68,70,72,74,76,78,80',
|
243
|
+
'62,,65,,69,71,73,75,77,79,81,63,64,66,67,68,70,72,74,76,78,80,62,,65',
|
244
|
+
',69,71,73,75,77,79,81,63,64,66,67,68,70,72,74,76,78,80,62,,65,,69,71',
|
245
|
+
'73,75,77,79,81,63,64,66,67,68,70,72,74,76,78,80,62,,65,,69,71,73,75',
|
246
|
+
'77,79,81,63,64,66,67,68,70,72,74,76,78,80,62,,65,,69,71,73,75,77,79',
|
247
|
+
'81,63,64,66,67,68,70,72,74,76,78,80,62,,65,,69,71,73,75,77,79,81,63',
|
248
|
+
'64,66,67,68,70,72,74,76,78,80,62,,65,,69,71,73,75,77,81,63,64,66,67',
|
249
|
+
'68,70,72,74,76,78,80,62,,65,,69,71,73,75,81,63,64,66,67,68,70,72,74',
|
250
|
+
'76,78,80,62,,65,,69,71,73,81,63,64,66,67,68,70,72,74,76,78,80,62,,65',
|
251
|
+
',69,71,81,63,64,66,67,68,70,72,74,76,78,80,62,,65,,69,81,63,64,66,67',
|
252
|
+
'68,70,72,74,76,78,80,62,,65' ]
|
253
|
+
racc_action_table = arr = Array.new(3460, nil)
|
254
|
+
idx = 0
|
255
|
+
clist.each do |str|
|
256
|
+
str.split(',', -1).each do |i|
|
257
|
+
arr[idx] = i.to_i unless i.empty?
|
258
|
+
idx += 1
|
259
|
+
end
|
260
|
+
end
|
261
|
+
|
262
|
+
clist = [
|
263
|
+
'0,0,0,0,0,163,201,59,0,0,53,49,53,49,24,3,125,3,101,170,99,177,120,166',
|
264
|
+
'227,227,227,227,227,59,163,201,227,227,102,24,125,13,170,165,156,0,0',
|
265
|
+
'0,0,0,0,133,0,0,0,0,0,0,0,0,40,0,0,0,43,0,186,0,0,227,227,227,227,227',
|
266
|
+
'227,130,227,227,227,227,227,227,227,227,101,227,227,227,120,227,39,227',
|
267
|
+
'227,2,2,2,2,2,34,129,102,2,2,13,39,146,146,146,146,146,190,178,34,140',
|
268
|
+
'140,140,44,222,222,222,222,222,141,141,141,222,222,142,142,142,142,142',
|
269
|
+
'121,199,2,2,2,2,2,2,200,2,2,2,2,2,2,2,2,55,2,2,2,56,2,2,2,2,222,222',
|
270
|
+
'222,222,222,222,33,222,222,222,222,222,222,222,222,32,222,222,222,28',
|
271
|
+
'222,58,222,222,221,221,221,221,221,82,84,85,221,221,139,139,139,139',
|
272
|
+
'139,139,139,139,139,139,139,139,214,215,8,8,216,217,8,93,94,95,8,8,144',
|
273
|
+
'144,144,144,144,225,1,221,221,221,,,,,,,221,221,221,221,221,,,221,221',
|
274
|
+
'221,,221,,,221,8,8,8,,,,,,,,8,8,8,8,,,8,8,8,,8,,,8,212,212,212,212,212',
|
275
|
+
',,,212,212,136,136,136,136,136,136,136,136,136,136,136,136,,,14,14,',
|
276
|
+
',14,,,,14,14,,,,,,,,212,212,212,212,212,212,,212,212,212,212,212,212',
|
277
|
+
'212,212,,212,212,212,,212,212,212,212,14,14,14,,,,,,35,35,14,14,14,14',
|
278
|
+
',,14,14,14,,14,,,14,15,15,15,15,15,,,,15,15,35,35,35,35,35,35,35,35',
|
279
|
+
'35,35,35,35,,,23,23,23,23,23,,,,23,23,,,,,,,,15,15,15,,,35,,,,,15,15',
|
280
|
+
'15,15,,,15,15,15,,15,,,15,23,23,23,23,,,,,,,23,23,23,23,,,23,23,23,',
|
281
|
+
'23,,,23,209,209,209,209,209,,,,209,209,152,152,152,152,152,152,152,152',
|
282
|
+
',,,,,,26,26,,,26,,,,26,26,,,,,,,,209,209,209,,,,,,,,209,209,209,209',
|
283
|
+
',,209,209,209,,209,,,209,26,26,26,,,,,,,,26,26,26,26,,,26,26,26,,26',
|
284
|
+
',,26,207,207,207,207,207,,,,207,207,150,150,150,150,150,150,150,150',
|
285
|
+
',,,,,,30,30,,,30,,,,30,30,,,,,,,,207,207,207,207,207,207,,207,207,207',
|
286
|
+
'207,207,207,207,207,,207,207,207,,207,,207,207,30,30,30,,,,,,,,30,30',
|
287
|
+
'30,30,,,30,30,30,,30,,,30,206,206,206,206,206,,,,206,206,154,154,154',
|
288
|
+
'154,154,154,154,154,,,,,,,203,203,203,203,203,,,,203,203,,,,,,,,206',
|
289
|
+
'206,206,,,,,,,,206,206,206,206,,,206,206,206,,206,,,206,203,203,203',
|
290
|
+
'203,203,203,,203,203,203,203,203,203,203,203,,203,203,203,,203,,203',
|
291
|
+
'203,202,202,202,202,202,,,,202,202,148,148,148,148,148,148,148,148,',
|
292
|
+
',,,,,197,197,197,197,197,,,,197,197,,,,,,,,202,202,202,,,,,,,202,202',
|
293
|
+
'202,202,202,,,202,202,202,,202,,,202,197,197,197,,,,,,,,197,197,197',
|
294
|
+
'197,,,197,197,197,,197,,,197,38,38,38,38,38,,,,38,38,,,,,,,,,,,,,,,188',
|
295
|
+
'188,188,188,188,,,,188,188,,,,,,,,38,38,38,38,38,38,,38,38,38,38,38',
|
296
|
+
'38,38,38,,38,38,38,,38,,38,38,188,188,188,,,,,,,,188,188,188,188,,,188',
|
297
|
+
'188,188,,188,,,188,132,132,132,132,132,,,,132,132,,,,,,,,,,,,,,,131',
|
298
|
+
'131,131,131,131,,,,131,131,,,,,,,,132,132,132,132,,,,,,,132,132,132',
|
299
|
+
'132,,,132,132,132,,132,,,132,131,131,131,,,,,,,,131,131,131,131,,,131',
|
300
|
+
'131,131,,131,,,131,123,123,123,123,123,,,,123,123,,,,,,,,,,,,,,,46,46',
|
301
|
+
'46,46,46,,,,46,46,,,,,,,,123,123,123,,,,,,,,123,123,123,123,,,123,123',
|
302
|
+
'123,,123,,,123,46,46,46,,,,,,,,46,46,46,46,,,46,46,46,,46,,,46,48,48',
|
303
|
+
'48,48,48,,,,48,48,,,,,,,,,,,,,,,117,117,117,117,117,,,,117,117,,,,,',
|
304
|
+
',,48,48,48,,,,,,,,48,48,48,48,,,48,48,48,,48,,,48,117,117,117,,,,,,',
|
305
|
+
',117,117,117,117,,,117,117,117,,117,,,117,50,50,50,50,50,,,,50,50,,',
|
306
|
+
',,,,,,,,,,,,116,116,116,116,116,,,,116,116,,,,,,,,50,50,50,50,50,50',
|
307
|
+
',50,50,50,50,50,50,50,50,,50,50,50,,50,,50,50,116,116,116,,,,,,,,116',
|
308
|
+
'116,116,116,,,116,116,116,,116,,,116,114,114,114,114,114,,,,114,114',
|
309
|
+
',,,,,,,,,,,,,,112,112,112,112,112,,,,112,112,,,,,,,,114,114,114,,,,',
|
310
|
+
',,,114,114,114,114,,,114,114,114,,114,,,114,112,112,112,,,,,,,,112,112',
|
311
|
+
'112,112,,,112,112,112,,112,,,112,111,111,111,111,111,,,,111,111,,,,',
|
312
|
+
',,,,,,,,,,110,110,110,110,110,,,,110,110,,,,,,,,111,111,111,,,,,,,,111',
|
313
|
+
'111,111,111,,,111,111,111,,111,,,111,110,110,110,,,,,,,,110,110,110',
|
314
|
+
'110,,,110,110,110,,110,,,110,60,60,60,60,60,,,,60,60,,,,,,,,,,,,,,,62',
|
315
|
+
'62,62,62,62,,,,62,62,,,,,,,,60,60,60,60,60,60,,60,60,60,60,60,60,60',
|
316
|
+
'60,,60,60,60,,60,60,60,60,62,62,62,,,,,,,,62,62,62,62,,,62,62,62,,62',
|
317
|
+
',,62,63,63,63,63,63,,,,63,63,,,,,,,,,,,,,,,64,64,64,64,64,,,,64,64,',
|
318
|
+
',,,,,,63,63,63,,,,,,,,63,63,63,63,,,63,63,63,,63,,,63,64,64,64,,,,,',
|
319
|
+
',,64,64,64,64,,,64,64,64,,64,,,64,65,65,65,65,65,,,,65,65,,,,,,,,,,',
|
320
|
+
',,,,66,66,66,66,66,,,,66,66,,,,,,,,65,65,65,,,,,,,,65,65,65,65,,,65',
|
321
|
+
'65,65,,65,,,65,66,66,66,,,,,,,,66,66,66,66,,,66,66,66,,66,,,66,97,97',
|
322
|
+
'97,97,97,,,,97,97,,,,,,,,,,,,,,,68,68,68,68,68,,,,68,68,,,,,,,,97,97',
|
323
|
+
'97,,,,,,,97,97,97,97,97,,,97,97,97,,97,,,97,68,68,68,,,,,,,,68,68,68',
|
324
|
+
'68,,,68,68,68,,68,,,68,69,69,69,69,69,,,,69,69,,,,,,,,,,,,,,,70,70,70',
|
325
|
+
'70,70,,,,70,70,,,,,,,,69,69,69,,,,,,,,69,69,69,69,,,69,69,69,,69,,,69',
|
326
|
+
'70,70,70,,,,,,,,70,70,70,70,,,70,70,70,,70,,,70,71,71,71,71,71,,,,71',
|
327
|
+
'71,,,,,,,,,,,,,,,72,72,72,72,72,,,,72,72,,,,,,,,71,71,71,,,,,,,,71,71',
|
328
|
+
'71,71,,,71,71,71,,71,,,71,72,72,72,,,,,,,,72,72,72,72,,,72,72,72,,72',
|
329
|
+
',,72,73,73,73,73,73,,,,73,73,,,,,,,,,,,,,,,74,74,74,74,74,,,,74,74,',
|
330
|
+
',,,,,,73,73,73,,,,,,,,73,73,73,73,,,73,73,73,,73,,,73,74,74,74,,,,,',
|
331
|
+
',,74,74,74,74,,,74,74,74,,74,,,74,75,75,75,75,75,,,,75,75,,,,,,,,,,',
|
332
|
+
',,,,76,76,76,76,76,,,,76,76,,,,,,,,75,75,75,,,,,,,,75,75,75,75,,,75',
|
333
|
+
'75,75,,75,,,75,76,76,76,,,,,,,,76,76,76,76,,,76,76,76,,76,,,76,77,77',
|
334
|
+
'77,77,77,,,,77,77,,,,,,,,,,,,,,,78,78,78,78,78,,,,78,78,,,,,,,,77,77',
|
335
|
+
'77,,,,,,,,77,77,77,77,,,77,77,77,,77,,,77,78,78,78,,,,,,,,78,78,78,78',
|
336
|
+
',,78,78,78,,78,,,78,79,79,79,79,79,,,,79,79,,,,,,,,,,,,,,,80,80,80,80',
|
337
|
+
'80,,,,80,80,,,,,,,,79,79,79,,,,,,,,79,79,79,79,,,79,79,79,,79,,,79,80',
|
338
|
+
'80,80,,,,,,,,80,80,80,80,,,80,80,80,,80,,,80,81,81,81,81,81,,,,81,81',
|
339
|
+
',,,,,,,,,,,,,,109,109,109,109,109,,,,109,109,,,,,,,,81,81,81,,,,,,,',
|
340
|
+
'81,81,81,81,,,81,81,81,,81,,,81,109,109,109,,,,,,,,109,109,109,109,',
|
341
|
+
',109,109,109,,109,,,109,108,108,108,108,108,,,,108,108,,,,,,,,,,,,,',
|
342
|
+
',107,107,107,107,107,,,,107,107,,,,,,,,108,108,108,,,,,,,,108,108,108',
|
343
|
+
'108,,,108,108,108,,108,,,108,107,107,107,,,,,,,,107,107,107,107,,,107',
|
344
|
+
'107,107,,107,,,107,86,86,86,86,86,,,,86,86,,,,,,,,,,,,,,,106,106,106',
|
345
|
+
'106,106,,,,106,106,,,,,,,,86,86,86,,,,,,,,86,86,86,86,,,86,86,86,,86',
|
346
|
+
',,86,106,106,106,,,,,,,,106,106,106,106,,,106,106,106,,106,,,106,105',
|
347
|
+
'105,105,105,105,,,,105,105,,,,,,,,,,,,,,,104,104,104,104,104,,,,104',
|
348
|
+
'104,,,,,,,,105,105,105,,,,,,,,105,105,105,105,,,105,105,105,,105,,,105',
|
349
|
+
'104,104,104,104,,,,,,,104,104,104,104,,,104,104,104,,104,,,104,103,103',
|
350
|
+
'103,103,103,,,,103,103,,,,,,,,,,,,,,,100,100,100,100,100,,,,100,100',
|
351
|
+
',,,,,,,103,103,103,,,,,,,,103,103,103,103,,,103,103,103,,103,,,103,100',
|
352
|
+
'100,100,,,,,,,,100,100,100,100,,,100,100,100,,100,,,100,67,67,67,67',
|
353
|
+
'67,,,,67,67,219,219,219,219,219,219,219,219,219,219,219,219,219,,219',
|
354
|
+
',219,219,219,219,219,219,,,,,,,,,,67,67,67,,,,,,,,67,67,67,67,,,67,67',
|
355
|
+
'67,,67,,,67,,,,,,219,187,187,187,187,187,187,187,187,187,187,187,187',
|
356
|
+
'187,,187,,187,187,187,187,187,187,168,168,168,168,168,168,168,168,168',
|
357
|
+
'168,168,168,168,,168,,168,168,168,168,168,168,,89,89,89,89,89,89,89',
|
358
|
+
'89,89,89,89,89,89,,89,187,89,89,89,89,89,89,92,92,92,92,92,92,92,92',
|
359
|
+
'92,92,92,92,92,,92,168,92,92,92,92,92,92,,158,158,158,158,158,158,158',
|
360
|
+
'158,158,158,158,158,158,,158,89,158,158,158,158,158,158,153,153,153',
|
361
|
+
'153,153,153,153,153,153,153,153,153,153,92,153,,153,153,153,153,153',
|
362
|
+
'153,153,,,,,,,,,,,158,169,169,169,169,169,169,169,169,169,169,169,169',
|
363
|
+
'169,,169,,169,169,169,169,169,169,171,171,171,171,171,171,171,171,171',
|
364
|
+
'171,171,171,171,,171,,171,171,171,171,171,171,174,174,174,174,174,174',
|
365
|
+
'174,174,174,174,174,174,174,,174,,174,174,174,174,174,174,208,208,208',
|
366
|
+
'208,208,208,208,208,208,208,208,208,208,,208,,208,208,208,208,208,208',
|
367
|
+
'193,193,193,193,193,193,193,193,193,193,193,193,193,,193,,193,193,193',
|
368
|
+
'193,193,193,126,126,126,126,126,126,126,126,126,126,126,126,126,,126',
|
369
|
+
',126,126,126,126,126,126,180,180,180,180,180,180,180,180,180,180,180',
|
370
|
+
'180,180,,180,,180,180,180,180,180,180,175,175,175,175,175,175,175,175',
|
371
|
+
'175,175,175,175,175,,175,,175,175,175,175,175,175,185,185,185,185,185',
|
372
|
+
'185,185,185,185,185,185,185,185,,185,,185,185,185,185,185,185,184,184',
|
373
|
+
'184,184,184,184,184,184,184,184,184,184,184,,184,,184,184,184,184,184',
|
374
|
+
'184,183,183,183,183,183,183,183,183,183,183,183,183,183,,183,,183,183',
|
375
|
+
'183,183,183,183,181,181,181,181,181,181,181,181,181,181,181,181,181',
|
376
|
+
',181,,181,181,181,181,181,181,4,4,4,4,4,4,4,4,4,4,4,4,4,,4,,4,4,4,4',
|
377
|
+
'4,4,192,192,192,192,192,192,192,192,192,192,192,192,192,,192,,192,192',
|
378
|
+
'192,192,192,192,176,176,176,176,176,176,176,176,176,176,176,176,176',
|
379
|
+
',176,,176,176,176,176,176,176,182,182,182,182,182,182,182,182,182,182',
|
380
|
+
'182,182,182,,182,,182,182,182,182,182,182,179,179,179,179,179,179,179',
|
381
|
+
'179,179,179,179,179,179,,179,,179,179,179,179,179,179,210,210,210,210',
|
382
|
+
'210,210,210,210,210,210,210,210,210,,210,,210,210,210,210,210,151,151',
|
383
|
+
'151,151,151,151,151,151,151,151,151,151,151,,151,,151,151,151,151,149',
|
384
|
+
'149,149,149,149,149,149,149,149,149,149,149,149,,149,,149,149,149,147',
|
385
|
+
'147,147,147,147,147,147,147,147,147,147,147,147,,147,,147,147,145,145',
|
386
|
+
'145,145,145,145,145,145,145,145,145,145,145,,145,,145,143,143,143,143',
|
387
|
+
'143,143,143,143,143,143,143,143,143,,143' ]
|
388
|
+
racc_action_check = arr = Array.new(3460, nil)
|
389
|
+
idx = 0
|
390
|
+
clist.each do |str|
|
391
|
+
str.split(',', -1).each do |i|
|
392
|
+
arr[idx] = i.to_i unless i.empty?
|
393
|
+
idx += 1
|
394
|
+
end
|
395
|
+
end
|
396
|
+
|
397
|
+
racc_action_pointer = [
|
398
|
+
-5, 170, 84, -53, 3230, nil, nil, nil, 197, nil,
|
399
|
+
nil, nil, nil, 35, 286, 351, nil, nil, nil, nil,
|
400
|
+
nil, nil, nil, 375, -34, nil, 464, nil, 104, nil,
|
401
|
+
553, nil, 169, 91, 46, 333, nil, nil, 796, 38,
|
402
|
+
54, nil, nil, -8, 43, nil, 998, nil, 1063, -57,
|
403
|
+
1152, nil, nil, -58, nil, 100, 116, nil, 143, -38,
|
404
|
+
1419, nil, 1443, 1508, 1532, 1597, 1621, 2754, 1710, 1775,
|
405
|
+
1799, 1864, 1888, 1953, 1977, 2042, 2066, 2131, 2155, 2220,
|
406
|
+
2244, 2309, 135, nil, 115, 137, 2487, nil, nil, 2865,
|
407
|
+
nil, nil, 2887, 139, 160, 140, nil, 1686, nil, 20,
|
408
|
+
2689, 16, 32, 2665, 2600, 2576, 2511, 2422, 2398, 2333,
|
409
|
+
1354, 1330, 1265, nil, 1241, nil, 1176, 1087, nil, nil,
|
410
|
+
20, 80, nil, 974, nil, -29, 3076, nil, nil, 42,
|
411
|
+
23, 909, 885, -1, nil, nil, 267, nil, nil, 178,
|
412
|
+
99, 108, 113, 3435, 202, 3418, 91, 3400, 712, 3381,
|
413
|
+
534, 3361, 445, 2932, 623, nil, 8, nil, 2910, nil,
|
414
|
+
nil, nil, nil, -40, nil, -9, -45, nil, 2842, 2966,
|
415
|
+
-29, 2988, nil, nil, 3010, 3120, 3274, -49, 62, 3318,
|
416
|
+
3098, 3208, 3296, 3186, 3164, 3142, -7, 2820, 820, nil,
|
417
|
+
37, nil, 3252, 3054, nil, nil, nil, 731, nil, 81,
|
418
|
+
70, -39, 707, 642, nil, nil, 618, 529, 3032, 440,
|
419
|
+
3340, nil, 262, nil, 134, 133, 152, 135, nil, 2759,
|
420
|
+
nil, 173, 108, nil, nil, 147, nil, 19, nil ]
|
421
|
+
|
422
|
+
racc_action_default = [
|
423
|
+
-2, -122, -122, -63, -122, -23, -6, -70, -122, -24,
|
424
|
+
-20, -15, -14, -57, -122, -122, -25, -21, -8, -80,
|
425
|
+
-58, -22, -9, -122, -122, -61, -122, -10, -122, -62,
|
426
|
+
-122, -11, -122, -122, -122, -69, -50, -12, -1, -122,
|
427
|
+
-122, -66, -13, -122, -122, -67, -122, -51, -29, -64,
|
428
|
+
-122, -68, -59, -65, -84, -83, -82, -19, -80, -122,
|
429
|
+
-122, -120, -122, -122, -122, -122, -122, -122, -122, -122,
|
430
|
+
-122, -122, -122, -122, -122, -122, -122, -122, -122, -122,
|
431
|
+
-122, -122, -122, -54, -69, -122, -122, -53, -63, -122,
|
432
|
+
-64, -65, -122, -122, -77, -122, -55, -122, -56, -122,
|
433
|
+
-122, -122, -89, -122, -122, -122, -122, -122, -29, -122,
|
434
|
+
-122, -122, -122, -91, -122, -92, -122, -122, -17, -16,
|
435
|
+
-90, -122, -7, -122, -60, -122, -27, -107, -106, -122,
|
436
|
+
-122, -122, -122, -122, -116, -18, -46, -33, -34, -47,
|
437
|
+
-30, -31, -38, -35, -40, -36, -39, -37, -45, -41,
|
438
|
+
-44, -42, -48, -122, -49, -32, -122, -71, -122, -52,
|
439
|
+
-113, -114, -75, -122, -74, -77, -122, 229, -122, -97,
|
440
|
+
-122, -86, -87, -88, -93, -94, -101, -122, -73, -102,
|
441
|
+
-103, -99, -100, -98, -95, -96, -122, -122, -122, -26,
|
442
|
+
-122, -85, -81, -117, -118, -119, -121, -122, -79, -122,
|
443
|
+
-122, -122, -122, -122, -115, -72, -29, -122, -28, -122,
|
444
|
+
-43, -76, -122, -104, -122, -122, -112, -122, -108, -122,
|
445
|
+
-105, -122, -122, -78, -109, -122, -111, -122, -110 ]
|
446
|
+
|
447
|
+
racc_goto_table = [
|
448
|
+
3, 54, 3, 53, 11, 53, 11, 177, 83, 129,
|
449
|
+
163, 49, 32, 49, 87, 213, 101, 84, 211, 125,
|
450
|
+
55, 101, 93, 84, 166, 172, 96, 164, 38, 220,
|
451
|
+
98, 195, 196, nil, nil, 84, nil, nil, 3, 84,
|
452
|
+
nil, 53, 119, 102, nil, nil, nil, nil, 120, 49,
|
453
|
+
3, nil, nil, 53, nil, nil, nil, nil, nil, nil,
|
454
|
+
3, 49, 89, 53, 119, nil, nil, nil, nil, nil,
|
455
|
+
92, 49, nil, nil, nil, nil, nil, nil, nil, nil,
|
456
|
+
nil, 201, nil, nil, nil, nil, nil, nil, nil, nil,
|
457
|
+
nil, nil, nil, 124, nil, 126, nil, 3, 164, nil,
|
458
|
+
53, nil, nil, 173, nil, 217, nil, nil, 49, 136,
|
459
|
+
137, 138, 139, 140, 141, 142, 143, 144, 145, 146,
|
460
|
+
147, 148, 149, 150, 151, 152, 153, 154, 155, 215,
|
461
|
+
191, 194, 164, 158, nil, nil, nil, nil, nil, nil,
|
462
|
+
nil, nil, nil, nil, nil, nil, nil, 168, 225, nil,
|
463
|
+
169, 171, 174, 175, 176, 126, 179, 180, 181, 182,
|
464
|
+
nil, 183, 216, 184, 185, nil, 218, nil, nil, nil,
|
465
|
+
187, nil, nil, nil, nil, nil, nil, nil, 192, 193,
|
466
|
+
nil, 226, nil, nil, nil, nil, 228, nil, nil, nil,
|
467
|
+
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
468
|
+
nil, nil, 3, 3, nil, 53, 53, 3, nil, nil,
|
469
|
+
53, nil, 3, 49, 49, 53, 11, nil, 49, nil,
|
470
|
+
nil, 3, 3, 49, 53, 53, nil, 3, nil, nil,
|
471
|
+
53, nil, 49, 49, nil, 208, nil, nil, 49, nil,
|
472
|
+
nil, nil, nil, nil, 210, nil, nil, nil, nil, nil,
|
473
|
+
nil, nil, nil, 126, nil, nil, 219 ]
|
474
|
+
|
475
|
+
racc_goto_check = [
|
476
|
+
6, 31, 6, 5, 8, 5, 8, 28, 6, 34,
|
477
|
+
30, 4, 1, 4, 6, 14, 20, 24, 29, 17,
|
478
|
+
32, 20, 13, 24, 3, 33, 6, 25, 2, 14,
|
479
|
+
6, 36, 37, nil, nil, 24, nil, nil, 6, 24,
|
480
|
+
nil, 5, 8, 24, nil, nil, nil, nil, 24, 4,
|
481
|
+
6, nil, nil, 5, nil, nil, nil, nil, nil, nil,
|
482
|
+
6, 4, 18, 5, 8, nil, nil, nil, nil, nil,
|
483
|
+
18, 4, nil, nil, nil, nil, nil, nil, nil, nil,
|
484
|
+
nil, 30, nil, nil, nil, nil, nil, nil, nil, nil,
|
485
|
+
nil, nil, nil, 18, nil, 18, nil, 6, 25, nil,
|
486
|
+
5, nil, nil, 13, nil, 28, nil, nil, 4, 18,
|
487
|
+
18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
|
488
|
+
18, 18, 18, 18, 18, 18, 18, 18, 18, 3,
|
489
|
+
31, 13, 25, 18, nil, nil, nil, nil, nil, nil,
|
490
|
+
nil, nil, nil, nil, nil, nil, nil, 18, 3, nil,
|
491
|
+
18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
|
492
|
+
nil, 18, 34, 18, 18, nil, 34, nil, nil, nil,
|
493
|
+
18, nil, nil, nil, nil, nil, nil, nil, 18, 18,
|
494
|
+
nil, 34, nil, nil, nil, nil, 34, nil, nil, nil,
|
495
|
+
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
496
|
+
nil, nil, 6, 6, nil, 5, 5, 6, nil, nil,
|
497
|
+
5, nil, 6, 4, 4, 5, 8, nil, 4, nil,
|
498
|
+
nil, 6, 6, 4, 5, 5, nil, 6, nil, nil,
|
499
|
+
5, nil, 4, 4, nil, 18, nil, nil, 4, nil,
|
500
|
+
nil, nil, nil, nil, 18, nil, nil, nil, nil, nil,
|
501
|
+
nil, nil, nil, 18, nil, nil, 18 ]
|
502
|
+
|
503
|
+
racc_goto_pointer = [
|
504
|
+
nil, 12, 28, -73, 11, 3, 0, nil, 4, nil,
|
505
|
+
nil, nil, nil, -1, -185, nil, nil, -29, 47, nil,
|
506
|
+
-18, nil, nil, nil, 9, -67, nil, nil, -101, -181,
|
507
|
+
-84, 0, 19, -79, -41, nil, -101, -101 ]
|
508
|
+
|
509
|
+
racc_goto_default = [
|
510
|
+
nil, nil, 60, 43, 90, 91, 88, 6, 128, 18,
|
511
|
+
22, 27, 31, 37, 42, 47, 52, 178, 4, 7,
|
512
|
+
13, 20, 25, 29, 35, 41, 45, 51, nil, 162,
|
513
|
+
nil, nil, nil, nil, nil, 59, nil, 61 ]
|
514
|
+
|
515
|
+
racc_reduce_table = [
|
516
|
+
0, 0, :racc_error,
|
517
|
+
1, 72, :_reduce_1,
|
518
|
+
0, 72, :_reduce_2,
|
519
|
+
1, 74, :_reduce_none,
|
520
|
+
1, 74, :_reduce_none,
|
521
|
+
1, 74, :_reduce_none,
|
522
|
+
1, 74, :_reduce_none,
|
523
|
+
2, 79, :_reduce_none,
|
524
|
+
1, 79, :_reduce_none,
|
525
|
+
1, 79, :_reduce_none,
|
526
|
+
1, 79, :_reduce_none,
|
527
|
+
1, 79, :_reduce_none,
|
528
|
+
1, 79, :_reduce_none,
|
529
|
+
1, 79, :_reduce_none,
|
530
|
+
1, 73, :_reduce_14,
|
531
|
+
1, 73, :_reduce_15,
|
532
|
+
2, 73, :_reduce_16,
|
533
|
+
2, 73, :_reduce_none,
|
534
|
+
3, 85, :_reduce_18,
|
535
|
+
2, 85, :_reduce_19,
|
536
|
+
1, 86, :_reduce_20,
|
537
|
+
1, 86, :_reduce_21,
|
538
|
+
1, 86, :_reduce_22,
|
539
|
+
1, 86, :_reduce_23,
|
540
|
+
1, 86, :_reduce_24,
|
541
|
+
1, 86, :_reduce_25,
|
542
|
+
3, 87, :_reduce_26,
|
543
|
+
1, 88, :_reduce_27,
|
544
|
+
3, 88, :_reduce_28,
|
545
|
+
0, 88, :_reduce_29,
|
546
|
+
3, 75, :_reduce_30,
|
547
|
+
3, 75, :_reduce_31,
|
548
|
+
3, 75, :_reduce_32,
|
549
|
+
3, 75, :_reduce_33,
|
550
|
+
3, 75, :_reduce_34,
|
551
|
+
3, 75, :_reduce_35,
|
552
|
+
3, 75, :_reduce_36,
|
553
|
+
3, 75, :_reduce_37,
|
554
|
+
3, 75, :_reduce_38,
|
555
|
+
3, 75, :_reduce_39,
|
556
|
+
3, 75, :_reduce_40,
|
557
|
+
3, 75, :_reduce_41,
|
558
|
+
3, 75, :_reduce_42,
|
559
|
+
5, 75, :_reduce_43,
|
560
|
+
3, 75, :_reduce_44,
|
561
|
+
3, 75, :_reduce_45,
|
562
|
+
3, 75, :_reduce_46,
|
563
|
+
3, 75, :_reduce_47,
|
564
|
+
3, 75, :_reduce_48,
|
565
|
+
3, 75, :_reduce_49,
|
566
|
+
1, 90, :_reduce_50,
|
567
|
+
1, 77, :_reduce_none,
|
568
|
+
3, 77, :_reduce_52,
|
569
|
+
2, 77, :_reduce_53,
|
570
|
+
2, 77, :_reduce_none,
|
571
|
+
2, 77, :_reduce_55,
|
572
|
+
2, 77, :_reduce_56,
|
573
|
+
1, 77, :_reduce_57,
|
574
|
+
1, 77, :_reduce_none,
|
575
|
+
1, 77, :_reduce_none,
|
576
|
+
2, 77, :_reduce_60,
|
577
|
+
1, 77, :_reduce_none,
|
578
|
+
1, 77, :_reduce_none,
|
579
|
+
1, 89, :_reduce_none,
|
580
|
+
1, 89, :_reduce_none,
|
581
|
+
1, 89, :_reduce_none,
|
582
|
+
1, 95, :_reduce_66,
|
583
|
+
1, 95, :_reduce_none,
|
584
|
+
1, 95, :_reduce_none,
|
585
|
+
1, 91, :_reduce_none,
|
586
|
+
1, 91, :_reduce_none,
|
587
|
+
3, 97, :_reduce_71,
|
588
|
+
4, 93, :_reduce_72,
|
589
|
+
1, 99, :_reduce_none,
|
590
|
+
1, 100, :_reduce_none,
|
591
|
+
1, 101, :_reduce_75,
|
592
|
+
3, 101, :_reduce_76,
|
593
|
+
0, 101, :_reduce_77,
|
594
|
+
6, 94, :_reduce_78,
|
595
|
+
4, 98, :_reduce_79,
|
596
|
+
1, 96, :_reduce_none,
|
597
|
+
3, 102, :_reduce_81,
|
598
|
+
1, 102, :_reduce_82,
|
599
|
+
2, 78, :_reduce_83,
|
600
|
+
1, 103, :_reduce_84,
|
601
|
+
3, 103, :_reduce_85,
|
602
|
+
3, 76, :_reduce_86,
|
603
|
+
3, 76, :_reduce_87,
|
604
|
+
3, 76, :_reduce_88,
|
605
|
+
2, 76, :_reduce_89,
|
606
|
+
2, 76, :_reduce_90,
|
607
|
+
2, 76, :_reduce_91,
|
608
|
+
2, 76, :_reduce_92,
|
609
|
+
3, 76, :_reduce_93,
|
610
|
+
3, 76, :_reduce_94,
|
611
|
+
3, 76, :_reduce_95,
|
612
|
+
3, 76, :_reduce_96,
|
613
|
+
3, 76, :_reduce_97,
|
614
|
+
3, 76, :_reduce_98,
|
615
|
+
3, 76, :_reduce_99,
|
616
|
+
3, 76, :_reduce_100,
|
617
|
+
3, 76, :_reduce_101,
|
618
|
+
3, 76, :_reduce_102,
|
619
|
+
3, 76, :_reduce_103,
|
620
|
+
5, 84, :_reduce_104,
|
621
|
+
6, 84, :_reduce_105,
|
622
|
+
1, 105, :_reduce_none,
|
623
|
+
1, 105, :_reduce_none,
|
624
|
+
5, 80, :_reduce_108,
|
625
|
+
6, 80, :_reduce_109,
|
626
|
+
9, 81, :_reduce_110,
|
627
|
+
7, 82, :_reduce_111,
|
628
|
+
5, 82, :_reduce_112,
|
629
|
+
3, 83, :_reduce_113,
|
630
|
+
3, 83, :_reduce_114,
|
631
|
+
2, 104, :_reduce_115,
|
632
|
+
3, 92, :_reduce_116,
|
633
|
+
1, 107, :_reduce_none,
|
634
|
+
1, 107, :_reduce_none,
|
635
|
+
3, 108, :_reduce_119,
|
636
|
+
1, 106, :_reduce_120,
|
637
|
+
3, 106, :_reduce_121 ]
|
638
|
+
|
639
|
+
racc_reduce_n = 122
|
640
|
+
|
641
|
+
racc_shift_n = 229
|
642
|
+
|
643
|
+
racc_token_table = {
|
644
|
+
false => 0,
|
645
|
+
:error => 1,
|
646
|
+
"." => 2,
|
647
|
+
:UMINUS => 3,
|
648
|
+
:UPLUS => 4,
|
649
|
+
"!" => 5,
|
650
|
+
"~" => 6,
|
651
|
+
"++" => 7,
|
652
|
+
"--" => 8,
|
653
|
+
:KW_TYPEOF => 9,
|
654
|
+
"*" => 10,
|
655
|
+
"/" => 11,
|
656
|
+
"%" => 12,
|
657
|
+
"+" => 13,
|
658
|
+
"-" => 14,
|
659
|
+
">>" => 15,
|
660
|
+
"<<" => 16,
|
661
|
+
">>>" => 17,
|
662
|
+
">" => 18,
|
663
|
+
"<" => 19,
|
664
|
+
">=" => 20,
|
665
|
+
"<=" => 21,
|
666
|
+
"==" => 22,
|
667
|
+
"===" => 23,
|
668
|
+
"!=" => 24,
|
669
|
+
"!==" => 25,
|
670
|
+
"&" => 26,
|
671
|
+
"^" => 27,
|
672
|
+
"|" => 28,
|
673
|
+
"&&" => 29,
|
674
|
+
"||" => 30,
|
675
|
+
"?" => 31,
|
676
|
+
":" => 32,
|
677
|
+
"=" => 33,
|
678
|
+
"+=" => 34,
|
679
|
+
"-=" => 35,
|
680
|
+
"<<=" => 36,
|
681
|
+
">>=" => 37,
|
682
|
+
">>>=" => 38,
|
683
|
+
"&=" => 39,
|
684
|
+
"^=" => 40,
|
685
|
+
"|=" => 41,
|
686
|
+
"*=" => 42,
|
687
|
+
"/=" => 43,
|
688
|
+
"%=" => 44,
|
689
|
+
"," => 45,
|
690
|
+
:FLOAT => 46,
|
691
|
+
:INTEGER => 47,
|
692
|
+
:IDENT => 48,
|
693
|
+
:KW_FUNCTION => 49,
|
694
|
+
:KW_FOR => 50,
|
695
|
+
:KW_IF => 51,
|
696
|
+
:KW_ELSE => 52,
|
697
|
+
:KW_WHILE => 53,
|
698
|
+
:KW_DO => 54,
|
699
|
+
:KW_VAR => 55,
|
700
|
+
:KW_TRUE => 56,
|
701
|
+
:KW_FALSE => 57,
|
702
|
+
:KW_NULL => 58,
|
703
|
+
:STRING => 59,
|
704
|
+
:KW_RETURN => 60,
|
705
|
+
:KW_NEW => 61,
|
706
|
+
:KW_THIS => 62,
|
707
|
+
:KW_CORE => 63,
|
708
|
+
:SBRACKET_OPEN => 64,
|
709
|
+
:SBRACKET_CLOSE => 65,
|
710
|
+
:CBRACKET_OPEN => 66,
|
711
|
+
:CBRACKET_CLOSE => 67,
|
712
|
+
";" => 68,
|
713
|
+
"(" => 69,
|
714
|
+
")" => 70 }
|
715
|
+
|
716
|
+
racc_nt_base = 71
|
717
|
+
|
718
|
+
racc_use_result_var = true
|
719
|
+
|
720
|
+
Racc_arg = [
|
721
|
+
racc_action_table,
|
722
|
+
racc_action_check,
|
723
|
+
racc_action_default,
|
724
|
+
racc_action_pointer,
|
725
|
+
racc_goto_table,
|
726
|
+
racc_goto_check,
|
727
|
+
racc_goto_default,
|
728
|
+
racc_goto_pointer,
|
729
|
+
racc_nt_base,
|
730
|
+
racc_reduce_table,
|
731
|
+
racc_token_table,
|
732
|
+
racc_shift_n,
|
733
|
+
racc_reduce_n,
|
734
|
+
racc_use_result_var ]
|
735
|
+
|
736
|
+
Racc_token_to_s_table = [
|
737
|
+
"$end",
|
738
|
+
"error",
|
739
|
+
"\".\"",
|
740
|
+
"UMINUS",
|
741
|
+
"UPLUS",
|
742
|
+
"\"!\"",
|
743
|
+
"\"~\"",
|
744
|
+
"\"++\"",
|
745
|
+
"\"--\"",
|
746
|
+
"KW_TYPEOF",
|
747
|
+
"\"*\"",
|
748
|
+
"\"/\"",
|
749
|
+
"\"%\"",
|
750
|
+
"\"+\"",
|
751
|
+
"\"-\"",
|
752
|
+
"\">>\"",
|
753
|
+
"\"<<\"",
|
754
|
+
"\">>>\"",
|
755
|
+
"\">\"",
|
756
|
+
"\"<\"",
|
757
|
+
"\">=\"",
|
758
|
+
"\"<=\"",
|
759
|
+
"\"==\"",
|
760
|
+
"\"===\"",
|
761
|
+
"\"!=\"",
|
762
|
+
"\"!==\"",
|
763
|
+
"\"&\"",
|
764
|
+
"\"^\"",
|
765
|
+
"\"|\"",
|
766
|
+
"\"&&\"",
|
767
|
+
"\"||\"",
|
768
|
+
"\"?\"",
|
769
|
+
"\":\"",
|
770
|
+
"\"=\"",
|
771
|
+
"\"+=\"",
|
772
|
+
"\"-=\"",
|
773
|
+
"\"<<=\"",
|
774
|
+
"\">>=\"",
|
775
|
+
"\">>>=\"",
|
776
|
+
"\"&=\"",
|
777
|
+
"\"^=\"",
|
778
|
+
"\"|=\"",
|
779
|
+
"\"*=\"",
|
780
|
+
"\"/=\"",
|
781
|
+
"\"%=\"",
|
782
|
+
"\",\"",
|
783
|
+
"FLOAT",
|
784
|
+
"INTEGER",
|
785
|
+
"IDENT",
|
786
|
+
"KW_FUNCTION",
|
787
|
+
"KW_FOR",
|
788
|
+
"KW_IF",
|
789
|
+
"KW_ELSE",
|
790
|
+
"KW_WHILE",
|
791
|
+
"KW_DO",
|
792
|
+
"KW_VAR",
|
793
|
+
"KW_TRUE",
|
794
|
+
"KW_FALSE",
|
795
|
+
"KW_NULL",
|
796
|
+
"STRING",
|
797
|
+
"KW_RETURN",
|
798
|
+
"KW_NEW",
|
799
|
+
"KW_THIS",
|
800
|
+
"KW_CORE",
|
801
|
+
"SBRACKET_OPEN",
|
802
|
+
"SBRACKET_CLOSE",
|
803
|
+
"CBRACKET_OPEN",
|
804
|
+
"CBRACKET_CLOSE",
|
805
|
+
"\";\"",
|
806
|
+
"\"(\"",
|
807
|
+
"\")\"",
|
808
|
+
"$start",
|
809
|
+
"target",
|
810
|
+
"seq",
|
811
|
+
"simple_stmt",
|
812
|
+
"exp",
|
813
|
+
"ass",
|
814
|
+
"simple_rhs",
|
815
|
+
"local_def",
|
816
|
+
"stmt",
|
817
|
+
"while_stmt",
|
818
|
+
"for_stmt",
|
819
|
+
"if_stmt",
|
820
|
+
"return_stmt",
|
821
|
+
"fun_def",
|
822
|
+
"block",
|
823
|
+
"literal",
|
824
|
+
"array",
|
825
|
+
"array_content",
|
826
|
+
"rhs",
|
827
|
+
"this",
|
828
|
+
"lhs_or_this",
|
829
|
+
"object",
|
830
|
+
"function_call",
|
831
|
+
"amber_core",
|
832
|
+
"lhs",
|
833
|
+
"variable",
|
834
|
+
"object_variable",
|
835
|
+
"array_variable",
|
836
|
+
"args",
|
837
|
+
"argument",
|
838
|
+
"arg_def",
|
839
|
+
"declaration",
|
840
|
+
"ass_list",
|
841
|
+
"empty_object",
|
842
|
+
"optional_statement",
|
843
|
+
"object_content",
|
844
|
+
"object_value",
|
845
|
+
"object_element" ]
|
846
|
+
|
847
|
+
Racc_debug_parser = false
|
848
|
+
|
849
|
+
##### State transition tables end #####
|
850
|
+
|
851
|
+
# reduce 0 omitted
|
852
|
+
|
853
|
+
module_eval(<<'.,.,', 'ecma.y', 48)
|
854
|
+
def _reduce_1(val, _values, result)
|
855
|
+
result = Sequence.new([val[0]])
|
856
|
+
result
|
857
|
+
end
|
858
|
+
.,.,
|
859
|
+
|
860
|
+
module_eval(<<'.,.,', 'ecma.y', 49)
|
861
|
+
def _reduce_2(val, _values, result)
|
862
|
+
result = Sequence.new([])
|
863
|
+
result
|
864
|
+
end
|
865
|
+
.,.,
|
866
|
+
|
867
|
+
# reduce 3 omitted
|
868
|
+
|
869
|
+
# reduce 4 omitted
|
870
|
+
|
871
|
+
# reduce 5 omitted
|
872
|
+
|
873
|
+
# reduce 6 omitted
|
874
|
+
|
875
|
+
# reduce 7 omitted
|
876
|
+
|
877
|
+
# reduce 8 omitted
|
878
|
+
|
879
|
+
# reduce 9 omitted
|
880
|
+
|
881
|
+
# reduce 10 omitted
|
882
|
+
|
883
|
+
# reduce 11 omitted
|
884
|
+
|
885
|
+
# reduce 12 omitted
|
886
|
+
|
887
|
+
# reduce 13 omitted
|
888
|
+
|
889
|
+
module_eval(<<'.,.,', 'ecma.y', 64)
|
890
|
+
def _reduce_14(val, _values, result)
|
891
|
+
result = Sequence.new([])
|
892
|
+
result
|
893
|
+
end
|
894
|
+
.,.,
|
895
|
+
|
896
|
+
module_eval(<<'.,.,', 'ecma.y', 65)
|
897
|
+
def _reduce_15(val, _values, result)
|
898
|
+
result = Sequence.new([val[0]])
|
899
|
+
result
|
900
|
+
end
|
901
|
+
.,.,
|
902
|
+
|
903
|
+
module_eval(<<'.,.,', 'ecma.y', 66)
|
904
|
+
def _reduce_16(val, _values, result)
|
905
|
+
result << val[1]
|
906
|
+
result
|
907
|
+
end
|
908
|
+
.,.,
|
909
|
+
|
910
|
+
# reduce 17 omitted
|
911
|
+
|
912
|
+
module_eval(<<'.,.,', 'ecma.y', 69)
|
913
|
+
def _reduce_18(val, _values, result)
|
914
|
+
result = val[1]
|
915
|
+
result
|
916
|
+
end
|
917
|
+
.,.,
|
918
|
+
|
919
|
+
module_eval(<<'.,.,', 'ecma.y', 70)
|
920
|
+
def _reduce_19(val, _values, result)
|
921
|
+
result = result = const(:object, nil)
|
922
|
+
result
|
923
|
+
end
|
924
|
+
.,.,
|
925
|
+
|
926
|
+
module_eval(<<'.,.,', 'ecma.y', 72)
|
927
|
+
def _reduce_20(val, _values, result)
|
928
|
+
result = const :number, val[0][0]
|
929
|
+
result
|
930
|
+
end
|
931
|
+
.,.,
|
932
|
+
|
933
|
+
module_eval(<<'.,.,', 'ecma.y', 73)
|
934
|
+
def _reduce_21(val, _values, result)
|
935
|
+
result = const :number, val[0][0]
|
936
|
+
result
|
937
|
+
end
|
938
|
+
.,.,
|
939
|
+
|
940
|
+
module_eval(<<'.,.,', 'ecma.y', 74)
|
941
|
+
def _reduce_22(val, _values, result)
|
942
|
+
result = const :string, val[0][0]
|
943
|
+
result
|
944
|
+
end
|
945
|
+
.,.,
|
946
|
+
|
947
|
+
module_eval(<<'.,.,', 'ecma.y', 75)
|
948
|
+
def _reduce_23(val, _values, result)
|
949
|
+
result = const :boolean, true
|
950
|
+
result
|
951
|
+
end
|
952
|
+
.,.,
|
953
|
+
|
954
|
+
module_eval(<<'.,.,', 'ecma.y', 76)
|
955
|
+
def _reduce_24(val, _values, result)
|
956
|
+
result = const :boolean, false
|
957
|
+
result
|
958
|
+
end
|
959
|
+
.,.,
|
960
|
+
|
961
|
+
module_eval(<<'.,.,', 'ecma.y', 77)
|
962
|
+
def _reduce_25(val, _values, result)
|
963
|
+
result = const :boolean, nil
|
964
|
+
result
|
965
|
+
end
|
966
|
+
.,.,
|
967
|
+
|
968
|
+
module_eval(<<'.,.,', 'ecma.y', 80)
|
969
|
+
def _reduce_26(val, _values, result)
|
970
|
+
result = AmberVM::Interpreter::Sequence.new()
|
971
|
+
list = StaticVariable.new(AmberVM::Classes::List.new([]))
|
972
|
+
content = val[1]
|
973
|
+
content.size.times do |i|
|
974
|
+
result << AmberVM::Interpreter::CoreCall.new(:set_at, [list, AmberVM::Interpreter.const(:number, i), content[i]])
|
975
|
+
end
|
976
|
+
result << VariableValue.new(list)
|
977
|
+
|
978
|
+
result
|
979
|
+
end
|
980
|
+
.,.,
|
981
|
+
|
982
|
+
module_eval(<<'.,.,', 'ecma.y', 89)
|
983
|
+
def _reduce_27(val, _values, result)
|
984
|
+
result = [result]
|
985
|
+
result
|
986
|
+
end
|
987
|
+
.,.,
|
988
|
+
|
989
|
+
module_eval(<<'.,.,', 'ecma.y', 90)
|
990
|
+
def _reduce_28(val, _values, result)
|
991
|
+
result << val[2]
|
992
|
+
result
|
993
|
+
end
|
994
|
+
.,.,
|
995
|
+
|
996
|
+
module_eval(<<'.,.,', 'ecma.y', 91)
|
997
|
+
def _reduce_29(val, _values, result)
|
998
|
+
result = []
|
999
|
+
result
|
1000
|
+
end
|
1001
|
+
.,.,
|
1002
|
+
|
1003
|
+
module_eval(<<'.,.,', 'ecma.y', 94)
|
1004
|
+
def _reduce_30(val, _values, result)
|
1005
|
+
lhs = val[0]
|
1006
|
+
rhs = val[2]
|
1007
|
+
if rhs.is_a?(Constant) and rhs.value.is_a?(AmberVM::Classes::Number)
|
1008
|
+
result = CoreCall.new(:add, [lhs, rhs], val[1][1])
|
1009
|
+
else
|
1010
|
+
result = result = FunctionCall.new(core_fun('plus'), [lhs, rhs] ,val[1][1])
|
1011
|
+
end
|
1012
|
+
|
1013
|
+
result
|
1014
|
+
end
|
1015
|
+
.,.,
|
1016
|
+
|
1017
|
+
module_eval(<<'.,.,', 'ecma.y', 102)
|
1018
|
+
def _reduce_31(val, _values, result)
|
1019
|
+
result = CoreCall.new(:sub, [result, val[2]], val[1][1])
|
1020
|
+
result
|
1021
|
+
end
|
1022
|
+
.,.,
|
1023
|
+
|
1024
|
+
module_eval(<<'.,.,', 'ecma.y', 103)
|
1025
|
+
def _reduce_32(val, _values, result)
|
1026
|
+
result = CoreCall.new(:mul, [result, val[2]], val[1][1])
|
1027
|
+
result
|
1028
|
+
end
|
1029
|
+
.,.,
|
1030
|
+
|
1031
|
+
module_eval(<<'.,.,', 'ecma.y', 104)
|
1032
|
+
def _reduce_33(val, _values, result)
|
1033
|
+
result = CoreCall.new(:div, [result, val[2]], val[1][1])
|
1034
|
+
result
|
1035
|
+
end
|
1036
|
+
.,.,
|
1037
|
+
|
1038
|
+
module_eval(<<'.,.,', 'ecma.y', 105)
|
1039
|
+
def _reduce_34(val, _values, result)
|
1040
|
+
result = CoreCall.new(:mod, [result, val[2]], val[1][1])
|
1041
|
+
result
|
1042
|
+
end
|
1043
|
+
.,.,
|
1044
|
+
|
1045
|
+
module_eval(<<'.,.,', 'ecma.y', 106)
|
1046
|
+
def _reduce_35(val, _values, result)
|
1047
|
+
result = CoreCall.new(:bitwise_and, [result, val[2]])
|
1048
|
+
result
|
1049
|
+
end
|
1050
|
+
.,.,
|
1051
|
+
|
1052
|
+
module_eval(<<'.,.,', 'ecma.y', 107)
|
1053
|
+
def _reduce_36(val, _values, result)
|
1054
|
+
result = CoreCall.new(:bitwise_xor, [result, val[2]])
|
1055
|
+
result
|
1056
|
+
end
|
1057
|
+
.,.,
|
1058
|
+
|
1059
|
+
module_eval(<<'.,.,', 'ecma.y', 108)
|
1060
|
+
def _reduce_37(val, _values, result)
|
1061
|
+
result = CoreCall.new(:bitwise_or, [result, val[2]])
|
1062
|
+
result
|
1063
|
+
end
|
1064
|
+
.,.,
|
1065
|
+
|
1066
|
+
module_eval(<<'.,.,', 'ecma.y', 109)
|
1067
|
+
def _reduce_38(val, _values, result)
|
1068
|
+
result = CoreCall.new(:shr, [result, val[2]])
|
1069
|
+
result
|
1070
|
+
end
|
1071
|
+
.,.,
|
1072
|
+
|
1073
|
+
module_eval(<<'.,.,', 'ecma.y', 110)
|
1074
|
+
def _reduce_39(val, _values, result)
|
1075
|
+
result = CoreCall.new(:shr, [result, val[2]])
|
1076
|
+
result
|
1077
|
+
end
|
1078
|
+
.,.,
|
1079
|
+
|
1080
|
+
module_eval(<<'.,.,', 'ecma.y', 111)
|
1081
|
+
def _reduce_40(val, _values, result)
|
1082
|
+
result = CoreCall.new(:shl, [result, val[2]])
|
1083
|
+
result
|
1084
|
+
end
|
1085
|
+
.,.,
|
1086
|
+
|
1087
|
+
module_eval(<<'.,.,', 'ecma.y', 112)
|
1088
|
+
def _reduce_41(val, _values, result)
|
1089
|
+
result = CoreCall.new(:and, [result, val[2]])
|
1090
|
+
result
|
1091
|
+
end
|
1092
|
+
.,.,
|
1093
|
+
|
1094
|
+
module_eval(<<'.,.,', 'ecma.y', 113)
|
1095
|
+
def _reduce_42(val, _values, result)
|
1096
|
+
result = CoreCall.new(:or, [result, val[2]])
|
1097
|
+
result
|
1098
|
+
end
|
1099
|
+
.,.,
|
1100
|
+
|
1101
|
+
module_eval(<<'.,.,', 'ecma.y', 114)
|
1102
|
+
def _reduce_43(val, _values, result)
|
1103
|
+
result = Condition.new(val[0], val[2], val[4], val[1][1])
|
1104
|
+
result
|
1105
|
+
end
|
1106
|
+
.,.,
|
1107
|
+
|
1108
|
+
module_eval(<<'.,.,', 'ecma.y', 115)
|
1109
|
+
def _reduce_44(val, _values, result)
|
1110
|
+
result = CoreCall.new(:lt, [result, val[2]], val[1][1])
|
1111
|
+
result
|
1112
|
+
end
|
1113
|
+
.,.,
|
1114
|
+
|
1115
|
+
module_eval(<<'.,.,', 'ecma.y', 116)
|
1116
|
+
def _reduce_45(val, _values, result)
|
1117
|
+
result = CoreCall.new(:gt, [result, val[2]], val[1][1])
|
1118
|
+
result
|
1119
|
+
end
|
1120
|
+
.,.,
|
1121
|
+
|
1122
|
+
module_eval(<<'.,.,', 'ecma.y', 117)
|
1123
|
+
def _reduce_46(val, _values, result)
|
1124
|
+
result = CoreCall.new(:eq, [result, val[2]], val[1][1])
|
1125
|
+
result
|
1126
|
+
end
|
1127
|
+
.,.,
|
1128
|
+
|
1129
|
+
module_eval(<<'.,.,', 'ecma.y', 118)
|
1130
|
+
def _reduce_47(val, _values, result)
|
1131
|
+
result = CoreCall.new(:neq, [result, val[2]], val[1][1])
|
1132
|
+
result
|
1133
|
+
end
|
1134
|
+
.,.,
|
1135
|
+
|
1136
|
+
module_eval(<<'.,.,', 'ecma.y', 119)
|
1137
|
+
def _reduce_48(val, _values, result)
|
1138
|
+
result = CoreCall.new(:gte, [result, val[2]], val[1][1])
|
1139
|
+
result
|
1140
|
+
end
|
1141
|
+
.,.,
|
1142
|
+
|
1143
|
+
module_eval(<<'.,.,', 'ecma.y', 120)
|
1144
|
+
def _reduce_49(val, _values, result)
|
1145
|
+
result = CoreCall.new(:lte, [result, val[2]], val[1][1])
|
1146
|
+
result
|
1147
|
+
end
|
1148
|
+
.,.,
|
1149
|
+
|
1150
|
+
module_eval(<<'.,.,', 'ecma.y', 122)
|
1151
|
+
def _reduce_50(val, _values, result)
|
1152
|
+
result = Variable.new(:self)
|
1153
|
+
result
|
1154
|
+
end
|
1155
|
+
.,.,
|
1156
|
+
|
1157
|
+
# reduce 51 omitted
|
1158
|
+
|
1159
|
+
module_eval(<<'.,.,', 'ecma.y', 125)
|
1160
|
+
def _reduce_52(val, _values, result)
|
1161
|
+
result = val[1]
|
1162
|
+
result
|
1163
|
+
end
|
1164
|
+
.,.,
|
1165
|
+
|
1166
|
+
module_eval(<<'.,.,', 'ecma.y', 126)
|
1167
|
+
def _reduce_53(val, _values, result)
|
1168
|
+
result = CoreCall.new(:neg, [val[1]], val[0][1])
|
1169
|
+
result
|
1170
|
+
end
|
1171
|
+
.,.,
|
1172
|
+
|
1173
|
+
# reduce 54 omitted
|
1174
|
+
|
1175
|
+
module_eval(<<'.,.,', 'ecma.y', 128)
|
1176
|
+
def _reduce_55(val, _values, result)
|
1177
|
+
result = CoreCall.new(:not, [val[1]], val[0][1])
|
1178
|
+
result
|
1179
|
+
end
|
1180
|
+
.,.,
|
1181
|
+
|
1182
|
+
module_eval(<<'.,.,', 'ecma.y', 129)
|
1183
|
+
def _reduce_56(val, _values, result)
|
1184
|
+
result = CoreCall.new(:bitwise_not, [val[1]], val[0][1])
|
1185
|
+
result
|
1186
|
+
end
|
1187
|
+
.,.,
|
1188
|
+
|
1189
|
+
module_eval(<<'.,.,', 'ecma.y', 130)
|
1190
|
+
def _reduce_57(val, _values, result)
|
1191
|
+
result = VariableValue.new(result)
|
1192
|
+
result
|
1193
|
+
end
|
1194
|
+
.,.,
|
1195
|
+
|
1196
|
+
# reduce 58 omitted
|
1197
|
+
|
1198
|
+
# reduce 59 omitted
|
1199
|
+
|
1200
|
+
module_eval(<<'.,.,', 'ecma.y', 133)
|
1201
|
+
def _reduce_60(val, _values, result)
|
1202
|
+
result = FunctionCall.new(core_fun('type'), [val[1]] ,val[0][1])
|
1203
|
+
result
|
1204
|
+
end
|
1205
|
+
.,.,
|
1206
|
+
|
1207
|
+
# reduce 61 omitted
|
1208
|
+
|
1209
|
+
# reduce 62 omitted
|
1210
|
+
|
1211
|
+
# reduce 63 omitted
|
1212
|
+
|
1213
|
+
# reduce 64 omitted
|
1214
|
+
|
1215
|
+
# reduce 65 omitted
|
1216
|
+
|
1217
|
+
module_eval(<<'.,.,', 'ecma.y', 141)
|
1218
|
+
def _reduce_66(val, _values, result)
|
1219
|
+
result = SimpleVariable.new(val[0][0], val[0][1])
|
1220
|
+
result
|
1221
|
+
end
|
1222
|
+
.,.,
|
1223
|
+
|
1224
|
+
# reduce 67 omitted
|
1225
|
+
|
1226
|
+
# reduce 68 omitted
|
1227
|
+
|
1228
|
+
# reduce 69 omitted
|
1229
|
+
|
1230
|
+
# reduce 70 omitted
|
1231
|
+
|
1232
|
+
module_eval(<<'.,.,', 'ecma.y', 148)
|
1233
|
+
def _reduce_71(val, _values, result)
|
1234
|
+
result = ObjectVariable.new(VariableValue.new(val[0]), val[2][0], val[1][1])
|
1235
|
+
|
1236
|
+
result
|
1237
|
+
end
|
1238
|
+
.,.,
|
1239
|
+
|
1240
|
+
module_eval(<<'.,.,', 'ecma.y', 152)
|
1241
|
+
def _reduce_72(val, _values, result)
|
1242
|
+
if val[0].is_a? ObjectVariable
|
1243
|
+
last_self = StaticVariable.new(nil)
|
1244
|
+
result = StaticVariable.new(nil)
|
1245
|
+
obj = val[0].object
|
1246
|
+
var = val[0].name
|
1247
|
+
result = Sequence.new([
|
1248
|
+
Assignment.new(last_self, VariableValue.new(Variable.new(:self))),
|
1249
|
+
Assignment.new(Variable.new(:self), obj),
|
1250
|
+
Assignment.new(result,FunctionCall.new(VariableValue.new(ObjectVariable.new(VariableValue.new(Variable.new(:self)), var, val[0].pos)),val[2])),
|
1251
|
+
Assignment.new(Variable.new(:self), VariableValue.new(last_self)),
|
1252
|
+
VariableValue.new(result)
|
1253
|
+
])
|
1254
|
+
else
|
1255
|
+
result = FunctionCall.new(VariableValue.new(val[0]), val[2], val[1][1])
|
1256
|
+
end
|
1257
|
+
|
1258
|
+
result
|
1259
|
+
end
|
1260
|
+
.,.,
|
1261
|
+
|
1262
|
+
# reduce 73 omitted
|
1263
|
+
|
1264
|
+
# reduce 74 omitted
|
1265
|
+
|
1266
|
+
module_eval(<<'.,.,', 'ecma.y', 173)
|
1267
|
+
def _reduce_75(val, _values, result)
|
1268
|
+
result = [val[0][0]]
|
1269
|
+
result
|
1270
|
+
end
|
1271
|
+
.,.,
|
1272
|
+
|
1273
|
+
module_eval(<<'.,.,', 'ecma.y', 174)
|
1274
|
+
def _reduce_76(val, _values, result)
|
1275
|
+
result << val[2][0]
|
1276
|
+
result
|
1277
|
+
end
|
1278
|
+
.,.,
|
1279
|
+
|
1280
|
+
module_eval(<<'.,.,', 'ecma.y', 175)
|
1281
|
+
def _reduce_77(val, _values, result)
|
1282
|
+
result = []
|
1283
|
+
result
|
1284
|
+
end
|
1285
|
+
.,.,
|
1286
|
+
|
1287
|
+
module_eval(<<'.,.,', 'ecma.y', 178)
|
1288
|
+
def _reduce_78(val, _values, result)
|
1289
|
+
result = CoreCall.new(val[2][0], val[4], val[1][1])
|
1290
|
+
|
1291
|
+
result
|
1292
|
+
end
|
1293
|
+
.,.,
|
1294
|
+
|
1295
|
+
module_eval(<<'.,.,', 'ecma.y', 181)
|
1296
|
+
def _reduce_79(val, _values, result)
|
1297
|
+
result = CoreCall.new(:at, [VariableValue.new(val[0]), val[2]], val[1][1])
|
1298
|
+
result
|
1299
|
+
end
|
1300
|
+
.,.,
|
1301
|
+
|
1302
|
+
# reduce 80 omitted
|
1303
|
+
|
1304
|
+
module_eval(<<'.,.,', 'ecma.y', 186)
|
1305
|
+
def _reduce_81(val, _values, result)
|
1306
|
+
result = SimpleDeclaration.new(val[0][0], val[2], val[1][1])
|
1307
|
+
|
1308
|
+
result
|
1309
|
+
end
|
1310
|
+
.,.,
|
1311
|
+
|
1312
|
+
module_eval(<<'.,.,', 'ecma.y', 189)
|
1313
|
+
def _reduce_82(val, _values, result)
|
1314
|
+
result = SimpleDeclaration.new(val[0][0], const(:null,nil), val[0][1])
|
1315
|
+
|
1316
|
+
result
|
1317
|
+
end
|
1318
|
+
.,.,
|
1319
|
+
|
1320
|
+
module_eval(<<'.,.,', 'ecma.y', 192)
|
1321
|
+
def _reduce_83(val, _values, result)
|
1322
|
+
result = val[1]
|
1323
|
+
result
|
1324
|
+
end
|
1325
|
+
.,.,
|
1326
|
+
|
1327
|
+
module_eval(<<'.,.,', 'ecma.y', 194)
|
1328
|
+
def _reduce_84(val, _values, result)
|
1329
|
+
result = Sequence.new([result])
|
1330
|
+
result
|
1331
|
+
end
|
1332
|
+
.,.,
|
1333
|
+
|
1334
|
+
module_eval(<<'.,.,', 'ecma.y', 195)
|
1335
|
+
def _reduce_85(val, _values, result)
|
1336
|
+
result << val[2]
|
1337
|
+
result
|
1338
|
+
end
|
1339
|
+
.,.,
|
1340
|
+
|
1341
|
+
module_eval(<<'.,.,', 'ecma.y', 197)
|
1342
|
+
def _reduce_86(val, _values, result)
|
1343
|
+
result = Assignment.new(val[0], val[2], val[1][1])
|
1344
|
+
result
|
1345
|
+
end
|
1346
|
+
.,.,
|
1347
|
+
|
1348
|
+
module_eval(<<'.,.,', 'ecma.y', 198)
|
1349
|
+
def _reduce_87(val, _values, result)
|
1350
|
+
result = Assignment.new(val[0], val[2], val[1][1])
|
1351
|
+
result
|
1352
|
+
end
|
1353
|
+
.,.,
|
1354
|
+
|
1355
|
+
module_eval(<<'.,.,', 'ecma.y', 199)
|
1356
|
+
def _reduce_88(val, _values, result)
|
1357
|
+
result = Assignment.new(val[0], val[2], val[1][1])
|
1358
|
+
result
|
1359
|
+
end
|
1360
|
+
.,.,
|
1361
|
+
|
1362
|
+
module_eval(<<'.,.,', 'ecma.y', 200)
|
1363
|
+
def _reduce_89(val, _values, result)
|
1364
|
+
result = Assignment.new(val[1], FunctionCall.new(core_fun('inc'), [val[1]] ,val[0][1]), val[0][1])
|
1365
|
+
result
|
1366
|
+
end
|
1367
|
+
.,.,
|
1368
|
+
|
1369
|
+
module_eval(<<'.,.,', 'ecma.y', 201)
|
1370
|
+
def _reduce_90(val, _values, result)
|
1371
|
+
result = Assignment.new(val[1], FunctionCall.new(core_fun('dec'), [val[1]] ,val[0][1]), val[0][1])
|
1372
|
+
result
|
1373
|
+
end
|
1374
|
+
.,.,
|
1375
|
+
|
1376
|
+
module_eval(<<'.,.,', 'ecma.y', 203)
|
1377
|
+
def _reduce_91(val, _values, result)
|
1378
|
+
seq = Sequence.new()
|
1379
|
+
var = StaticVariable.new(nil)
|
1380
|
+
seq << Assignment.new(var, VariableValue.new(result, val[1][1]), val[1][1]);
|
1381
|
+
seq << Assignment.new(result, FunctionCall.new(core_fun('inc'), [result] ,val[1][1]), val[1][1])
|
1382
|
+
seq << VariableValue.new(var, val[1][1])
|
1383
|
+
result = seq
|
1384
|
+
|
1385
|
+
result
|
1386
|
+
end
|
1387
|
+
.,.,
|
1388
|
+
|
1389
|
+
module_eval(<<'.,.,', 'ecma.y', 211)
|
1390
|
+
def _reduce_92(val, _values, result)
|
1391
|
+
seq = Sequence.new()
|
1392
|
+
var = StaticVariable.new(nil)
|
1393
|
+
seq << Assignment.new(var, VariableValue.new(result, val[1][1]), val[1][1]);
|
1394
|
+
seq << Assignment.new(result, FunctionCall.new(core_fun('dec'), [result] ,val[1][1]), val[1][1])
|
1395
|
+
seq << VariableValue.new(var, val[1][1])
|
1396
|
+
result = seq
|
1397
|
+
|
1398
|
+
result
|
1399
|
+
end
|
1400
|
+
.,.,
|
1401
|
+
|
1402
|
+
module_eval(<<'.,.,', 'ecma.y', 219)
|
1403
|
+
def _reduce_93(val, _values, result)
|
1404
|
+
lhs = val[0]
|
1405
|
+
rhs = val[2]
|
1406
|
+
if rhs.is_a?(Constant) and rhs.value.is_a?(AmberVM::Classes::Number)
|
1407
|
+
result = Assignment.new(val[0], CoreCall.new(:add, [VariableValue.new(lhs, val[1][1]), rhs], val[1][1]), val[1][1])
|
1408
|
+
else
|
1409
|
+
result = Assignment.new(val[0], FunctionCall.new(core_fun('plus'), [VariableValue.new(lhs, val[1][1]), rhs] ,val[1][1]), val[1][1])
|
1410
|
+
end
|
1411
|
+
|
1412
|
+
result
|
1413
|
+
end
|
1414
|
+
.,.,
|
1415
|
+
|
1416
|
+
module_eval(<<'.,.,', 'ecma.y', 227)
|
1417
|
+
def _reduce_94(val, _values, result)
|
1418
|
+
result = Assignment.new(val[0], CoreCall.new(:sub, [VariableValue.new(val[0], val[1][1]), val[2]], val[1][1]), val[1][1])
|
1419
|
+
result
|
1420
|
+
end
|
1421
|
+
.,.,
|
1422
|
+
|
1423
|
+
module_eval(<<'.,.,', 'ecma.y', 228)
|
1424
|
+
def _reduce_95(val, _values, result)
|
1425
|
+
result = Assignment.new(val[0], CoreCall.new(:mul, [VariableValue.new(val[0], val[1][1]), val[2]], val[1][1]), val[1][1])
|
1426
|
+
result
|
1427
|
+
end
|
1428
|
+
.,.,
|
1429
|
+
|
1430
|
+
module_eval(<<'.,.,', 'ecma.y', 229)
|
1431
|
+
def _reduce_96(val, _values, result)
|
1432
|
+
result = Assignment.new(val[0], CoreCall.new(:div, [VariableValue.new(val[0], val[1][1]), val[2]], val[1][1]), val[1][1])
|
1433
|
+
result
|
1434
|
+
end
|
1435
|
+
.,.,
|
1436
|
+
|
1437
|
+
module_eval(<<'.,.,', 'ecma.y', 230)
|
1438
|
+
def _reduce_97(val, _values, result)
|
1439
|
+
result = Assignment.new(val[0], CoreCall.new(:mod, [VariableValue.new(val[0], val[1][1]), val[2]], val[1][1]), val[1][1])
|
1440
|
+
result
|
1441
|
+
end
|
1442
|
+
.,.,
|
1443
|
+
|
1444
|
+
module_eval(<<'.,.,', 'ecma.y', 231)
|
1445
|
+
def _reduce_98(val, _values, result)
|
1446
|
+
result = Assignment.new(val[0], CoreCall.new(:bitwise_or, [VariableValue.new(val[0], val[1][1]), val[2]], val[1][1]), val[1][1])
|
1447
|
+
result
|
1448
|
+
end
|
1449
|
+
.,.,
|
1450
|
+
|
1451
|
+
module_eval(<<'.,.,', 'ecma.y', 232)
|
1452
|
+
def _reduce_99(val, _values, result)
|
1453
|
+
result = Assignment.new(val[0], CoreCall.new(:bitwise_and, [VariableValue.new(val[0], val[1][1]), val[2]], val[1][1]), val[1][1])
|
1454
|
+
result
|
1455
|
+
end
|
1456
|
+
.,.,
|
1457
|
+
|
1458
|
+
module_eval(<<'.,.,', 'ecma.y', 233)
|
1459
|
+
def _reduce_100(val, _values, result)
|
1460
|
+
result = Assignment.new(val[0], CoreCall.new(:bitwise_xor, [VariableValue.new(val[0], val[1][1]), val[2]], val[1][1]), val[1][1])
|
1461
|
+
result
|
1462
|
+
end
|
1463
|
+
.,.,
|
1464
|
+
|
1465
|
+
module_eval(<<'.,.,', 'ecma.y', 234)
|
1466
|
+
def _reduce_101(val, _values, result)
|
1467
|
+
result = Assignment.new(val[0], CoreCall.new(:shl, [VariableValue.new(val[0], val[1][1]), val[2]], val[1][1]), val[1][1])
|
1468
|
+
result
|
1469
|
+
end
|
1470
|
+
.,.,
|
1471
|
+
|
1472
|
+
module_eval(<<'.,.,', 'ecma.y', 235)
|
1473
|
+
def _reduce_102(val, _values, result)
|
1474
|
+
result = Assignment.new(val[0], CoreCall.new(:shr, [VariableValue.new(val[0], val[1][1]), val[2]], val[1][1]), val[1][1])
|
1475
|
+
result
|
1476
|
+
end
|
1477
|
+
.,.,
|
1478
|
+
|
1479
|
+
module_eval(<<'.,.,', 'ecma.y', 236)
|
1480
|
+
def _reduce_103(val, _values, result)
|
1481
|
+
result = Assignment.new(val[0], CoreCall.new(:shr, [VariableValue.new(val[0], val[1][1]), val[2]], val[1][1]), val[1][1])
|
1482
|
+
result
|
1483
|
+
end
|
1484
|
+
.,.,
|
1485
|
+
|
1486
|
+
module_eval(<<'.,.,', 'ecma.y', 240)
|
1487
|
+
def _reduce_104(val, _values, result)
|
1488
|
+
name = nil
|
1489
|
+
arg_def = val[2]
|
1490
|
+
block = val[4]
|
1491
|
+
i=0
|
1492
|
+
if not block.is_a?(Sequence)
|
1493
|
+
temp_block = block
|
1494
|
+
block = Sequence.new()
|
1495
|
+
block << temp_block
|
1496
|
+
end
|
1497
|
+
val[2].each do |a|
|
1498
|
+
block.unshift SimpleDeclaration.new(a, Parameter.new(const(:number, i)))
|
1499
|
+
i +=1
|
1500
|
+
end
|
1501
|
+
block << Return.new(const(:null, nil, val[0][1]))
|
1502
|
+
block = AmberVM::Classes::Block.new(block)
|
1503
|
+
result = Closures.new(block)
|
1504
|
+
|
1505
|
+
result
|
1506
|
+
end
|
1507
|
+
.,.,
|
1508
|
+
|
1509
|
+
module_eval(<<'.,.,', 'ecma.y', 258)
|
1510
|
+
def _reduce_105(val, _values, result)
|
1511
|
+
name = val[1][0]
|
1512
|
+
arg_def = val[3]
|
1513
|
+
block = val[5]
|
1514
|
+
i = 0
|
1515
|
+
if not block.is_a?(Sequence)
|
1516
|
+
temp_block = block
|
1517
|
+
block = Sequence.new()
|
1518
|
+
block << temp_block
|
1519
|
+
end
|
1520
|
+
val[3].each do |a|
|
1521
|
+
block.unshift SimpleDeclaration.new(a, Parameter.new(const(:number, i)))
|
1522
|
+
i +=1
|
1523
|
+
end
|
1524
|
+
block << Return.new(const(:null, nil, val[0][1]))
|
1525
|
+
block = AmberVM::Classes::Block.new(block)
|
1526
|
+
result = Assignment.new(SimpleVariable.new(name, val[1][1]), Closures.new(block), val[0][1])
|
1527
|
+
|
1528
|
+
result
|
1529
|
+
end
|
1530
|
+
.,.,
|
1531
|
+
|
1532
|
+
# reduce 106 omitted
|
1533
|
+
|
1534
|
+
# reduce 107 omitted
|
1535
|
+
|
1536
|
+
module_eval(<<'.,.,', 'ecma.y', 280)
|
1537
|
+
def _reduce_108(val, _values, result)
|
1538
|
+
cond = val[2]
|
1539
|
+
body = val[4]
|
1540
|
+
result = Loop.new(cond, body, val[0][1])
|
1541
|
+
|
1542
|
+
result
|
1543
|
+
end
|
1544
|
+
.,.,
|
1545
|
+
|
1546
|
+
module_eval(<<'.,.,', 'ecma.y', 285)
|
1547
|
+
def _reduce_109(val, _values, result)
|
1548
|
+
cond = val[4]
|
1549
|
+
block = val[1]
|
1550
|
+
result = Sequence.new(
|
1551
|
+
[block,Loop.new(cond, block, val[2][1])]
|
1552
|
+
)
|
1553
|
+
|
1554
|
+
result
|
1555
|
+
end
|
1556
|
+
.,.,
|
1557
|
+
|
1558
|
+
module_eval(<<'.,.,', 'ecma.y', 293)
|
1559
|
+
def _reduce_110(val, _values, result)
|
1560
|
+
init = val[2]
|
1561
|
+
cond = val[4]
|
1562
|
+
event = val[6]
|
1563
|
+
command = val[8]
|
1564
|
+
|
1565
|
+
body = if command.is_a?(AmberVM::Interpreter::Block)
|
1566
|
+
command.content << event
|
1567
|
+
else
|
1568
|
+
AmberVM::Interpreter::Sequence.new([command, event])
|
1569
|
+
end
|
1570
|
+
|
1571
|
+
result = AmberVM::Interpreter::Sequence.new(
|
1572
|
+
[init,AmberVM::Interpreter::Loop.new(cond, body, val[0][1])]
|
1573
|
+
)
|
1574
|
+
|
1575
|
+
result
|
1576
|
+
end
|
1577
|
+
.,.,
|
1578
|
+
|
1579
|
+
module_eval(<<'.,.,', 'ecma.y', 309)
|
1580
|
+
def _reduce_111(val, _values, result)
|
1581
|
+
result = Condition.new(val[2], val[4], val[6], val[0][1])
|
1582
|
+
result
|
1583
|
+
end
|
1584
|
+
.,.,
|
1585
|
+
|
1586
|
+
module_eval(<<'.,.,', 'ecma.y', 310)
|
1587
|
+
def _reduce_112(val, _values, result)
|
1588
|
+
result = Condition.new(val[2], val[4], nil, val[0][1])
|
1589
|
+
result
|
1590
|
+
end
|
1591
|
+
.,.,
|
1592
|
+
|
1593
|
+
module_eval(<<'.,.,', 'ecma.y', 312)
|
1594
|
+
def _reduce_113(val, _values, result)
|
1595
|
+
result = Return.new(val[1])
|
1596
|
+
result
|
1597
|
+
end
|
1598
|
+
.,.,
|
1599
|
+
|
1600
|
+
module_eval(<<'.,.,', 'ecma.y', 313)
|
1601
|
+
def _reduce_114(val, _values, result)
|
1602
|
+
result = Return.new(val[1])
|
1603
|
+
result
|
1604
|
+
end
|
1605
|
+
.,.,
|
1606
|
+
|
1607
|
+
module_eval(<<'.,.,', 'ecma.y', 315)
|
1608
|
+
def _reduce_115(val, _values, result)
|
1609
|
+
result = const(:object, nil)
|
1610
|
+
result
|
1611
|
+
end
|
1612
|
+
.,.,
|
1613
|
+
|
1614
|
+
module_eval(<<'.,.,', 'ecma.y', 318)
|
1615
|
+
def _reduce_116(val, _values, result)
|
1616
|
+
object = const(:object, nil)
|
1617
|
+
result = Sequence.new([])
|
1618
|
+
|
1619
|
+
for key, value in val[1]
|
1620
|
+
result << Assignment.new(ObjectVariable.new(object,key),value) # ObjectContext.new(object, SimpleDeclaration.new(key, value))
|
1621
|
+
end
|
1622
|
+
|
1623
|
+
result << object
|
1624
|
+
|
1625
|
+
result
|
1626
|
+
end
|
1627
|
+
.,.,
|
1628
|
+
|
1629
|
+
# reduce 117 omitted
|
1630
|
+
|
1631
|
+
# reduce 118 omitted
|
1632
|
+
|
1633
|
+
module_eval(<<'.,.,', 'ecma.y', 329)
|
1634
|
+
def _reduce_119(val, _values, result)
|
1635
|
+
result = [val[0][0], val[2]]
|
1636
|
+
result
|
1637
|
+
end
|
1638
|
+
.,.,
|
1639
|
+
|
1640
|
+
module_eval(<<'.,.,', 'ecma.y', 330)
|
1641
|
+
def _reduce_120(val, _values, result)
|
1642
|
+
result = [result]
|
1643
|
+
result
|
1644
|
+
end
|
1645
|
+
.,.,
|
1646
|
+
|
1647
|
+
module_eval(<<'.,.,', 'ecma.y', 331)
|
1648
|
+
def _reduce_121(val, _values, result)
|
1649
|
+
result << val[2]
|
1650
|
+
result
|
1651
|
+
end
|
1652
|
+
.,.,
|
1653
|
+
|
1654
|
+
def _reduce_none(val, _values, result)
|
1655
|
+
val[0]
|
1656
|
+
end
|
1657
|
+
|
1658
|
+
end # class Compiler
|
1659
|
+
end # module ECMA
|
1660
|
+
end # module Languages
|
1661
|
+
end # module AmberVM
|