cadenza 0.7.2 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/cadenza +9 -1
- data/lib/cadenza.rb +15 -0
- data/lib/cadenza/base_renderer.rb +0 -8
- data/lib/cadenza/block_hierarchy.rb +42 -0
- data/lib/cadenza/cli.rb +2 -2
- data/lib/cadenza/context.rb +44 -313
- data/lib/cadenza/context/blocks.rb +60 -0
- data/lib/cadenza/context/filters.rb +60 -0
- data/lib/cadenza/context/functional_variables.rb +58 -0
- data/lib/cadenza/context/loaders.rb +116 -0
- data/lib/cadenza/context/stack.rb +85 -0
- data/lib/cadenza/context_object.rb +92 -2
- data/lib/cadenza/filters/standard_filters.rb +82 -23
- data/lib/cadenza/lexer.rb +0 -3
- data/lib/cadenza/nodes/filter_node.rb +1 -2
- data/lib/cadenza/nodes/filtered_value_node.rb +48 -0
- data/lib/cadenza/nodes/variable_node.rb +17 -4
- data/lib/cadenza/racc_parser.rb +329 -339
- data/lib/cadenza/source_renderer.rb +225 -0
- data/lib/cadenza/text_renderer.rb +25 -10
- data/lib/cadenza/version.rb +2 -2
- metadata +10 -3
- data/lib/cadenza/nodes/inject_node.rb +0 -57
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'cgi'
|
2
2
|
|
3
3
|
# adds slashes to \, ', and " characters in the given string
|
4
|
-
define_filter :addslashes do |string|
|
4
|
+
define_filter :addslashes do |string, params|
|
5
5
|
word = string.dup
|
6
6
|
word.gsub!(/\\/, "\\\\\\\\")
|
7
7
|
word.gsub!(/'/, "\\\\'")
|
@@ -10,27 +10,32 @@ define_filter :addslashes do |string|
|
|
10
10
|
end
|
11
11
|
|
12
12
|
# capitalizes the first letter of the string
|
13
|
-
define_filter :capitalize,
|
13
|
+
define_filter :capitalize do |input, params|
|
14
|
+
input.capitalize
|
15
|
+
end
|
14
16
|
|
15
17
|
# centers the string in a fixed width field with the given padding
|
16
|
-
define_filter :center do |string,
|
17
|
-
|
18
|
+
define_filter :center do |string, params|
|
19
|
+
length = params[0]
|
20
|
+
padding = params[1] || ' '
|
18
21
|
string.center(length, padding)
|
19
22
|
end
|
20
23
|
|
21
24
|
# removes all instances of the given string from the string
|
22
|
-
define_filter :cut do |string,
|
23
|
-
string.gsub(
|
25
|
+
define_filter :cut do |string, params|
|
26
|
+
string.gsub(params.first, '')
|
24
27
|
end
|
25
28
|
|
26
29
|
# formats the given date object with the given format string
|
27
|
-
define_filter :date do |date,
|
28
|
-
format =
|
30
|
+
define_filter :date do |date, params|
|
31
|
+
format = params.first || '%F'
|
29
32
|
date.strftime(format)
|
30
33
|
end
|
31
34
|
|
32
35
|
# returns the given value if the input is falsy or is empty
|
33
|
-
define_filter :default do |input,
|
36
|
+
define_filter :default do |input, params|
|
37
|
+
default = params.first
|
38
|
+
|
34
39
|
if input.respond_to?(:empty?) and input.empty?
|
35
40
|
default
|
36
41
|
else
|
@@ -39,12 +44,12 @@ define_filter :default do |input, default|
|
|
39
44
|
end
|
40
45
|
|
41
46
|
# escapes the HTML content of the value
|
42
|
-
define_filter :escape do |input|
|
47
|
+
define_filter :escape do |input, params|
|
43
48
|
CGI::escapeHTML(input)
|
44
49
|
end
|
45
50
|
|
46
51
|
# returns the first item of an iterable
|
47
|
-
define_filter :first do |input|
|
52
|
+
define_filter :first do |input, params|
|
48
53
|
if input.respond_to?(:[])
|
49
54
|
RUBY_VERSION =~ /^1.8/ && input.is_a?(String) ? input[0].chr : input[0]
|
50
55
|
else
|
@@ -53,7 +58,7 @@ define_filter :first do |input|
|
|
53
58
|
end
|
54
59
|
|
55
60
|
# returns the last item of an iterable
|
56
|
-
define_filter :last do |input|
|
61
|
+
define_filter :last do |input, params|
|
57
62
|
if input.respond_to?(:[])
|
58
63
|
RUBY_VERSION =~ /^1.8/ && input.is_a?(String) ? input[-1].chr : input[-1]
|
59
64
|
else
|
@@ -62,36 +67,90 @@ define_filter :last do |input|
|
|
62
67
|
end
|
63
68
|
|
64
69
|
# glues together elements of the input with the glue string
|
65
|
-
define_filter :join do |input,
|
70
|
+
define_filter :join do |input, params|
|
71
|
+
glue = params.first
|
66
72
|
input.join(glue)
|
67
73
|
end
|
68
74
|
|
69
75
|
# returns the length of the input
|
70
|
-
define_filter :length,
|
76
|
+
define_filter :length do |input, params|
|
77
|
+
input.length
|
78
|
+
end
|
71
79
|
|
72
80
|
# returns the string left justified with the given padding character
|
73
|
-
define_filter :ljust do |input,
|
74
|
-
|
81
|
+
define_filter :ljust do |input, params|
|
82
|
+
length = params[0]
|
83
|
+
padding = params[1] || ' '
|
75
84
|
input.ljust(length, padding)
|
76
85
|
end
|
77
86
|
|
78
87
|
# returns the string right justified with the given padding character
|
79
|
-
define_filter :rjust do |input,
|
80
|
-
|
88
|
+
define_filter :rjust do |input, params|
|
89
|
+
length = params[0]
|
90
|
+
padding = params[1] || ' '
|
81
91
|
input.rjust(length, padding)
|
82
92
|
end
|
83
93
|
|
84
94
|
# returns the string downcased
|
85
|
-
define_filter :lower,
|
95
|
+
define_filter :lower do |input, params|
|
96
|
+
input.downcase
|
97
|
+
end
|
86
98
|
|
87
99
|
# returns the string upcased
|
88
|
-
define_filter :upper,
|
100
|
+
define_filter :upper do |input, params|
|
101
|
+
input.upcase
|
102
|
+
end
|
89
103
|
|
90
104
|
# returns the given words wrapped to fit inside the given column width. Wrapping
|
91
105
|
# is done on word boundaries so that no word cutting is done.
|
92
106
|
# source: http://www.java2s.com/Code/Ruby/String/WordwrappingLinesofText.htm
|
93
|
-
define_filter :wordwrap do |input,
|
94
|
-
|
95
|
-
|
107
|
+
define_filter :wordwrap do |input, params|
|
108
|
+
length = params[0]
|
109
|
+
linefeed = params[1] || "\n"
|
110
|
+
input.gsub(/(.{1,#{length}})(\s+|\Z)/, "\\1\n").strip.gsub(/\n/, linefeed)
|
111
|
+
end
|
112
|
+
|
113
|
+
# returns the string or array reversed
|
114
|
+
define_filter :reverse do |input, params|
|
115
|
+
input.reverse
|
116
|
+
end
|
117
|
+
|
118
|
+
# returns the string or array with the first +length+ items/characters contained
|
119
|
+
define_filter :limit do |input, params|
|
120
|
+
length = params.first
|
121
|
+
|
122
|
+
if length > 0
|
123
|
+
input.slice(0..length-1)
|
124
|
+
else
|
125
|
+
input.is_a?(Array) ? [] : ""
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
# returns the string or array with all items/characters after the +index+
|
130
|
+
# item/character (where 1 is the first index, not 0 as programmers are used to)
|
131
|
+
define_filter :offset do |input, params|
|
132
|
+
index = params.first
|
133
|
+
|
134
|
+
input.slice(index..-1)
|
96
135
|
end
|
97
136
|
|
137
|
+
# returns an array of objects with the given identifier looked up on all of the
|
138
|
+
# input array elements.
|
139
|
+
define_filter :pluck do |input, params|
|
140
|
+
identifier = params.first
|
141
|
+
|
142
|
+
input.map {|item| Cadenza::Context.lookup_on_object(identifier, item) }
|
143
|
+
end
|
144
|
+
|
145
|
+
alias_filter :pluck, :map
|
146
|
+
alias_filter :pluck, :collect
|
147
|
+
|
148
|
+
define_filter :sort do |input, params|
|
149
|
+
identifier = params.first
|
150
|
+
|
151
|
+
if identifier
|
152
|
+
input.sort {|a,b| Cadenza::Context.lookup_on_object(identifier, a) <=> Cadenza::Context.lookup_on_object(identifier, b) }
|
153
|
+
else
|
154
|
+
input.sort
|
155
|
+
end
|
156
|
+
end
|
data/lib/cadenza/lexer.rb
CHANGED
@@ -4,9 +4,6 @@ module Cadenza
|
|
4
4
|
# The {Lexer} class accepts in input {IO} object which it will parse simple
|
5
5
|
# {Token}s from for use in a {Parser} class.
|
6
6
|
class Lexer
|
7
|
-
#TODO: look at using the CodeRay scanner instead, it supports reading from
|
8
|
-
# an IO object (unlike StringScanner which must have a string in memory)
|
9
|
-
# http://coderay.rubychan.de/doc/classes/CodeRay/Scanners/Scanner.html
|
10
7
|
|
11
8
|
# constructs a new parser and sets it to the position (0, 0)
|
12
9
|
def initialize
|
@@ -37,8 +37,7 @@ module Cadenza
|
|
37
37
|
# @param [String] value the input value to filter
|
38
38
|
# @return the input value when passed through this evaluated filter
|
39
39
|
def evaluate(context, value)
|
40
|
-
|
41
|
-
context.evaluate_filter(@identifier, params)
|
40
|
+
context.evaluate_filter(@identifier, value, @parameters.map {|x| x.eval(context) })
|
42
41
|
end
|
43
42
|
end
|
44
43
|
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
|
2
|
+
module Cadenza
|
3
|
+
# The {FilteredValueNode} applies a list of passed {FilterNode} to it's value
|
4
|
+
# when evaluated.
|
5
|
+
class FilteredValueNode
|
6
|
+
# @return [Node] the value to be filtered
|
7
|
+
attr_accessor :value
|
8
|
+
|
9
|
+
# @return [Array] a list of {FilterNode} to evaluate the value with, once the
|
10
|
+
# value has itself been evaluated.
|
11
|
+
attr_accessor :filters
|
12
|
+
|
13
|
+
# creates a new {FilteredValueNode}.
|
14
|
+
# @param [String] identifier see {#identifier}
|
15
|
+
# @param [Array] filters see {#filters}
|
16
|
+
def initialize(value, filters=[])
|
17
|
+
@value = value
|
18
|
+
@filters = filters
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [Array] a list of names which are implied to be global variables
|
22
|
+
# from this node.
|
23
|
+
def implied_globals
|
24
|
+
(@value.implied_globals + @filters.map(&:implied_globals).flatten).uniq
|
25
|
+
end
|
26
|
+
|
27
|
+
# @param [Context] context
|
28
|
+
# @return [Object] gets the value and returns it after being passed
|
29
|
+
# through all filters
|
30
|
+
def eval(context)
|
31
|
+
value = @value.eval(context)
|
32
|
+
|
33
|
+
@filters.each {|filter| value = filter.evaluate(context, value) }
|
34
|
+
|
35
|
+
value
|
36
|
+
end
|
37
|
+
|
38
|
+
# @param [FilteredValueNode] rhs
|
39
|
+
# @return [Boolean] if the given {FilteredValueNode} is equivalent by
|
40
|
+
# value to this node.
|
41
|
+
def ==(rhs)
|
42
|
+
self.value == rhs.value && self.filters == rhs.filters
|
43
|
+
end
|
44
|
+
|
45
|
+
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
@@ -5,30 +5,43 @@ module Cadenza
|
|
5
5
|
# @return [String] the name given to this variable
|
6
6
|
attr_accessor :identifier
|
7
7
|
|
8
|
+
# @return [Array] a list of Node objects passed to the {#value} for use in a
|
9
|
+
# functional variable. See {Context#define_functional_variable}.
|
10
|
+
attr_accessor :parameters
|
11
|
+
|
8
12
|
# creates a new {VariableNode} with the name given.
|
9
13
|
# @param [String] identifier see {#identifier}
|
10
|
-
|
14
|
+
# @param [Array] parameters see {#parameters}
|
15
|
+
def initialize(identifier, parameters=[])
|
11
16
|
@identifier = identifier
|
17
|
+
@parameters = parameters
|
12
18
|
end
|
13
19
|
|
14
20
|
# @return [Array] a list of names which are implied to be global variables
|
15
21
|
# from this node.
|
16
22
|
def implied_globals
|
17
|
-
[self.identifier]
|
23
|
+
([self.identifier] + @parameters.map(&:implied_globals).flatten).uniq
|
18
24
|
end
|
19
25
|
|
20
26
|
# @param [Context] context
|
21
27
|
# @return [Object] looks up and returns the value of this variable in the
|
22
28
|
# given {Context}
|
23
29
|
def eval(context)
|
24
|
-
context.lookup(@identifier)
|
30
|
+
value = context.lookup(@identifier)
|
31
|
+
|
32
|
+
if value.is_a? Proc
|
33
|
+
args = parameters.map {|p| p.eval(context) }
|
34
|
+
value = value.call(context, *args)
|
35
|
+
end
|
36
|
+
|
37
|
+
value
|
25
38
|
end
|
26
39
|
|
27
40
|
# @param [VariableNode] rhs
|
28
41
|
# @return [Boolean] if the given {VariableNode} is equivalent by value to
|
29
42
|
# this node.
|
30
43
|
def ==(rhs)
|
31
|
-
self.identifier == rhs.identifier
|
44
|
+
self.identifier == rhs.identifier && self.parameters == rhs.parameters
|
32
45
|
end
|
33
46
|
end
|
34
47
|
end
|
data/lib/cadenza/racc_parser.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
2
|
# DO NOT MODIFY!!!!
|
3
|
-
# This file is automatically generated by Racc 1.4.
|
3
|
+
# This file is automatically generated by Racc 1.4.9
|
4
4
|
# from Racc grammer file "".
|
5
5
|
#
|
6
6
|
|
@@ -11,243 +11,241 @@ require 'racc/parser.rb'
|
|
11
11
|
module Cadenza
|
12
12
|
class RaccParser < Racc::Parser
|
13
13
|
|
14
|
-
module_eval(<<'...end cadenza.y/module_eval...', 'cadenza.y',
|
14
|
+
module_eval(<<'...end cadenza.y/module_eval...', 'cadenza.y', 223)
|
15
15
|
|
16
16
|
...end cadenza.y/module_eval...
|
17
17
|
##### State transition tables begin ###
|
18
18
|
|
19
19
|
racc_action_table = [
|
20
|
-
|
21
|
-
25, 26,
|
22
|
-
9,
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
25, 26,
|
50
|
-
25, 26,
|
51
|
-
25, 26,
|
52
|
-
|
53
|
-
|
20
|
+
39, 39, 95, 134, 3, 131, 122, 22, 23, 24,
|
21
|
+
25, 26, 70, 71, 39, 72, 61, 62, 81, 39,
|
22
|
+
9, 80, 126, 31, 35, 35, 36, 36, 116, 83,
|
23
|
+
37, 37, 39, 38, 38, 152, 40, 40, 35, 121,
|
24
|
+
36, 82, 83, 35, 37, 36, 39, 38, 87, 37,
|
25
|
+
40, 120, 38, 119, 39, 40, 35, 138, 36, 39,
|
26
|
+
139, 3, 37, 135, 118, 38, 115, 39, 40, 114,
|
27
|
+
35, 109, 36, 82, 96, 87, 37, 9, 35, 38,
|
28
|
+
36, 95, 40, 35, 37, 36, 93, 38, 93, 37,
|
29
|
+
40, 35, 38, 36, 151, 40, 3, 37, 132, 91,
|
30
|
+
38, 70, 71, 40, 22, 23, 24, 25, 26, 3,
|
31
|
+
91, 127, 9, 77, 3, 76, 127, 109, 70, 71,
|
32
|
+
31, 61, 62, 61, 62, 9, 112, 59, 60, 79,
|
33
|
+
9, 22, 23, 24, 25, 26, 22, 23, 24, 25,
|
34
|
+
26, 22, 23, 24, 25, 26, 147, 31, 70, 71,
|
35
|
+
61, 62, 31, 70, 71, 73, 113, 31, 22, 23,
|
36
|
+
24, 25, 26, 22, 23, 24, 25, 26, 22, 23,
|
37
|
+
24, 25, 26, 3, 31, 122, 3, 55, 149, 31,
|
38
|
+
3, 3, 41, 4, 31, 3, 3, 150, 45, 9,
|
39
|
+
95, 3, 9, 4, 61, 62, 9, 9, 3, 52,
|
40
|
+
45, 9, 9, 3, 3, 4, 41, 9, 3, 49,
|
41
|
+
4, 61, 62, 18, 9, 3, 153, 127, 154, 9,
|
42
|
+
9, 3, nil, 4, 9, 22, 23, 24, 25, 26,
|
43
|
+
nil, 9, 22, 23, 24, 25, 26, 9, 3, nil,
|
44
|
+
4, 31, 3, 3, 4, 122, 59, 60, 31, 22,
|
45
|
+
23, 24, 25, 26, 9, 3, nil, 4, 9, 9,
|
46
|
+
22, 23, 24, 25, 26, 31, 22, 23, 24, 25,
|
47
|
+
26, 9, 63, 64, 65, 66, 67, 68, 63, 64,
|
48
|
+
65, 66, 67, 68, 22, 23, 24, 25, 26, 22,
|
49
|
+
23, 24, 25, 26, 22, 23, 24, 25, 26, 22,
|
50
|
+
23, 24, 25, 26, 22, 23, 24, 25, 26, 22,
|
51
|
+
23, 24, 25, 26, 22, 23, 24, 25, 26, 22,
|
52
|
+
23, 24, 25, 26, 22, 23, 24, 25, 26, 59,
|
53
|
+
60, 61, 62 ]
|
54
54
|
|
55
55
|
racc_action_check = [
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
64,
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
56
|
+
150, 122, 78, 93, 86, 91, 86, 95, 95, 95,
|
57
|
+
95, 95, 33, 33, 41, 33, 106, 106, 40, 127,
|
58
|
+
86, 40, 87, 95, 150, 122, 150, 122, 78, 122,
|
59
|
+
150, 122, 4, 150, 122, 150, 150, 122, 41, 83,
|
60
|
+
41, 41, 41, 127, 41, 127, 45, 41, 127, 127,
|
61
|
+
41, 82, 127, 81, 135, 127, 4, 109, 4, 149,
|
62
|
+
111, 94, 4, 94, 80, 4, 77, 132, 4, 76,
|
63
|
+
45, 72, 45, 45, 58, 45, 45, 94, 135, 45,
|
64
|
+
135, 57, 45, 149, 135, 149, 52, 135, 135, 149,
|
65
|
+
135, 132, 149, 132, 149, 149, 92, 132, 92, 132,
|
66
|
+
132, 137, 137, 132, 39, 39, 39, 39, 39, 90,
|
67
|
+
49, 90, 92, 38, 89, 37, 89, 139, 74, 74,
|
68
|
+
39, 103, 103, 105, 105, 90, 74, 100, 100, 39,
|
69
|
+
89, 70, 70, 70, 70, 70, 35, 35, 35, 35,
|
70
|
+
35, 36, 36, 36, 36, 36, 140, 70, 75, 75,
|
71
|
+
102, 102, 35, 56, 56, 34, 75, 36, 138, 138,
|
72
|
+
138, 138, 138, 26, 26, 26, 26, 26, 22, 22,
|
73
|
+
22, 22, 22, 85, 138, 85, 142, 18, 142, 26,
|
74
|
+
43, 44, 43, 44, 22, 148, 47, 148, 47, 85,
|
75
|
+
145, 48, 142, 48, 101, 101, 43, 44, 6, 8,
|
76
|
+
6, 148, 47, 51, 5, 51, 5, 48, 54, 7,
|
77
|
+
54, 29, 29, 1, 6, 129, 151, 129, 152, 51,
|
78
|
+
5, 2, nil, 2, 54, 114, 114, 114, 114, 114,
|
79
|
+
nil, 129, 3, 3, 3, 3, 3, 2, 117, nil,
|
80
|
+
117, 114, 0, 124, 0, 124, 28, 28, 3, 71,
|
81
|
+
71, 71, 71, 71, 117, 141, nil, 141, 0, 124,
|
82
|
+
65, 65, 65, 65, 65, 71, 64, 64, 64, 64,
|
83
|
+
64, 141, 30, 30, 30, 30, 30, 30, 69, 69,
|
84
|
+
69, 69, 69, 69, 63, 63, 63, 63, 63, 62,
|
85
|
+
62, 62, 62, 62, 68, 68, 68, 68, 68, 67,
|
86
|
+
67, 67, 67, 67, 61, 61, 61, 61, 61, 31,
|
87
|
+
31, 31, 31, 31, 59, 59, 59, 59, 59, 66,
|
88
|
+
66, 66, 66, 66, 60, 60, 60, 60, 60, 99,
|
89
|
+
99, 104, 104 ]
|
90
90
|
|
91
91
|
racc_action_pointer = [
|
92
|
-
|
93
|
-
nil, nil, nil, nil, nil, nil, nil, nil,
|
94
|
-
nil, nil,
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
nil,
|
104
|
-
nil, nil, nil, nil,
|
105
|
-
nil,
|
106
|
-
|
107
|
-
|
92
|
+
218, 213, 197, 229, 29, 180, 174, 183, 173, nil,
|
93
|
+
nil, nil, nil, nil, nil, nil, nil, nil, 177, nil,
|
94
|
+
nil, nil, 165, nil, nil, nil, 160, nil, 237, 200,
|
95
|
+
259, 306, nil, -8, 130, 133, 138, 112, 110, 101,
|
96
|
+
15, 11, nil, 156, 157, 43, nil, 162, 167, 75,
|
97
|
+
nil, 179, 49, nil, 184, nil, 133, 79, 66, 311,
|
98
|
+
321, 301, 286, 281, 263, 257, 316, 296, 291, 265,
|
99
|
+
128, 246, 68, nil, 98, 128, 35, 38, 0, nil,
|
100
|
+
36, 25, 23, 11, nil, 149, -20, -6, nil, 90,
|
101
|
+
85, -23, 72, -25, 37, 4, nil, nil, nil, 320,
|
102
|
+
118, 183, 139, 110, 320, 112, 5, nil, nil, 35,
|
103
|
+
nil, 37, nil, nil, 222, nil, nil, 214, nil, nil,
|
104
|
+
nil, nil, -2, nil, 219, nil, nil, 16, nil, 191,
|
105
|
+
nil, nil, 64, nil, nil, 51, nil, 81, 155, 114,
|
106
|
+
118, 231, 152, nil, nil, 188, nil, nil, 161, 56,
|
107
|
+
-3, 188, 190, nil, nil ]
|
108
108
|
|
109
109
|
racc_action_default = [
|
110
110
|
-2, -79, -1, -79, -79, -79, -79, -54, -59, -67,
|
111
111
|
-68, -69, -70, -71, -72, -73, -75, -77, -79, -74,
|
112
|
-
-76, -78, -
|
113
|
-
-
|
114
|
-
-79, -41, -79, -79, -79, -46, -79, -79, -79,
|
115
|
-
-79, -79, -58, -79,
|
116
|
-
-79, -79, -79, -79, -79, -79, -79, -79, -79, -
|
117
|
-
-79, -79, -
|
112
|
+
-76, -78, -5, -7, -8, -9, -79, -11, -14, -17,
|
113
|
+
-24, -79, -26, -33, -79, -79, -79, -79, -79, -79,
|
114
|
+
-79, -79, -41, -79, -79, -79, -46, -79, -79, -79,
|
115
|
+
-53, -79, -79, -58, -79, 155, -3, -6, -79, -79,
|
116
|
+
-79, -79, -79, -79, -79, -79, -79, -79, -79, -25,
|
117
|
+
-79, -79, -79, -35, -79, -79, -79, -79, -79, -61,
|
118
118
|
-79, -79, -79, -79, -42, -79, -79, -79, -47, -79,
|
119
|
-
-79, -79, -79, -79, -79, -79, -
|
120
|
-
-
|
121
|
-
-
|
122
|
-
-
|
123
|
-
-
|
124
|
-
-79, -79, -79, -
|
125
|
-
-
|
119
|
+
-79, -79, -79, -79, -79, -79, -10, -12, -13, -15,
|
120
|
+
-16, -18, -19, -20, -21, -22, -23, -27, -28, -29,
|
121
|
+
-31, -34, -36, -37, -79, -56, -63, -79, -65, -66,
|
122
|
+
-38, -39, -79, -44, -79, -43, -40, -79, -49, -79,
|
123
|
+
-48, -52, -79, -55, -57, -79, -60, -4, -79, -79,
|
124
|
+
-79, -79, -79, -45, -50, -30, -32, -51, -79, -79,
|
125
|
+
-79, -79, -79, -62, -64 ]
|
126
126
|
|
127
127
|
racc_goto_table = [
|
128
|
-
19,
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
nil, nil, 92, nil, nil, 94,
|
135
|
-
|
136
|
-
nil, nil,
|
137
|
-
19,
|
138
|
-
|
139
|
-
nil, nil, nil, nil, nil, nil,
|
140
|
-
|
141
|
-
|
142
|
-
nil, nil, nil, nil, 19,
|
143
|
-
|
144
|
-
nil, 20 ]
|
128
|
+
19, 20, 42, 46, 57, 34, 110, 97, 98, 111,
|
129
|
+
21, 50, 2, 53, 51, 44, 48, 43, 47, 107,
|
130
|
+
108, 78, 56, 99, 100, 54, 117, 141, 58, 101,
|
131
|
+
102, 103, 104, 105, 106, 74, 75, 69, 1, 56,
|
132
|
+
84, 19, 20, nil, 88, 19, 20, nil, nil, nil,
|
133
|
+
nil, 21, nil, 85, nil, 21, 86, 89, nil, nil,
|
134
|
+
90, nil, nil, 92, nil, nil, 94, nil, nil, nil,
|
135
|
+
nil, nil, nil, 146, nil, nil, nil, nil, nil, nil,
|
136
|
+
nil, nil, 123, 125, 19, 20, 128, 130, 19, 20,
|
137
|
+
19, 20, 19, 20, 21, 137, 133, 124, 21, 136,
|
138
|
+
21, 129, 21, nil, nil, nil, nil, nil, nil, nil,
|
139
|
+
nil, nil, nil, nil, nil, nil, 140, nil, nil, nil,
|
140
|
+
145, 143, 19, 20, nil, nil, 144, 19, 20, 142,
|
141
|
+
nil, nil, 21, nil, nil, nil, nil, 21, 56, nil,
|
142
|
+
19, 20, nil, nil, nil, nil, 19, 20, nil, nil,
|
143
|
+
21, nil, nil, 148, nil, nil, 21 ]
|
145
144
|
|
146
145
|
racc_goto_check = [
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
nil, nil, 2, nil, nil, 2,
|
154
|
-
|
155
|
-
nil, nil,
|
156
|
-
|
157
|
-
|
158
|
-
nil, nil, nil, nil, nil, nil,
|
159
|
-
|
160
|
-
|
161
|
-
nil, nil, nil, nil,
|
162
|
-
|
163
|
-
nil, 31 ]
|
146
|
+
33, 32, 17, 18, 3, 6, 11, 5, 5, 12,
|
147
|
+
27, 22, 2, 26, 24, 16, 16, 2, 2, 10,
|
148
|
+
10, 3, 4, 7, 7, 28, 30, 31, 6, 8,
|
149
|
+
8, 8, 8, 8, 8, 4, 4, 9, 1, 4,
|
150
|
+
17, 33, 32, nil, 18, 33, 32, nil, nil, nil,
|
151
|
+
nil, 27, nil, 16, nil, 27, 2, 16, nil, nil,
|
152
|
+
2, nil, nil, 2, nil, nil, 2, nil, nil, nil,
|
153
|
+
nil, nil, nil, 11, nil, nil, nil, nil, nil, nil,
|
154
|
+
nil, nil, 17, 17, 33, 32, 18, 18, 33, 32,
|
155
|
+
33, 32, 33, 32, 27, 4, 22, 2, 27, 26,
|
156
|
+
27, 2, 27, nil, nil, nil, nil, nil, nil, nil,
|
157
|
+
nil, nil, nil, nil, nil, nil, 6, nil, nil, nil,
|
158
|
+
3, 17, 33, 32, nil, nil, 18, 33, 32, 2,
|
159
|
+
nil, nil, 27, nil, nil, nil, nil, 27, 4, nil,
|
160
|
+
33, 32, nil, nil, nil, nil, 33, 32, nil, nil,
|
161
|
+
27, nil, nil, 2, nil, nil, 27 ]
|
164
162
|
|
165
163
|
racc_goto_pointer = [
|
166
|
-
nil,
|
167
|
-
|
168
|
-
nil,
|
169
|
-
-
|
164
|
+
nil, 38, 12, -18, 0, -52, 2, -38, -34, 6,
|
165
|
+
-51, -66, -63, nil, nil, nil, 10, -3, -3, nil,
|
166
|
+
nil, nil, 4, nil, 7, nil, 5, 8, 17, nil,
|
167
|
+
-53, -89, -1, -2 ]
|
170
168
|
|
171
169
|
racc_goto_default = [
|
172
|
-
nil, nil, nil,
|
173
|
-
|
174
|
-
7, nil, 13, nil, 8, nil, 17, nil, 14,
|
175
|
-
nil, 16, 15 ]
|
170
|
+
nil, nil, nil, nil, 33, 27, nil, 28, 29, 30,
|
171
|
+
32, nil, nil, 10, 5, 6, nil, nil, nil, 11,
|
172
|
+
12, 7, nil, 13, nil, 8, nil, 17, nil, 14,
|
173
|
+
nil, nil, 16, 15 ]
|
176
174
|
|
177
175
|
racc_reduce_table = [
|
178
176
|
0, 0, :racc_error,
|
179
177
|
1, 42, :_reduce_none,
|
180
178
|
0, 42, :_reduce_2,
|
181
179
|
1, 44, :_reduce_3,
|
182
|
-
|
183
|
-
1,
|
184
|
-
|
185
|
-
|
186
|
-
1, 46, :
|
187
|
-
|
180
|
+
3, 44, :_reduce_4,
|
181
|
+
1, 46, :_reduce_5,
|
182
|
+
2, 46, :_reduce_6,
|
183
|
+
1, 46, :_reduce_7,
|
184
|
+
1, 46, :_reduce_8,
|
185
|
+
1, 46, :_reduce_9,
|
188
186
|
3, 46, :_reduce_10,
|
189
|
-
1, 47, :_reduce_none,
|
190
|
-
3, 47, :_reduce_12,
|
191
|
-
3, 47, :_reduce_13,
|
192
187
|
1, 48, :_reduce_none,
|
193
|
-
3, 48, :
|
194
|
-
3, 48, :
|
195
|
-
3, 48, :_reduce_17,
|
196
|
-
3, 48, :_reduce_18,
|
197
|
-
3, 48, :_reduce_19,
|
198
|
-
3, 48, :_reduce_20,
|
188
|
+
3, 48, :_reduce_12,
|
189
|
+
3, 48, :_reduce_13,
|
199
190
|
1, 49, :_reduce_none,
|
200
|
-
|
191
|
+
3, 49, :_reduce_15,
|
192
|
+
3, 49, :_reduce_16,
|
193
|
+
1, 50, :_reduce_none,
|
194
|
+
3, 50, :_reduce_18,
|
195
|
+
3, 50, :_reduce_19,
|
196
|
+
3, 50, :_reduce_20,
|
197
|
+
3, 50, :_reduce_21,
|
198
|
+
3, 50, :_reduce_22,
|
199
|
+
3, 50, :_reduce_23,
|
200
|
+
1, 51, :_reduce_none,
|
201
|
+
2, 51, :_reduce_25,
|
201
202
|
1, 45, :_reduce_none,
|
202
|
-
3, 45, :
|
203
|
-
3, 45, :
|
204
|
-
1,
|
205
|
-
3,
|
206
|
-
1,
|
207
|
-
3, 51, :_reduce_29,
|
208
|
-
1, 52, :_reduce_30,
|
209
|
-
3, 52, :_reduce_31,
|
203
|
+
3, 45, :_reduce_27,
|
204
|
+
3, 45, :_reduce_28,
|
205
|
+
1, 52, :_reduce_29,
|
206
|
+
3, 52, :_reduce_30,
|
207
|
+
1, 53, :_reduce_31,
|
210
208
|
3, 53, :_reduce_32,
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
4,
|
215
|
-
4,
|
216
|
-
3,
|
217
|
-
3, 57, :_reduce_none,
|
209
|
+
1, 47, :_reduce_none,
|
210
|
+
3, 47, :_reduce_34,
|
211
|
+
3, 54, :_reduce_35,
|
212
|
+
4, 55, :_reduce_36,
|
213
|
+
4, 56, :_reduce_37,
|
214
|
+
3, 57, :_reduce_38,
|
218
215
|
3, 58, :_reduce_none,
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
4,
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
4,
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
4,
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
4,
|
245
|
-
|
246
|
-
1,
|
247
|
-
1,
|
248
|
-
1,
|
249
|
-
1,
|
250
|
-
1,
|
216
|
+
3, 59, :_reduce_none,
|
217
|
+
2, 60, :_reduce_41,
|
218
|
+
3, 60, :_reduce_42,
|
219
|
+
4, 60, :_reduce_43,
|
220
|
+
4, 60, :_reduce_44,
|
221
|
+
5, 60, :_reduce_45,
|
222
|
+
2, 61, :_reduce_46,
|
223
|
+
3, 61, :_reduce_47,
|
224
|
+
4, 61, :_reduce_48,
|
225
|
+
4, 61, :_reduce_49,
|
226
|
+
5, 61, :_reduce_50,
|
227
|
+
6, 62, :_reduce_51,
|
228
|
+
3, 63, :_reduce_none,
|
229
|
+
2, 64, :_reduce_53,
|
230
|
+
0, 65, :_reduce_54,
|
231
|
+
4, 64, :_reduce_55,
|
232
|
+
4, 66, :_reduce_56,
|
233
|
+
3, 67, :_reduce_none,
|
234
|
+
2, 68, :_reduce_58,
|
235
|
+
0, 69, :_reduce_59,
|
236
|
+
4, 68, :_reduce_60,
|
237
|
+
0, 71, :_reduce_61,
|
238
|
+
8, 70, :_reduce_62,
|
239
|
+
0, 72, :_reduce_63,
|
240
|
+
9, 70, :_reduce_64,
|
241
|
+
4, 73, :_reduce_65,
|
242
|
+
4, 73, :_reduce_66,
|
243
|
+
1, 74, :_reduce_67,
|
244
|
+
1, 74, :_reduce_none,
|
245
|
+
1, 74, :_reduce_none,
|
246
|
+
1, 74, :_reduce_none,
|
247
|
+
1, 74, :_reduce_none,
|
248
|
+
1, 74, :_reduce_none,
|
251
249
|
1, 43, :_reduce_73,
|
252
250
|
2, 43, :_reduce_74,
|
253
251
|
1, 43, :_reduce_75,
|
@@ -257,31 +255,31 @@ racc_reduce_table = [
|
|
257
255
|
|
258
256
|
racc_reduce_n = 79
|
259
257
|
|
260
|
-
racc_shift_n =
|
258
|
+
racc_shift_n = 155
|
261
259
|
|
262
260
|
racc_token_table = {
|
263
261
|
false => 0,
|
264
262
|
:error => 1,
|
265
|
-
|
266
|
-
:
|
267
|
-
:
|
268
|
-
:
|
269
|
-
|
270
|
-
"
|
271
|
-
"
|
272
|
-
"
|
273
|
-
"
|
274
|
-
"
|
275
|
-
|
276
|
-
:
|
277
|
-
:
|
278
|
-
:
|
279
|
-
|
280
|
-
"
|
281
|
-
|
282
|
-
:
|
283
|
-
:
|
284
|
-
|
263
|
+
"," => 2,
|
264
|
+
:IDENTIFIER => 3,
|
265
|
+
:INTEGER => 4,
|
266
|
+
:REAL => 5,
|
267
|
+
:STRING => 6,
|
268
|
+
"(" => 7,
|
269
|
+
")" => 8,
|
270
|
+
"*" => 9,
|
271
|
+
"/" => 10,
|
272
|
+
"+" => 11,
|
273
|
+
"-" => 12,
|
274
|
+
:OP_EQ => 13,
|
275
|
+
:OP_NEQ => 14,
|
276
|
+
:OP_LEQ => 15,
|
277
|
+
:OP_GEQ => 16,
|
278
|
+
">" => 17,
|
279
|
+
"<" => 18,
|
280
|
+
:NOT => 19,
|
281
|
+
:AND => 20,
|
282
|
+
:OR => 21,
|
285
283
|
":" => 22,
|
286
284
|
"|" => 23,
|
287
285
|
:VAR_OPEN => 24,
|
@@ -325,6 +323,7 @@ Racc_arg = [
|
|
325
323
|
Racc_token_to_s_table = [
|
326
324
|
"$end",
|
327
325
|
"error",
|
326
|
+
"\",\"",
|
328
327
|
"IDENTIFIER",
|
329
328
|
"INTEGER",
|
330
329
|
"REAL",
|
@@ -344,7 +343,6 @@ Racc_token_to_s_table = [
|
|
344
343
|
"NOT",
|
345
344
|
"AND",
|
346
345
|
"OR",
|
347
|
-
"\",\"",
|
348
346
|
"\":\"",
|
349
347
|
"\"|\"",
|
350
348
|
"VAR_OPEN",
|
@@ -367,13 +365,14 @@ Racc_token_to_s_table = [
|
|
367
365
|
"$start",
|
368
366
|
"target",
|
369
367
|
"document",
|
370
|
-
"
|
368
|
+
"parameter_list",
|
371
369
|
"logical_expression",
|
370
|
+
"primary_expression",
|
371
|
+
"filtered_expression",
|
372
372
|
"multiplicative_expression",
|
373
373
|
"additive_expression",
|
374
374
|
"boolean_expression",
|
375
375
|
"inverse_expression",
|
376
|
-
"parameter_list",
|
377
376
|
"filter",
|
378
377
|
"filter_list",
|
379
378
|
"inject_statement",
|
@@ -415,215 +414,206 @@ module_eval(<<'.,.,', 'cadenza.y', 8)
|
|
415
414
|
|
416
415
|
module_eval(<<'.,.,', 'cadenza.y', 12)
|
417
416
|
def _reduce_3(val, _values, result)
|
418
|
-
result =
|
417
|
+
result = [val[0]]
|
419
418
|
result
|
420
419
|
end
|
421
420
|
.,.,
|
422
421
|
|
423
422
|
module_eval(<<'.,.,', 'cadenza.y', 13)
|
424
423
|
def _reduce_4(val, _values, result)
|
425
|
-
result =
|
424
|
+
result = val[0].push(val[2])
|
426
425
|
result
|
427
426
|
end
|
428
427
|
.,.,
|
429
428
|
|
430
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
429
|
+
module_eval(<<'.,.,', 'cadenza.y', 18)
|
431
430
|
def _reduce_5(val, _values, result)
|
432
|
-
result =
|
431
|
+
result = VariableNode.new(val[0].value)
|
433
432
|
result
|
434
433
|
end
|
435
434
|
.,.,
|
436
435
|
|
437
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
436
|
+
module_eval(<<'.,.,', 'cadenza.y', 19)
|
438
437
|
def _reduce_6(val, _values, result)
|
439
|
-
result =
|
438
|
+
result = VariableNode.new(val[0].value, val[1])
|
440
439
|
result
|
441
440
|
end
|
442
441
|
.,.,
|
443
442
|
|
444
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
443
|
+
module_eval(<<'.,.,', 'cadenza.y', 20)
|
445
444
|
def _reduce_7(val, _values, result)
|
446
|
-
result = val[
|
445
|
+
result = ConstantNode.new(val[0].value)
|
447
446
|
result
|
448
447
|
end
|
449
448
|
.,.,
|
450
449
|
|
451
|
-
# reduce 8 omitted
|
452
|
-
|
453
450
|
module_eval(<<'.,.,', 'cadenza.y', 21)
|
454
|
-
def
|
455
|
-
result =
|
451
|
+
def _reduce_8(val, _values, result)
|
452
|
+
result = ConstantNode.new(val[0].value)
|
456
453
|
result
|
457
454
|
end
|
458
455
|
.,.,
|
459
456
|
|
460
457
|
module_eval(<<'.,.,', 'cadenza.y', 22)
|
458
|
+
def _reduce_9(val, _values, result)
|
459
|
+
result = ConstantNode.new(val[0].value)
|
460
|
+
result
|
461
|
+
end
|
462
|
+
.,.,
|
463
|
+
|
464
|
+
module_eval(<<'.,.,', 'cadenza.y', 23)
|
461
465
|
def _reduce_10(val, _values, result)
|
462
|
-
result =
|
466
|
+
result = val[1]
|
463
467
|
result
|
464
468
|
end
|
465
469
|
.,.,
|
466
470
|
|
467
471
|
# reduce 11 omitted
|
468
472
|
|
469
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
473
|
+
module_eval(<<'.,.,', 'cadenza.y', 28)
|
470
474
|
def _reduce_12(val, _values, result)
|
471
|
-
result = OperationNode.new(val[0], "
|
475
|
+
result = OperationNode.new(val[0], "*", val[2])
|
472
476
|
result
|
473
477
|
end
|
474
478
|
.,.,
|
475
479
|
|
476
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
480
|
+
module_eval(<<'.,.,', 'cadenza.y', 29)
|
477
481
|
def _reduce_13(val, _values, result)
|
478
|
-
result = OperationNode.new(val[0], "
|
482
|
+
result = OperationNode.new(val[0], "/", val[2])
|
479
483
|
result
|
480
484
|
end
|
481
485
|
.,.,
|
482
486
|
|
483
487
|
# reduce 14 omitted
|
484
488
|
|
485
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
489
|
+
module_eval(<<'.,.,', 'cadenza.y', 34)
|
486
490
|
def _reduce_15(val, _values, result)
|
487
|
-
result = OperationNode.new(val[0], "
|
491
|
+
result = OperationNode.new(val[0], "+", val[2])
|
488
492
|
result
|
489
493
|
end
|
490
494
|
.,.,
|
491
495
|
|
492
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
496
|
+
module_eval(<<'.,.,', 'cadenza.y', 35)
|
493
497
|
def _reduce_16(val, _values, result)
|
494
|
-
result = OperationNode.new(val[0], "
|
498
|
+
result = OperationNode.new(val[0], "-", val[2])
|
495
499
|
result
|
496
500
|
end
|
497
501
|
.,.,
|
498
502
|
|
499
|
-
|
500
|
-
def _reduce_17(val, _values, result)
|
501
|
-
result = OperationNode.new(val[0], "<=", val[2])
|
502
|
-
result
|
503
|
-
end
|
504
|
-
.,.,
|
503
|
+
# reduce 17 omitted
|
505
504
|
|
506
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
505
|
+
module_eval(<<'.,.,', 'cadenza.y', 40)
|
507
506
|
def _reduce_18(val, _values, result)
|
508
|
-
result = OperationNode.new(val[0], "
|
507
|
+
result = OperationNode.new(val[0], "==", val[2])
|
509
508
|
result
|
510
509
|
end
|
511
510
|
.,.,
|
512
511
|
|
513
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
512
|
+
module_eval(<<'.,.,', 'cadenza.y', 41)
|
514
513
|
def _reduce_19(val, _values, result)
|
515
|
-
result = OperationNode.new(val[0], "
|
514
|
+
result = OperationNode.new(val[0], "!=", val[2])
|
516
515
|
result
|
517
516
|
end
|
518
517
|
.,.,
|
519
518
|
|
520
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
519
|
+
module_eval(<<'.,.,', 'cadenza.y', 42)
|
521
520
|
def _reduce_20(val, _values, result)
|
522
|
-
result = OperationNode.new(val[0], "
|
521
|
+
result = OperationNode.new(val[0], "<=", val[2])
|
523
522
|
result
|
524
523
|
end
|
525
524
|
.,.,
|
526
525
|
|
527
|
-
# reduce 21 omitted
|
528
|
-
|
529
526
|
module_eval(<<'.,.,', 'cadenza.y', 43)
|
530
|
-
def
|
531
|
-
result =
|
527
|
+
def _reduce_21(val, _values, result)
|
528
|
+
result = OperationNode.new(val[0], ">=", val[2])
|
532
529
|
result
|
533
530
|
end
|
534
531
|
.,.,
|
535
532
|
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
def _reduce_24(val, _values, result)
|
540
|
-
result = OperationNode.new(val[0], "and", val[2])
|
533
|
+
module_eval(<<'.,.,', 'cadenza.y', 44)
|
534
|
+
def _reduce_22(val, _values, result)
|
535
|
+
result = OperationNode.new(val[0], ">", val[2])
|
541
536
|
result
|
542
537
|
end
|
543
538
|
.,.,
|
544
539
|
|
545
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
546
|
-
def
|
547
|
-
result = OperationNode.new(val[0], "
|
540
|
+
module_eval(<<'.,.,', 'cadenza.y', 45)
|
541
|
+
def _reduce_23(val, _values, result)
|
542
|
+
result = OperationNode.new(val[0], "<", val[2])
|
548
543
|
result
|
549
544
|
end
|
550
545
|
.,.,
|
551
546
|
|
552
|
-
|
553
|
-
|
554
|
-
|
547
|
+
# reduce 24 omitted
|
548
|
+
|
549
|
+
module_eval(<<'.,.,', 'cadenza.y', 50)
|
550
|
+
def _reduce_25(val, _values, result)
|
551
|
+
result = BooleanInverseNode.new(val[1])
|
555
552
|
result
|
556
553
|
end
|
557
554
|
.,.,
|
558
555
|
|
559
|
-
|
556
|
+
# reduce 26 omitted
|
557
|
+
|
558
|
+
module_eval(<<'.,.,', 'cadenza.y', 55)
|
560
559
|
def _reduce_27(val, _values, result)
|
561
|
-
result = val[0]
|
560
|
+
result = OperationNode.new(val[0], "and", val[2])
|
562
561
|
result
|
563
562
|
end
|
564
563
|
.,.,
|
565
564
|
|
566
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
565
|
+
module_eval(<<'.,.,', 'cadenza.y', 56)
|
567
566
|
def _reduce_28(val, _values, result)
|
568
|
-
result =
|
567
|
+
result = OperationNode.new(val[0], "or", val[2])
|
569
568
|
result
|
570
569
|
end
|
571
570
|
.,.,
|
572
571
|
|
573
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
572
|
+
module_eval(<<'.,.,', 'cadenza.y', 60)
|
574
573
|
def _reduce_29(val, _values, result)
|
575
|
-
result = FilterNode.new(val[0].value
|
574
|
+
result = FilterNode.new(val[0].value)
|
576
575
|
result
|
577
576
|
end
|
578
577
|
.,.,
|
579
578
|
|
580
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
579
|
+
module_eval(<<'.,.,', 'cadenza.y', 61)
|
581
580
|
def _reduce_30(val, _values, result)
|
582
|
-
result =
|
581
|
+
result = FilterNode.new(val[0].value, val[2])
|
583
582
|
result
|
584
583
|
end
|
585
584
|
.,.,
|
586
585
|
|
587
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
586
|
+
module_eval(<<'.,.,', 'cadenza.y', 65)
|
588
587
|
def _reduce_31(val, _values, result)
|
589
|
-
result = val[0]
|
588
|
+
result = [val[0]]
|
590
589
|
result
|
591
590
|
end
|
592
591
|
.,.,
|
593
592
|
|
594
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
593
|
+
module_eval(<<'.,.,', 'cadenza.y', 66)
|
595
594
|
def _reduce_32(val, _values, result)
|
596
|
-
result =
|
595
|
+
result = val[0].push(val[2])
|
597
596
|
result
|
598
597
|
end
|
599
598
|
.,.,
|
600
599
|
|
601
|
-
|
602
|
-
def _reduce_33(val, _values, result)
|
603
|
-
result = InjectNode.new(val[1], val[3])
|
604
|
-
result
|
605
|
-
end
|
606
|
-
.,.,
|
600
|
+
# reduce 33 omitted
|
607
601
|
|
608
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
602
|
+
module_eval(<<'.,.,', 'cadenza.y', 71)
|
609
603
|
def _reduce_34(val, _values, result)
|
610
|
-
|
611
|
-
result = InjectNode.new(variable, [], val[2])
|
612
|
-
|
604
|
+
result = FilteredValueNode.new(val[0], val[2])
|
613
605
|
result
|
614
606
|
end
|
615
607
|
.,.,
|
616
608
|
|
617
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
609
|
+
module_eval(<<'.,.,', 'cadenza.y', 75)
|
618
610
|
def _reduce_35(val, _values, result)
|
619
|
-
|
620
|
-
result = InjectNode.new(variable, val[4], val[2])
|
621
|
-
|
611
|
+
result = val[1]
|
622
612
|
result
|
623
613
|
end
|
624
614
|
.,.,
|
625
615
|
|
626
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
616
|
+
module_eval(<<'.,.,', 'cadenza.y', 81)
|
627
617
|
def _reduce_36(val, _values, result)
|
628
618
|
@stack.push DocumentNode.new
|
629
619
|
result = val[2]
|
@@ -632,7 +622,7 @@ module_eval(<<'.,.,', 'cadenza.y', 87)
|
|
632
622
|
end
|
633
623
|
.,.,
|
634
624
|
|
635
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
625
|
+
module_eval(<<'.,.,', 'cadenza.y', 89)
|
636
626
|
def _reduce_37(val, _values, result)
|
637
627
|
@stack.push DocumentNode.new
|
638
628
|
result = BooleanInverseNode.new(val[2])
|
@@ -641,7 +631,7 @@ module_eval(<<'.,.,', 'cadenza.y', 95)
|
|
641
631
|
end
|
642
632
|
.,.,
|
643
633
|
|
644
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
634
|
+
module_eval(<<'.,.,', 'cadenza.y', 95)
|
645
635
|
def _reduce_38(val, _values, result)
|
646
636
|
@stack.push DocumentNode.new
|
647
637
|
result
|
@@ -652,21 +642,21 @@ module_eval(<<'.,.,', 'cadenza.y', 101)
|
|
652
642
|
|
653
643
|
# reduce 40 omitted
|
654
644
|
|
655
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
645
|
+
module_eval(<<'.,.,', 'cadenza.y', 107)
|
656
646
|
def _reduce_41(val, _values, result)
|
657
647
|
@stack.pop; result = IfNode.new(val[0])
|
658
648
|
result
|
659
649
|
end
|
660
650
|
.,.,
|
661
651
|
|
662
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
652
|
+
module_eval(<<'.,.,', 'cadenza.y', 108)
|
663
653
|
def _reduce_42(val, _values, result)
|
664
654
|
result = IfNode.new(val[0], @stack.pop.children)
|
665
655
|
result
|
666
656
|
end
|
667
657
|
.,.,
|
668
658
|
|
669
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
659
|
+
module_eval(<<'.,.,', 'cadenza.y', 111)
|
670
660
|
def _reduce_43(val, _values, result)
|
671
661
|
false_children, true_children = @stack.pop.children, @stack.pop.children
|
672
662
|
result = IfNode.new(val[0], true_children, false_children)
|
@@ -675,7 +665,7 @@ module_eval(<<'.,.,', 'cadenza.y', 117)
|
|
675
665
|
end
|
676
666
|
.,.,
|
677
667
|
|
678
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
668
|
+
module_eval(<<'.,.,', 'cadenza.y', 116)
|
679
669
|
def _reduce_44(val, _values, result)
|
680
670
|
false_children, true_children = @stack.pop.children, @stack.pop.children
|
681
671
|
result = IfNode.new(val[0], true_children, false_children)
|
@@ -684,7 +674,7 @@ module_eval(<<'.,.,', 'cadenza.y', 122)
|
|
684
674
|
end
|
685
675
|
.,.,
|
686
676
|
|
687
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
677
|
+
module_eval(<<'.,.,', 'cadenza.y', 121)
|
688
678
|
def _reduce_45(val, _values, result)
|
689
679
|
false_children, true_children = @stack.pop.children, @stack.pop.children
|
690
680
|
result = IfNode.new(val[0], true_children, false_children)
|
@@ -693,21 +683,21 @@ module_eval(<<'.,.,', 'cadenza.y', 127)
|
|
693
683
|
end
|
694
684
|
.,.,
|
695
685
|
|
696
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
686
|
+
module_eval(<<'.,.,', 'cadenza.y', 127)
|
697
687
|
def _reduce_46(val, _values, result)
|
698
688
|
@stack.pop; result = IfNode.new(val[0])
|
699
689
|
result
|
700
690
|
end
|
701
691
|
.,.,
|
702
692
|
|
703
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
693
|
+
module_eval(<<'.,.,', 'cadenza.y', 128)
|
704
694
|
def _reduce_47(val, _values, result)
|
705
695
|
result = IfNode.new(val[0], @stack.pop.children)
|
706
696
|
result
|
707
697
|
end
|
708
698
|
.,.,
|
709
699
|
|
710
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
700
|
+
module_eval(<<'.,.,', 'cadenza.y', 131)
|
711
701
|
def _reduce_48(val, _values, result)
|
712
702
|
false_children, true_children = @stack.pop.children, @stack.pop.children
|
713
703
|
result = IfNode.new(val[0], true_children, false_children)
|
@@ -716,7 +706,7 @@ module_eval(<<'.,.,', 'cadenza.y', 137)
|
|
716
706
|
end
|
717
707
|
.,.,
|
718
708
|
|
719
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
709
|
+
module_eval(<<'.,.,', 'cadenza.y', 136)
|
720
710
|
def _reduce_49(val, _values, result)
|
721
711
|
false_children, true_children = @stack.pop.children, @stack.pop.children
|
722
712
|
result = IfNode.new(val[0], true_children, false_children)
|
@@ -725,7 +715,7 @@ module_eval(<<'.,.,', 'cadenza.y', 142)
|
|
725
715
|
end
|
726
716
|
.,.,
|
727
717
|
|
728
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
718
|
+
module_eval(<<'.,.,', 'cadenza.y', 141)
|
729
719
|
def _reduce_50(val, _values, result)
|
730
720
|
false_children, true_children = @stack.pop.children, @stack.pop.children
|
731
721
|
result = IfNode.new(val[0], true_children, false_children)
|
@@ -734,19 +724,19 @@ module_eval(<<'.,.,', 'cadenza.y', 147)
|
|
734
724
|
end
|
735
725
|
.,.,
|
736
726
|
|
737
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
727
|
+
module_eval(<<'.,.,', 'cadenza.y', 147)
|
738
728
|
def _reduce_51(val, _values, result)
|
739
|
-
result = [val[2].value, val[4]
|
729
|
+
result = [val[2].value, val[4]]
|
740
730
|
result
|
741
731
|
end
|
742
732
|
.,.,
|
743
733
|
|
744
734
|
# reduce 52 omitted
|
745
735
|
|
746
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
736
|
+
module_eval(<<'.,.,', 'cadenza.y', 158)
|
747
737
|
def _reduce_53(val, _values, result)
|
748
738
|
iterator = VariableNode.new(val[0][0])
|
749
|
-
iterable =
|
739
|
+
iterable = val[0][1]
|
750
740
|
|
751
741
|
result = ForNode.new(iterator, iterable, [])
|
752
742
|
|
@@ -754,17 +744,17 @@ module_eval(<<'.,.,', 'cadenza.y', 164)
|
|
754
744
|
end
|
755
745
|
.,.,
|
756
746
|
|
757
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
747
|
+
module_eval(<<'.,.,', 'cadenza.y', 163)
|
758
748
|
def _reduce_54(val, _values, result)
|
759
749
|
@stack.push DocumentNode.new
|
760
750
|
result
|
761
751
|
end
|
762
752
|
.,.,
|
763
753
|
|
764
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
754
|
+
module_eval(<<'.,.,', 'cadenza.y', 165)
|
765
755
|
def _reduce_55(val, _values, result)
|
766
756
|
iterator = VariableNode.new(val[0][0])
|
767
|
-
iterable =
|
757
|
+
iterable = val[0][1]
|
768
758
|
|
769
759
|
result = ForNode.new(iterator, iterable, @stack.pop.children)
|
770
760
|
|
@@ -772,7 +762,7 @@ module_eval(<<'.,.,', 'cadenza.y', 171)
|
|
772
762
|
end
|
773
763
|
.,.,
|
774
764
|
|
775
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
765
|
+
module_eval(<<'.,.,', 'cadenza.y', 173)
|
776
766
|
def _reduce_56(val, _values, result)
|
777
767
|
result = val[2].value
|
778
768
|
result
|
@@ -781,70 +771,70 @@ module_eval(<<'.,.,', 'cadenza.y', 179)
|
|
781
771
|
|
782
772
|
# reduce 57 omitted
|
783
773
|
|
784
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
774
|
+
module_eval(<<'.,.,', 'cadenza.y', 182)
|
785
775
|
def _reduce_58(val, _values, result)
|
786
776
|
result = BlockNode.new(val[0], [])
|
787
777
|
result
|
788
778
|
end
|
789
779
|
.,.,
|
790
780
|
|
791
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
781
|
+
module_eval(<<'.,.,', 'cadenza.y', 183)
|
792
782
|
def _reduce_59(val, _values, result)
|
793
783
|
@stack.push DocumentNode.new
|
794
784
|
result
|
795
785
|
end
|
796
786
|
.,.,
|
797
787
|
|
798
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
788
|
+
module_eval(<<'.,.,', 'cadenza.y', 183)
|
799
789
|
def _reduce_60(val, _values, result)
|
800
790
|
result = BlockNode.new(val[0], @stack.pop.children)
|
801
791
|
result
|
802
792
|
end
|
803
793
|
.,.,
|
804
794
|
|
805
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
795
|
+
module_eval(<<'.,.,', 'cadenza.y', 187)
|
806
796
|
def _reduce_61(val, _values, result)
|
807
797
|
@stack.push DocumentNode.new
|
808
798
|
result
|
809
799
|
end
|
810
800
|
.,.,
|
811
801
|
|
812
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
802
|
+
module_eval(<<'.,.,', 'cadenza.y', 189)
|
813
803
|
def _reduce_62(val, _values, result)
|
814
804
|
result = GenericBlockNode.new(val[1].value, @stack.pop.children)
|
815
805
|
result
|
816
806
|
end
|
817
807
|
.,.,
|
818
808
|
|
819
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
809
|
+
module_eval(<<'.,.,', 'cadenza.y', 190)
|
820
810
|
def _reduce_63(val, _values, result)
|
821
811
|
@stack.push DocumentNode.new
|
822
812
|
result
|
823
813
|
end
|
824
814
|
.,.,
|
825
815
|
|
826
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
816
|
+
module_eval(<<'.,.,', 'cadenza.y', 192)
|
827
817
|
def _reduce_64(val, _values, result)
|
828
818
|
result = GenericBlockNode.new(val[1].value, @stack.pop.children, val[2])
|
829
819
|
result
|
830
820
|
end
|
831
821
|
.,.,
|
832
822
|
|
833
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
823
|
+
module_eval(<<'.,.,', 'cadenza.y', 196)
|
834
824
|
def _reduce_65(val, _values, result)
|
835
825
|
result = val[2].value
|
836
826
|
result
|
837
827
|
end
|
838
828
|
.,.,
|
839
829
|
|
840
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
830
|
+
module_eval(<<'.,.,', 'cadenza.y', 197)
|
841
831
|
def _reduce_66(val, _values, result)
|
842
832
|
result = VariableNode.new(val[2].value)
|
843
833
|
result
|
844
834
|
end
|
845
835
|
.,.,
|
846
836
|
|
847
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
837
|
+
module_eval(<<'.,.,', 'cadenza.y', 201)
|
848
838
|
def _reduce_67(val, _values, result)
|
849
839
|
result = TextNode.new(val[0].value)
|
850
840
|
result
|
@@ -861,42 +851,42 @@ module_eval(<<'.,.,', 'cadenza.y', 207)
|
|
861
851
|
|
862
852
|
# reduce 72 omitted
|
863
853
|
|
864
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
854
|
+
module_eval(<<'.,.,', 'cadenza.y', 210)
|
865
855
|
def _reduce_73(val, _values, result)
|
866
856
|
push_child val[0]
|
867
857
|
result
|
868
858
|
end
|
869
859
|
.,.,
|
870
860
|
|
871
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
861
|
+
module_eval(<<'.,.,', 'cadenza.y', 211)
|
872
862
|
def _reduce_74(val, _values, result)
|
873
863
|
push_child val[1]
|
874
864
|
result
|
875
865
|
end
|
876
866
|
.,.,
|
877
867
|
|
878
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
868
|
+
module_eval(<<'.,.,', 'cadenza.y', 212)
|
879
869
|
def _reduce_75(val, _values, result)
|
880
870
|
@stack.first.extends = val[0]
|
881
871
|
result
|
882
872
|
end
|
883
873
|
.,.,
|
884
874
|
|
885
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
875
|
+
module_eval(<<'.,.,', 'cadenza.y', 213)
|
886
876
|
def _reduce_76(val, _values, result)
|
887
877
|
@stack.first.extends = val[1]
|
888
878
|
result
|
889
879
|
end
|
890
880
|
.,.,
|
891
881
|
|
892
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
882
|
+
module_eval(<<'.,.,', 'cadenza.y', 214)
|
893
883
|
def _reduce_77(val, _values, result)
|
894
884
|
push_block(val[0])
|
895
885
|
result
|
896
886
|
end
|
897
887
|
.,.,
|
898
888
|
|
899
|
-
module_eval(<<'.,.,', 'cadenza.y',
|
889
|
+
module_eval(<<'.,.,', 'cadenza.y', 215)
|
900
890
|
def _reduce_78(val, _values, result)
|
901
891
|
push_block(val[1])
|
902
892
|
result
|