statsailr 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.travis.yml +6 -0
- data/Gemfile +7 -0
- data/HISTORY.md +15 -0
- data/LICENSE.txt +675 -0
- data/README.md +287 -0
- data/Rakefile +10 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/example/blank.slr +3 -0
- data/example/category.slr +5 -0
- data/example/example_read.slr +10 -0
- data/example/iris.csv +151 -0
- data/example/mtcars.rda +0 -0
- data/example/new_mtcars.csv +33 -0
- data/example/new_mtcars.rda +0 -0
- data/example/plot_reg_example.slr +55 -0
- data/example/scatter.png +0 -0
- data/exe/sailr +54 -0
- data/exe/sailrREPL +75 -0
- data/lib/statsailr.rb +7 -0
- data/lib/statsailr/block_builder/sts_block.rb +167 -0
- data/lib/statsailr/block_builder/sts_block_parse_proc_opts.rb +168 -0
- data/lib/statsailr/block_to_r/proc_setting_support/proc_opt_validator.rb +52 -0
- data/lib/statsailr/block_to_r/proc_setting_support/proc_setting_manager.rb +49 -0
- data/lib/statsailr/block_to_r/proc_setting_support/proc_setting_module.rb +44 -0
- data/lib/statsailr/block_to_r/sts_block_to_r.rb +98 -0
- data/lib/statsailr/block_to_r/sts_lazy_func_gen.rb +236 -0
- data/lib/statsailr/block_to_r/top_stmt/top_stmt_to_r_func.rb +182 -0
- data/lib/statsailr/parser/sts_gram_node.rb +9 -0
- data/lib/statsailr/parser/sts_parse.output +831 -0
- data/lib/statsailr/parser/sts_parse.ry +132 -0
- data/lib/statsailr/parser/sts_parse.tab.rb +682 -0
- data/lib/statsailr/scanner/sample1.sts +37 -0
- data/lib/statsailr/scanner/sts_scanner.rb +433 -0
- data/lib/statsailr/scanner/test_sample1.rb +8 -0
- data/lib/statsailr/sts_build_exec.rb +304 -0
- data/lib/statsailr/sts_controller.rb +66 -0
- data/lib/statsailr/sts_output/output_manager.rb +192 -0
- data/lib/statsailr/sts_runner.rb +17 -0
- data/lib/statsailr/sts_server.rb +85 -0
- data/lib/statsailr/version.rb +3 -0
- data/statsailr.gemspec +32 -0
- metadata +133 -0
@@ -0,0 +1,182 @@
|
|
1
|
+
module TopStmtToR
|
2
|
+
def self.read_rds(data_path, opts)
|
3
|
+
if as_name = opts["as"]
|
4
|
+
opts.delete("as")
|
5
|
+
puts "Read #{data_path} using readRDS(), which uses #{as_name} for dataset name."
|
6
|
+
read_func = RBridge.create_function_call( "readRDS" , {"file" => RBridge.create_strvec([data_path])} )
|
7
|
+
r_func = RBridge.create_assign_function( as_name.to_s , read_func )
|
8
|
+
else
|
9
|
+
basename = File.basename(data_path, File.extname(data_path))
|
10
|
+
as_name = basename.gsub(/\s/, '_').downcase
|
11
|
+
puts "Read #{data_path} using readRDS(), which uses #{as_name} for dataset name (created from filename)."
|
12
|
+
read_func = RBridge.create_function_call( "readRDS" , {"file" => RBridge.create_strvec([data_path])} )
|
13
|
+
r_func = RBridge.create_assign_function( as_name , read_func )
|
14
|
+
end
|
15
|
+
return(r_func)
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.read_rda(data_path, opts)
|
19
|
+
if as_name = opts["as"]
|
20
|
+
opts.delete("as")
|
21
|
+
puts "Read #{data_path} using laod(), which does not rename object when importing. 'as' option is ignored."
|
22
|
+
end
|
23
|
+
|
24
|
+
r_func = RBridge.create_function_call( "load" , {"file" => RBridge.create_strvec([data_path])} )
|
25
|
+
return(r_func)
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.read_csv(data_path, opts)
|
29
|
+
opt_hash = {}
|
30
|
+
if header = opts["header"]
|
31
|
+
opts.delete("header")
|
32
|
+
opt_hash = {"header" => RBridge.create_lglvec([header]) }
|
33
|
+
else
|
34
|
+
opt_hash = {"header" => RBridge.create_lglvec([true]) }
|
35
|
+
end
|
36
|
+
|
37
|
+
available_opts = ["sep","na.strings","skip"]
|
38
|
+
|
39
|
+
opts.filter!(){|k,v|
|
40
|
+
if available_opts.include?(k)
|
41
|
+
opt_hash[k] = RBridge.create_vec( [v] )
|
42
|
+
end
|
43
|
+
! available_opts.include?(k)
|
44
|
+
}
|
45
|
+
|
46
|
+
if as_name = opts["as"]
|
47
|
+
opts.delete("as")
|
48
|
+
puts "Read #{data_path} using read.csv(), which uses #{as_name} for dataset name."
|
49
|
+
read_func = RBridge.create_function_call( "read.csv" , {"file" => RBridge.create_strvec([data_path])}.merge(opt_hash) )
|
50
|
+
r_func = RBridge.create_assign_function( as_name.to_s , read_func )
|
51
|
+
else
|
52
|
+
basename = File.basename(data_path, File.extname(data_path))
|
53
|
+
as_name = basename.gsub(/\s/, '_').downcase
|
54
|
+
puts "Read #{data_path} using read.csv(), which uses #{as_name} for dataset name (created from filename)."
|
55
|
+
read_func = RBridge.create_function_call( "read.csv" , {"file" => RBridge.create_strvec([data_path])}.merge(opt_hash) )
|
56
|
+
r_func = RBridge.create_assign_function( as_name , read_func )
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def self.create_r_func_for_read(opts)
|
61
|
+
case
|
62
|
+
when builtin_data_name = opts["builtin"] # builtin
|
63
|
+
opts.delete("builtin"); opts.delete("file")
|
64
|
+
puts "Built-in dataset becomes available using data(): #{builtin_data_name.to_s}"
|
65
|
+
r_func = RBridge.create_function_call( "data" , {"" => RBridge.create_strvec([ builtin_data_name.to_s ])} )
|
66
|
+
when file_path = opts["file"] # csv
|
67
|
+
opts.delete("builtin"); opts.delete("file")
|
68
|
+
if type = opts["type"]
|
69
|
+
opts.delete("type")
|
70
|
+
case type.downcase
|
71
|
+
when "rds"
|
72
|
+
r_func = read_rds(file_path, opts)
|
73
|
+
when "rdata"
|
74
|
+
r_func = read_rda(file_path, opts)
|
75
|
+
when "csv"
|
76
|
+
r_func = read_csv(file_path, opts)
|
77
|
+
else
|
78
|
+
raise "TOPLEVEL READ statement currently supports rds(single r object), rdata or csv for type option. #{type} is specified."
|
79
|
+
end
|
80
|
+
else
|
81
|
+
case file_path
|
82
|
+
when /\.(rds)$/i # i is option to ignore cases
|
83
|
+
r_func = read_rds(file_path, opts)
|
84
|
+
when /\.(rdata|rda)$/i
|
85
|
+
r_func = read_rda(file_path, opts)
|
86
|
+
when /\.csv$/i
|
87
|
+
r_func = read_csv(file_path, opts)
|
88
|
+
else
|
89
|
+
raise "TOP level READ statement tried to idenfity file type from 'file=' option, but failed. File name preferably ends with .rds, .RData(.rdata) or .csv, or specify file type."
|
90
|
+
end
|
91
|
+
end
|
92
|
+
else
|
93
|
+
raise "TOPLEVEL READ statement requires 'builtin=' or 'file=' option."
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
def self.save_rds(r_var, data_path)
|
98
|
+
puts "SAVE #{data_path} using saveRDS()"
|
99
|
+
if(r_var.size != 1)
|
100
|
+
puts "Only one dataset can be specified. Others are ignored."
|
101
|
+
end
|
102
|
+
r_var = r_var[0]
|
103
|
+
save_rds_func = RBridge.create_function_call( "saveRDS" , {"object" => RBridge::SymbolR.new(r_var).to_r_symbol, "file" => RBridge.create_strvec([data_path])} )
|
104
|
+
return save_rds_func
|
105
|
+
end
|
106
|
+
def self.save_rda(r_var, data_path)
|
107
|
+
puts "SAVE #{data_path} using save()"
|
108
|
+
save_rds_func = RBridge.create_function_call( "save" , {"" => RBridge::create_strvec(r_var), "file" => RBridge.create_strvec([data_path])} )
|
109
|
+
return save_rds_func
|
110
|
+
end
|
111
|
+
def self.save_csv(r_var, data_path)
|
112
|
+
puts "SAVE #{data_path} using write.csv()"
|
113
|
+
if(r_var.size != 1)
|
114
|
+
puts "Only one dataset can be specified. Others are ignored."
|
115
|
+
end
|
116
|
+
r_var = r_var[0]
|
117
|
+
save_csv_func = RBridge.create_function_call( "write.csv" , {"x" => RBridge::SymbolR.new(r_var).to_r_symbol, "file" => RBridge.create_strvec([data_path])} )
|
118
|
+
return save_csv_func
|
119
|
+
end
|
120
|
+
|
121
|
+
def self.create_r_func_for_save(opts)
|
122
|
+
if opts["file"]
|
123
|
+
file_path = opts["file"]
|
124
|
+
else
|
125
|
+
raise "TOPLEVEL SAVE statement require 'file=' option. 'type=' option is optional when file extension matches file type."
|
126
|
+
end
|
127
|
+
if opts["type"]
|
128
|
+
type = opts["type"].downcase
|
129
|
+
end
|
130
|
+
opts.delete("file"); opts.delete("type")
|
131
|
+
|
132
|
+
if ! opts.empty?
|
133
|
+
dataset_to_save = opts.filter(){|k,v| v.nil? }.keys
|
134
|
+
dataset_to_save.each{|elem|
|
135
|
+
opts.delete(elem)
|
136
|
+
}
|
137
|
+
else
|
138
|
+
raise "Dataset should be specified"
|
139
|
+
end
|
140
|
+
|
141
|
+
case type
|
142
|
+
when "rds"
|
143
|
+
r_func = save_rds(dataset_to_save, file_path)
|
144
|
+
when "rdata"
|
145
|
+
r_func = save_rda(dataset_to_save, file_path)
|
146
|
+
when "csv"
|
147
|
+
r_func = save_csv(dataset_to_save, file_path)
|
148
|
+
else
|
149
|
+
case file_path
|
150
|
+
when /\.rds$/i
|
151
|
+
r_func = save_rds(dataset_to_save, file_path)
|
152
|
+
when /\.(rda|rdata)$/i
|
153
|
+
r_func = save_rda(dataset_to_save, file_path)
|
154
|
+
when /\.csv$/i
|
155
|
+
r_func = save_csv(dataset_to_save, file_path)
|
156
|
+
else
|
157
|
+
raise "TOP level SAVE statement tried to idenfity file type from file option, but failed. File name preferably ends with .rds, .rda (.rdata) or .csv, or specify file type."
|
158
|
+
end
|
159
|
+
end
|
160
|
+
return r_func
|
161
|
+
end
|
162
|
+
|
163
|
+
def self.create_r_func_for_getwd(opts)
|
164
|
+
puts "Current working directory"
|
165
|
+
r_func = RBridge.create_function_call( "print", {"x" => RBridge.create_function_call( "getwd" , {} )})
|
166
|
+
return r_func
|
167
|
+
end
|
168
|
+
|
169
|
+
def self.create_r_func_for_setwd(opts)
|
170
|
+
opts.select!(){|k,v| v.nil? }
|
171
|
+
if opts.empty?
|
172
|
+
raise "SETWD requires String keyword that specifies directory to which working diretory moves."
|
173
|
+
end
|
174
|
+
|
175
|
+
puts "Setting new working directory"
|
176
|
+
dir_path = opts.keys[0]
|
177
|
+
opts.delete(dir_path)
|
178
|
+
r_func = RBridge.create_function_call( "setwd" , {"dir" => RBridge.create_strvec([dir_path])} )
|
179
|
+
return r_func
|
180
|
+
end
|
181
|
+
|
182
|
+
end
|
@@ -0,0 +1,831 @@
|
|
1
|
+
state 11 contains 3 shift/reduce conflicts
|
2
|
+
|
3
|
+
|
4
|
+
-------- Grammar --------
|
5
|
+
|
6
|
+
rule 1 program: opt_termins blocks opt_termins
|
7
|
+
rule 2 blocks: blocks TERMIN block
|
8
|
+
rule 3 blocks: block
|
9
|
+
rule 4 block: top_stmt
|
10
|
+
rule 5 block: data_block
|
11
|
+
rule 6 block: proc_block
|
12
|
+
rule 7 top_stmt: TOP_INST top_options TOP_INST_END
|
13
|
+
rule 8 data_block: DATA_START data_engine_option IDENT data_options TERMIN DATA_SCRIPT DATA_END
|
14
|
+
rule 9 proc_block: PROC_START IDENT proc_options TERMIN proc_stmts TERMIN PROC_END
|
15
|
+
rule 10 top_options:
|
16
|
+
rule 11 top_options: value_or_kv
|
17
|
+
rule 12 top_options: top_options value_or_kv
|
18
|
+
rule 13 value_or_kv: opt_primary
|
19
|
+
rule 14 value_or_kv: kv
|
20
|
+
rule 15 data_engine_option:
|
21
|
+
rule 16 data_engine_option: COLON IDENT
|
22
|
+
rule 17 data_options:
|
23
|
+
rule 18 data_options: options
|
24
|
+
rule 19 proc_options:
|
25
|
+
rule 20 proc_options: options
|
26
|
+
rule 21 options: options key_or_kv
|
27
|
+
rule 22 options: key_or_kv
|
28
|
+
rule 23 key_or_kv: key
|
29
|
+
rule 24 key_or_kv: kv
|
30
|
+
rule 25 key: IDENT
|
31
|
+
rule 26 kv: IDENT ASSIGN opt_primary
|
32
|
+
rule 27 opt_primary: NUMBER
|
33
|
+
rule 28 opt_primary: STRING
|
34
|
+
rule 29 opt_primary: IDENT
|
35
|
+
rule 30 proc_stmts: proc_stmts TERMIN proc_stmt
|
36
|
+
rule 31 proc_stmts: proc_stmt
|
37
|
+
rule 32 proc_stmt: PROC_INST optional_proc_stmt_options
|
38
|
+
rule 33 optional_proc_stmt_options:
|
39
|
+
rule 34 optional_proc_stmt_options: proc_stmt_options
|
40
|
+
rule 35 proc_stmt_options: proc_stmt_options proc_primary
|
41
|
+
rule 36 proc_stmt_options: proc_primary
|
42
|
+
rule 37 proc_primary: IDENT
|
43
|
+
rule 38 proc_primary: NUMBER
|
44
|
+
rule 39 proc_primary: STRING
|
45
|
+
rule 40 proc_primary: P_EQ
|
46
|
+
rule 41 proc_primary: P_MULT
|
47
|
+
rule 42 proc_primary: P_PLUS
|
48
|
+
rule 43 proc_primary: P_MINUS
|
49
|
+
rule 44 proc_primary: P_HAT
|
50
|
+
rule 45 proc_primary: P_IN
|
51
|
+
rule 46 proc_primary: P_PERC
|
52
|
+
rule 47 proc_primary: P_TILDA
|
53
|
+
rule 48 proc_primary: P_COLON
|
54
|
+
rule 49 proc_primary: P_LPAR
|
55
|
+
rule 50 proc_primary: P_RPAR
|
56
|
+
rule 51 proc_primary: P_LSQBR
|
57
|
+
rule 52 proc_primary: P_RSQBR
|
58
|
+
rule 53 proc_primary: P_COMMA
|
59
|
+
rule 54 proc_primary: SEP_SLASH
|
60
|
+
rule 55 opt_termins:
|
61
|
+
rule 56 opt_termins: termins
|
62
|
+
rule 57 termins: termins TERMIN
|
63
|
+
rule 58 termins: TERMIN
|
64
|
+
|
65
|
+
------- Symbols -------
|
66
|
+
|
67
|
+
**Nonterminals, with rules where they appear
|
68
|
+
|
69
|
+
$start (31)
|
70
|
+
on right:
|
71
|
+
on left :
|
72
|
+
program (32)
|
73
|
+
on right:
|
74
|
+
on left : 1
|
75
|
+
opt_termins (33)
|
76
|
+
on right: 1
|
77
|
+
on left : 55 56
|
78
|
+
blocks (34)
|
79
|
+
on right: 1 2
|
80
|
+
on left : 2 3
|
81
|
+
block (35)
|
82
|
+
on right: 2 3
|
83
|
+
on left : 4 5 6
|
84
|
+
top_stmt (36)
|
85
|
+
on right: 4
|
86
|
+
on left : 7
|
87
|
+
data_block (37)
|
88
|
+
on right: 5
|
89
|
+
on left : 8
|
90
|
+
proc_block (38)
|
91
|
+
on right: 6
|
92
|
+
on left : 9
|
93
|
+
top_options (39)
|
94
|
+
on right: 7 12
|
95
|
+
on left : 10 11 12
|
96
|
+
data_engine_option (40)
|
97
|
+
on right: 8
|
98
|
+
on left : 15 16
|
99
|
+
data_options (41)
|
100
|
+
on right: 8
|
101
|
+
on left : 17 18
|
102
|
+
proc_options (42)
|
103
|
+
on right: 9
|
104
|
+
on left : 19 20
|
105
|
+
proc_stmts (43)
|
106
|
+
on right: 9 30
|
107
|
+
on left : 30 31
|
108
|
+
value_or_kv (44)
|
109
|
+
on right: 11 12
|
110
|
+
on left : 13 14
|
111
|
+
opt_primary (45)
|
112
|
+
on right: 13 26
|
113
|
+
on left : 27 28 29
|
114
|
+
kv (46)
|
115
|
+
on right: 14 24
|
116
|
+
on left : 26
|
117
|
+
options (47)
|
118
|
+
on right: 18 20 21
|
119
|
+
on left : 21 22
|
120
|
+
key_or_kv (48)
|
121
|
+
on right: 21 22
|
122
|
+
on left : 23 24
|
123
|
+
key (49)
|
124
|
+
on right: 23
|
125
|
+
on left : 25
|
126
|
+
proc_stmt (50)
|
127
|
+
on right: 30 31
|
128
|
+
on left : 32
|
129
|
+
optional_proc_stmt_options (51)
|
130
|
+
on right: 32
|
131
|
+
on left : 33 34
|
132
|
+
proc_stmt_options (52)
|
133
|
+
on right: 34 35
|
134
|
+
on left : 35 36
|
135
|
+
proc_primary (53)
|
136
|
+
on right: 35 36
|
137
|
+
on left : 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
138
|
+
termins (54)
|
139
|
+
on right: 56 57
|
140
|
+
on left : 57 58
|
141
|
+
|
142
|
+
**Terminals, with rules where they appear
|
143
|
+
|
144
|
+
$end (0)
|
145
|
+
error (1)
|
146
|
+
TOP_INST (2) 7
|
147
|
+
TOP_INST_END (3) 7
|
148
|
+
DATA_START (4) 8
|
149
|
+
DATA_SCRIPT (5) 8
|
150
|
+
DATA_END (6) 8
|
151
|
+
PROC_START (7) 9
|
152
|
+
PROC_INST (8) 32
|
153
|
+
PROC_END (9) 9
|
154
|
+
TERMIN (10) 2 8 9 30 57 58
|
155
|
+
IDENT (11) 8 9 16 25 26 29 37
|
156
|
+
ASSIGN (12) 26
|
157
|
+
COLON (13) 16
|
158
|
+
NUMBER (14) 27 38
|
159
|
+
STRING (15) 28 39
|
160
|
+
P_EQ (16) 40
|
161
|
+
P_MULT (17) 41
|
162
|
+
P_PLUS (18) 42
|
163
|
+
P_MINUS (19) 43
|
164
|
+
P_HAT (20) 44
|
165
|
+
P_IN (21) 45
|
166
|
+
P_PERC (22) 46
|
167
|
+
P_TILDA (23) 47
|
168
|
+
P_COLON (24) 48
|
169
|
+
P_LPAR (25) 49
|
170
|
+
P_RPAR (26) 50
|
171
|
+
P_LSQBR (27) 51
|
172
|
+
P_RSQBR (28) 52
|
173
|
+
P_COMMA (29) 53
|
174
|
+
SEP_SLASH (30) 54
|
175
|
+
|
176
|
+
--------- State ---------
|
177
|
+
|
178
|
+
state 0
|
179
|
+
|
180
|
+
|
181
|
+
TERMIN shift, and go to state 4
|
182
|
+
$default reduce using rule 55 (opt_termins)
|
183
|
+
|
184
|
+
program go to state 1
|
185
|
+
opt_termins go to state 2
|
186
|
+
termins go to state 3
|
187
|
+
|
188
|
+
state 1
|
189
|
+
|
190
|
+
|
191
|
+
$end shift, and go to state 5
|
192
|
+
|
193
|
+
|
194
|
+
state 2
|
195
|
+
|
196
|
+
1) program : opt_termins _ blocks opt_termins
|
197
|
+
|
198
|
+
TOP_INST shift, and go to state 11
|
199
|
+
DATA_START shift, and go to state 12
|
200
|
+
PROC_START shift, and go to state 13
|
201
|
+
|
202
|
+
blocks go to state 6
|
203
|
+
block go to state 7
|
204
|
+
top_stmt go to state 8
|
205
|
+
data_block go to state 9
|
206
|
+
proc_block go to state 10
|
207
|
+
|
208
|
+
state 3
|
209
|
+
|
210
|
+
56) opt_termins : termins _
|
211
|
+
57) termins : termins _ TERMIN
|
212
|
+
|
213
|
+
TERMIN shift, and go to state 14
|
214
|
+
$default reduce using rule 56 (opt_termins)
|
215
|
+
|
216
|
+
|
217
|
+
state 4
|
218
|
+
|
219
|
+
58) termins : TERMIN _
|
220
|
+
|
221
|
+
$default reduce using rule 58 (termins)
|
222
|
+
|
223
|
+
|
224
|
+
state 5
|
225
|
+
|
226
|
+
|
227
|
+
$end shift, and go to state 15
|
228
|
+
|
229
|
+
|
230
|
+
state 6
|
231
|
+
|
232
|
+
1) program : opt_termins blocks _ opt_termins
|
233
|
+
2) blocks : blocks _ TERMIN block
|
234
|
+
|
235
|
+
TERMIN shift, and go to state 17
|
236
|
+
$default reduce using rule 55 (opt_termins)
|
237
|
+
|
238
|
+
opt_termins go to state 16
|
239
|
+
termins go to state 3
|
240
|
+
|
241
|
+
state 7
|
242
|
+
|
243
|
+
3) blocks : block _
|
244
|
+
|
245
|
+
$default reduce using rule 3 (blocks)
|
246
|
+
|
247
|
+
|
248
|
+
state 8
|
249
|
+
|
250
|
+
4) block : top_stmt _
|
251
|
+
|
252
|
+
$default reduce using rule 4 (block)
|
253
|
+
|
254
|
+
|
255
|
+
state 9
|
256
|
+
|
257
|
+
5) block : data_block _
|
258
|
+
|
259
|
+
$default reduce using rule 5 (block)
|
260
|
+
|
261
|
+
|
262
|
+
state 10
|
263
|
+
|
264
|
+
6) block : proc_block _
|
265
|
+
|
266
|
+
$default reduce using rule 6 (block)
|
267
|
+
|
268
|
+
|
269
|
+
state 11
|
270
|
+
|
271
|
+
7) top_stmt : TOP_INST _ top_options TOP_INST_END
|
272
|
+
|
273
|
+
IDENT shift, and go to state 22
|
274
|
+
IDENT [reduce using rule 10 (top_options)]
|
275
|
+
NUMBER shift, and go to state 23
|
276
|
+
NUMBER [reduce using rule 10 (top_options)]
|
277
|
+
STRING shift, and go to state 24
|
278
|
+
STRING [reduce using rule 10 (top_options)]
|
279
|
+
$default reduce using rule 10 (top_options)
|
280
|
+
|
281
|
+
top_options go to state 18
|
282
|
+
value_or_kv go to state 19
|
283
|
+
opt_primary go to state 20
|
284
|
+
kv go to state 21
|
285
|
+
|
286
|
+
state 12
|
287
|
+
|
288
|
+
8) data_block : DATA_START _ data_engine_option IDENT data_options TERMIN DATA_SCRIPT DATA_END
|
289
|
+
|
290
|
+
COLON shift, and go to state 26
|
291
|
+
$default reduce using rule 15 (data_engine_option)
|
292
|
+
|
293
|
+
data_engine_option go to state 25
|
294
|
+
|
295
|
+
state 13
|
296
|
+
|
297
|
+
9) proc_block : PROC_START _ IDENT proc_options TERMIN proc_stmts TERMIN PROC_END
|
298
|
+
|
299
|
+
IDENT shift, and go to state 27
|
300
|
+
|
301
|
+
|
302
|
+
state 14
|
303
|
+
|
304
|
+
57) termins : termins TERMIN _
|
305
|
+
|
306
|
+
$default reduce using rule 57 (termins)
|
307
|
+
|
308
|
+
|
309
|
+
state 15
|
310
|
+
|
311
|
+
|
312
|
+
$default accept
|
313
|
+
|
314
|
+
|
315
|
+
state 16
|
316
|
+
|
317
|
+
1) program : opt_termins blocks opt_termins _
|
318
|
+
|
319
|
+
$default reduce using rule 1 (program)
|
320
|
+
|
321
|
+
|
322
|
+
state 17
|
323
|
+
|
324
|
+
2) blocks : blocks TERMIN _ block
|
325
|
+
58) termins : TERMIN _
|
326
|
+
|
327
|
+
TOP_INST shift, and go to state 11
|
328
|
+
DATA_START shift, and go to state 12
|
329
|
+
PROC_START shift, and go to state 13
|
330
|
+
$default reduce using rule 58 (termins)
|
331
|
+
|
332
|
+
block go to state 28
|
333
|
+
top_stmt go to state 8
|
334
|
+
data_block go to state 9
|
335
|
+
proc_block go to state 10
|
336
|
+
|
337
|
+
state 18
|
338
|
+
|
339
|
+
7) top_stmt : TOP_INST top_options _ TOP_INST_END
|
340
|
+
12) top_options : top_options _ value_or_kv
|
341
|
+
|
342
|
+
TOP_INST_END shift, and go to state 29
|
343
|
+
IDENT shift, and go to state 22
|
344
|
+
NUMBER shift, and go to state 23
|
345
|
+
STRING shift, and go to state 24
|
346
|
+
|
347
|
+
value_or_kv go to state 30
|
348
|
+
opt_primary go to state 20
|
349
|
+
kv go to state 21
|
350
|
+
|
351
|
+
state 19
|
352
|
+
|
353
|
+
11) top_options : value_or_kv _
|
354
|
+
|
355
|
+
$default reduce using rule 11 (top_options)
|
356
|
+
|
357
|
+
|
358
|
+
state 20
|
359
|
+
|
360
|
+
13) value_or_kv : opt_primary _
|
361
|
+
|
362
|
+
$default reduce using rule 13 (value_or_kv)
|
363
|
+
|
364
|
+
|
365
|
+
state 21
|
366
|
+
|
367
|
+
14) value_or_kv : kv _
|
368
|
+
|
369
|
+
$default reduce using rule 14 (value_or_kv)
|
370
|
+
|
371
|
+
|
372
|
+
state 22
|
373
|
+
|
374
|
+
26) kv : IDENT _ ASSIGN opt_primary
|
375
|
+
29) opt_primary : IDENT _
|
376
|
+
|
377
|
+
ASSIGN shift, and go to state 31
|
378
|
+
$default reduce using rule 29 (opt_primary)
|
379
|
+
|
380
|
+
|
381
|
+
state 23
|
382
|
+
|
383
|
+
27) opt_primary : NUMBER _
|
384
|
+
|
385
|
+
$default reduce using rule 27 (opt_primary)
|
386
|
+
|
387
|
+
|
388
|
+
state 24
|
389
|
+
|
390
|
+
28) opt_primary : STRING _
|
391
|
+
|
392
|
+
$default reduce using rule 28 (opt_primary)
|
393
|
+
|
394
|
+
|
395
|
+
state 25
|
396
|
+
|
397
|
+
8) data_block : DATA_START data_engine_option _ IDENT data_options TERMIN DATA_SCRIPT DATA_END
|
398
|
+
|
399
|
+
IDENT shift, and go to state 32
|
400
|
+
|
401
|
+
|
402
|
+
state 26
|
403
|
+
|
404
|
+
16) data_engine_option : COLON _ IDENT
|
405
|
+
|
406
|
+
IDENT shift, and go to state 33
|
407
|
+
|
408
|
+
|
409
|
+
state 27
|
410
|
+
|
411
|
+
9) proc_block : PROC_START IDENT _ proc_options TERMIN proc_stmts TERMIN PROC_END
|
412
|
+
|
413
|
+
IDENT shift, and go to state 39
|
414
|
+
$default reduce using rule 19 (proc_options)
|
415
|
+
|
416
|
+
proc_options go to state 34
|
417
|
+
options go to state 35
|
418
|
+
key_or_kv go to state 36
|
419
|
+
key go to state 37
|
420
|
+
kv go to state 38
|
421
|
+
|
422
|
+
state 28
|
423
|
+
|
424
|
+
2) blocks : blocks TERMIN block _
|
425
|
+
|
426
|
+
$default reduce using rule 2 (blocks)
|
427
|
+
|
428
|
+
|
429
|
+
state 29
|
430
|
+
|
431
|
+
7) top_stmt : TOP_INST top_options TOP_INST_END _
|
432
|
+
|
433
|
+
$default reduce using rule 7 (top_stmt)
|
434
|
+
|
435
|
+
|
436
|
+
state 30
|
437
|
+
|
438
|
+
12) top_options : top_options value_or_kv _
|
439
|
+
|
440
|
+
$default reduce using rule 12 (top_options)
|
441
|
+
|
442
|
+
|
443
|
+
state 31
|
444
|
+
|
445
|
+
26) kv : IDENT ASSIGN _ opt_primary
|
446
|
+
|
447
|
+
IDENT shift, and go to state 41
|
448
|
+
NUMBER shift, and go to state 23
|
449
|
+
STRING shift, and go to state 24
|
450
|
+
|
451
|
+
opt_primary go to state 40
|
452
|
+
|
453
|
+
state 32
|
454
|
+
|
455
|
+
8) data_block : DATA_START data_engine_option IDENT _ data_options TERMIN DATA_SCRIPT DATA_END
|
456
|
+
|
457
|
+
IDENT shift, and go to state 39
|
458
|
+
$default reduce using rule 17 (data_options)
|
459
|
+
|
460
|
+
data_options go to state 42
|
461
|
+
options go to state 43
|
462
|
+
key_or_kv go to state 36
|
463
|
+
key go to state 37
|
464
|
+
kv go to state 38
|
465
|
+
|
466
|
+
state 33
|
467
|
+
|
468
|
+
16) data_engine_option : COLON IDENT _
|
469
|
+
|
470
|
+
$default reduce using rule 16 (data_engine_option)
|
471
|
+
|
472
|
+
|
473
|
+
state 34
|
474
|
+
|
475
|
+
9) proc_block : PROC_START IDENT proc_options _ TERMIN proc_stmts TERMIN PROC_END
|
476
|
+
|
477
|
+
TERMIN shift, and go to state 44
|
478
|
+
|
479
|
+
|
480
|
+
state 35
|
481
|
+
|
482
|
+
20) proc_options : options _
|
483
|
+
21) options : options _ key_or_kv
|
484
|
+
|
485
|
+
IDENT shift, and go to state 39
|
486
|
+
$default reduce using rule 20 (proc_options)
|
487
|
+
|
488
|
+
key_or_kv go to state 45
|
489
|
+
key go to state 37
|
490
|
+
kv go to state 38
|
491
|
+
|
492
|
+
state 36
|
493
|
+
|
494
|
+
22) options : key_or_kv _
|
495
|
+
|
496
|
+
$default reduce using rule 22 (options)
|
497
|
+
|
498
|
+
|
499
|
+
state 37
|
500
|
+
|
501
|
+
23) key_or_kv : key _
|
502
|
+
|
503
|
+
$default reduce using rule 23 (key_or_kv)
|
504
|
+
|
505
|
+
|
506
|
+
state 38
|
507
|
+
|
508
|
+
24) key_or_kv : kv _
|
509
|
+
|
510
|
+
$default reduce using rule 24 (key_or_kv)
|
511
|
+
|
512
|
+
|
513
|
+
state 39
|
514
|
+
|
515
|
+
25) key : IDENT _
|
516
|
+
26) kv : IDENT _ ASSIGN opt_primary
|
517
|
+
|
518
|
+
ASSIGN shift, and go to state 31
|
519
|
+
$default reduce using rule 25 (key)
|
520
|
+
|
521
|
+
|
522
|
+
state 40
|
523
|
+
|
524
|
+
26) kv : IDENT ASSIGN opt_primary _
|
525
|
+
|
526
|
+
$default reduce using rule 26 (kv)
|
527
|
+
|
528
|
+
|
529
|
+
state 41
|
530
|
+
|
531
|
+
29) opt_primary : IDENT _
|
532
|
+
|
533
|
+
$default reduce using rule 29 (opt_primary)
|
534
|
+
|
535
|
+
|
536
|
+
state 42
|
537
|
+
|
538
|
+
8) data_block : DATA_START data_engine_option IDENT data_options _ TERMIN DATA_SCRIPT DATA_END
|
539
|
+
|
540
|
+
TERMIN shift, and go to state 46
|
541
|
+
|
542
|
+
|
543
|
+
state 43
|
544
|
+
|
545
|
+
18) data_options : options _
|
546
|
+
21) options : options _ key_or_kv
|
547
|
+
|
548
|
+
IDENT shift, and go to state 39
|
549
|
+
$default reduce using rule 18 (data_options)
|
550
|
+
|
551
|
+
key_or_kv go to state 45
|
552
|
+
key go to state 37
|
553
|
+
kv go to state 38
|
554
|
+
|
555
|
+
state 44
|
556
|
+
|
557
|
+
9) proc_block : PROC_START IDENT proc_options TERMIN _ proc_stmts TERMIN PROC_END
|
558
|
+
|
559
|
+
PROC_INST shift, and go to state 49
|
560
|
+
|
561
|
+
proc_stmts go to state 47
|
562
|
+
proc_stmt go to state 48
|
563
|
+
|
564
|
+
state 45
|
565
|
+
|
566
|
+
21) options : options key_or_kv _
|
567
|
+
|
568
|
+
$default reduce using rule 21 (options)
|
569
|
+
|
570
|
+
|
571
|
+
state 46
|
572
|
+
|
573
|
+
8) data_block : DATA_START data_engine_option IDENT data_options TERMIN _ DATA_SCRIPT DATA_END
|
574
|
+
|
575
|
+
DATA_SCRIPT shift, and go to state 50
|
576
|
+
|
577
|
+
|
578
|
+
state 47
|
579
|
+
|
580
|
+
9) proc_block : PROC_START IDENT proc_options TERMIN proc_stmts _ TERMIN PROC_END
|
581
|
+
30) proc_stmts : proc_stmts _ TERMIN proc_stmt
|
582
|
+
|
583
|
+
TERMIN shift, and go to state 51
|
584
|
+
|
585
|
+
|
586
|
+
state 48
|
587
|
+
|
588
|
+
31) proc_stmts : proc_stmt _
|
589
|
+
|
590
|
+
$default reduce using rule 31 (proc_stmts)
|
591
|
+
|
592
|
+
|
593
|
+
state 49
|
594
|
+
|
595
|
+
32) proc_stmt : PROC_INST _ optional_proc_stmt_options
|
596
|
+
|
597
|
+
IDENT shift, and go to state 55
|
598
|
+
NUMBER shift, and go to state 56
|
599
|
+
STRING shift, and go to state 57
|
600
|
+
P_EQ shift, and go to state 58
|
601
|
+
P_MULT shift, and go to state 59
|
602
|
+
P_PLUS shift, and go to state 60
|
603
|
+
P_MINUS shift, and go to state 61
|
604
|
+
P_HAT shift, and go to state 62
|
605
|
+
P_IN shift, and go to state 63
|
606
|
+
P_PERC shift, and go to state 64
|
607
|
+
P_TILDA shift, and go to state 65
|
608
|
+
P_COLON shift, and go to state 66
|
609
|
+
P_LPAR shift, and go to state 67
|
610
|
+
P_RPAR shift, and go to state 68
|
611
|
+
P_LSQBR shift, and go to state 69
|
612
|
+
P_RSQBR shift, and go to state 70
|
613
|
+
P_COMMA shift, and go to state 71
|
614
|
+
SEP_SLASH shift, and go to state 72
|
615
|
+
$default reduce using rule 33 (optional_proc_stmt_options)
|
616
|
+
|
617
|
+
optional_proc_stmt_options go to state 52
|
618
|
+
proc_stmt_options go to state 53
|
619
|
+
proc_primary go to state 54
|
620
|
+
|
621
|
+
state 50
|
622
|
+
|
623
|
+
8) data_block : DATA_START data_engine_option IDENT data_options TERMIN DATA_SCRIPT _ DATA_END
|
624
|
+
|
625
|
+
DATA_END shift, and go to state 73
|
626
|
+
|
627
|
+
|
628
|
+
state 51
|
629
|
+
|
630
|
+
9) proc_block : PROC_START IDENT proc_options TERMIN proc_stmts TERMIN _ PROC_END
|
631
|
+
30) proc_stmts : proc_stmts TERMIN _ proc_stmt
|
632
|
+
|
633
|
+
PROC_INST shift, and go to state 49
|
634
|
+
PROC_END shift, and go to state 74
|
635
|
+
|
636
|
+
proc_stmt go to state 75
|
637
|
+
|
638
|
+
state 52
|
639
|
+
|
640
|
+
32) proc_stmt : PROC_INST optional_proc_stmt_options _
|
641
|
+
|
642
|
+
$default reduce using rule 32 (proc_stmt)
|
643
|
+
|
644
|
+
|
645
|
+
state 53
|
646
|
+
|
647
|
+
34) optional_proc_stmt_options : proc_stmt_options _
|
648
|
+
35) proc_stmt_options : proc_stmt_options _ proc_primary
|
649
|
+
|
650
|
+
IDENT shift, and go to state 55
|
651
|
+
NUMBER shift, and go to state 56
|
652
|
+
STRING shift, and go to state 57
|
653
|
+
P_EQ shift, and go to state 58
|
654
|
+
P_MULT shift, and go to state 59
|
655
|
+
P_PLUS shift, and go to state 60
|
656
|
+
P_MINUS shift, and go to state 61
|
657
|
+
P_HAT shift, and go to state 62
|
658
|
+
P_IN shift, and go to state 63
|
659
|
+
P_PERC shift, and go to state 64
|
660
|
+
P_TILDA shift, and go to state 65
|
661
|
+
P_COLON shift, and go to state 66
|
662
|
+
P_LPAR shift, and go to state 67
|
663
|
+
P_RPAR shift, and go to state 68
|
664
|
+
P_LSQBR shift, and go to state 69
|
665
|
+
P_RSQBR shift, and go to state 70
|
666
|
+
P_COMMA shift, and go to state 71
|
667
|
+
SEP_SLASH shift, and go to state 72
|
668
|
+
$default reduce using rule 34 (optional_proc_stmt_options)
|
669
|
+
|
670
|
+
proc_primary go to state 76
|
671
|
+
|
672
|
+
state 54
|
673
|
+
|
674
|
+
36) proc_stmt_options : proc_primary _
|
675
|
+
|
676
|
+
$default reduce using rule 36 (proc_stmt_options)
|
677
|
+
|
678
|
+
|
679
|
+
state 55
|
680
|
+
|
681
|
+
37) proc_primary : IDENT _
|
682
|
+
|
683
|
+
$default reduce using rule 37 (proc_primary)
|
684
|
+
|
685
|
+
|
686
|
+
state 56
|
687
|
+
|
688
|
+
38) proc_primary : NUMBER _
|
689
|
+
|
690
|
+
$default reduce using rule 38 (proc_primary)
|
691
|
+
|
692
|
+
|
693
|
+
state 57
|
694
|
+
|
695
|
+
39) proc_primary : STRING _
|
696
|
+
|
697
|
+
$default reduce using rule 39 (proc_primary)
|
698
|
+
|
699
|
+
|
700
|
+
state 58
|
701
|
+
|
702
|
+
40) proc_primary : P_EQ _
|
703
|
+
|
704
|
+
$default reduce using rule 40 (proc_primary)
|
705
|
+
|
706
|
+
|
707
|
+
state 59
|
708
|
+
|
709
|
+
41) proc_primary : P_MULT _
|
710
|
+
|
711
|
+
$default reduce using rule 41 (proc_primary)
|
712
|
+
|
713
|
+
|
714
|
+
state 60
|
715
|
+
|
716
|
+
42) proc_primary : P_PLUS _
|
717
|
+
|
718
|
+
$default reduce using rule 42 (proc_primary)
|
719
|
+
|
720
|
+
|
721
|
+
state 61
|
722
|
+
|
723
|
+
43) proc_primary : P_MINUS _
|
724
|
+
|
725
|
+
$default reduce using rule 43 (proc_primary)
|
726
|
+
|
727
|
+
|
728
|
+
state 62
|
729
|
+
|
730
|
+
44) proc_primary : P_HAT _
|
731
|
+
|
732
|
+
$default reduce using rule 44 (proc_primary)
|
733
|
+
|
734
|
+
|
735
|
+
state 63
|
736
|
+
|
737
|
+
45) proc_primary : P_IN _
|
738
|
+
|
739
|
+
$default reduce using rule 45 (proc_primary)
|
740
|
+
|
741
|
+
|
742
|
+
state 64
|
743
|
+
|
744
|
+
46) proc_primary : P_PERC _
|
745
|
+
|
746
|
+
$default reduce using rule 46 (proc_primary)
|
747
|
+
|
748
|
+
|
749
|
+
state 65
|
750
|
+
|
751
|
+
47) proc_primary : P_TILDA _
|
752
|
+
|
753
|
+
$default reduce using rule 47 (proc_primary)
|
754
|
+
|
755
|
+
|
756
|
+
state 66
|
757
|
+
|
758
|
+
48) proc_primary : P_COLON _
|
759
|
+
|
760
|
+
$default reduce using rule 48 (proc_primary)
|
761
|
+
|
762
|
+
|
763
|
+
state 67
|
764
|
+
|
765
|
+
49) proc_primary : P_LPAR _
|
766
|
+
|
767
|
+
$default reduce using rule 49 (proc_primary)
|
768
|
+
|
769
|
+
|
770
|
+
state 68
|
771
|
+
|
772
|
+
50) proc_primary : P_RPAR _
|
773
|
+
|
774
|
+
$default reduce using rule 50 (proc_primary)
|
775
|
+
|
776
|
+
|
777
|
+
state 69
|
778
|
+
|
779
|
+
51) proc_primary : P_LSQBR _
|
780
|
+
|
781
|
+
$default reduce using rule 51 (proc_primary)
|
782
|
+
|
783
|
+
|
784
|
+
state 70
|
785
|
+
|
786
|
+
52) proc_primary : P_RSQBR _
|
787
|
+
|
788
|
+
$default reduce using rule 52 (proc_primary)
|
789
|
+
|
790
|
+
|
791
|
+
state 71
|
792
|
+
|
793
|
+
53) proc_primary : P_COMMA _
|
794
|
+
|
795
|
+
$default reduce using rule 53 (proc_primary)
|
796
|
+
|
797
|
+
|
798
|
+
state 72
|
799
|
+
|
800
|
+
54) proc_primary : SEP_SLASH _
|
801
|
+
|
802
|
+
$default reduce using rule 54 (proc_primary)
|
803
|
+
|
804
|
+
|
805
|
+
state 73
|
806
|
+
|
807
|
+
8) data_block : DATA_START data_engine_option IDENT data_options TERMIN DATA_SCRIPT DATA_END _
|
808
|
+
|
809
|
+
$default reduce using rule 8 (data_block)
|
810
|
+
|
811
|
+
|
812
|
+
state 74
|
813
|
+
|
814
|
+
9) proc_block : PROC_START IDENT proc_options TERMIN proc_stmts TERMIN PROC_END _
|
815
|
+
|
816
|
+
$default reduce using rule 9 (proc_block)
|
817
|
+
|
818
|
+
|
819
|
+
state 75
|
820
|
+
|
821
|
+
30) proc_stmts : proc_stmts TERMIN proc_stmt _
|
822
|
+
|
823
|
+
$default reduce using rule 30 (proc_stmts)
|
824
|
+
|
825
|
+
|
826
|
+
state 76
|
827
|
+
|
828
|
+
35) proc_stmt_options : proc_stmt_options proc_primary _
|
829
|
+
|
830
|
+
$default reduce using rule 35 (proc_stmt_options)
|
831
|
+
|