modl 0.3.26 → 0.3.28
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -149
- data/Gemfile +4 -2
- data/LICENSE.txt +1 -1
- data/README.md +19 -11
- data/Rakefile +5 -3
- data/lib/modl/interpreter.rb +38 -0
- data/lib/modl/model/model.rb +264 -0
- data/lib/modl/parser/parser.rb +280 -59
- data/lib/modl/tokeniser/context.rb +113 -0
- data/lib/modl/tokeniser/tokeniser.rb +28 -0
- data/lib/modl/util/functions.rb +74 -0
- data/lib/modl/util/unicode.rb +44 -0
- data/lib/modl/version.rb +5 -0
- data/lib/modl.rb +7 -32
- data/modl.gemspec +8 -11
- metadata +16 -75
- data/.DS_Store +0 -0
- data/.idea/vcs.xml +0 -6
- data/.rspec +0 -3
- data/.rubocop.yml +0 -5
- data/.travis.yml +0 -7
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/lib/modl/parser/MODLLexer.interp +0 -132
- data/lib/modl/parser/MODLLexer.rb +0 -324
- data/lib/modl/parser/MODLLexer.tokens +0 -40
- data/lib/modl/parser/MODLParser.interp +0 -93
- data/lib/modl/parser/MODLParser.rb +0 -2492
- data/lib/modl/parser/MODLParser.tokens +0 -40
- data/lib/modl/parser/MODLParserBaseListener.rb +0 -164
- data/lib/modl/parser/MODLParserBaseVisitor.rb +0 -107
- data/lib/modl/parser/MODLParserListener.rb +0 -151
- data/lib/modl/parser/MODLParserVisitor.rb +0 -56
- data/lib/modl/parser/class_processor.rb +0 -411
- data/lib/modl/parser/evaluator.rb +0 -125
- data/lib/modl/parser/file_importer.rb +0 -101
- data/lib/modl/parser/global_parse_context.rb +0 -318
- data/lib/modl/parser/instruction_processor.rb +0 -82
- data/lib/modl/parser/interpreter.rb +0 -75
- data/lib/modl/parser/modl_class.rb +0 -138
- data/lib/modl/parser/modl_index.rb +0 -54
- data/lib/modl/parser/modl_keylist.rb +0 -81
- data/lib/modl/parser/modl_method.rb +0 -172
- data/lib/modl/parser/object_cache.rb +0 -88
- data/lib/modl/parser/orphan_handler.rb +0 -98
- data/lib/modl/parser/parsed.rb +0 -1469
- data/lib/modl/parser/ref_processor.rb +0 -258
- data/lib/modl/parser/substitutions.rb +0 -101
- data/lib/modl/parser/sutil.rb +0 -108
- data/lib/modl/parser/throwing_error_listener.rb +0 -44
- data/lib/modl/parser/unicode_escape_replacer.rb +0 -148
- data/lib/modl/parser/unicode_escapes.rb +0 -112
- data/lib/modl/parser/version.rb +0 -29
@@ -1,40 +0,0 @@
|
|
1
|
-
WS=1
|
2
|
-
NULL=2
|
3
|
-
TRUE=3
|
4
|
-
FALSE=4
|
5
|
-
COLON=5
|
6
|
-
EQUALS=6
|
7
|
-
STRUCT_SEP=7
|
8
|
-
ARR_SEP=8
|
9
|
-
LBRAC=9
|
10
|
-
RBRAC=10
|
11
|
-
LSBRAC=11
|
12
|
-
RSBRAC=12
|
13
|
-
NUMBER=13
|
14
|
-
COMMENT=14
|
15
|
-
QUOTED=15
|
16
|
-
STRING=16
|
17
|
-
HASH_PREFIX=17
|
18
|
-
LCBRAC=18
|
19
|
-
CWS=19
|
20
|
-
QMARK=20
|
21
|
-
FSLASH=21
|
22
|
-
GTHAN=22
|
23
|
-
LTHAN=23
|
24
|
-
ASTERISK=24
|
25
|
-
AMP=25
|
26
|
-
PIPE=26
|
27
|
-
EXCLAM=27
|
28
|
-
CCOMMENT=28
|
29
|
-
RCBRAC=29
|
30
|
-
','=8
|
31
|
-
'{'=18
|
32
|
-
'?'=20
|
33
|
-
'/'=21
|
34
|
-
'>'=22
|
35
|
-
'<'=23
|
36
|
-
'*'=24
|
37
|
-
'&'=25
|
38
|
-
'|'=26
|
39
|
-
'!'=27
|
40
|
-
'}'=29
|
@@ -1,164 +0,0 @@
|
|
1
|
-
# Generated from MODLParser.g4 by ANTLR 4.7.2
|
2
|
-
require 'antlr4/runtime'
|
3
|
-
|
4
|
-
module MODL::Parser
|
5
|
-
|
6
|
-
class MODLParserBaseListener < MODLParserListener
|
7
|
-
def enterModl(ctx)
|
8
|
-
end
|
9
|
-
|
10
|
-
def exitModl(ctx)
|
11
|
-
end
|
12
|
-
|
13
|
-
def enterModl_structure(ctx)
|
14
|
-
end
|
15
|
-
|
16
|
-
def exitModl_structure(ctx)
|
17
|
-
end
|
18
|
-
|
19
|
-
def enterModl_map(ctx)
|
20
|
-
end
|
21
|
-
|
22
|
-
def exitModl_map(ctx)
|
23
|
-
end
|
24
|
-
|
25
|
-
def enterModl_array(ctx)
|
26
|
-
end
|
27
|
-
|
28
|
-
def exitModl_array(ctx)
|
29
|
-
end
|
30
|
-
|
31
|
-
def enterModl_nb_array(ctx)
|
32
|
-
end
|
33
|
-
|
34
|
-
def exitModl_nb_array(ctx)
|
35
|
-
end
|
36
|
-
|
37
|
-
def enterModl_pair(ctx)
|
38
|
-
end
|
39
|
-
|
40
|
-
def exitModl_pair(ctx)
|
41
|
-
end
|
42
|
-
|
43
|
-
def enterModl_value_item(ctx)
|
44
|
-
end
|
45
|
-
|
46
|
-
def exitModl_value_item(ctx)
|
47
|
-
end
|
48
|
-
|
49
|
-
def enterModl_top_level_conditional(ctx)
|
50
|
-
end
|
51
|
-
|
52
|
-
def exitModl_top_level_conditional(ctx)
|
53
|
-
end
|
54
|
-
|
55
|
-
def enterModl_top_level_conditional_return(ctx)
|
56
|
-
end
|
57
|
-
|
58
|
-
def exitModl_top_level_conditional_return(ctx)
|
59
|
-
end
|
60
|
-
|
61
|
-
def enterModl_map_conditional(ctx)
|
62
|
-
end
|
63
|
-
|
64
|
-
def exitModl_map_conditional(ctx)
|
65
|
-
end
|
66
|
-
|
67
|
-
def enterModl_map_conditional_return(ctx)
|
68
|
-
end
|
69
|
-
|
70
|
-
def exitModl_map_conditional_return(ctx)
|
71
|
-
end
|
72
|
-
|
73
|
-
def enterModl_map_item(ctx)
|
74
|
-
end
|
75
|
-
|
76
|
-
def exitModl_map_item(ctx)
|
77
|
-
end
|
78
|
-
|
79
|
-
def enterModl_array_conditional(ctx)
|
80
|
-
end
|
81
|
-
|
82
|
-
def exitModl_array_conditional(ctx)
|
83
|
-
end
|
84
|
-
|
85
|
-
def enterModl_array_conditional_return(ctx)
|
86
|
-
end
|
87
|
-
|
88
|
-
def exitModl_array_conditional_return(ctx)
|
89
|
-
end
|
90
|
-
|
91
|
-
def enterModl_array_item(ctx)
|
92
|
-
end
|
93
|
-
|
94
|
-
def exitModl_array_item(ctx)
|
95
|
-
end
|
96
|
-
|
97
|
-
def enterModl_value_conditional(ctx)
|
98
|
-
end
|
99
|
-
|
100
|
-
def exitModl_value_conditional(ctx)
|
101
|
-
end
|
102
|
-
|
103
|
-
def enterModl_value_conditional_return(ctx)
|
104
|
-
end
|
105
|
-
|
106
|
-
def exitModl_value_conditional_return(ctx)
|
107
|
-
end
|
108
|
-
|
109
|
-
def enterModl_condition_test(ctx)
|
110
|
-
end
|
111
|
-
|
112
|
-
def exitModl_condition_test(ctx)
|
113
|
-
end
|
114
|
-
|
115
|
-
def enterModl_operator(ctx)
|
116
|
-
end
|
117
|
-
|
118
|
-
def exitModl_operator(ctx)
|
119
|
-
end
|
120
|
-
|
121
|
-
def enterModl_condition(ctx)
|
122
|
-
end
|
123
|
-
|
124
|
-
def exitModl_condition(ctx)
|
125
|
-
end
|
126
|
-
|
127
|
-
def enterModl_condition_group(ctx)
|
128
|
-
end
|
129
|
-
|
130
|
-
def exitModl_condition_group(ctx)
|
131
|
-
end
|
132
|
-
|
133
|
-
def enterModl_value(ctx)
|
134
|
-
end
|
135
|
-
|
136
|
-
def exitModl_value(ctx)
|
137
|
-
end
|
138
|
-
|
139
|
-
def enterModl_array_value_item(ctx)
|
140
|
-
end
|
141
|
-
|
142
|
-
def exitModl_array_value_item(ctx)
|
143
|
-
end
|
144
|
-
|
145
|
-
def enterModl_primitive(ctx)
|
146
|
-
end
|
147
|
-
|
148
|
-
def exitModl_primitive(ctx)
|
149
|
-
end
|
150
|
-
|
151
|
-
def enter_every_rule(ctx)
|
152
|
-
end
|
153
|
-
|
154
|
-
def exit_every_rule(ctx)
|
155
|
-
end
|
156
|
-
|
157
|
-
def visit_terminal(node)
|
158
|
-
end
|
159
|
-
|
160
|
-
def visit_error_node(node)
|
161
|
-
end
|
162
|
-
|
163
|
-
end
|
164
|
-
end
|
@@ -1,107 +0,0 @@
|
|
1
|
-
# Generated from MODLParser.g4 by ANTLR 4.7.2
|
2
|
-
|
3
|
-
require 'antlr4/runtime'
|
4
|
-
|
5
|
-
|
6
|
-
module MODL::Parser
|
7
|
-
|
8
|
-
class MODLParserBaseVisitor < Antlr4::Runtime::AbstractParseTreeVisitor
|
9
|
-
def visitModl( ctx)
|
10
|
-
return visit_children(ctx)
|
11
|
-
end
|
12
|
-
|
13
|
-
def visitModl_structure( ctx)
|
14
|
-
return visit_children(ctx)
|
15
|
-
end
|
16
|
-
|
17
|
-
def visitModl_map( ctx)
|
18
|
-
return visit_children(ctx)
|
19
|
-
end
|
20
|
-
|
21
|
-
def visitModl_array( ctx)
|
22
|
-
return visit_children(ctx)
|
23
|
-
end
|
24
|
-
|
25
|
-
def visitModl_nb_array( ctx)
|
26
|
-
return visit_children(ctx)
|
27
|
-
end
|
28
|
-
|
29
|
-
def visitModl_pair( ctx)
|
30
|
-
return visit_children(ctx)
|
31
|
-
end
|
32
|
-
|
33
|
-
def visitModl_value_item( ctx)
|
34
|
-
return visit_children(ctx)
|
35
|
-
end
|
36
|
-
|
37
|
-
def visitModl_top_level_conditional( ctx)
|
38
|
-
return visit_children(ctx)
|
39
|
-
end
|
40
|
-
|
41
|
-
def visitModl_top_level_conditional_return( ctx)
|
42
|
-
return visit_children(ctx)
|
43
|
-
end
|
44
|
-
|
45
|
-
def visitModl_map_conditional( ctx)
|
46
|
-
return visit_children(ctx)
|
47
|
-
end
|
48
|
-
|
49
|
-
def visitModl_map_conditional_return( ctx)
|
50
|
-
return visit_children(ctx)
|
51
|
-
end
|
52
|
-
|
53
|
-
def visitModl_map_item( ctx)
|
54
|
-
return visit_children(ctx)
|
55
|
-
end
|
56
|
-
|
57
|
-
def visitModl_array_conditional( ctx)
|
58
|
-
return visit_children(ctx)
|
59
|
-
end
|
60
|
-
|
61
|
-
def visitModl_array_conditional_return( ctx)
|
62
|
-
return visit_children(ctx)
|
63
|
-
end
|
64
|
-
|
65
|
-
def visitModl_array_item( ctx)
|
66
|
-
return visit_children(ctx)
|
67
|
-
end
|
68
|
-
|
69
|
-
def visitModl_value_conditional( ctx)
|
70
|
-
return visit_children(ctx)
|
71
|
-
end
|
72
|
-
|
73
|
-
def visitModl_value_conditional_return( ctx)
|
74
|
-
return visit_children(ctx)
|
75
|
-
end
|
76
|
-
|
77
|
-
def visitModl_condition_test( ctx)
|
78
|
-
return visit_children(ctx)
|
79
|
-
end
|
80
|
-
|
81
|
-
def visitModl_operator( ctx)
|
82
|
-
return visit_children(ctx)
|
83
|
-
end
|
84
|
-
|
85
|
-
def visitModl_condition( ctx)
|
86
|
-
return visit_children(ctx)
|
87
|
-
end
|
88
|
-
|
89
|
-
def visitModl_condition_group( ctx)
|
90
|
-
return visit_children(ctx)
|
91
|
-
end
|
92
|
-
|
93
|
-
def visitModl_value( ctx)
|
94
|
-
return visit_children(ctx)
|
95
|
-
end
|
96
|
-
|
97
|
-
def visitModl_array_value_item( ctx)
|
98
|
-
return visit_children(ctx)
|
99
|
-
end
|
100
|
-
|
101
|
-
def visitModl_primitive( ctx)
|
102
|
-
return visit_children(ctx)
|
103
|
-
end
|
104
|
-
|
105
|
-
|
106
|
-
end
|
107
|
-
end
|
@@ -1,151 +0,0 @@
|
|
1
|
-
# Generated from MODLParser.g4 by ANTLR 4.7.2
|
2
|
-
module MODL::Parser
|
3
|
-
require 'antlr4/runtime'
|
4
|
-
|
5
|
-
class MODLParserListener < Antlr4::Runtime::ParseTreeListener
|
6
|
-
def enterModl(ctx)
|
7
|
-
end
|
8
|
-
|
9
|
-
def exitModl(ctx)
|
10
|
-
end
|
11
|
-
|
12
|
-
def enterModl_structure(ctx)
|
13
|
-
end
|
14
|
-
|
15
|
-
def exitModl_structure(ctx)
|
16
|
-
end
|
17
|
-
|
18
|
-
def enterModl_map(ctx)
|
19
|
-
end
|
20
|
-
|
21
|
-
def exitModl_map(ctx)
|
22
|
-
end
|
23
|
-
|
24
|
-
def enterModl_array(ctx)
|
25
|
-
end
|
26
|
-
|
27
|
-
def exitModl_array(ctx)
|
28
|
-
end
|
29
|
-
|
30
|
-
def enterModl_nb_array(ctx)
|
31
|
-
end
|
32
|
-
|
33
|
-
def exitModl_nb_array(ctx)
|
34
|
-
end
|
35
|
-
|
36
|
-
def enterModl_pair(ctx)
|
37
|
-
end
|
38
|
-
|
39
|
-
def exitModl_pair(ctx)
|
40
|
-
end
|
41
|
-
|
42
|
-
def enterModl_value_item(ctx)
|
43
|
-
end
|
44
|
-
|
45
|
-
def exitModl_value_item(ctx)
|
46
|
-
end
|
47
|
-
|
48
|
-
def enterModl_top_level_conditional(ctx)
|
49
|
-
end
|
50
|
-
|
51
|
-
def exitModl_top_level_conditional(ctx)
|
52
|
-
end
|
53
|
-
|
54
|
-
def enterModl_top_level_conditional_return(ctx)
|
55
|
-
end
|
56
|
-
|
57
|
-
def exitModl_top_level_conditional_return(ctx)
|
58
|
-
end
|
59
|
-
|
60
|
-
def enterModl_map_conditional(ctx)
|
61
|
-
end
|
62
|
-
|
63
|
-
def exitModl_map_conditional(ctx)
|
64
|
-
end
|
65
|
-
|
66
|
-
def enterModl_map_conditional_return(ctx)
|
67
|
-
end
|
68
|
-
|
69
|
-
def exitModl_map_conditional_return(ctx)
|
70
|
-
end
|
71
|
-
|
72
|
-
def enterModl_map_item(ctx)
|
73
|
-
end
|
74
|
-
|
75
|
-
def exitModl_map_item(ctx)
|
76
|
-
end
|
77
|
-
|
78
|
-
def enterModl_array_conditional(ctx)
|
79
|
-
end
|
80
|
-
|
81
|
-
def exitModl_array_conditional(ctx)
|
82
|
-
end
|
83
|
-
|
84
|
-
def enterModl_array_conditional_return(ctx)
|
85
|
-
end
|
86
|
-
|
87
|
-
def exitModl_array_conditional_return(ctx)
|
88
|
-
end
|
89
|
-
|
90
|
-
def enterModl_array_item(ctx)
|
91
|
-
end
|
92
|
-
|
93
|
-
def exitModl_array_item(ctx)
|
94
|
-
end
|
95
|
-
|
96
|
-
def enterModl_value_conditional(ctx)
|
97
|
-
end
|
98
|
-
|
99
|
-
def exitModl_value_conditional(ctx)
|
100
|
-
end
|
101
|
-
|
102
|
-
def enterModl_value_conditional_return(ctx)
|
103
|
-
end
|
104
|
-
|
105
|
-
def exitModl_value_conditional_return(ctx)
|
106
|
-
end
|
107
|
-
|
108
|
-
def enterModl_condition_test(ctx)
|
109
|
-
end
|
110
|
-
|
111
|
-
def exitModl_condition_test(ctx)
|
112
|
-
end
|
113
|
-
|
114
|
-
def enterModl_operator(ctx)
|
115
|
-
end
|
116
|
-
|
117
|
-
def exitModl_operator(ctx)
|
118
|
-
end
|
119
|
-
|
120
|
-
def enterModl_condition(ctx)
|
121
|
-
end
|
122
|
-
|
123
|
-
def exitModl_condition(ctx)
|
124
|
-
end
|
125
|
-
|
126
|
-
def enterModl_condition_group(ctx)
|
127
|
-
end
|
128
|
-
|
129
|
-
def exitModl_condition_group(ctx)
|
130
|
-
end
|
131
|
-
|
132
|
-
def enterModl_value(ctx)
|
133
|
-
end
|
134
|
-
|
135
|
-
def exitModl_value(ctx)
|
136
|
-
end
|
137
|
-
|
138
|
-
def enterModl_array_value_item(ctx)
|
139
|
-
end
|
140
|
-
|
141
|
-
def exitModl_array_value_item(ctx)
|
142
|
-
end
|
143
|
-
|
144
|
-
def enterModl_primitive(ctx)
|
145
|
-
end
|
146
|
-
|
147
|
-
def exitModl_primitive(ctx)
|
148
|
-
end
|
149
|
-
|
150
|
-
end
|
151
|
-
end
|
@@ -1,56 +0,0 @@
|
|
1
|
-
# Generated from MODLParser.g4 by ANTLR 4.7.2
|
2
|
-
require 'antlr4/runtime'
|
3
|
-
|
4
|
-
module MODL::Parser
|
5
|
-
|
6
|
-
class MODLParserVisitor < Antlr4::Runtime::ParseTreeVisitor
|
7
|
-
def visitModl(ctx)
|
8
|
-
end
|
9
|
-
def visitModl_structure(ctx)
|
10
|
-
end
|
11
|
-
def visitModl_map(ctx)
|
12
|
-
end
|
13
|
-
def visitModl_array(ctx)
|
14
|
-
end
|
15
|
-
def visitModl_nb_array(ctx)
|
16
|
-
end
|
17
|
-
def visitModl_pair(ctx)
|
18
|
-
end
|
19
|
-
def visitModl_value_item(ctx)
|
20
|
-
end
|
21
|
-
def visitModl_top_level_conditional(ctx)
|
22
|
-
end
|
23
|
-
def visitModl_top_level_conditional_return(ctx)
|
24
|
-
end
|
25
|
-
def visitModl_map_conditional(ctx)
|
26
|
-
end
|
27
|
-
def visitModl_map_conditional_return(ctx)
|
28
|
-
end
|
29
|
-
def visitModl_map_item(ctx)
|
30
|
-
end
|
31
|
-
def visitModl_array_conditional(ctx)
|
32
|
-
end
|
33
|
-
def visitModl_array_conditional_return(ctx)
|
34
|
-
end
|
35
|
-
def visitModl_array_item(ctx)
|
36
|
-
end
|
37
|
-
def visitModl_value_conditional(ctx)
|
38
|
-
end
|
39
|
-
def visitModl_value_conditional_return(ctx)
|
40
|
-
end
|
41
|
-
def visitModl_condition_test(ctx)
|
42
|
-
end
|
43
|
-
def visitModl_operator(ctx)
|
44
|
-
end
|
45
|
-
def visitModl_condition(ctx)
|
46
|
-
end
|
47
|
-
def visitModl_condition_group(ctx)
|
48
|
-
end
|
49
|
-
def visitModl_value(ctx)
|
50
|
-
end
|
51
|
-
def visitModl_array_value_item(ctx)
|
52
|
-
end
|
53
|
-
def visitModl_primitive(ctx)
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|