myco 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/myco/bootstrap/instance.rb +13 -3
- data/lib/myco/code_tools/AST.my +0 -2
- data/lib/myco/code_tools/AST.my.rb +0 -1
- data/lib/myco/code_tools/AST/Block.my +15 -4
- data/lib/myco/code_tools/AST/Block.my.rb +16 -3
- data/lib/myco/code_tools/AST/DeclareMeme.my +44 -64
- data/lib/myco/code_tools/AST/DeclareMeme.my.rb +66 -74
- data/lib/myco/code_tools/AST/ToRuby.my +17 -20
- data/lib/myco/code_tools/AST/ToRuby.my.rb +24 -22
- data/lib/myco/code_tools/Parser.my +2 -1
- data/lib/myco/code_tools/Parser.my.rb +2 -1
- data/lib/myco/code_tools/parser/MycoBuilder.my +2 -2
- data/lib/myco/code_tools/parser/MycoBuilder.my.rb +2 -2
- data/lib/myco/code_tools/parser/MycoGrammar.my +28 -21
- data/lib/myco/code_tools/parser/MycoGrammar.my.rb +94 -56
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces.my +10 -11
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces.my.rb +10 -9
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/BytecodeHelpers.my +25 -3
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/BytecodeHelpers.my.rb +38 -0
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Capture.my +152 -0
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Capture.my.rb +189 -0
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Common.my +84 -0
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Common.my.rb +114 -0
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Common/Parser.my +139 -0
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/{BytecodeParser.my.rb → Common/Parser.my.rb} +17 -36
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Composite.my +229 -0
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Composite.my.rb +296 -0
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Grammar.my +8 -25
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Grammar.my.rb +9 -37
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Parser.my +139 -37
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Parser.my.rb +206 -36
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Processor.my +21 -12
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Processor.my.rb +45 -24
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Stream.my +99 -0
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Stream.my.rb +152 -0
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Stream/Parser.my +37 -0
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Stream/Parser.my.rb +57 -0
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/String.my +136 -0
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/String.my.rb +147 -0
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/String/Parser.my +45 -0
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/String/Parser.my.rb +85 -0
- data/lib/myco/code_tools/parser/pegleromyces/spec/Patterns.test.my +31 -25
- data/lib/myco/code_tools/parser/pegleromyces/spec/Patterns.test.my.rb +44 -25
- data/lib/myco/code_tools/parser/pegleromyces/spec/Stream/Parser.test.my +49 -0
- data/lib/myco/code_tools/parser/pegleromyces/spec/Stream/Parser.test.my.rb +119 -0
- data/lib/myco/code_tools/parser/pegleromyces/spec/Stream/Patterns.test.my +131 -0
- data/lib/myco/code_tools/parser/pegleromyces/spec/Stream/Patterns.test.my.rb +595 -0
- data/lib/myco/code_tools/parser/pegleromyces/spec/{BytecodeParser.test.my → String/Parser.test.my} +41 -2
- data/lib/myco/code_tools/parser/pegleromyces/spec/{BytecodeParser.test.my.rb → String/Parser.test.my.rb} +144 -3
- data/lib/myco/code_tools/parser/pegleromyces/spec/run.my +4 -10
- data/lib/myco/code_tools/parser/pegleromyces/spec/run.my.rb +4 -8
- data/lib/myco/core.my +1 -0
- data/lib/myco/core.my.rb +1 -0
- data/lib/myco/core/BasicObject.my +4 -2
- data/lib/myco/core/BasicObject.my.rb +2 -5
- data/lib/myco/core/Loop.my +5 -0
- data/lib/myco/core/Loop.my.rb +13 -0
- data/lib/myco/dev.rb +1 -0
- data/lib/myco/dev/profile.rb +12 -0
- data/lib/myco/version.rb +3 -3
- metadata +54 -59
- data/lib/myco/code_tools/AST/DeclareDecorator.my +0 -19
- data/lib/myco/code_tools/AST/DeclareDecorator.my.rb +0 -24
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Builder.my +0 -4
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Builder.my.rb +0 -5
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/BytecodeInstructions.my +0 -420
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/BytecodeInstructions.my.rb +0 -415
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/BytecodeParser.my +0 -147
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Constructions.my +0 -183
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Constructions.my.rb +0 -370
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Instructions.my +0 -139
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Instructions.my.rb +0 -284
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Machine.my +0 -37
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Machine.my.rb +0 -24
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Patterns.my +0 -123
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Patterns.my.rb +0 -164
- data/lib/myco/code_tools/parser/pegleromyces/spec/Builder.test.my +0 -10
- data/lib/myco/code_tools/parser/pegleromyces/spec/Builder.test.my.rb +0 -9
- data/lib/myco/code_tools/parser/pegleromyces/spec/BytecodeInstructions.test.my +0 -10
- data/lib/myco/code_tools/parser/pegleromyces/spec/BytecodeInstructions.test.my.rb +0 -9
- data/lib/myco/code_tools/parser/pegleromyces/spec/Constructions.test.my +0 -229
- data/lib/myco/code_tools/parser/pegleromyces/spec/Constructions.test.my.rb +0 -663
- data/lib/myco/code_tools/parser/pegleromyces/spec/Instructions.test.my +0 -10
- data/lib/myco/code_tools/parser/pegleromyces/spec/Instructions.test.my.rb +0 -9
- data/lib/myco/code_tools/parser/pegleromyces/spec/Machine.test.my +0 -13
- data/lib/myco/code_tools/parser/pegleromyces/spec/Machine.test.my.rb +0 -20
- data/lib/myco/code_tools/parser/pegleromyces/spec/Parser.test.my +0 -54
- data/lib/myco/code_tools/parser/pegleromyces/spec/Parser.test.my.rb +0 -215
@@ -1,183 +0,0 @@
|
|
1
|
-
|
2
|
-
Constructions < EmptyObject {
|
3
|
-
|
4
|
-
##
|
5
|
-
# Basic types of constructions.
|
6
|
-
|
7
|
-
Base < BasicObject { }
|
8
|
-
UnaryBase < Base { var inner }
|
9
|
-
BinaryBase < Base { var first, var second }
|
10
|
-
|
11
|
-
AnyCharacter < Base { }
|
12
|
-
Character < Base { var code }
|
13
|
-
CharacterString < Base { var codes }
|
14
|
-
CharacterSet < Base { var codes }
|
15
|
-
CharacterRange < Base { var start, var stop }
|
16
|
-
|
17
|
-
NegativePredicate < UnaryBase { }
|
18
|
-
PositivePredicate < UnaryBase { }
|
19
|
-
OneOrMore < UnaryBase { }
|
20
|
-
ZeroOrOne < UnaryBase { }
|
21
|
-
ZeroOrMore < UnaryBase { }
|
22
|
-
OrderedChoice < BinaryBase { }
|
23
|
-
Concatenation < BinaryBase { }
|
24
|
-
|
25
|
-
NamedCapture < UnaryBase { var captargs }
|
26
|
-
NamedTextCapture < UnaryBase { var captargs }
|
27
|
-
NamedTokenCapture < UnaryBase { var captargs }
|
28
|
-
Reduction < UnaryBase { var captargs }
|
29
|
-
|
30
|
-
##
|
31
|
-
# Bindings of patterns to constructions.
|
32
|
-
|
33
|
-
Patterns::UnaryBase << {
|
34
|
-
construct: construct_type.new(inner:inner.construct)
|
35
|
-
}
|
36
|
-
|
37
|
-
Patterns::BinaryBase << {
|
38
|
-
construct: construct_type.new(first:first.construct,second:second.construct)
|
39
|
-
}
|
40
|
-
|
41
|
-
Patterns::AnyCharacter << { construct: AnyCharacter.new }
|
42
|
-
Patterns::Character << { construct: Character .new(code:code) }
|
43
|
-
Patterns::CharacterString << { construct: CharacterString.new(codes:codes) }
|
44
|
-
Patterns::CharacterSet << { construct: CharacterSet .new(codes:codes) }
|
45
|
-
Patterns::CharacterRange << { construct: CharacterRange .new(start:start
|
46
|
-
stop:stop) }
|
47
|
-
|
48
|
-
Patterns::NegativePredicate << { construct_type: NegativePredicate }
|
49
|
-
Patterns::PositivePredicate << { construct_type: PositivePredicate }
|
50
|
-
Patterns::OneOrMore << { construct_type: OneOrMore }
|
51
|
-
Patterns::ZeroOrOne << { construct_type: ZeroOrOne }
|
52
|
-
Patterns::ZeroOrMore << { construct_type: ZeroOrMore }
|
53
|
-
Patterns::OrderedChoice << { construct_type: OrderedChoice }
|
54
|
-
Patterns::Concatenation << { construct_type: Concatenation }
|
55
|
-
|
56
|
-
Patterns::NamedCapture << {
|
57
|
-
construct: NamedCapture.new(
|
58
|
-
inner: inner.construct
|
59
|
-
captargs: [self.name]
|
60
|
-
)
|
61
|
-
}
|
62
|
-
Patterns::NamedTextCapture << {
|
63
|
-
construct: NamedTextCapture.new(
|
64
|
-
inner: inner.construct
|
65
|
-
captargs: [self.name]
|
66
|
-
)
|
67
|
-
}
|
68
|
-
Patterns::NamedTokenCapture << {
|
69
|
-
construct: NamedTokenCapture.new(
|
70
|
-
inner: inner.construct
|
71
|
-
captargs: [self.name]
|
72
|
-
)
|
73
|
-
}
|
74
|
-
Patterns::Reduction << {
|
75
|
-
construct: Reduction.new(
|
76
|
-
inner: inner.construct
|
77
|
-
captargs: [self.code, *self.args]
|
78
|
-
)
|
79
|
-
}
|
80
|
-
|
81
|
-
##
|
82
|
-
# The instruction sequence generator for each construction.
|
83
|
-
|
84
|
-
AnyCharacter << { sequence: [[:any, 1]] }
|
85
|
-
Character << { sequence: [[:char, code]] }
|
86
|
-
CharacterString << { sequence: codes.map |code| { [:char, code] } }
|
87
|
-
CharacterSet << { sequence: [[:charset, table]]
|
88
|
-
table: codes.map |code| { [code, true] }.to_h }
|
89
|
-
CharacterRange << { sequence: [[:charrange, start, stop]] }
|
90
|
-
|
91
|
-
NegativePredicate << {
|
92
|
-
sequence: {
|
93
|
-
a = inner.sequence
|
94
|
-
[[:choice, a.size+2], *a, [:fail_twice]]
|
95
|
-
}
|
96
|
-
}
|
97
|
-
|
98
|
-
PositivePredicate << {
|
99
|
-
sequence: {
|
100
|
-
a = inner.sequence
|
101
|
-
size = a.size
|
102
|
-
[[:choice, size+4], [:choice, size+1], *a, [:commit, 1], [:fail]]
|
103
|
-
}
|
104
|
-
}
|
105
|
-
|
106
|
-
OneOrMore << {
|
107
|
-
var inlaid
|
108
|
-
sequence: {
|
109
|
-
one = inner.sequence
|
110
|
-
inlaid && (one = one + inlaid)
|
111
|
-
or_more = ZeroOrMore.new(inner:inner,inlaid:inlaid).sequence
|
112
|
-
[*one, *or_more]
|
113
|
-
}
|
114
|
-
}
|
115
|
-
|
116
|
-
ZeroOrOne << {
|
117
|
-
sequence: {
|
118
|
-
a = inner.sequence
|
119
|
-
[[:choice, a.size+2], *a, [:commit, 1]]
|
120
|
-
}
|
121
|
-
}
|
122
|
-
|
123
|
-
ZeroOrMore << {
|
124
|
-
var inlaid
|
125
|
-
sequence:
|
126
|
-
switch(inner, :"is_a?")
|
127
|
-
.when(CharacterSet) { [[:span, inner.table]] }
|
128
|
-
.else {
|
129
|
-
a = inner.sequence
|
130
|
-
inlaid && (a = a + inlaid)
|
131
|
-
size = a.size
|
132
|
-
[[:choice, size+2], *a, [:partial_commit, size*-1]]
|
133
|
-
}
|
134
|
-
.output
|
135
|
-
}
|
136
|
-
|
137
|
-
OrderedChoice << {
|
138
|
-
sequence: {
|
139
|
-
a = first.sequence
|
140
|
-
b = second.sequence
|
141
|
-
[[:choice, a.size+2], *a, [:commit, b.size+1], *b]
|
142
|
-
}
|
143
|
-
}
|
144
|
-
|
145
|
-
Concatenation << {
|
146
|
-
sequence: [*first.sequence, *second.sequence]
|
147
|
-
}
|
148
|
-
|
149
|
-
NamedCapture << {
|
150
|
-
sequence: {
|
151
|
-
(inner.is_a?(OneOrMore) || inner.is_a?(ZeroOrMore)) &? (
|
152
|
-
inner.inlaid = [[:capture, [:m_split, captargs]]]
|
153
|
-
a = inner.sequence
|
154
|
-
[[:capture, [:m_start]], *a, [:capture, [:m_end, captargs]]]
|
155
|
-
) ?? (
|
156
|
-
a = inner.sequence
|
157
|
-
[[:capture, [:c_start]], *a, [:capture, [:c_end, captargs]]]
|
158
|
-
)
|
159
|
-
}
|
160
|
-
}
|
161
|
-
|
162
|
-
NamedTextCapture << {
|
163
|
-
sequence: {
|
164
|
-
a = inner.sequence
|
165
|
-
[[:capture, [:s_start]], *a, [:capture, [:s_end, captargs]]]
|
166
|
-
}
|
167
|
-
}
|
168
|
-
|
169
|
-
NamedTokenCapture << {
|
170
|
-
sequence: {
|
171
|
-
a = inner.sequence
|
172
|
-
[[:capture, [:t_start]], *a, [:capture, [:t_end, captargs]]]
|
173
|
-
}
|
174
|
-
}
|
175
|
-
|
176
|
-
Reduction << {
|
177
|
-
sequence: {
|
178
|
-
a = inner.sequence
|
179
|
-
[[:capture, [:r_start]], *a, [:capture, [:r_end, captargs]]]
|
180
|
-
}
|
181
|
-
}
|
182
|
-
|
183
|
-
}
|
@@ -1,370 +0,0 @@
|
|
1
|
-
|
2
|
-
::Myco::Component.new([::Myco::FileToplevel], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
3
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {(::Myco.cscope.for_method_definition::Constructions = ::Myco::Component.new([::Myco.find_constant(:EmptyObject)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
4
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {(
|
5
|
-
::Myco.cscope.for_method_definition::Base = ::Myco::Component.new([::Myco.find_constant(:BasicObject)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
6
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {nil}}
|
7
|
-
.tap { |__c__| __c__.__name__ = :Base }
|
8
|
-
::Myco.cscope.for_method_definition::UnaryBase = ::Myco::Component.new([::Myco.find_constant(:Base)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
9
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(:inner, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil})}}
|
10
|
-
.tap { |__c__| __c__.__name__ = :UnaryBase }
|
11
|
-
::Myco.cscope.for_method_definition::BinaryBase = ::Myco::Component.new([::Myco.find_constant(:Base)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
12
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {(
|
13
|
-
declare_meme(:first, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil}
|
14
|
-
declare_meme(:second, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil}
|
15
|
-
)}}
|
16
|
-
.tap { |__c__| __c__.__name__ = :BinaryBase }
|
17
|
-
::Myco.cscope.for_method_definition::AnyCharacter = ::Myco::Component.new([::Myco.find_constant(:Base)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
18
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {nil}}
|
19
|
-
.tap { |__c__| __c__.__name__ = :AnyCharacter }
|
20
|
-
::Myco.cscope.for_method_definition::Character = ::Myco::Component.new([::Myco.find_constant(:Base)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
21
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(:code, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil})}}
|
22
|
-
.tap { |__c__| __c__.__name__ = :Character }
|
23
|
-
::Myco.cscope.for_method_definition::CharacterString = ::Myco::Component.new([::Myco.find_constant(:Base)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
24
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(:codes, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil})}}
|
25
|
-
.tap { |__c__| __c__.__name__ = :CharacterString }
|
26
|
-
::Myco.cscope.for_method_definition::CharacterSet = ::Myco::Component.new([::Myco.find_constant(:Base)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
27
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(:codes, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil})}}
|
28
|
-
.tap { |__c__| __c__.__name__ = :CharacterSet }
|
29
|
-
::Myco.cscope.for_method_definition::CharacterRange = ::Myco::Component.new([::Myco.find_constant(:Base)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
30
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {(
|
31
|
-
declare_meme(:start, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil}
|
32
|
-
declare_meme(:stop, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil}
|
33
|
-
)}}
|
34
|
-
.tap { |__c__| __c__.__name__ = :CharacterRange }
|
35
|
-
::Myco.cscope.for_method_definition::NegativePredicate = ::Myco::Component.new([::Myco.find_constant(:UnaryBase)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
36
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {nil}}
|
37
|
-
.tap { |__c__| __c__.__name__ = :NegativePredicate }
|
38
|
-
::Myco.cscope.for_method_definition::PositivePredicate = ::Myco::Component.new([::Myco.find_constant(:UnaryBase)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
39
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {nil}}
|
40
|
-
.tap { |__c__| __c__.__name__ = :PositivePredicate }
|
41
|
-
::Myco.cscope.for_method_definition::OneOrMore = ::Myco::Component.new([::Myco.find_constant(:UnaryBase)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
42
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {nil}}
|
43
|
-
.tap { |__c__| __c__.__name__ = :OneOrMore }
|
44
|
-
::Myco.cscope.for_method_definition::ZeroOrOne = ::Myco::Component.new([::Myco.find_constant(:UnaryBase)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
45
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {nil}}
|
46
|
-
.tap { |__c__| __c__.__name__ = :ZeroOrOne }
|
47
|
-
::Myco.cscope.for_method_definition::ZeroOrMore = ::Myco::Component.new([::Myco.find_constant(:UnaryBase)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
48
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {nil}}
|
49
|
-
.tap { |__c__| __c__.__name__ = :ZeroOrMore }
|
50
|
-
::Myco.cscope.for_method_definition::OrderedChoice = ::Myco::Component.new([::Myco.find_constant(:BinaryBase)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
51
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {nil}}
|
52
|
-
.tap { |__c__| __c__.__name__ = :OrderedChoice }
|
53
|
-
::Myco.cscope.for_method_definition::Concatenation = ::Myco::Component.new([::Myco.find_constant(:BinaryBase)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
54
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {nil}}
|
55
|
-
.tap { |__c__| __c__.__name__ = :Concatenation }
|
56
|
-
::Myco.cscope.for_method_definition::NamedCapture = ::Myco::Component.new([::Myco.find_constant(:UnaryBase)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
57
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(:captargs, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil})}}
|
58
|
-
.tap { |__c__| __c__.__name__ = :NamedCapture }
|
59
|
-
::Myco.cscope.for_method_definition::NamedTextCapture = ::Myco::Component.new([::Myco.find_constant(:UnaryBase)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
60
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(:captargs, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil})}}
|
61
|
-
.tap { |__c__| __c__.__name__ = :NamedTextCapture }
|
62
|
-
::Myco.cscope.for_method_definition::NamedTokenCapture = ::Myco::Component.new([::Myco.find_constant(:UnaryBase)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
63
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(:captargs, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil})}}
|
64
|
-
.tap { |__c__| __c__.__name__ = :NamedTokenCapture }
|
65
|
-
::Myco.cscope.for_method_definition::Reduction = ::Myco::Component.new([::Myco.find_constant(:UnaryBase)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
66
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(:captargs, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil})}}
|
67
|
-
.tap { |__c__| __c__.__name__ = :Reduction }
|
68
|
-
::Myco.find_constant(:Patterns)::UnaryBase.component_eval {(declare_meme(:construct, [], nil, ::Myco.cscope.dup) { |*| (self.construct_type.new({:inner => self.inner.construct}))})}
|
69
|
-
::Myco.find_constant(:Patterns)::BinaryBase.component_eval {(declare_meme(:construct, [], nil, ::Myco.cscope.dup) { |*| (self.construct_type.new({
|
70
|
-
:first => self.first.construct,
|
71
|
-
:second => self.second.construct
|
72
|
-
}))})}
|
73
|
-
::Myco.find_constant(:Patterns)::AnyCharacter.component_eval {(declare_meme(:construct, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:AnyCharacter).new)})}
|
74
|
-
::Myco.find_constant(:Patterns)::Character.component_eval {(declare_meme(:construct, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:Character).new({:code => self.code}))})}
|
75
|
-
::Myco.find_constant(:Patterns)::CharacterString.component_eval {(declare_meme(:construct, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:CharacterString).new({:codes => self.codes}))})}
|
76
|
-
::Myco.find_constant(:Patterns)::CharacterSet.component_eval {(declare_meme(:construct, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:CharacterSet).new({:codes => self.codes}))})}
|
77
|
-
::Myco.find_constant(:Patterns)::CharacterRange.component_eval {(declare_meme(:construct, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:CharacterRange).new({
|
78
|
-
:start => self.start,
|
79
|
-
:stop => self.stop
|
80
|
-
}))})}
|
81
|
-
::Myco.find_constant(:Patterns)::NegativePredicate.component_eval {(declare_meme(:construct_type, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:NegativePredicate))})}
|
82
|
-
::Myco.find_constant(:Patterns)::PositivePredicate.component_eval {(declare_meme(:construct_type, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:PositivePredicate))})}
|
83
|
-
::Myco.find_constant(:Patterns)::OneOrMore.component_eval {(declare_meme(:construct_type, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:OneOrMore))})}
|
84
|
-
::Myco.find_constant(:Patterns)::ZeroOrOne.component_eval {(declare_meme(:construct_type, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:ZeroOrOne))})}
|
85
|
-
::Myco.find_constant(:Patterns)::ZeroOrMore.component_eval {(declare_meme(:construct_type, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:ZeroOrMore))})}
|
86
|
-
::Myco.find_constant(:Patterns)::OrderedChoice.component_eval {(declare_meme(:construct_type, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:OrderedChoice))})}
|
87
|
-
::Myco.find_constant(:Patterns)::Concatenation.component_eval {(declare_meme(:construct_type, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:Concatenation))})}
|
88
|
-
::Myco.find_constant(:Patterns)::NamedCapture.component_eval {(declare_meme(:construct, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:NamedCapture).new({
|
89
|
-
:inner => self.inner.construct,
|
90
|
-
:captargs => [self.name]
|
91
|
-
}))})}
|
92
|
-
::Myco.find_constant(:Patterns)::NamedTextCapture.component_eval {(declare_meme(:construct, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:NamedTextCapture).new({
|
93
|
-
:inner => self.inner.construct,
|
94
|
-
:captargs => [self.name]
|
95
|
-
}))})}
|
96
|
-
::Myco.find_constant(:Patterns)::NamedTokenCapture.component_eval {(declare_meme(:construct, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:NamedTokenCapture).new({
|
97
|
-
:inner => self.inner.construct,
|
98
|
-
:captargs => [self.name]
|
99
|
-
}))})}
|
100
|
-
::Myco.find_constant(:Patterns)::Reduction.component_eval {(declare_meme(:construct, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:Reduction).new({
|
101
|
-
:inner => self.inner.construct,
|
102
|
-
:captargs => [
|
103
|
-
self.code,
|
104
|
-
*self.args
|
105
|
-
]
|
106
|
-
}))})}
|
107
|
-
::Myco.find_constant(:AnyCharacter).component_eval {(declare_meme(:sequence, [], nil, ::Myco.cscope.dup) { |*| ([[
|
108
|
-
:any,
|
109
|
-
1
|
110
|
-
]])})}
|
111
|
-
::Myco.find_constant(:Character).component_eval {(declare_meme(:sequence, [], nil, ::Myco.cscope.dup) { |*| ([[
|
112
|
-
:char,
|
113
|
-
self.code
|
114
|
-
]])})}
|
115
|
-
::Myco.find_constant(:CharacterString).component_eval {(declare_meme(:sequence, [], nil, ::Myco.cscope.dup) { |*| (self.codes.map { |code| ([
|
116
|
-
:char,
|
117
|
-
code
|
118
|
-
])})})}
|
119
|
-
::Myco.find_constant(:CharacterSet).component_eval {(
|
120
|
-
declare_meme(:sequence, [], nil, ::Myco.cscope.dup) { |*| ([[
|
121
|
-
:charset,
|
122
|
-
self.table
|
123
|
-
]])}
|
124
|
-
declare_meme(:table, [], nil, ::Myco.cscope.dup) { |*| (self.codes.map { |code| ([
|
125
|
-
code,
|
126
|
-
true
|
127
|
-
])}.to_h)}
|
128
|
-
)}
|
129
|
-
::Myco.find_constant(:CharacterRange).component_eval {(declare_meme(:sequence, [], nil, ::Myco.cscope.dup) { |*| ([[
|
130
|
-
:charrange,
|
131
|
-
self.start,
|
132
|
-
self.stop
|
133
|
-
]])})}
|
134
|
-
::Myco.find_constant(:NegativePredicate).component_eval {(declare_meme(:sequence, [], nil, ::Myco.cscope.dup) { |*| (
|
135
|
-
a = self.inner.sequence
|
136
|
-
[
|
137
|
-
[
|
138
|
-
:choice,
|
139
|
-
a.size.__send__(
|
140
|
-
:+,
|
141
|
-
2
|
142
|
-
)
|
143
|
-
],
|
144
|
-
*a,
|
145
|
-
[:fail_twice]
|
146
|
-
]
|
147
|
-
)})}
|
148
|
-
::Myco.find_constant(:PositivePredicate).component_eval {(declare_meme(:sequence, [], nil, ::Myco.cscope.dup) { |*| (
|
149
|
-
a = self.inner.sequence
|
150
|
-
size = a.size
|
151
|
-
[
|
152
|
-
[
|
153
|
-
:choice,
|
154
|
-
size.__send__(
|
155
|
-
:+,
|
156
|
-
4
|
157
|
-
)
|
158
|
-
],
|
159
|
-
[
|
160
|
-
:choice,
|
161
|
-
size.__send__(
|
162
|
-
:+,
|
163
|
-
1
|
164
|
-
)
|
165
|
-
],
|
166
|
-
*a,
|
167
|
-
[
|
168
|
-
:commit,
|
169
|
-
1
|
170
|
-
],
|
171
|
-
[:fail]
|
172
|
-
]
|
173
|
-
)})}
|
174
|
-
::Myco.find_constant(:OneOrMore).component_eval {(
|
175
|
-
declare_meme(:inlaid, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil}
|
176
|
-
declare_meme(:sequence, [], nil, ::Myco.cscope.dup) { |*| (
|
177
|
-
one = self.inner.sequence
|
178
|
-
::Myco.branch_op(:"&&", self.inlaid) {one = one.__send__(
|
179
|
-
:+,
|
180
|
-
self.inlaid
|
181
|
-
)}
|
182
|
-
or_more = ::Myco.find_constant(:ZeroOrMore).new({
|
183
|
-
:inner => self.inner,
|
184
|
-
:inlaid => self.inlaid
|
185
|
-
}).sequence
|
186
|
-
[
|
187
|
-
*one,
|
188
|
-
*or_more
|
189
|
-
]
|
190
|
-
)}
|
191
|
-
)}
|
192
|
-
::Myco.find_constant(:ZeroOrOne).component_eval {(declare_meme(:sequence, [], nil, ::Myco.cscope.dup) { |*| (
|
193
|
-
a = self.inner.sequence
|
194
|
-
[
|
195
|
-
[
|
196
|
-
:choice,
|
197
|
-
a.size.__send__(
|
198
|
-
:+,
|
199
|
-
2
|
200
|
-
)
|
201
|
-
],
|
202
|
-
*a,
|
203
|
-
[
|
204
|
-
:commit,
|
205
|
-
1
|
206
|
-
]
|
207
|
-
]
|
208
|
-
)})}
|
209
|
-
::Myco.find_constant(:ZeroOrMore).component_eval {(
|
210
|
-
declare_meme(:inlaid, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil}
|
211
|
-
declare_meme(:sequence, [], nil, ::Myco.cscope.dup) { |*| (self.switch(
|
212
|
-
self.inner,
|
213
|
-
:is_a?
|
214
|
-
).when(::Myco.find_constant(:CharacterSet)) { || ([[
|
215
|
-
:span,
|
216
|
-
self.inner.table
|
217
|
-
]])}.else { || (
|
218
|
-
a = self.inner.sequence
|
219
|
-
::Myco.branch_op(:"&&", self.inlaid) {a = a.__send__(
|
220
|
-
:+,
|
221
|
-
self.inlaid
|
222
|
-
)}
|
223
|
-
size = a.size
|
224
|
-
[
|
225
|
-
[
|
226
|
-
:choice,
|
227
|
-
size.__send__(
|
228
|
-
:+,
|
229
|
-
2
|
230
|
-
)
|
231
|
-
],
|
232
|
-
*a,
|
233
|
-
[
|
234
|
-
:partial_commit,
|
235
|
-
size.__send__(
|
236
|
-
:*,
|
237
|
-
-1
|
238
|
-
)
|
239
|
-
]
|
240
|
-
]
|
241
|
-
)}.output)}
|
242
|
-
)}
|
243
|
-
::Myco.find_constant(:OrderedChoice).component_eval {(declare_meme(:sequence, [], nil, ::Myco.cscope.dup) { |*| (
|
244
|
-
a = self.first.sequence
|
245
|
-
b = self.second.sequence
|
246
|
-
[
|
247
|
-
[
|
248
|
-
:choice,
|
249
|
-
a.size.__send__(
|
250
|
-
:+,
|
251
|
-
2
|
252
|
-
)
|
253
|
-
],
|
254
|
-
*a,
|
255
|
-
[
|
256
|
-
:commit,
|
257
|
-
b.size.__send__(
|
258
|
-
:+,
|
259
|
-
1
|
260
|
-
)
|
261
|
-
],
|
262
|
-
*b
|
263
|
-
]
|
264
|
-
)})}
|
265
|
-
::Myco.find_constant(:Concatenation).component_eval {(declare_meme(:sequence, [], nil, ::Myco.cscope.dup) { |*| ([
|
266
|
-
*self.first.sequence,
|
267
|
-
*self.second.sequence
|
268
|
-
])})}
|
269
|
-
::Myco.find_constant(:NamedCapture).component_eval {(declare_meme(:sequence, [], nil, ::Myco.cscope.dup) { |*| (::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", ::Myco.branch_op(:"||", self.inner.__send__(
|
270
|
-
:is_a?,
|
271
|
-
::Myco.find_constant(:OneOrMore)
|
272
|
-
)) {self.inner.__send__(
|
273
|
-
:is_a?,
|
274
|
-
::Myco.find_constant(:ZeroOrMore)
|
275
|
-
)}) {(
|
276
|
-
self.inner.__send__(
|
277
|
-
:inlaid=,
|
278
|
-
[[
|
279
|
-
:capture,
|
280
|
-
[
|
281
|
-
:m_split,
|
282
|
-
self.captargs
|
283
|
-
]
|
284
|
-
]]
|
285
|
-
)
|
286
|
-
a = self.inner.sequence
|
287
|
-
[
|
288
|
-
[
|
289
|
-
:capture,
|
290
|
-
[:m_start]
|
291
|
-
],
|
292
|
-
*a,
|
293
|
-
[
|
294
|
-
:capture,
|
295
|
-
[
|
296
|
-
:m_end,
|
297
|
-
self.captargs
|
298
|
-
]
|
299
|
-
]
|
300
|
-
]
|
301
|
-
)}) {(
|
302
|
-
a = self.inner.sequence
|
303
|
-
[
|
304
|
-
[
|
305
|
-
:capture,
|
306
|
-
[:c_start]
|
307
|
-
],
|
308
|
-
*a,
|
309
|
-
[
|
310
|
-
:capture,
|
311
|
-
[
|
312
|
-
:c_end,
|
313
|
-
self.captargs
|
314
|
-
]
|
315
|
-
]
|
316
|
-
]
|
317
|
-
)})})}
|
318
|
-
::Myco.find_constant(:NamedTextCapture).component_eval {(declare_meme(:sequence, [], nil, ::Myco.cscope.dup) { |*| (
|
319
|
-
a = self.inner.sequence
|
320
|
-
[
|
321
|
-
[
|
322
|
-
:capture,
|
323
|
-
[:s_start]
|
324
|
-
],
|
325
|
-
*a,
|
326
|
-
[
|
327
|
-
:capture,
|
328
|
-
[
|
329
|
-
:s_end,
|
330
|
-
self.captargs
|
331
|
-
]
|
332
|
-
]
|
333
|
-
]
|
334
|
-
)})}
|
335
|
-
::Myco.find_constant(:NamedTokenCapture).component_eval {(declare_meme(:sequence, [], nil, ::Myco.cscope.dup) { |*| (
|
336
|
-
a = self.inner.sequence
|
337
|
-
[
|
338
|
-
[
|
339
|
-
:capture,
|
340
|
-
[:t_start]
|
341
|
-
],
|
342
|
-
*a,
|
343
|
-
[
|
344
|
-
:capture,
|
345
|
-
[
|
346
|
-
:t_end,
|
347
|
-
self.captargs
|
348
|
-
]
|
349
|
-
]
|
350
|
-
]
|
351
|
-
)})}
|
352
|
-
::Myco.find_constant(:Reduction).component_eval {(declare_meme(:sequence, [], nil, ::Myco.cscope.dup) { |*| (
|
353
|
-
a = self.inner.sequence
|
354
|
-
[
|
355
|
-
[
|
356
|
-
:capture,
|
357
|
-
[:r_start]
|
358
|
-
],
|
359
|
-
*a,
|
360
|
-
[
|
361
|
-
:capture,
|
362
|
-
[
|
363
|
-
:r_end,
|
364
|
-
self.captargs
|
365
|
-
]
|
366
|
-
]
|
367
|
-
]
|
368
|
-
)})}
|
369
|
-
)}}
|
370
|
-
.tap { |__c__| __c__.__name__ = :Constructions })}}.instance
|