adsl 0.0.2

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.
@@ -0,0 +1,151 @@
1
+ class ADSLParser
2
+ prechigh
3
+ left '==' '!='
4
+ noassoc NOT
5
+ left '<=>'
6
+ left '<=' '=>'
7
+ left and or
8
+ preclow
9
+ token class extends inverseof action foreach either or create delete subset oneof dotall invariant forall exists in empty true false not and equal equiv implies IDENT
10
+ start adslspec
11
+ rule
12
+ adslspec: root_elems { return ADSLSpec.new :lineno => lineno, :classes => val[0][0], :actions => val[0][1], :invariants => val[0][2] }
13
+
14
+ root_elems: class_decl root_elems { val[1][0].unshift val[0]; return val[1] }
15
+ | action_decl root_elems { val[1][1].unshift val[0]; return val[1] }
16
+ | invariant_decl root_elems { val[1][2].unshift val[0]; return val[1] }
17
+ | { return [[], [], []] }
18
+
19
+ class_decl: class IDENT '{' rel_decls '}'
20
+ { return ADSLClass.new :lineno => val[0], :name => val[1], :relations => val[3] }
21
+ | class IDENT extends IDENT '{' rel_decls '}'
22
+ { return ADSLClass.new :lineno => val[0], :name => val[1], :parent_name => val[3], :relations => val[5] }
23
+
24
+ rel_decls: rel_decls rel_decl { val[0] << val[1]; return val[0] }
25
+ | { return [] }
26
+
27
+ rel_decl: cardinality IDENT IDENT inverse_suffix { return ADSLRelation.new :lineno => val[0][2], :cardinality => val[0].first(2), :to_class_name => val[1], :name => val[2], :inverse_of_name => val[3] }
28
+
29
+ cardinality: card_number { return [val[0][0], val[0][0], val[0][1]] }
30
+ | card_number '..' card_number { return [val[0][0], val[2][0], val[0][1]] }
31
+ | card_number '+' { return [val[0][0], 1.0/0.0, val[0][1]] }
32
+
33
+ card_number: '0' { return [0, lineno] }
34
+ | '1' { return [1, lineno] }
35
+
36
+ inverse_suffix: inverseof IDENT { return val[1] }
37
+ | { return nil }
38
+
39
+ action_decl: action IDENT '(' action_args ')' block { return ADSLAction.new(:lineno => val[0], :name => val[1], :arg_cardinalities => val[3][0], :arg_types => val[3][1], :arg_names => val[3][2], :block => val[5]) }
40
+
41
+ action_args: additional_args cardinality IDENT IDENT { val[0][0] << val[1]; val[0][1] << val[2]; val[0][2] << val[3]; return val[0] }
42
+ | { return [[], [], []] }
43
+
44
+ additional_args: additional_args cardinality IDENT IDENT ',' { val[0][0] << val[1]; val[0][1] << val[2]; val[0][2] << val[3]; return val[0] }
45
+ | { return [[], [], []] }
46
+
47
+ block: '{' statements '}' { return ADSLBlock.new :lineno => val[0], :statements => val[1] }
48
+
49
+ statements: statement statements { val[1].unshift val[0]; return val[1] }
50
+ | { return [] }
51
+
52
+ statement: IDENT '=' assignmentrhs { val[2].var_name = val[0]; return val[2] }
53
+ | create IDENT { return ADSLCreateObj.new :lineno => val[0], :class_name => val[1] }
54
+ | delete objset { return ADSLDeleteObj.new :lineno => val[0], :objset => val[1] }
55
+ | objset '.' IDENT '+=' objset { return ADSLCreateTup.new :lineno => val[0].lineno, :objset1 => val[0], :rel_name => val[2], :objset2 => val[4] }
56
+ | objset '.' IDENT '-=' objset { return ADSLDeleteTup.new :lineno => val[0].lineno, :objset1 => val[0], :rel_name => val[2], :objset2 => val[4] }
57
+ | foreach IDENT ':' objset block { return ADSLForEach.new :lineno => val[0], :var_name => val[1], :objset => val[3], :block => val[4] }
58
+ | either block or eitherblocks { val[3].unshift val[1]; return ADSLEither.new :lineno => val[0], :blocks => val[3] }
59
+
60
+ assignmentrhs: create IDENT { return ADSLCreateObj.new :lineno => val[0], :class_name => val[1] }
61
+ | objset { return ADSLAssignment.new :lineno => val[0].lineno, :objset => val[0] }
62
+
63
+ eitherblocks: eitherblocks or block { val[0] << val[2]; return val[0] }
64
+ | block { return [val[0]] }
65
+
66
+ objset: IDENT { return ADSLVariable.new :lineno => val[0].lineno, :var_name => val[0] }
67
+ | subset '(' objset ')' { return ADSLSubset.new :lineno => val[0], :objset => val[2] }
68
+ | oneof '(' objset ')' { return ADSLOneOf.new :lineno => val[0], :objset => val[2] }
69
+ | IDENT dotall { return ADSLAllOf.new :lineno => val[0].lineno, :class_name => val[0] }
70
+ | objset '.' IDENT { return ADSLDereference.new :lineno => val[0].lineno, :objset => val[0], :rel_name => val[2] }
71
+
72
+ invariant_objset: IDENT { return ADSLVariable.new :lineno => val[0].lineno, :var_name => val[0] }
73
+ | subset '(' objset ')' { return ADSLSubset.new :lineno => val[0], :objset => val[2] }
74
+ | IDENT dotall { return ADSLAllOf.new :lineno => val[0].lineno, :class_name => val[0] }
75
+ | objset '.' IDENT { return ADSLDereference.new :lineno => val[0].lineno, :objset => val[0], :rel_name => val[2] }
76
+
77
+ invariant_decl: invariant formula { return ADSLInvariant.new :lineno => val[0], :name => nil, :formula => val[1] }
78
+ | invariant IDENT ':' formula { return ADSLInvariant.new :lineno => val[0], :name => val[1], :formula => val[3] }
79
+
80
+ formula: forall '(' quantifier_parameters_with_commas ':' formula ')'
81
+ { return ADSLForAll.new :lineno => val[0], :vars => val[2], :subformula => val[4] }
82
+ | exists '(' quantifier_parameters_with_commas optional_formula ')'
83
+ { return ADSLExists.new :lineno => val[0], :vars => val[2], :subformula => val[3] }
84
+ | not formula
85
+ { return ADSLNot.new :lineno => val[0], :subformula => val[1] } =NOT
86
+ | formula and formula
87
+ { return ADSLAnd.new :lineno => val[0].lineno, :subformulae => [val[0], val[2]] }
88
+ | formula or formula
89
+ { return ADSLOr.new :lineno => val[0].lineno, :subformulae => [val[0], val[2]] }
90
+ | formula '<=>' formula
91
+ { return ADSLEquiv.new :lineno => val[0].lineno, :subformulae => [val[0], val[2]] }
92
+ | formula '=>' formula
93
+ { return ADSLImplies.new :lineno => val[0].lineno, :subformula1 => val[0], :subformula2 => val[2] }
94
+ | formula '<=' formula
95
+ { return ADSLImplies.new :lineno => val[0].lineno, :subformula1 => val[2], :subformula2 => val[0] }
96
+ | '(' formula ')' { return val[1] }
97
+ | equiv '(' formula ',' formula additional_formulae ')'
98
+ { return ADSLEquiv.new :lineno => val[0], :subformulae => [val[2], val[4]] + val[5] }
99
+ | implies '(' formula ',' formula ')'
100
+ { return ADSLImplies.new :lineno => val[0], :subformula1 => val[2], :subformula2 => val[4] }
101
+ | invariant_objset '==' invariant_objset
102
+ { return ADSLEqual.new :lineno => val[0].lineno, :objsets => [val[0], val[2]] }
103
+ | invariant_objset '!=' invariant_objset
104
+ { return ADSLNot.new(:lineno => val[0].lineno, :subformula => ADSLEqual.new(:lineno => val[0].lineno, :objsets => [val[0], val[2]])) }
105
+ | equal '(' invariant_objset ',' invariant_objset additional_invariant_objsets ')'
106
+ { return ADSLEqual.new :lineno => val[0], :objsets => [val[2], val[4]] + val[5] }
107
+ | invariant_objset in invariant_objset { return ADSLIn.new :lineno => val[0].lineno, :objset1 => val[0], :objset2 => val[2] }
108
+ | true { return ADSLBoolean.new :lineno => val[0], :bool_value => true }
109
+ | false { return ADSLBoolean.new :lineno => val[0], :bool_value => false }
110
+ | empty '(' invariant_objset ')' { return ADSLEmpty.new :lineno => val[0], :objset => val[2] }
111
+
112
+ quantifier_parameters_with_commas: quantifier_parameters_with_commas ',' quantifier_parameter
113
+ { val[0] << val[2]; return val[0] }
114
+ | quantifier_parameter { return [val[0]] }
115
+
116
+ quantifier_parameter: IDENT IDENT { return [val[1], ADSLAllOf.new(:lineno => val[0].lineno, :class_name => val[0]), val[0].lineno] }
117
+ | IDENT in objset { return [val[0], val[2], val[0].lineno] }
118
+
119
+ optional_formula: ':' formula { return val[1] }
120
+ | { return nil }
121
+
122
+ additional_formulae: additional_formulae ',' formula { val[0] << val[2]; return val[0] }
123
+ | { return [] }
124
+
125
+ additional_invariant_objsets: additional_invariant_objsets ',' invariant_objset { val[0] << val[2]; return val[0] }
126
+ | { return [] }
127
+
128
+ end
129
+
130
+ ---- header
131
+
132
+ require 'parser/adsl_parser.rex'
133
+ require 'fol/first_order_logic'
134
+
135
+ module ADSL
136
+
137
+ ---- inner
138
+
139
+ # generated by racc
140
+ def generate_ast(str)
141
+ scan_evaluate str
142
+ do_parse
143
+ end
144
+
145
+ def parse(str)
146
+ generate_ast(str).typecheck_and_resolve
147
+ end
148
+
149
+ ---- footer
150
+
151
+ end
@@ -0,0 +1,48 @@
1
+ require 'parser/adsl_ast'
2
+
3
+ class ADSL::ADSLParser
4
+ macro
5
+ rule
6
+ \/\/[^\n\z]* # comment, no action
7
+ \#[^\n\z]* # comment, no action
8
+ \/\*(?:[^\*]*(?:\*+[^\/]+)?)*\*\/ # comment, no action
9
+ class\b { [:class, lineno] }
10
+ extends\b { [:extends, lineno] }
11
+ inverseof\b { [:inverseof, lineno] }
12
+ create\b { [:create, lineno] }
13
+ delete\b { [:delete, lineno] }
14
+ foreach\b { [:foreach, lineno] }
15
+ either\b { [:either, lineno] }
16
+ action\b { [:action, lineno] }
17
+ or\b { [:or, lineno] }
18
+ subset\b { [:subset, lineno] }
19
+ oneof\b { [:oneof, lineno] }
20
+ \.\s*all\b { [:dotall, lineno] }
21
+ forall\b { [:forall, lineno] }
22
+ exists\b { [:exists, lineno] }
23
+ in\b { [:in, lineno] }
24
+ invariant\b { [:invariant, lineno] }
25
+ true\b { [:true, lineno] }
26
+ false\b { [:false, lineno] }
27
+ != { [text, lineno] }
28
+ !|not\b { [:not, lineno] }
29
+ and\b { [:and, lineno] }
30
+ equal\b { [:equal, lineno] }
31
+ equiv\b { [:equiv, lineno] }
32
+ empty\b { [:empty, lineno] }
33
+ implies\b { [:implies, lineno] }
34
+ \.\. { [text, lineno] }
35
+ [{}:\(\)\.,] { [text, lineno] }
36
+ \+= { [text, lineno] }
37
+ \-= { [text, lineno] }
38
+ == { [text, lineno] }
39
+ <=> { [text, lineno] }
40
+ <= { [text, lineno] }
41
+ => { [text, lineno] }
42
+ = { [text, lineno] }
43
+ \+ { [text, lineno] }
44
+ [01] { [text, lineno] }
45
+ \w+ { [:IDENT, ADSLIdent.new(:lineno => lineno, :text => text)] }
46
+ \s # blank, no action
47
+ . { [:unknown_symbol, [text, lineno]] }
48
+ end
@@ -0,0 +1,196 @@
1
+ #--
2
+ # DO NOT MODIFY!!!!
3
+ # This file is automatically generated by rex 1.0.2
4
+ # from lexical definition file "./lib/parser/adsl_parser.rex".
5
+ #++
6
+
7
+ require 'racc/parser'
8
+ require 'parser/adsl_ast'
9
+
10
+ module ADSL
11
+ class ADSLParser < Racc::Parser
12
+ require 'strscan'
13
+
14
+ class ScanError < StandardError ; end
15
+
16
+ attr_reader :lineno
17
+ attr_reader :filename
18
+
19
+ def scan_setup ; end
20
+
21
+ def action &block
22
+ yield
23
+ end
24
+
25
+ def scan_str( str )
26
+ scan_evaluate str
27
+ do_parse
28
+ end
29
+
30
+ def load_file( filename )
31
+ @filename = filename
32
+ open(filename, "r") do |f|
33
+ scan_evaluate f.read
34
+ end
35
+ end
36
+
37
+ def scan_file( filename )
38
+ load_file filename
39
+ do_parse
40
+ end
41
+
42
+ def next_token
43
+ @rex_tokens.shift
44
+ end
45
+
46
+ def scan_evaluate( str )
47
+ scan_setup
48
+ @rex_tokens = []
49
+ @lineno = 1
50
+ ss = StringScanner.new(str)
51
+ state = nil
52
+ until ss.eos?
53
+ text = ss.peek(1)
54
+ @lineno += 1 if text == "\n"
55
+ case state
56
+ when nil
57
+ case
58
+ when (text = ss.scan(/\/\/[^\n\z]*/))
59
+ ;
60
+
61
+ when (text = ss.scan(/\#[^\n\z]*/))
62
+ ;
63
+
64
+ when (text = ss.scan(/\/\*(?:[^\*]*(?:\*+[^\/]+)?)*\*\//))
65
+ ;
66
+
67
+ when (text = ss.scan(/class\b/))
68
+ @rex_tokens.push action { [:class, lineno] }
69
+
70
+ when (text = ss.scan(/extends\b/))
71
+ @rex_tokens.push action { [:extends, lineno] }
72
+
73
+ when (text = ss.scan(/inverseof\b/))
74
+ @rex_tokens.push action { [:inverseof, lineno] }
75
+
76
+ when (text = ss.scan(/create\b/))
77
+ @rex_tokens.push action { [:create, lineno] }
78
+
79
+ when (text = ss.scan(/delete\b/))
80
+ @rex_tokens.push action { [:delete, lineno] }
81
+
82
+ when (text = ss.scan(/foreach\b/))
83
+ @rex_tokens.push action { [:foreach, lineno] }
84
+
85
+ when (text = ss.scan(/either\b/))
86
+ @rex_tokens.push action { [:either, lineno] }
87
+
88
+ when (text = ss.scan(/action\b/))
89
+ @rex_tokens.push action { [:action, lineno] }
90
+
91
+ when (text = ss.scan(/or\b/))
92
+ @rex_tokens.push action { [:or, lineno] }
93
+
94
+ when (text = ss.scan(/subset\b/))
95
+ @rex_tokens.push action { [:subset, lineno] }
96
+
97
+ when (text = ss.scan(/oneof\b/))
98
+ @rex_tokens.push action { [:oneof, lineno] }
99
+
100
+ when (text = ss.scan(/\.\s*all\b/))
101
+ @rex_tokens.push action { [:dotall, lineno] }
102
+
103
+ when (text = ss.scan(/forall\b/))
104
+ @rex_tokens.push action { [:forall, lineno] }
105
+
106
+ when (text = ss.scan(/exists\b/))
107
+ @rex_tokens.push action { [:exists, lineno] }
108
+
109
+ when (text = ss.scan(/in\b/))
110
+ @rex_tokens.push action { [:in, lineno] }
111
+
112
+ when (text = ss.scan(/invariant\b/))
113
+ @rex_tokens.push action { [:invariant, lineno] }
114
+
115
+ when (text = ss.scan(/true\b/))
116
+ @rex_tokens.push action { [:true, lineno] }
117
+
118
+ when (text = ss.scan(/false\b/))
119
+ @rex_tokens.push action { [:false, lineno] }
120
+
121
+ when (text = ss.scan(/!=/))
122
+ @rex_tokens.push action { [text, lineno] }
123
+
124
+ when (text = ss.scan(/!|not\b/))
125
+ @rex_tokens.push action { [:not, lineno] }
126
+
127
+ when (text = ss.scan(/and\b/))
128
+ @rex_tokens.push action { [:and, lineno] }
129
+
130
+ when (text = ss.scan(/equal\b/))
131
+ @rex_tokens.push action { [:equal, lineno] }
132
+
133
+ when (text = ss.scan(/equiv\b/))
134
+ @rex_tokens.push action { [:equiv, lineno] }
135
+
136
+ when (text = ss.scan(/empty\b/))
137
+ @rex_tokens.push action { [:empty, lineno] }
138
+
139
+ when (text = ss.scan(/implies\b/))
140
+ @rex_tokens.push action { [:implies, lineno] }
141
+
142
+ when (text = ss.scan(/\.\./))
143
+ @rex_tokens.push action { [text, lineno] }
144
+
145
+ when (text = ss.scan(/[{}:\(\)\.,]/))
146
+ @rex_tokens.push action { [text, lineno] }
147
+
148
+ when (text = ss.scan(/\+=/))
149
+ @rex_tokens.push action { [text, lineno] }
150
+
151
+ when (text = ss.scan(/\-=/))
152
+ @rex_tokens.push action { [text, lineno] }
153
+
154
+ when (text = ss.scan(/==/))
155
+ @rex_tokens.push action { [text, lineno] }
156
+
157
+ when (text = ss.scan(/<=>/))
158
+ @rex_tokens.push action { [text, lineno] }
159
+
160
+ when (text = ss.scan(/<=/))
161
+ @rex_tokens.push action { [text, lineno] }
162
+
163
+ when (text = ss.scan(/=>/))
164
+ @rex_tokens.push action { [text, lineno] }
165
+
166
+ when (text = ss.scan(/=/))
167
+ @rex_tokens.push action { [text, lineno] }
168
+
169
+ when (text = ss.scan(/\+/))
170
+ @rex_tokens.push action { [text, lineno] }
171
+
172
+ when (text = ss.scan(/[01]/))
173
+ @rex_tokens.push action { [text, lineno] }
174
+
175
+ when (text = ss.scan(/\w+/))
176
+ @rex_tokens.push action { [:IDENT, ADSLIdent.new(:lineno => lineno, :text => text)] }
177
+
178
+ when (text = ss.scan(/\s/))
179
+ ;
180
+
181
+ when (text = ss.scan(/./))
182
+ @rex_tokens.push action { [:unknown_symbol, [text, lineno]] }
183
+
184
+ else
185
+ text = ss.string[ss.pos .. -1]
186
+ raise ScanError, "can not match: '" + text + "'"
187
+ end # if
188
+
189
+ else
190
+ raise ScanError, "undefined state: '" + state.to_s + "'"
191
+ end # case state
192
+ end # until ss
193
+ end # def scan_evaluate
194
+
195
+ end # class
196
+ end # module
@@ -0,0 +1,976 @@
1
+ #
2
+ # DO NOT MODIFY!!!!
3
+ # This file is automatically generated by Racc 1.4.9
4
+ # from Racc grammer file "".
5
+ #
6
+
7
+ require 'racc/parser.rb'
8
+
9
+
10
+ require 'parser/adsl_parser.rex'
11
+ require 'fol/first_order_logic'
12
+
13
+ module ADSL
14
+
15
+ class ADSLParser < Racc::Parser
16
+
17
+ module_eval(<<'...end adsl_parser.racc/module_eval...', 'adsl_parser.racc', 138)
18
+
19
+ # generated by racc
20
+ def generate_ast(str)
21
+ scan_evaluate str
22
+ do_parse
23
+ end
24
+
25
+ def parse(str)
26
+ generate_ast(str).typecheck_and_resolve
27
+ end
28
+
29
+ ...end adsl_parser.racc/module_eval...
30
+ ##### State transition tables begin ###
31
+
32
+ racc_action_table = [
33
+ 38, 39, 40, 41, 42, 38, 39, 40, 41, 42,
34
+ 38, 39, 40, 41, 42, 38, 39, 40, 41, 42,
35
+ 38, 39, 40, 41, 42, 32, 32, 122, 106, 33,
36
+ 35, 92, 53, 20, 22, 2, 98, 94, 3, 87,
37
+ 127, 96, 61, 94, 86, 71, 1, 44, -37, -37,
38
+ 129, 31, 34, 148, 54, 125, 20, 22, 99, 95,
39
+ 11, 12, 94, 14, 15, 16, 18, 19, 21, 23,
40
+ 44, 20, 22, 104, 105, 11, 12, 17, 14, 15,
41
+ 16, 18, 19, 21, 23, 44, 20, 22, 170, 171,
42
+ 11, 12, 17, 14, 15, 16, 18, 19, 21, 23,
43
+ 44, 20, 22, 120, 121, 11, 12, 17, 14, 15,
44
+ 16, 18, 19, 21, 23, 9, 20, 22, 142, 143,
45
+ 11, 12, 17, 14, 15, 16, 18, 19, 21, 23,
46
+ 44, 20, 22, 104, 105, 11, 12, 17, 14, 15,
47
+ 16, 18, 19, 21, 23, 44, 20, 22, 144, 145,
48
+ 11, 12, 17, 14, 15, 16, 18, 19, 21, 23,
49
+ 44, 20, 22, 112, -41, 11, 12, 17, 14, 15,
50
+ 16, 18, 19, 21, 23, 44, 20, 22, 93, 115,
51
+ 11, 12, 17, 14, 15, 16, 18, 19, 21, 23,
52
+ 44, 20, 22, -38, 92, 11, 12, 17, 14, 15,
53
+ 16, 18, 19, 21, 23, 44, 20, 22, 91, 119,
54
+ 11, 12, 17, 14, 15, 16, 18, 19, 21, 23,
55
+ 44, 20, 22, 90, 122, 11, 12, 17, 14, 15,
56
+ 16, 18, 19, 21, 23, 44, 20, 22, 124, 94,
57
+ 11, 12, 17, 14, 15, 16, 18, 19, 21, 23,
58
+ 44, 20, 22, 38, 38, 11, 12, 17, 14, 15,
59
+ 16, 18, 19, 21, 23, 44, 20, 22, -20, 80,
60
+ 11, 12, 17, 14, 15, 16, 18, 19, 21, 23,
61
+ 44, 20, 22, 79, 61, 11, 12, 17, 14, 15,
62
+ 16, 18, 19, 21, 23, 44, 134, 135, 136, 137,
63
+ 74, 22, 17, 134, 135, 136, 137, 74, 22, 160,
64
+ 97, 74, 22, 94, 133, 74, 22, 20, 22, 20,
65
+ 22, 133, 74, 22, 85, 73, 20, 22, 131, 73,
66
+ 61, 44, 84, 44, 74, 22, 73, 20, 22, -40,
67
+ 44, 20, 22, 74, 22, 74, 22, 141, 73, 20,
68
+ 22, 44, 74, 22, 56, 44, 55, 73, 146, 73,
69
+ 74, 22, 87, 44, 74, 22, 73, 88, 2, 2,
70
+ 2, 3, 3, 3, 73, 38, 39, 40, 73, 1,
71
+ 1, 1, 38, 39, 40, 41, 42, 38, 39, 40,
72
+ 41, 42, 38, 39, 40, 41, 42, 38, 39, 40,
73
+ 41, 42, 102, 52, 149, 104, 105, 38, 39, 40,
74
+ 41, 42, 130, 122, 151, 104, 105, 38, 39, 40,
75
+ 51, 153, 50, 155, 156, 49, 48, 159, 47, 163,
76
+ 164, 94, 165, 43, 166, 94, 37, 122, 36, 27,
77
+ 173, 26, 25, 122, 94, 94 ]
78
+
79
+ racc_action_check = [
80
+ 78, 78, 78, 78, 78, 76, 76, 76, 76, 76,
81
+ 45, 45, 45, 45, 45, 117, 117, 117, 117, 117,
82
+ 109, 109, 109, 109, 109, 9, 44, 167, 82, 10,
83
+ 10, 133, 25, 33, 33, 0, 78, 167, 0, 62,
84
+ 114, 76, 87, 114, 62, 45, 0, 33, 9, 44,
85
+ 117, 9, 10, 133, 25, 109, 145, 145, 80, 75,
86
+ 145, 145, 75, 145, 145, 145, 145, 145, 145, 145,
87
+ 145, 96, 96, 120, 120, 96, 96, 145, 96, 96,
88
+ 96, 96, 96, 96, 96, 96, 49, 49, 165, 165,
89
+ 49, 49, 96, 49, 49, 49, 49, 49, 49, 49,
90
+ 49, 1, 1, 103, 103, 1, 1, 49, 1, 1,
91
+ 1, 1, 1, 1, 1, 1, 17, 17, 126, 126,
92
+ 17, 17, 1, 17, 17, 17, 17, 17, 17, 17,
93
+ 17, 18, 18, 83, 83, 18, 18, 17, 18, 18,
94
+ 18, 18, 18, 18, 18, 18, 51, 51, 128, 128,
95
+ 51, 51, 18, 51, 51, 51, 51, 51, 51, 51,
96
+ 51, 98, 98, 89, 79, 98, 98, 51, 98, 98,
97
+ 98, 98, 98, 98, 98, 98, 42, 42, 74, 94,
98
+ 42, 42, 98, 42, 42, 42, 42, 42, 42, 42,
99
+ 42, 38, 38, 95, 73, 38, 38, 42, 38, 38,
100
+ 38, 38, 38, 38, 38, 38, 31, 31, 72, 101,
101
+ 31, 31, 38, 31, 31, 31, 31, 31, 31, 31,
102
+ 31, 88, 88, 70, 106, 88, 88, 31, 88, 88,
103
+ 88, 88, 88, 88, 88, 88, 40, 40, 107, 108,
104
+ 40, 40, 88, 40, 40, 40, 40, 40, 40, 40,
105
+ 40, 39, 39, 67, 66, 39, 39, 40, 39, 39,
106
+ 39, 39, 39, 39, 39, 39, 86, 86, 55, 53,
107
+ 86, 86, 39, 86, 86, 86, 86, 86, 86, 86,
108
+ 86, 41, 41, 52, 37, 41, 41, 86, 41, 41,
109
+ 41, 41, 41, 41, 41, 41, 122, 122, 122, 122,
110
+ 122, 122, 41, 139, 139, 139, 139, 139, 139, 148,
111
+ 77, 148, 148, 77, 122, 170, 170, 34, 34, 35,
112
+ 35, 139, 85, 85, 61, 148, 91, 91, 119, 170,
113
+ 36, 34, 61, 35, 137, 137, 85, 143, 143, 32,
114
+ 91, 43, 43, 171, 171, 163, 163, 124, 137, 47,
115
+ 47, 143, 48, 48, 27, 43, 26, 171, 131, 163,
116
+ 93, 93, 64, 47, 50, 50, 48, 64, 8, 7,
117
+ 6, 8, 7, 6, 93, 69, 69, 69, 50, 8,
118
+ 7, 6, 111, 111, 111, 111, 111, 116, 116, 116,
119
+ 116, 116, 158, 158, 158, 158, 158, 13, 13, 13,
120
+ 13, 13, 81, 24, 134, 81, 81, 57, 57, 57,
121
+ 57, 57, 118, 135, 136, 118, 118, 68, 68, 68,
122
+ 23, 138, 22, 140, 141, 21, 20, 146, 19, 149,
123
+ 150, 152, 155, 14, 160, 162, 12, 164, 11, 4,
124
+ 168, 3, 2, 173, 174, 175 ]
125
+
126
+ racc_action_pointer = [
127
+ 24, 82, 409, 408, 439, nil, 359, 358, 357, 4,
128
+ 27, 398, 396, 391, 393, nil, nil, 97, 112, 388,
129
+ 386, 385, 382, 380, 359, 20, 316, 354, nil, nil,
130
+ nil, 187, 295, 14, 298, 300, 297, 251, 172, 232,
131
+ 217, 262, 157, 322, 5, 4, nil, 330, 333, 67,
132
+ 345, 127, 250, 236, nil, 227, nil, 401, nil, nil,
133
+ nil, 299, -3, nil, 320, nil, 248, 247, 411, 369,
134
+ 182, nil, 166, 173, 138, 18, -1, 269, -6, 120,
135
+ 24, 367, -13, 95, nil, 303, 247, 9, 202, 122,
136
+ nil, 307, nil, 341, 146, 149, 52, nil, 142, nil,
137
+ nil, 176, nil, 67, nil, nil, 190, 205, 195, 14,
138
+ nil, 376, nil, nil, -1, nil, 381, 9, 377, 295,
139
+ 35, nil, 281, nil, 314, nil, 77, nil, 107, nil,
140
+ nil, 345, nil, 10, 371, 379, 381, 315, 386, 288,
141
+ 379, 382, nil, 318, nil, 37, 394, nil, 292, 382,
142
+ 420, nil, 387, nil, nil, 399, nil, nil, 386, nil,
143
+ 401, nil, 391, 326, 403, 43, nil, -7, 430, nil,
144
+ 296, 324, nil, 409, 400, 401, nil ]
145
+
146
+ racc_action_default = [
147
+ -5, -76, -76, -76, -76, -1, -5, -5, -5, -42,
148
+ -76, -76, -76, -46, -76, -63, -64, -76, -76, -76,
149
+ -76, -76, -76, -76, -76, -76, -76, -76, -2, -3,
150
+ -4, -76, -44, -76, -76, -76, -76, -76, -76, -76,
151
+ -76, -76, -76, -76, -42, -76, -50, -76, -76, -76,
152
+ -76, -76, -76, -76, -9, -22, 177, -47, -59, -62,
153
+ -60, -76, -76, -67, -71, -53, -55, -54, -51, -52,
154
+ -76, -56, -76, -37, -76, -76, -76, -76, -76, -45,
155
+ -76, -76, -76, -76, -68, -76, -76, -76, -76, -76,
156
+ -65, -76, -40, -76, -76, -43, -76, -39, -76, -9,
157
+ -8, -76, -6, -11, -14, -15, -76, -76, -69, -76,
158
+ -66, -70, -49, -75, -76, -41, -73, -76, -76, -76,
159
+ -76, -13, -25, -18, -76, -48, -76, -38, -76, -58,
160
+ -7, -17, -12, -37, -76, -76, -76, -76, -76, -25,
161
+ -76, -19, -61, -76, -57, -76, -76, -10, -76, -76,
162
+ -76, -27, -28, -23, -24, -76, -21, -74, -72, -16,
163
+ -76, -26, -34, -76, -76, -41, -33, -76, -32, -36,
164
+ -76, -76, -31, -76, -29, -30, -35 ]
165
+
166
+ racc_goto_table = [
167
+ 13, 58, 59, 60, 123, 138, 81, 75, 161, 77,
168
+ 82, 70, 5, 62, 64, 72, 45, 46, 28, 29,
169
+ 30, 83, 154, 132, 168, 147, 107, 4, 89, 128,
170
+ 57, 126, 110, 150, nil, nil, nil, 65, 66, 67,
171
+ 68, 69, nil, nil, 108, nil, nil, nil, 76, nil,
172
+ 78, 118, 114, nil, nil, nil, nil, nil, nil, 113,
173
+ nil, nil, 169, nil, nil, 172, nil, nil, nil, nil,
174
+ nil, 176, nil, nil, nil, nil, nil, nil, nil, nil,
175
+ nil, 140, nil, nil, nil, 109, nil, 111, nil, nil,
176
+ nil, nil, nil, nil, nil, 116, 152, 117, 140, nil,
177
+ nil, nil, nil, nil, nil, nil, nil, 162, nil, nil,
178
+ nil, 157, nil, nil, nil, nil, nil, nil, nil, nil,
179
+ nil, nil, 167, nil, nil, nil, nil, nil, nil, 174,
180
+ 175, nil, nil, nil, nil, nil, nil, nil, nil, nil,
181
+ nil, nil, nil, nil, 158 ]
182
+
183
+ racc_goto_check = [
184
+ 20, 19, 19, 19, 12, 14, 6, 17, 16, 17,
185
+ 11, 19, 2, 21, 21, 19, 20, 20, 2, 2,
186
+ 2, 13, 14, 10, 18, 9, 8, 1, 22, 23,
187
+ 20, 24, 25, 12, nil, nil, nil, 20, 20, 20,
188
+ 20, 20, nil, nil, 17, nil, nil, nil, 20, nil,
189
+ 20, 6, 17, nil, nil, nil, nil, nil, nil, 19,
190
+ nil, nil, 12, nil, nil, 12, nil, nil, nil, nil,
191
+ nil, 12, nil, nil, nil, nil, nil, nil, nil, nil,
192
+ nil, 17, nil, nil, nil, 20, nil, 20, nil, nil,
193
+ nil, nil, nil, nil, nil, 20, 17, 20, 17, nil,
194
+ nil, nil, nil, nil, nil, nil, nil, 17, nil, nil,
195
+ nil, 19, nil, nil, nil, nil, nil, nil, nil, nil,
196
+ nil, nil, 17, nil, nil, nil, nil, nil, nil, 17,
197
+ 17, nil, nil, nil, nil, nil, nil, nil, nil, nil,
198
+ nil, nil, nil, nil, 20 ]
199
+
200
+ racc_goto_pointer = [
201
+ nil, 27, 12, nil, nil, nil, -48, nil, -57, -106,
202
+ -97, -45, -102, -34, -117, nil, -140, -41, -140, -32,
203
+ -1, -23, -36, -87, -82, -55 ]
204
+
205
+ racc_goto_default = [
206
+ nil, nil, nil, 6, 7, 8, nil, 100, 101, nil,
207
+ 103, nil, nil, nil, nil, 139, nil, 24, nil, 10,
208
+ nil, nil, nil, nil, nil, 63 ]
209
+
210
+ racc_reduce_table = [
211
+ 0, 0, :racc_error,
212
+ 1, 49, :_reduce_1,
213
+ 2, 50, :_reduce_2,
214
+ 2, 50, :_reduce_3,
215
+ 2, 50, :_reduce_4,
216
+ 0, 50, :_reduce_5,
217
+ 5, 51, :_reduce_6,
218
+ 7, 51, :_reduce_7,
219
+ 2, 54, :_reduce_8,
220
+ 0, 54, :_reduce_9,
221
+ 4, 55, :_reduce_10,
222
+ 1, 56, :_reduce_11,
223
+ 3, 56, :_reduce_12,
224
+ 2, 56, :_reduce_13,
225
+ 1, 58, :_reduce_14,
226
+ 1, 58, :_reduce_15,
227
+ 2, 57, :_reduce_16,
228
+ 0, 57, :_reduce_17,
229
+ 6, 52, :_reduce_18,
230
+ 4, 59, :_reduce_19,
231
+ 0, 59, :_reduce_20,
232
+ 5, 61, :_reduce_21,
233
+ 0, 61, :_reduce_22,
234
+ 3, 60, :_reduce_23,
235
+ 2, 62, :_reduce_24,
236
+ 0, 62, :_reduce_25,
237
+ 3, 63, :_reduce_26,
238
+ 2, 63, :_reduce_27,
239
+ 2, 63, :_reduce_28,
240
+ 5, 63, :_reduce_29,
241
+ 5, 63, :_reduce_30,
242
+ 5, 63, :_reduce_31,
243
+ 4, 63, :_reduce_32,
244
+ 2, 64, :_reduce_33,
245
+ 1, 64, :_reduce_34,
246
+ 3, 66, :_reduce_35,
247
+ 1, 66, :_reduce_36,
248
+ 1, 65, :_reduce_37,
249
+ 4, 65, :_reduce_38,
250
+ 4, 65, :_reduce_39,
251
+ 2, 65, :_reduce_40,
252
+ 3, 65, :_reduce_41,
253
+ 1, 67, :_reduce_42,
254
+ 4, 67, :_reduce_43,
255
+ 2, 67, :_reduce_44,
256
+ 3, 67, :_reduce_45,
257
+ 2, 53, :_reduce_46,
258
+ 4, 53, :_reduce_47,
259
+ 6, 68, :_reduce_48,
260
+ 5, 68, :_reduce_49,
261
+ 2, 68, :_reduce_50,
262
+ 3, 68, :_reduce_51,
263
+ 3, 68, :_reduce_52,
264
+ 3, 68, :_reduce_53,
265
+ 3, 68, :_reduce_54,
266
+ 3, 68, :_reduce_55,
267
+ 3, 68, :_reduce_56,
268
+ 7, 68, :_reduce_57,
269
+ 6, 68, :_reduce_58,
270
+ 3, 68, :_reduce_59,
271
+ 3, 68, :_reduce_60,
272
+ 7, 68, :_reduce_61,
273
+ 3, 68, :_reduce_62,
274
+ 1, 68, :_reduce_63,
275
+ 1, 68, :_reduce_64,
276
+ 4, 68, :_reduce_65,
277
+ 3, 69, :_reduce_66,
278
+ 1, 69, :_reduce_67,
279
+ 2, 73, :_reduce_68,
280
+ 3, 73, :_reduce_69,
281
+ 2, 70, :_reduce_70,
282
+ 0, 70, :_reduce_71,
283
+ 3, 71, :_reduce_72,
284
+ 0, 71, :_reduce_73,
285
+ 3, 72, :_reduce_74,
286
+ 0, 72, :_reduce_75 ]
287
+
288
+ racc_reduce_n = 76
289
+
290
+ racc_shift_n = 177
291
+
292
+ racc_token_table = {
293
+ false => 0,
294
+ :error => 1,
295
+ "==" => 2,
296
+ "!=" => 3,
297
+ :noassoc => 4,
298
+ :NOT => 5,
299
+ "<=>" => 6,
300
+ "<=" => 7,
301
+ "=>" => 8,
302
+ :and => 9,
303
+ :or => 10,
304
+ :class => 11,
305
+ :extends => 12,
306
+ :inverseof => 13,
307
+ :action => 14,
308
+ :foreach => 15,
309
+ :either => 16,
310
+ :create => 17,
311
+ :delete => 18,
312
+ :subset => 19,
313
+ :oneof => 20,
314
+ :dotall => 21,
315
+ :invariant => 22,
316
+ :forall => 23,
317
+ :exists => 24,
318
+ :in => 25,
319
+ :empty => 26,
320
+ :true => 27,
321
+ :false => 28,
322
+ :not => 29,
323
+ :equal => 30,
324
+ :equiv => 31,
325
+ :implies => 32,
326
+ :IDENT => 33,
327
+ "{" => 34,
328
+ "}" => 35,
329
+ ".." => 36,
330
+ "+" => 37,
331
+ "0" => 38,
332
+ "1" => 39,
333
+ "(" => 40,
334
+ ")" => 41,
335
+ "," => 42,
336
+ "=" => 43,
337
+ "." => 44,
338
+ "+=" => 45,
339
+ "-=" => 46,
340
+ ":" => 47 }
341
+
342
+ racc_nt_base = 48
343
+
344
+ racc_use_result_var = true
345
+
346
+ Racc_arg = [
347
+ racc_action_table,
348
+ racc_action_check,
349
+ racc_action_default,
350
+ racc_action_pointer,
351
+ racc_goto_table,
352
+ racc_goto_check,
353
+ racc_goto_default,
354
+ racc_goto_pointer,
355
+ racc_nt_base,
356
+ racc_reduce_table,
357
+ racc_token_table,
358
+ racc_shift_n,
359
+ racc_reduce_n,
360
+ racc_use_result_var ]
361
+
362
+ Racc_token_to_s_table = [
363
+ "$end",
364
+ "error",
365
+ "\"==\"",
366
+ "\"!=\"",
367
+ "noassoc",
368
+ "NOT",
369
+ "\"<=>\"",
370
+ "\"<=\"",
371
+ "\"=>\"",
372
+ "and",
373
+ "or",
374
+ "class",
375
+ "extends",
376
+ "inverseof",
377
+ "action",
378
+ "foreach",
379
+ "either",
380
+ "create",
381
+ "delete",
382
+ "subset",
383
+ "oneof",
384
+ "dotall",
385
+ "invariant",
386
+ "forall",
387
+ "exists",
388
+ "in",
389
+ "empty",
390
+ "true",
391
+ "false",
392
+ "not",
393
+ "equal",
394
+ "equiv",
395
+ "implies",
396
+ "IDENT",
397
+ "\"{\"",
398
+ "\"}\"",
399
+ "\"..\"",
400
+ "\"+\"",
401
+ "\"0\"",
402
+ "\"1\"",
403
+ "\"(\"",
404
+ "\")\"",
405
+ "\",\"",
406
+ "\"=\"",
407
+ "\".\"",
408
+ "\"+=\"",
409
+ "\"-=\"",
410
+ "\":\"",
411
+ "$start",
412
+ "adslspec",
413
+ "root_elems",
414
+ "class_decl",
415
+ "action_decl",
416
+ "invariant_decl",
417
+ "rel_decls",
418
+ "rel_decl",
419
+ "cardinality",
420
+ "inverse_suffix",
421
+ "card_number",
422
+ "action_args",
423
+ "block",
424
+ "additional_args",
425
+ "statements",
426
+ "statement",
427
+ "assignmentrhs",
428
+ "objset",
429
+ "eitherblocks",
430
+ "invariant_objset",
431
+ "formula",
432
+ "quantifier_parameters_with_commas",
433
+ "optional_formula",
434
+ "additional_formulae",
435
+ "additional_invariant_objsets",
436
+ "quantifier_parameter" ]
437
+
438
+ Racc_debug_parser = false
439
+
440
+ ##### State transition tables end #####
441
+
442
+ # reduce 0 omitted
443
+
444
+ module_eval(<<'.,.,', 'adsl_parser.racc', 11)
445
+ def _reduce_1(val, _values, result)
446
+ return ADSLSpec.new :lineno => lineno, :classes => val[0][0], :actions => val[0][1], :invariants => val[0][2]
447
+ result
448
+ end
449
+ .,.,
450
+
451
+ module_eval(<<'.,.,', 'adsl_parser.racc', 13)
452
+ def _reduce_2(val, _values, result)
453
+ val[1][0].unshift val[0]; return val[1]
454
+ result
455
+ end
456
+ .,.,
457
+
458
+ module_eval(<<'.,.,', 'adsl_parser.racc', 14)
459
+ def _reduce_3(val, _values, result)
460
+ val[1][1].unshift val[0]; return val[1]
461
+ result
462
+ end
463
+ .,.,
464
+
465
+ module_eval(<<'.,.,', 'adsl_parser.racc', 15)
466
+ def _reduce_4(val, _values, result)
467
+ val[1][2].unshift val[0]; return val[1]
468
+ result
469
+ end
470
+ .,.,
471
+
472
+ module_eval(<<'.,.,', 'adsl_parser.racc', 16)
473
+ def _reduce_5(val, _values, result)
474
+ return [[], [], []]
475
+ result
476
+ end
477
+ .,.,
478
+
479
+ module_eval(<<'.,.,', 'adsl_parser.racc', 19)
480
+ def _reduce_6(val, _values, result)
481
+ return ADSLClass.new :lineno => val[0], :name => val[1], :relations => val[3]
482
+ result
483
+ end
484
+ .,.,
485
+
486
+ module_eval(<<'.,.,', 'adsl_parser.racc', 21)
487
+ def _reduce_7(val, _values, result)
488
+ return ADSLClass.new :lineno => val[0], :name => val[1], :parent_name => val[3], :relations => val[5]
489
+ result
490
+ end
491
+ .,.,
492
+
493
+ module_eval(<<'.,.,', 'adsl_parser.racc', 23)
494
+ def _reduce_8(val, _values, result)
495
+ val[0] << val[1]; return val[0]
496
+ result
497
+ end
498
+ .,.,
499
+
500
+ module_eval(<<'.,.,', 'adsl_parser.racc', 24)
501
+ def _reduce_9(val, _values, result)
502
+ return []
503
+ result
504
+ end
505
+ .,.,
506
+
507
+ module_eval(<<'.,.,', 'adsl_parser.racc', 26)
508
+ def _reduce_10(val, _values, result)
509
+ return ADSLRelation.new :lineno => val[0][2], :cardinality => val[0].first(2), :to_class_name => val[1], :name => val[2], :inverse_of_name => val[3]
510
+ result
511
+ end
512
+ .,.,
513
+
514
+ module_eval(<<'.,.,', 'adsl_parser.racc', 28)
515
+ def _reduce_11(val, _values, result)
516
+ return [val[0][0], val[0][0], val[0][1]]
517
+ result
518
+ end
519
+ .,.,
520
+
521
+ module_eval(<<'.,.,', 'adsl_parser.racc', 29)
522
+ def _reduce_12(val, _values, result)
523
+ return [val[0][0], val[2][0], val[0][1]]
524
+ result
525
+ end
526
+ .,.,
527
+
528
+ module_eval(<<'.,.,', 'adsl_parser.racc', 30)
529
+ def _reduce_13(val, _values, result)
530
+ return [val[0][0], 1.0/0.0, val[0][1]]
531
+ result
532
+ end
533
+ .,.,
534
+
535
+ module_eval(<<'.,.,', 'adsl_parser.racc', 32)
536
+ def _reduce_14(val, _values, result)
537
+ return [0, lineno]
538
+ result
539
+ end
540
+ .,.,
541
+
542
+ module_eval(<<'.,.,', 'adsl_parser.racc', 33)
543
+ def _reduce_15(val, _values, result)
544
+ return [1, lineno]
545
+ result
546
+ end
547
+ .,.,
548
+
549
+ module_eval(<<'.,.,', 'adsl_parser.racc', 35)
550
+ def _reduce_16(val, _values, result)
551
+ return val[1]
552
+ result
553
+ end
554
+ .,.,
555
+
556
+ module_eval(<<'.,.,', 'adsl_parser.racc', 36)
557
+ def _reduce_17(val, _values, result)
558
+ return nil
559
+ result
560
+ end
561
+ .,.,
562
+
563
+ module_eval(<<'.,.,', 'adsl_parser.racc', 38)
564
+ def _reduce_18(val, _values, result)
565
+ return ADSLAction.new(:lineno => val[0], :name => val[1], :arg_cardinalities => val[3][0], :arg_types => val[3][1], :arg_names => val[3][2], :block => val[5])
566
+ result
567
+ end
568
+ .,.,
569
+
570
+ module_eval(<<'.,.,', 'adsl_parser.racc', 40)
571
+ def _reduce_19(val, _values, result)
572
+ val[0][0] << val[1]; val[0][1] << val[2]; val[0][2] << val[3]; return val[0]
573
+ result
574
+ end
575
+ .,.,
576
+
577
+ module_eval(<<'.,.,', 'adsl_parser.racc', 41)
578
+ def _reduce_20(val, _values, result)
579
+ return [[], [], []]
580
+ result
581
+ end
582
+ .,.,
583
+
584
+ module_eval(<<'.,.,', 'adsl_parser.racc', 43)
585
+ def _reduce_21(val, _values, result)
586
+ val[0][0] << val[1]; val[0][1] << val[2]; val[0][2] << val[3]; return val[0]
587
+ result
588
+ end
589
+ .,.,
590
+
591
+ module_eval(<<'.,.,', 'adsl_parser.racc', 44)
592
+ def _reduce_22(val, _values, result)
593
+ return [[], [], []]
594
+ result
595
+ end
596
+ .,.,
597
+
598
+ module_eval(<<'.,.,', 'adsl_parser.racc', 46)
599
+ def _reduce_23(val, _values, result)
600
+ return ADSLBlock.new :lineno => val[0], :statements => val[1]
601
+ result
602
+ end
603
+ .,.,
604
+
605
+ module_eval(<<'.,.,', 'adsl_parser.racc', 48)
606
+ def _reduce_24(val, _values, result)
607
+ val[1].unshift val[0]; return val[1]
608
+ result
609
+ end
610
+ .,.,
611
+
612
+ module_eval(<<'.,.,', 'adsl_parser.racc', 49)
613
+ def _reduce_25(val, _values, result)
614
+ return []
615
+ result
616
+ end
617
+ .,.,
618
+
619
+ module_eval(<<'.,.,', 'adsl_parser.racc', 51)
620
+ def _reduce_26(val, _values, result)
621
+ val[2].var_name = val[0]; return val[2]
622
+ result
623
+ end
624
+ .,.,
625
+
626
+ module_eval(<<'.,.,', 'adsl_parser.racc', 52)
627
+ def _reduce_27(val, _values, result)
628
+ return ADSLCreateObj.new :lineno => val[0], :class_name => val[1]
629
+ result
630
+ end
631
+ .,.,
632
+
633
+ module_eval(<<'.,.,', 'adsl_parser.racc', 53)
634
+ def _reduce_28(val, _values, result)
635
+ return ADSLDeleteObj.new :lineno => val[0], :objset => val[1]
636
+ result
637
+ end
638
+ .,.,
639
+
640
+ module_eval(<<'.,.,', 'adsl_parser.racc', 54)
641
+ def _reduce_29(val, _values, result)
642
+ return ADSLCreateTup.new :lineno => val[0].lineno, :objset1 => val[0], :rel_name => val[2], :objset2 => val[4]
643
+ result
644
+ end
645
+ .,.,
646
+
647
+ module_eval(<<'.,.,', 'adsl_parser.racc', 55)
648
+ def _reduce_30(val, _values, result)
649
+ return ADSLDeleteTup.new :lineno => val[0].lineno, :objset1 => val[0], :rel_name => val[2], :objset2 => val[4]
650
+ result
651
+ end
652
+ .,.,
653
+
654
+ module_eval(<<'.,.,', 'adsl_parser.racc', 56)
655
+ def _reduce_31(val, _values, result)
656
+ return ADSLForEach.new :lineno => val[0], :var_name => val[1], :objset => val[3], :block => val[4]
657
+ result
658
+ end
659
+ .,.,
660
+
661
+ module_eval(<<'.,.,', 'adsl_parser.racc', 57)
662
+ def _reduce_32(val, _values, result)
663
+ val[3].unshift val[1]; return ADSLEither.new :lineno => val[0], :blocks => val[3]
664
+ result
665
+ end
666
+ .,.,
667
+
668
+ module_eval(<<'.,.,', 'adsl_parser.racc', 59)
669
+ def _reduce_33(val, _values, result)
670
+ return ADSLCreateObj.new :lineno => val[0], :class_name => val[1]
671
+ result
672
+ end
673
+ .,.,
674
+
675
+ module_eval(<<'.,.,', 'adsl_parser.racc', 60)
676
+ def _reduce_34(val, _values, result)
677
+ return ADSLAssignment.new :lineno => val[0].lineno, :objset => val[0]
678
+ result
679
+ end
680
+ .,.,
681
+
682
+ module_eval(<<'.,.,', 'adsl_parser.racc', 62)
683
+ def _reduce_35(val, _values, result)
684
+ val[0] << val[2]; return val[0]
685
+ result
686
+ end
687
+ .,.,
688
+
689
+ module_eval(<<'.,.,', 'adsl_parser.racc', 63)
690
+ def _reduce_36(val, _values, result)
691
+ return [val[0]]
692
+ result
693
+ end
694
+ .,.,
695
+
696
+ module_eval(<<'.,.,', 'adsl_parser.racc', 65)
697
+ def _reduce_37(val, _values, result)
698
+ return ADSLVariable.new :lineno => val[0].lineno, :var_name => val[0]
699
+ result
700
+ end
701
+ .,.,
702
+
703
+ module_eval(<<'.,.,', 'adsl_parser.racc', 66)
704
+ def _reduce_38(val, _values, result)
705
+ return ADSLSubset.new :lineno => val[0], :objset => val[2]
706
+ result
707
+ end
708
+ .,.,
709
+
710
+ module_eval(<<'.,.,', 'adsl_parser.racc', 67)
711
+ def _reduce_39(val, _values, result)
712
+ return ADSLOneOf.new :lineno => val[0], :objset => val[2]
713
+ result
714
+ end
715
+ .,.,
716
+
717
+ module_eval(<<'.,.,', 'adsl_parser.racc', 68)
718
+ def _reduce_40(val, _values, result)
719
+ return ADSLAllOf.new :lineno => val[0].lineno, :class_name => val[0]
720
+ result
721
+ end
722
+ .,.,
723
+
724
+ module_eval(<<'.,.,', 'adsl_parser.racc', 69)
725
+ def _reduce_41(val, _values, result)
726
+ return ADSLDereference.new :lineno => val[0].lineno, :objset => val[0], :rel_name => val[2]
727
+ result
728
+ end
729
+ .,.,
730
+
731
+ module_eval(<<'.,.,', 'adsl_parser.racc', 71)
732
+ def _reduce_42(val, _values, result)
733
+ return ADSLVariable.new :lineno => val[0].lineno, :var_name => val[0]
734
+ result
735
+ end
736
+ .,.,
737
+
738
+ module_eval(<<'.,.,', 'adsl_parser.racc', 72)
739
+ def _reduce_43(val, _values, result)
740
+ return ADSLSubset.new :lineno => val[0], :objset => val[2]
741
+ result
742
+ end
743
+ .,.,
744
+
745
+ module_eval(<<'.,.,', 'adsl_parser.racc', 73)
746
+ def _reduce_44(val, _values, result)
747
+ return ADSLAllOf.new :lineno => val[0].lineno, :class_name => val[0]
748
+ result
749
+ end
750
+ .,.,
751
+
752
+ module_eval(<<'.,.,', 'adsl_parser.racc', 74)
753
+ def _reduce_45(val, _values, result)
754
+ return ADSLDereference.new :lineno => val[0].lineno, :objset => val[0], :rel_name => val[2]
755
+ result
756
+ end
757
+ .,.,
758
+
759
+ module_eval(<<'.,.,', 'adsl_parser.racc', 76)
760
+ def _reduce_46(val, _values, result)
761
+ return ADSLInvariant.new :lineno => val[0], :name => nil, :formula => val[1]
762
+ result
763
+ end
764
+ .,.,
765
+
766
+ module_eval(<<'.,.,', 'adsl_parser.racc', 77)
767
+ def _reduce_47(val, _values, result)
768
+ return ADSLInvariant.new :lineno => val[0], :name => val[1], :formula => val[3]
769
+ result
770
+ end
771
+ .,.,
772
+
773
+ module_eval(<<'.,.,', 'adsl_parser.racc', 80)
774
+ def _reduce_48(val, _values, result)
775
+ return ADSLForAll.new :lineno => val[0], :vars => val[2], :subformula => val[4]
776
+ result
777
+ end
778
+ .,.,
779
+
780
+ module_eval(<<'.,.,', 'adsl_parser.racc', 82)
781
+ def _reduce_49(val, _values, result)
782
+ return ADSLExists.new :lineno => val[0], :vars => val[2], :subformula => val[3]
783
+ result
784
+ end
785
+ .,.,
786
+
787
+ module_eval(<<'.,.,', 'adsl_parser.racc', 84)
788
+ def _reduce_50(val, _values, result)
789
+ return ADSLNot.new :lineno => val[0], :subformula => val[1]
790
+ result
791
+ end
792
+ .,.,
793
+
794
+ module_eval(<<'.,.,', 'adsl_parser.racc', 86)
795
+ def _reduce_51(val, _values, result)
796
+ return ADSLAnd.new :lineno => val[0].lineno, :subformulae => [val[0], val[2]]
797
+ result
798
+ end
799
+ .,.,
800
+
801
+ module_eval(<<'.,.,', 'adsl_parser.racc', 88)
802
+ def _reduce_52(val, _values, result)
803
+ return ADSLOr.new :lineno => val[0].lineno, :subformulae => [val[0], val[2]]
804
+ result
805
+ end
806
+ .,.,
807
+
808
+ module_eval(<<'.,.,', 'adsl_parser.racc', 90)
809
+ def _reduce_53(val, _values, result)
810
+ return ADSLEquiv.new :lineno => val[0].lineno, :subformulae => [val[0], val[2]]
811
+ result
812
+ end
813
+ .,.,
814
+
815
+ module_eval(<<'.,.,', 'adsl_parser.racc', 92)
816
+ def _reduce_54(val, _values, result)
817
+ return ADSLImplies.new :lineno => val[0].lineno, :subformula1 => val[0], :subformula2 => val[2]
818
+ result
819
+ end
820
+ .,.,
821
+
822
+ module_eval(<<'.,.,', 'adsl_parser.racc', 94)
823
+ def _reduce_55(val, _values, result)
824
+ return ADSLImplies.new :lineno => val[0].lineno, :subformula1 => val[2], :subformula2 => val[0]
825
+ result
826
+ end
827
+ .,.,
828
+
829
+ module_eval(<<'.,.,', 'adsl_parser.racc', 95)
830
+ def _reduce_56(val, _values, result)
831
+ return val[1]
832
+ result
833
+ end
834
+ .,.,
835
+
836
+ module_eval(<<'.,.,', 'adsl_parser.racc', 97)
837
+ def _reduce_57(val, _values, result)
838
+ return ADSLEquiv.new :lineno => val[0], :subformulae => [val[2], val[4]] + val[5]
839
+ result
840
+ end
841
+ .,.,
842
+
843
+ module_eval(<<'.,.,', 'adsl_parser.racc', 99)
844
+ def _reduce_58(val, _values, result)
845
+ return ADSLImplies.new :lineno => val[0], :subformula1 => val[2], :subformula2 => val[4]
846
+ result
847
+ end
848
+ .,.,
849
+
850
+ module_eval(<<'.,.,', 'adsl_parser.racc', 101)
851
+ def _reduce_59(val, _values, result)
852
+ return ADSLEqual.new :lineno => val[0].lineno, :objsets => [val[0], val[2]]
853
+ result
854
+ end
855
+ .,.,
856
+
857
+ module_eval(<<'.,.,', 'adsl_parser.racc', 103)
858
+ def _reduce_60(val, _values, result)
859
+ return ADSLNot.new(:lineno => val[0].lineno, :subformula => ADSLEqual.new(:lineno => val[0].lineno, :objsets => [val[0], val[2]]))
860
+ result
861
+ end
862
+ .,.,
863
+
864
+ module_eval(<<'.,.,', 'adsl_parser.racc', 105)
865
+ def _reduce_61(val, _values, result)
866
+ return ADSLEqual.new :lineno => val[0], :objsets => [val[2], val[4]] + val[5]
867
+ result
868
+ end
869
+ .,.,
870
+
871
+ module_eval(<<'.,.,', 'adsl_parser.racc', 106)
872
+ def _reduce_62(val, _values, result)
873
+ return ADSLIn.new :lineno => val[0].lineno, :objset1 => val[0], :objset2 => val[2]
874
+ result
875
+ end
876
+ .,.,
877
+
878
+ module_eval(<<'.,.,', 'adsl_parser.racc', 107)
879
+ def _reduce_63(val, _values, result)
880
+ return ADSLBoolean.new :lineno => val[0], :bool_value => true
881
+ result
882
+ end
883
+ .,.,
884
+
885
+ module_eval(<<'.,.,', 'adsl_parser.racc', 108)
886
+ def _reduce_64(val, _values, result)
887
+ return ADSLBoolean.new :lineno => val[0], :bool_value => false
888
+ result
889
+ end
890
+ .,.,
891
+
892
+ module_eval(<<'.,.,', 'adsl_parser.racc', 109)
893
+ def _reduce_65(val, _values, result)
894
+ return ADSLEmpty.new :lineno => val[0], :objset => val[2]
895
+ result
896
+ end
897
+ .,.,
898
+
899
+ module_eval(<<'.,.,', 'adsl_parser.racc', 112)
900
+ def _reduce_66(val, _values, result)
901
+ val[0] << val[2]; return val[0]
902
+ result
903
+ end
904
+ .,.,
905
+
906
+ module_eval(<<'.,.,', 'adsl_parser.racc', 113)
907
+ def _reduce_67(val, _values, result)
908
+ return [val[0]]
909
+ result
910
+ end
911
+ .,.,
912
+
913
+ module_eval(<<'.,.,', 'adsl_parser.racc', 115)
914
+ def _reduce_68(val, _values, result)
915
+ return [val[1], ADSLAllOf.new(:lineno => val[0].lineno, :class_name => val[0]), val[0].lineno]
916
+ result
917
+ end
918
+ .,.,
919
+
920
+ module_eval(<<'.,.,', 'adsl_parser.racc', 116)
921
+ def _reduce_69(val, _values, result)
922
+ return [val[0], val[2], val[0].lineno]
923
+ result
924
+ end
925
+ .,.,
926
+
927
+ module_eval(<<'.,.,', 'adsl_parser.racc', 118)
928
+ def _reduce_70(val, _values, result)
929
+ return val[1]
930
+ result
931
+ end
932
+ .,.,
933
+
934
+ module_eval(<<'.,.,', 'adsl_parser.racc', 119)
935
+ def _reduce_71(val, _values, result)
936
+ return nil
937
+ result
938
+ end
939
+ .,.,
940
+
941
+ module_eval(<<'.,.,', 'adsl_parser.racc', 121)
942
+ def _reduce_72(val, _values, result)
943
+ val[0] << val[2]; return val[0]
944
+ result
945
+ end
946
+ .,.,
947
+
948
+ module_eval(<<'.,.,', 'adsl_parser.racc', 122)
949
+ def _reduce_73(val, _values, result)
950
+ return []
951
+ result
952
+ end
953
+ .,.,
954
+
955
+ module_eval(<<'.,.,', 'adsl_parser.racc', 124)
956
+ def _reduce_74(val, _values, result)
957
+ val[0] << val[2]; return val[0]
958
+ result
959
+ end
960
+ .,.,
961
+
962
+ module_eval(<<'.,.,', 'adsl_parser.racc', 125)
963
+ def _reduce_75(val, _values, result)
964
+ return []
965
+ result
966
+ end
967
+ .,.,
968
+
969
+ def _reduce_none(val, _values, result)
970
+ val[0]
971
+ end
972
+
973
+ end # class ADSLParser
974
+
975
+
976
+ end