occi 2.5.5 → 2.5.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/occi/version.rb +1 -1
- data/lib/occiantlr/OCCIANTLR.g +4 -4
- data/lib/occiantlr/OCCIANTLRLexer.rb +52 -52
- data/lib/occiantlr/OCCIANTLRParser.rb +85 -83
- metadata +1 -1
data/lib/occi/version.rb
CHANGED
data/lib/occiantlr/OCCIANTLR.g
CHANGED
@@ -121,8 +121,7 @@ attribute_name returns [hash] @init { hash = Hashie::Mash.new }
|
|
121
121
|
{ cur_hash[comp.to_sym] = ATTRIBUTE }
|
122
122
|
('{' ('mutable' { cur_hash[comp.to_sym][:Mutable] = true })? ('immutable' { cur_hash[comp.to_sym][:Mutable] = false })? ('required' { cur_hash[comp.to_sym][:Required] = true })? '}' )?;
|
123
123
|
attribute_component : ( LOALPHA | reserved_words) ( LOALPHA | DIGIT | DASH | UNDERSCORE | reserved_words )*;
|
124
|
-
attribute_value returns [value] : (
|
125
|
-
string : quoted_string;
|
124
|
+
attribute_value returns [value] : ( quoted_string { value = $quoted_string.text } | number { value = $number.text.to_i } );
|
126
125
|
number : ( digits ( DOT digits )? );
|
127
126
|
reserved_words
|
128
127
|
: ( ACTION | ACTIONS | ATTRIBUTES | CATEGORY | CLASS | KIND | LINK | LOCATION | MIXIN | REL | SCHEME | SELF | TERM | TITLE );
|
@@ -185,6 +184,7 @@ DIGIT : ('0'..'9')+;
|
|
185
184
|
WS : ( '\t' | ' ' | '\r' | '\n'| '\u000C' )+;
|
186
185
|
ESC : '\\' ( QUOTE | '\'' );
|
187
186
|
|
188
|
-
quoted_string
|
189
|
-
:
|
187
|
+
quoted_string returns [text]
|
188
|
+
: QUOTE string QUOTE {text = $string.text};
|
189
|
+
string : ( ESC | ~( '\\' | QUOTE | '\'' ) | '\'' )*;
|
190
190
|
digits : DIGIT+;
|
@@ -5,7 +5,7 @@
|
|
5
5
|
# Generated using ANTLR version: 3.2.1-SNAPSHOT Jul 31, 2010 19:34:52
|
6
6
|
# Ruby runtime library version: 1.8.11
|
7
7
|
# Input grammar file: OCCIANTLR.g
|
8
|
-
# Generated at: 2012-09-10
|
8
|
+
# Generated at: 2012-09-10 16:19:48
|
9
9
|
#
|
10
10
|
|
11
11
|
# ~~~> start load path setup
|
@@ -252,7 +252,7 @@ module OCCIANTLR
|
|
252
252
|
|
253
253
|
|
254
254
|
# - - - - main rule block - - - -
|
255
|
-
# at line
|
255
|
+
# at line 130:4: 'Category'
|
256
256
|
match( "Category" )
|
257
257
|
|
258
258
|
|
@@ -276,7 +276,7 @@ module OCCIANTLR
|
|
276
276
|
|
277
277
|
|
278
278
|
# - - - - main rule block - - - -
|
279
|
-
# at line
|
279
|
+
# at line 132:4: 'Link'
|
280
280
|
match( "Link" )
|
281
281
|
|
282
282
|
|
@@ -300,7 +300,7 @@ module OCCIANTLR
|
|
300
300
|
|
301
301
|
|
302
302
|
# - - - - main rule block - - - -
|
303
|
-
# at line
|
303
|
+
# at line 134:4: 'X-OCCI-Attribute'
|
304
304
|
match( "X-OCCI-Attribute" )
|
305
305
|
|
306
306
|
|
@@ -324,7 +324,7 @@ module OCCIANTLR
|
|
324
324
|
|
325
325
|
|
326
326
|
# - - - - main rule block - - - -
|
327
|
-
# at line
|
327
|
+
# at line 136:4: 'X-OCCI-Location'
|
328
328
|
match( "X-OCCI-Location" )
|
329
329
|
|
330
330
|
|
@@ -348,7 +348,7 @@ module OCCIANTLR
|
|
348
348
|
|
349
349
|
|
350
350
|
# - - - - main rule block - - - -
|
351
|
-
# at line
|
351
|
+
# at line 140:10: 'action'
|
352
352
|
match( "action" )
|
353
353
|
|
354
354
|
|
@@ -372,7 +372,7 @@ module OCCIANTLR
|
|
372
372
|
|
373
373
|
|
374
374
|
# - - - - main rule block - - - -
|
375
|
-
# at line
|
375
|
+
# at line 141:11: 'actions'
|
376
376
|
match( "actions" )
|
377
377
|
|
378
378
|
|
@@ -396,7 +396,7 @@ module OCCIANTLR
|
|
396
396
|
|
397
397
|
|
398
398
|
# - - - - main rule block - - - -
|
399
|
-
# at line
|
399
|
+
# at line 143:4: '&'
|
400
400
|
match( 0x26 )
|
401
401
|
|
402
402
|
|
@@ -420,7 +420,7 @@ module OCCIANTLR
|
|
420
420
|
|
421
421
|
|
422
422
|
# - - - - main rule block - - - -
|
423
|
-
# at line
|
423
|
+
# at line 144:6: '@'
|
424
424
|
match( 0x40 )
|
425
425
|
|
426
426
|
|
@@ -444,7 +444,7 @@ module OCCIANTLR
|
|
444
444
|
|
445
445
|
|
446
446
|
# - - - - main rule block - - - -
|
447
|
-
# at line
|
447
|
+
# at line 146:4: 'attributes'
|
448
448
|
match( "attributes" )
|
449
449
|
|
450
450
|
|
@@ -468,7 +468,7 @@ module OCCIANTLR
|
|
468
468
|
|
469
469
|
|
470
470
|
# - - - - main rule block - - - -
|
471
|
-
# at line
|
471
|
+
# at line 148:4: '\\\\'
|
472
472
|
match( 0x5c )
|
473
473
|
|
474
474
|
|
@@ -492,7 +492,7 @@ module OCCIANTLR
|
|
492
492
|
|
493
493
|
|
494
494
|
# - - - - main rule block - - - -
|
495
|
-
# at line
|
495
|
+
# at line 149:11: 'category'
|
496
496
|
match( "category" )
|
497
497
|
|
498
498
|
|
@@ -516,7 +516,7 @@ module OCCIANTLR
|
|
516
516
|
|
517
517
|
|
518
518
|
# - - - - main rule block - - - -
|
519
|
-
# at line
|
519
|
+
# at line 150:9: 'class'
|
520
520
|
match( "class" )
|
521
521
|
|
522
522
|
|
@@ -540,7 +540,7 @@ module OCCIANTLR
|
|
540
540
|
|
541
541
|
|
542
542
|
# - - - - main rule block - - - -
|
543
|
-
# at line
|
543
|
+
# at line 151:9: ':'
|
544
544
|
match( 0x3a )
|
545
545
|
|
546
546
|
|
@@ -564,7 +564,7 @@ module OCCIANTLR
|
|
564
564
|
|
565
565
|
|
566
566
|
# - - - - main rule block - - - -
|
567
|
-
# at line
|
567
|
+
# at line 152:8: '-'
|
568
568
|
match( 0x2d )
|
569
569
|
|
570
570
|
|
@@ -588,7 +588,7 @@ module OCCIANTLR
|
|
588
588
|
|
589
589
|
|
590
590
|
# - - - - main rule block - - - -
|
591
|
-
# at line
|
591
|
+
# at line 153:7: '.'
|
592
592
|
match( 0x2e )
|
593
593
|
|
594
594
|
|
@@ -612,7 +612,7 @@ module OCCIANTLR
|
|
612
612
|
|
613
613
|
|
614
614
|
# - - - - main rule block - - - -
|
615
|
-
# at line
|
615
|
+
# at line 154:10: '='
|
616
616
|
match( 0x3d )
|
617
617
|
|
618
618
|
|
@@ -636,7 +636,7 @@ module OCCIANTLR
|
|
636
636
|
|
637
637
|
|
638
638
|
# - - - - main rule block - - - -
|
639
|
-
# at line
|
639
|
+
# at line 155:6: '>'
|
640
640
|
match( 0x3e )
|
641
641
|
|
642
642
|
|
@@ -660,7 +660,7 @@ module OCCIANTLR
|
|
660
660
|
|
661
661
|
|
662
662
|
# - - - - main rule block - - - -
|
663
|
-
# at line
|
663
|
+
# at line 156:8: '#'
|
664
664
|
match( 0x23 )
|
665
665
|
|
666
666
|
|
@@ -684,7 +684,7 @@ module OCCIANTLR
|
|
684
684
|
|
685
685
|
|
686
686
|
# - - - - main rule block - - - -
|
687
|
-
# at line
|
687
|
+
# at line 157:8: 'kind'
|
688
688
|
match( "kind" )
|
689
689
|
|
690
690
|
|
@@ -708,7 +708,7 @@ module OCCIANTLR
|
|
708
708
|
|
709
709
|
|
710
710
|
# - - - - main rule block - - - -
|
711
|
-
# at line
|
711
|
+
# at line 158:8: 'link'
|
712
712
|
match( "link" )
|
713
713
|
|
714
714
|
|
@@ -732,7 +732,7 @@ module OCCIANTLR
|
|
732
732
|
|
733
733
|
|
734
734
|
# - - - - main rule block - - - -
|
735
|
-
# at line
|
735
|
+
# at line 159:11: 'location'
|
736
736
|
match( "location" )
|
737
737
|
|
738
738
|
|
@@ -756,7 +756,7 @@ module OCCIANTLR
|
|
756
756
|
|
757
757
|
|
758
758
|
# - - - - main rule block - - - -
|
759
|
-
# at line
|
759
|
+
# at line 160:6: '<'
|
760
760
|
match( 0x3c )
|
761
761
|
|
762
762
|
|
@@ -780,7 +780,7 @@ module OCCIANTLR
|
|
780
780
|
|
781
781
|
|
782
782
|
# - - - - main rule block - - - -
|
783
|
-
# at line
|
783
|
+
# at line 161:9: 'mixin'
|
784
784
|
match( "mixin" )
|
785
785
|
|
786
786
|
|
@@ -804,7 +804,7 @@ module OCCIANTLR
|
|
804
804
|
|
805
805
|
|
806
806
|
# - - - - main rule block - - - -
|
807
|
-
# at line
|
807
|
+
# at line 162:11: '%'
|
808
808
|
match( 0x25 )
|
809
809
|
|
810
810
|
|
@@ -828,7 +828,7 @@ module OCCIANTLR
|
|
828
828
|
|
829
829
|
|
830
830
|
# - - - - main rule block - - - -
|
831
|
-
# at line
|
831
|
+
# at line 163:8: '+'
|
832
832
|
match( 0x2b )
|
833
833
|
|
834
834
|
|
@@ -852,7 +852,7 @@ module OCCIANTLR
|
|
852
852
|
|
853
853
|
|
854
854
|
# - - - - main rule block - - - -
|
855
|
-
# at line
|
855
|
+
# at line 164:11: '?'
|
856
856
|
match( 0x3f )
|
857
857
|
|
858
858
|
|
@@ -876,7 +876,7 @@ module OCCIANTLR
|
|
876
876
|
|
877
877
|
|
878
878
|
# - - - - main rule block - - - -
|
879
|
-
# at line
|
879
|
+
# at line 165:9: '\"'
|
880
880
|
match( 0x22 )
|
881
881
|
|
882
882
|
|
@@ -900,7 +900,7 @@ module OCCIANTLR
|
|
900
900
|
|
901
901
|
|
902
902
|
# - - - - main rule block - - - -
|
903
|
-
# at line
|
903
|
+
# at line 166:7: 'rel'
|
904
904
|
match( "rel" )
|
905
905
|
|
906
906
|
|
@@ -924,7 +924,7 @@ module OCCIANTLR
|
|
924
924
|
|
925
925
|
|
926
926
|
# - - - - main rule block - - - -
|
927
|
-
# at line
|
927
|
+
# at line 167:10: 'scheme'
|
928
928
|
match( "scheme" )
|
929
929
|
|
930
930
|
|
@@ -948,7 +948,7 @@ module OCCIANTLR
|
|
948
948
|
|
949
949
|
|
950
950
|
# - - - - main rule block - - - -
|
951
|
-
# at line
|
951
|
+
# at line 168:8: 'self'
|
952
952
|
match( "self" )
|
953
953
|
|
954
954
|
|
@@ -972,7 +972,7 @@ module OCCIANTLR
|
|
972
972
|
|
973
973
|
|
974
974
|
# - - - - main rule block - - - -
|
975
|
-
# at line
|
975
|
+
# at line 170:4: ';'
|
976
976
|
match( 0x3b )
|
977
977
|
|
978
978
|
|
@@ -996,7 +996,7 @@ module OCCIANTLR
|
|
996
996
|
|
997
997
|
|
998
998
|
# - - - - main rule block - - - -
|
999
|
-
# at line
|
999
|
+
# at line 171:9: '/'
|
1000
1000
|
match( 0x2f )
|
1001
1001
|
|
1002
1002
|
|
@@ -1020,7 +1020,7 @@ module OCCIANTLR
|
|
1020
1020
|
|
1021
1021
|
|
1022
1022
|
# - - - - main rule block - - - -
|
1023
|
-
# at line
|
1023
|
+
# at line 172:10: '\\''
|
1024
1024
|
match( 0x27 )
|
1025
1025
|
|
1026
1026
|
|
@@ -1044,7 +1044,7 @@ module OCCIANTLR
|
|
1044
1044
|
|
1045
1045
|
|
1046
1046
|
# - - - - main rule block - - - -
|
1047
|
-
# at line
|
1047
|
+
# at line 173:8: 'term'
|
1048
1048
|
match( "term" )
|
1049
1049
|
|
1050
1050
|
|
@@ -1068,7 +1068,7 @@ module OCCIANTLR
|
|
1068
1068
|
|
1069
1069
|
|
1070
1070
|
# - - - - main rule block - - - -
|
1071
|
-
# at line
|
1071
|
+
# at line 174:9: '~'
|
1072
1072
|
match( 0x7e )
|
1073
1073
|
|
1074
1074
|
|
@@ -1092,7 +1092,7 @@ module OCCIANTLR
|
|
1092
1092
|
|
1093
1093
|
|
1094
1094
|
# - - - - main rule block - - - -
|
1095
|
-
# at line
|
1095
|
+
# at line 175:9: 'title'
|
1096
1096
|
match( "title" )
|
1097
1097
|
|
1098
1098
|
|
@@ -1116,7 +1116,7 @@ module OCCIANTLR
|
|
1116
1116
|
|
1117
1117
|
|
1118
1118
|
# - - - - main rule block - - - -
|
1119
|
-
# at line
|
1119
|
+
# at line 177:4: '_'
|
1120
1120
|
match( 0x5f )
|
1121
1121
|
|
1122
1122
|
|
@@ -1140,7 +1140,7 @@ module OCCIANTLR
|
|
1140
1140
|
|
1141
1141
|
|
1142
1142
|
# - - - - main rule block - - - -
|
1143
|
-
# at line
|
1143
|
+
# at line 178:12: '('
|
1144
1144
|
match( 0x28 )
|
1145
1145
|
|
1146
1146
|
|
@@ -1164,7 +1164,7 @@ module OCCIANTLR
|
|
1164
1164
|
|
1165
1165
|
|
1166
1166
|
# - - - - main rule block - - - -
|
1167
|
-
# at line
|
1167
|
+
# at line 179:12: ')'
|
1168
1168
|
match( 0x29 )
|
1169
1169
|
|
1170
1170
|
|
@@ -1188,8 +1188,8 @@ module OCCIANTLR
|
|
1188
1188
|
|
1189
1189
|
|
1190
1190
|
# - - - - main rule block - - - -
|
1191
|
-
# at line
|
1192
|
-
# at file
|
1191
|
+
# at line 181:12: ( 'a' .. 'z' )+
|
1192
|
+
# at file 181:12: ( 'a' .. 'z' )+
|
1193
1193
|
match_count_1 = 0
|
1194
1194
|
while true
|
1195
1195
|
alt_1 = 2
|
@@ -1201,7 +1201,7 @@ module OCCIANTLR
|
|
1201
1201
|
end
|
1202
1202
|
case alt_1
|
1203
1203
|
when 1
|
1204
|
-
# at line
|
1204
|
+
# at line 181:13: 'a' .. 'z'
|
1205
1205
|
match_range( 0x61, 0x7a )
|
1206
1206
|
|
1207
1207
|
else
|
@@ -1236,8 +1236,8 @@ module OCCIANTLR
|
|
1236
1236
|
|
1237
1237
|
|
1238
1238
|
# - - - - main rule block - - - -
|
1239
|
-
# at line
|
1240
|
-
# at file
|
1239
|
+
# at line 182:12: ( 'A' .. 'Z' )+
|
1240
|
+
# at file 182:12: ( 'A' .. 'Z' )+
|
1241
1241
|
match_count_2 = 0
|
1242
1242
|
while true
|
1243
1243
|
alt_2 = 2
|
@@ -1249,7 +1249,7 @@ module OCCIANTLR
|
|
1249
1249
|
end
|
1250
1250
|
case alt_2
|
1251
1251
|
when 1
|
1252
|
-
# at line
|
1252
|
+
# at line 182:13: 'A' .. 'Z'
|
1253
1253
|
match_range( 0x41, 0x5a )
|
1254
1254
|
|
1255
1255
|
else
|
@@ -1284,8 +1284,8 @@ module OCCIANTLR
|
|
1284
1284
|
|
1285
1285
|
|
1286
1286
|
# - - - - main rule block - - - -
|
1287
|
-
# at line
|
1288
|
-
# at file
|
1287
|
+
# at line 183:12: ( '0' .. '9' )+
|
1288
|
+
# at file 183:12: ( '0' .. '9' )+
|
1289
1289
|
match_count_3 = 0
|
1290
1290
|
while true
|
1291
1291
|
alt_3 = 2
|
@@ -1297,7 +1297,7 @@ module OCCIANTLR
|
|
1297
1297
|
end
|
1298
1298
|
case alt_3
|
1299
1299
|
when 1
|
1300
|
-
# at line
|
1300
|
+
# at line 183:13: '0' .. '9'
|
1301
1301
|
match_range( 0x30, 0x39 )
|
1302
1302
|
|
1303
1303
|
else
|
@@ -1332,8 +1332,8 @@ module OCCIANTLR
|
|
1332
1332
|
|
1333
1333
|
|
1334
1334
|
# - - - - main rule block - - - -
|
1335
|
-
# at line
|
1336
|
-
# at file
|
1335
|
+
# at line 184:12: ( '\\t' | ' ' | '\\r' | '\\n' | '\\u000C' )+
|
1336
|
+
# at file 184:12: ( '\\t' | ' ' | '\\r' | '\\n' | '\\u000C' )+
|
1337
1337
|
match_count_4 = 0
|
1338
1338
|
while true
|
1339
1339
|
alt_4 = 2
|
@@ -1388,7 +1388,7 @@ module OCCIANTLR
|
|
1388
1388
|
|
1389
1389
|
|
1390
1390
|
# - - - - main rule block - - - -
|
1391
|
-
# at line
|
1391
|
+
# at line 185:12: '\\\\' ( QUOTE | '\\'' )
|
1392
1392
|
match( 0x5c )
|
1393
1393
|
if @input.peek(1) == 0x22 || @input.peek(1) == 0x27
|
1394
1394
|
@input.consume
|
@@ -5,7 +5,7 @@
|
|
5
5
|
# Generated using ANTLR version: 3.2.1-SNAPSHOT Jul 31, 2010 19:34:52
|
6
6
|
# Ruby runtime library version: 1.8.11
|
7
7
|
# Input grammar file: OCCIANTLR.g
|
8
|
-
# Generated at: 2012-09-10
|
8
|
+
# Generated at: 2012-09-10 16:19:48
|
9
9
|
#
|
10
10
|
|
11
11
|
# ~~~> start load path setup
|
@@ -119,7 +119,7 @@ module OCCIANTLR
|
|
119
119
|
:link_attributes, :x_occi_attribute, :x_occi_location,
|
120
120
|
:uri, :term, :scheme, :class_type, :title, :attribute,
|
121
121
|
:attribute_name, :attribute_component, :attribute_value,
|
122
|
-
:
|
122
|
+
:number, :reserved_words, :quoted_string, :string,
|
123
123
|
:digits ].freeze
|
124
124
|
|
125
125
|
|
@@ -2066,18 +2066,18 @@ module OCCIANTLR
|
|
2066
2066
|
# parser rule attribute_value
|
2067
2067
|
#
|
2068
2068
|
# (in OCCIANTLR.g)
|
2069
|
-
# 124:1: attribute_value returns [value] : (
|
2069
|
+
# 124:1: attribute_value returns [value] : ( quoted_string | number ) ;
|
2070
2070
|
#
|
2071
2071
|
def attribute_value
|
2072
2072
|
# -> uncomment the next line to manually enable rule tracing
|
2073
2073
|
# trace_in( __method__, 28 )
|
2074
2074
|
value = nil
|
2075
|
-
|
2075
|
+
quoted_string30 = nil
|
2076
2076
|
number31 = nil
|
2077
2077
|
|
2078
2078
|
begin
|
2079
|
-
# at line 124:35: (
|
2080
|
-
# at line 124:35: (
|
2079
|
+
# at line 124:35: ( quoted_string | number )
|
2080
|
+
# at line 124:35: ( quoted_string | number )
|
2081
2081
|
alt_42 = 2
|
2082
2082
|
look_42_0 = @input.peek( 1 )
|
2083
2083
|
|
@@ -2090,16 +2090,16 @@ module OCCIANTLR
|
|
2090
2090
|
end
|
2091
2091
|
case alt_42
|
2092
2092
|
when 1
|
2093
|
-
# at line 124:37:
|
2094
|
-
@state.following.push(
|
2095
|
-
|
2093
|
+
# at line 124:37: quoted_string
|
2094
|
+
@state.following.push( TOKENS_FOLLOWING_quoted_string_IN_attribute_value_1183 )
|
2095
|
+
quoted_string30 = quoted_string
|
2096
2096
|
@state.following.pop
|
2097
2097
|
# --> action
|
2098
|
-
value =
|
2098
|
+
value = quoted_string30
|
2099
2099
|
# <-- action
|
2100
2100
|
|
2101
2101
|
when 2
|
2102
|
-
# at line 124:
|
2102
|
+
# at line 124:85: number
|
2103
2103
|
@state.following.push( TOKENS_FOLLOWING_number_IN_attribute_value_1189 )
|
2104
2104
|
number31 = number
|
2105
2105
|
@state.following.pop
|
@@ -2122,67 +2122,30 @@ module OCCIANTLR
|
|
2122
2122
|
return value
|
2123
2123
|
end
|
2124
2124
|
|
2125
|
-
StringReturnValue = define_return_scope
|
2126
|
-
|
2127
|
-
#
|
2128
|
-
# parser rule string
|
2129
|
-
#
|
2130
|
-
# (in OCCIANTLR.g)
|
2131
|
-
# 125:1: string : quoted_string ;
|
2132
|
-
#
|
2133
|
-
def string
|
2134
|
-
# -> uncomment the next line to manually enable rule tracing
|
2135
|
-
# trace_in( __method__, 29 )
|
2136
|
-
return_value = StringReturnValue.new
|
2137
|
-
|
2138
|
-
# $rule.start = the first token seen before matching
|
2139
|
-
return_value.start = @input.look
|
2140
|
-
|
2141
|
-
begin
|
2142
|
-
# at line 125:12: quoted_string
|
2143
|
-
@state.following.push( TOKENS_FOLLOWING_quoted_string_IN_string_1202 )
|
2144
|
-
quoted_string
|
2145
|
-
@state.following.pop
|
2146
|
-
# - - - - - - - rule clean up - - - - - - - -
|
2147
|
-
return_value.stop = @input.look( -1 )
|
2148
|
-
|
2149
|
-
rescue ANTLR3::Error::RecognitionError => re
|
2150
|
-
report_error(re)
|
2151
|
-
recover(re)
|
2152
|
-
|
2153
|
-
ensure
|
2154
|
-
# -> uncomment the next line to manually enable rule tracing
|
2155
|
-
# trace_out( __method__, 29 )
|
2156
|
-
|
2157
|
-
end
|
2158
|
-
|
2159
|
-
return return_value
|
2160
|
-
end
|
2161
|
-
|
2162
2125
|
NumberReturnValue = define_return_scope
|
2163
2126
|
|
2164
2127
|
#
|
2165
2128
|
# parser rule number
|
2166
2129
|
#
|
2167
2130
|
# (in OCCIANTLR.g)
|
2168
|
-
#
|
2131
|
+
# 125:1: number : ( digits ( DOT digits )? ) ;
|
2169
2132
|
#
|
2170
2133
|
def number
|
2171
2134
|
# -> uncomment the next line to manually enable rule tracing
|
2172
|
-
# trace_in( __method__,
|
2135
|
+
# trace_in( __method__, 29 )
|
2173
2136
|
return_value = NumberReturnValue.new
|
2174
2137
|
|
2175
2138
|
# $rule.start = the first token seen before matching
|
2176
2139
|
return_value.start = @input.look
|
2177
2140
|
|
2178
2141
|
begin
|
2179
|
-
# at line
|
2180
|
-
# at line
|
2181
|
-
# at line
|
2182
|
-
@state.following.push(
|
2142
|
+
# at line 125:12: ( digits ( DOT digits )? )
|
2143
|
+
# at line 125:12: ( digits ( DOT digits )? )
|
2144
|
+
# at line 125:14: digits ( DOT digits )?
|
2145
|
+
@state.following.push( TOKENS_FOLLOWING_digits_IN_number_1204 )
|
2183
2146
|
digits
|
2184
2147
|
@state.following.pop
|
2185
|
-
# at line
|
2148
|
+
# at line 125:21: ( DOT digits )?
|
2186
2149
|
alt_43 = 2
|
2187
2150
|
look_43_0 = @input.peek( 1 )
|
2188
2151
|
|
@@ -2191,9 +2154,9 @@ module OCCIANTLR
|
|
2191
2154
|
end
|
2192
2155
|
case alt_43
|
2193
2156
|
when 1
|
2194
|
-
# at line
|
2195
|
-
match( DOT,
|
2196
|
-
@state.following.push(
|
2157
|
+
# at line 125:23: DOT digits
|
2158
|
+
match( DOT, TOKENS_FOLLOWING_DOT_IN_number_1208 )
|
2159
|
+
@state.following.push( TOKENS_FOLLOWING_digits_IN_number_1210 )
|
2197
2160
|
digits
|
2198
2161
|
@state.following.pop
|
2199
2162
|
|
@@ -2208,7 +2171,7 @@ module OCCIANTLR
|
|
2208
2171
|
|
2209
2172
|
ensure
|
2210
2173
|
# -> uncomment the next line to manually enable rule tracing
|
2211
|
-
# trace_out( __method__,
|
2174
|
+
# trace_out( __method__, 29 )
|
2212
2175
|
|
2213
2176
|
end
|
2214
2177
|
|
@@ -2220,14 +2183,14 @@ module OCCIANTLR
|
|
2220
2183
|
# parser rule reserved_words
|
2221
2184
|
#
|
2222
2185
|
# (in OCCIANTLR.g)
|
2223
|
-
#
|
2186
|
+
# 126:1: reserved_words : ( ACTION | ACTIONS | ATTRIBUTES | CATEGORY | CLASS | KIND | LINK | LOCATION | MIXIN | REL | SCHEME | SELF | TERM | TITLE ) ;
|
2224
2187
|
#
|
2225
2188
|
def reserved_words
|
2226
2189
|
# -> uncomment the next line to manually enable rule tracing
|
2227
|
-
# trace_in( __method__,
|
2190
|
+
# trace_in( __method__, 30 )
|
2228
2191
|
|
2229
2192
|
begin
|
2230
|
-
# at line
|
2193
|
+
# at line 127:4: ( ACTION | ACTIONS | ATTRIBUTES | CATEGORY | CLASS | KIND | LINK | LOCATION | MIXIN | REL | SCHEME | SELF | TERM | TITLE )
|
2231
2194
|
if @input.peek(1) == SCHEME || @input.peek( 1 ).between?( CLASS, ACTIONS ) || @input.peek( 1 ).between?( SELF, CATEGORY ) || @input.peek( 1 ).between?( KIND, ACTION ) || @input.peek( 1 ).between?( LINK, TERM )
|
2232
2195
|
@input.consume
|
2233
2196
|
@state.error_recovery = false
|
@@ -2244,7 +2207,7 @@ module OCCIANTLR
|
|
2244
2207
|
|
2245
2208
|
ensure
|
2246
2209
|
# -> uncomment the next line to manually enable rule tracing
|
2247
|
-
# trace_out( __method__,
|
2210
|
+
# trace_out( __method__, 30 )
|
2248
2211
|
|
2249
2212
|
end
|
2250
2213
|
|
@@ -2256,18 +2219,57 @@ module OCCIANTLR
|
|
2256
2219
|
# parser rule quoted_string
|
2257
2220
|
#
|
2258
2221
|
# (in OCCIANTLR.g)
|
2259
|
-
#
|
2222
|
+
# 187:1: quoted_string returns [text] : QUOTE string QUOTE ;
|
2260
2223
|
#
|
2261
2224
|
def quoted_string
|
2225
|
+
# -> uncomment the next line to manually enable rule tracing
|
2226
|
+
# trace_in( __method__, 31 )
|
2227
|
+
text = nil
|
2228
|
+
string32 = nil
|
2229
|
+
|
2230
|
+
begin
|
2231
|
+
# at line 188:4: QUOTE string QUOTE
|
2232
|
+
match( QUOTE, TOKENS_FOLLOWING_QUOTE_IN_quoted_string_1676 )
|
2233
|
+
@state.following.push( TOKENS_FOLLOWING_string_IN_quoted_string_1678 )
|
2234
|
+
string32 = string
|
2235
|
+
@state.following.pop
|
2236
|
+
match( QUOTE, TOKENS_FOLLOWING_QUOTE_IN_quoted_string_1680 )
|
2237
|
+
# --> action
|
2238
|
+
text = ( string32 && @input.to_s( string32.start, string32.stop ) )
|
2239
|
+
# <-- action
|
2240
|
+
|
2241
|
+
rescue ANTLR3::Error::RecognitionError => re
|
2242
|
+
report_error(re)
|
2243
|
+
recover(re)
|
2244
|
+
|
2245
|
+
ensure
|
2246
|
+
# -> uncomment the next line to manually enable rule tracing
|
2247
|
+
# trace_out( __method__, 31 )
|
2248
|
+
|
2249
|
+
end
|
2250
|
+
|
2251
|
+
return text
|
2252
|
+
end
|
2253
|
+
|
2254
|
+
StringReturnValue = define_return_scope
|
2255
|
+
|
2256
|
+
#
|
2257
|
+
# parser rule string
|
2258
|
+
#
|
2259
|
+
# (in OCCIANTLR.g)
|
2260
|
+
# 189:1: string : ( ESC | ~ ( '\\\\' | QUOTE | '\\'' ) | '\\'' )* ;
|
2261
|
+
#
|
2262
|
+
def string
|
2262
2263
|
# -> uncomment the next line to manually enable rule tracing
|
2263
2264
|
# trace_in( __method__, 32 )
|
2265
|
+
return_value = StringReturnValue.new
|
2266
|
+
|
2267
|
+
# $rule.start = the first token seen before matching
|
2268
|
+
return_value.start = @input.look
|
2264
2269
|
|
2265
2270
|
begin
|
2266
|
-
# at line 189:
|
2267
|
-
# at line 189:
|
2268
|
-
# at line 189:6: QUOTE ( ESC | ~ ( '\\\\' | QUOTE | '\\'' ) | '\\'' )* QUOTE
|
2269
|
-
match( QUOTE, TOKENS_FOLLOWING_QUOTE_IN_quoted_string_1683 )
|
2270
|
-
# at line 189:12: ( ESC | ~ ( '\\\\' | QUOTE | '\\'' ) | '\\'' )*
|
2271
|
+
# at line 189:11: ( ESC | ~ ( '\\\\' | QUOTE | '\\'' ) | '\\'' )*
|
2272
|
+
# at line 189:11: ( ESC | ~ ( '\\\\' | QUOTE | '\\'' ) | '\\'' )*
|
2271
2273
|
while true # decision 44
|
2272
2274
|
alt_44 = 2
|
2273
2275
|
look_44_0 = @input.peek( 1 )
|
@@ -2293,8 +2295,8 @@ module OCCIANTLR
|
|
2293
2295
|
break # out of loop for decision 44
|
2294
2296
|
end
|
2295
2297
|
end # loop for decision 44
|
2296
|
-
|
2297
|
-
|
2298
|
+
# - - - - - - - rule clean up - - - - - - - -
|
2299
|
+
return_value.stop = @input.look( -1 )
|
2298
2300
|
|
2299
2301
|
rescue ANTLR3::Error::RecognitionError => re
|
2300
2302
|
report_error(re)
|
@@ -2306,7 +2308,7 @@ module OCCIANTLR
|
|
2306
2308
|
|
2307
2309
|
end
|
2308
2310
|
|
2309
|
-
return
|
2311
|
+
return return_value
|
2310
2312
|
end
|
2311
2313
|
|
2312
2314
|
|
@@ -2335,7 +2337,7 @@ module OCCIANTLR
|
|
2335
2337
|
case alt_45
|
2336
2338
|
when 1
|
2337
2339
|
# at line 190:10: DIGIT
|
2338
|
-
match( DIGIT,
|
2340
|
+
match( DIGIT, TOKENS_FOLLOWING_DIGIT_IN_digits_1725 )
|
2339
2341
|
|
2340
2342
|
else
|
2341
2343
|
match_count_45 > 0 and break
|
@@ -2777,17 +2779,17 @@ module OCCIANTLR
|
|
2777
2779
|
TOKENS_FOLLOWING_DASH_IN_attribute_component_1158 = Set[ 1, 7, 8, 11, 12, 13, 14, 15, 16, 20, 21, 24, 26, 29, 38, 39, 40, 41, 44, 45 ]
|
2778
2780
|
TOKENS_FOLLOWING_UNDERSCORE_IN_attribute_component_1162 = Set[ 1, 7, 8, 11, 12, 13, 14, 15, 16, 20, 21, 24, 26, 29, 38, 39, 40, 41, 44, 45 ]
|
2779
2781
|
TOKENS_FOLLOWING_reserved_words_IN_attribute_component_1166 = Set[ 1, 7, 8, 11, 12, 13, 14, 15, 16, 20, 21, 24, 26, 29, 38, 39, 40, 41, 44, 45 ]
|
2780
|
-
|
2782
|
+
TOKENS_FOLLOWING_quoted_string_IN_attribute_value_1183 = Set[ 1 ]
|
2781
2783
|
TOKENS_FOLLOWING_number_IN_attribute_value_1189 = Set[ 1 ]
|
2782
|
-
|
2783
|
-
|
2784
|
-
|
2785
|
-
|
2786
|
-
|
2787
|
-
|
2788
|
-
|
2789
|
-
|
2790
|
-
|
2784
|
+
TOKENS_FOLLOWING_digits_IN_number_1204 = Set[ 1, 32 ]
|
2785
|
+
TOKENS_FOLLOWING_DOT_IN_number_1208 = Set[ 10, 26 ]
|
2786
|
+
TOKENS_FOLLOWING_digits_IN_number_1210 = Set[ 1 ]
|
2787
|
+
TOKENS_FOLLOWING_set_IN_reserved_words_1223 = Set[ 1 ]
|
2788
|
+
TOKENS_FOLLOWING_QUOTE_IN_quoted_string_1676 = Set[ 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52 ]
|
2789
|
+
TOKENS_FOLLOWING_string_IN_quoted_string_1678 = Set[ 10 ]
|
2790
|
+
TOKENS_FOLLOWING_QUOTE_IN_quoted_string_1680 = Set[ 1 ]
|
2791
|
+
TOKENS_FOLLOWING_set_IN_string_1691 = Set[ 1, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52 ]
|
2792
|
+
TOKENS_FOLLOWING_DIGIT_IN_digits_1725 = Set[ 1, 26 ]
|
2791
2793
|
|
2792
2794
|
end # class Parser < ANTLR3::Parser
|
2793
2795
|
|