Module: StudTimeFormat
Defined Under Namespace
Modules: CenturyOfEra0, ClockhourOfDay0, ClockhourOfHalfday0, DayOfMonth0, DayOfWeekNumber0, DayOfWeekText0, DayOfYear0, Format0, FractionOfSecond0, HalfdayOfDay0, HourOfDay0, HourOfHalfday0, MinuteOfHour0, MonthOfYear0, QuoteChar0, SecondOfMinute0, String0, String1, Symbol0, TimeZoneOffsetOrId0, WeekOfWeekyear0, YearOfEra0
Instance Method Summary
collapse
Instance Method Details
#_nt_century_of_era ⇒ Object
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
|
# File 'lib/stud/time/format.rb', line 415
def _nt_century_of_era
start_index = index
if node_cache[:century_of_era].has_key?(index)
cached = node_cache[:century_of_era][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
s0, i0 = [], index
loop do
if has_terminal?("C", false, index)
r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
@index += 1
else
terminal_parse_failure("C")
r1 = nil
end
if r1
s0 << r1
else
break
end
end
if s0.empty?
@index = i0
r0 = nil
else
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
r0.extend(CenturyOfEra0)
end
node_cache[:century_of_era][start_index] = r0
r0
end
|
#_nt_clockhour_of_day ⇒ Object
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
|
# File 'lib/stud/time/format.rb', line 1061
def _nt_clockhour_of_day
start_index = index
if node_cache[:clockhour_of_day].has_key?(index)
cached = node_cache[:clockhour_of_day][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
s0, i0 = [], index
loop do
if has_terminal?("k", false, index)
r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
@index += 1
else
terminal_parse_failure("k")
r1 = nil
end
if r1
s0 << r1
else
break
end
end
if s0.empty?
@index = i0
r0 = nil
else
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
r0.extend(ClockhourOfDay0)
end
node_cache[:clockhour_of_day][start_index] = r0
r0
end
|
#_nt_clockhour_of_halfday ⇒ Object
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
|
# File 'lib/stud/time/format.rb', line 971
def _nt_clockhour_of_halfday
start_index = index
if node_cache[:clockhour_of_halfday].has_key?(index)
cached = node_cache[:clockhour_of_halfday][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
s0, i0 = [], index
loop do
if has_terminal?("h", false, index)
r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
@index += 1
else
terminal_parse_failure("h")
r1 = nil
end
if r1
s0 << r1
else
break
end
end
if s0.empty?
@index = i0
r0 = nil
else
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
r0.extend(ClockhourOfHalfday0)
end
node_cache[:clockhour_of_halfday][start_index] = r0
r0
end
|
#_nt_day_of_month ⇒ Object
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
|
# File 'lib/stud/time/format.rb', line 836
def _nt_day_of_month
start_index = index
if node_cache[:day_of_month].has_key?(index)
cached = node_cache[:day_of_month][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
s0, i0 = [], index
loop do
if has_terminal?("d", false, index)
r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
@index += 1
else
terminal_parse_failure("d")
r1 = nil
end
if r1
s0 << r1
else
break
end
end
if s0.empty?
@index = i0
r0 = nil
else
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
r0.extend(DayOfMonth0)
end
node_cache[:day_of_month][start_index] = r0
r0
end
|
#_nt_day_of_week_number ⇒ Object
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
|
# File 'lib/stud/time/format.rb', line 611
def _nt_day_of_week_number
start_index = index
if node_cache[:day_of_week_number].has_key?(index)
cached = node_cache[:day_of_week_number][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
s0, i0 = [], index
loop do
if has_terminal?("e", false, index)
r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
@index += 1
else
terminal_parse_failure("e")
r1 = nil
end
if r1
s0 << r1
else
break
end
end
if s0.empty?
@index = i0
r0 = nil
else
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
r0.extend(DayOfWeekNumber0)
end
node_cache[:day_of_week_number][start_index] = r0
r0
end
|
#_nt_day_of_week_text ⇒ Object
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
|
# File 'lib/stud/time/format.rb', line 659
def _nt_day_of_week_text
start_index = index
if node_cache[:day_of_week_text].has_key?(index)
cached = node_cache[:day_of_week_text][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
s0, i0 = [], index
loop do
if has_terminal?("E", false, index)
r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
@index += 1
else
terminal_parse_failure("E")
r1 = nil
end
if r1
s0 << r1
else
break
end
end
if s0.empty?
@index = i0
r0 = nil
else
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
r0.extend(DayOfWeekText0)
end
node_cache[:day_of_week_text][start_index] = r0
r0
end
|
#_nt_day_of_year ⇒ Object
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
|
# File 'lib/stud/time/format.rb', line 742
def _nt_day_of_year
start_index = index
if node_cache[:day_of_year].has_key?(index)
cached = node_cache[:day_of_year][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
s0, i0 = [], index
loop do
if has_terminal?("D", false, index)
r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
@index += 1
else
terminal_parse_failure("D")
r1 = nil
end
if r1
s0 << r1
else
break
end
end
if s0.empty?
@index = i0
r0 = nil
else
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
r0.extend(DayOfYear0)
end
node_cache[:day_of_year][start_index] = r0
r0
end
|
#_nt_era ⇒ Object
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
|
# File 'lib/stud/time/format.rb', line 370
def _nt_era
start_index = index
if node_cache[:era].has_key?(index)
cached = node_cache[:era][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
s0, i0 = [], index
loop do
if has_terminal?("G", false, index)
r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
@index += 1
else
terminal_parse_failure("G")
r1 = nil
end
if r1
s0 << r1
else
break
end
end
if s0.empty?
@index = i0
r0 = nil
else
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
end
node_cache[:era][start_index] = r0
r0
end
|
21
22
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
50
51
52
53
54
55
56
57
58
59
|
# File 'lib/stud/time/format.rb', line 21
def _nt_format
start_index = index
if node_cache[:format].has_key?(index)
cached = node_cache[:format][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
s0, i0 = [], index
loop do
i1 = index
r2 = _nt_time
if r2
r1 = r2
else
r3 = _nt_text
if r3
r1 = r3
else
@index = i1
r1 = nil
end
end
if r1
s0 << r1
else
break
end
end
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
r0.extend(Format0)
node_cache[:format][start_index] = r0
r0
end
|
#_nt_fraction_of_second ⇒ Object
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
|
# File 'lib/stud/time/format.rb', line 1196
def _nt_fraction_of_second
start_index = index
if node_cache[:fraction_of_second].has_key?(index)
cached = node_cache[:fraction_of_second][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
s0, i0 = [], index
loop do
if has_terminal?("S", false, index)
r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
@index += 1
else
terminal_parse_failure("S")
r1 = nil
end
if r1
s0 << r1
else
break
end
end
if s0.empty?
@index = i0
r0 = nil
else
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
r0.extend(FractionOfSecond0)
end
node_cache[:fraction_of_second][start_index] = r0
r0
end
|
#_nt_halfday_of_day ⇒ Object
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
|
# File 'lib/stud/time/format.rb', line 881
def _nt_halfday_of_day
start_index = index
if node_cache[:halfday_of_day].has_key?(index)
cached = node_cache[:halfday_of_day][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
s0, i0 = [], index
loop do
if has_terminal?("a", false, index)
r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
@index += 1
else
terminal_parse_failure("a")
r1 = nil
end
if r1
s0 << r1
else
break
end
end
if s0.empty?
@index = i0
r0 = nil
else
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
r0.extend(HalfdayOfDay0)
end
node_cache[:halfday_of_day][start_index] = r0
r0
end
|
#_nt_hour_of_day ⇒ Object
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
|
# File 'lib/stud/time/format.rb', line 1016
def _nt_hour_of_day
start_index = index
if node_cache[:hour_of_day].has_key?(index)
cached = node_cache[:hour_of_day][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
s0, i0 = [], index
loop do
if has_terminal?("H", false, index)
r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
@index += 1
else
terminal_parse_failure("H")
r1 = nil
end
if r1
s0 << r1
else
break
end
end
if s0.empty?
@index = i0
r0 = nil
else
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
r0.extend(HourOfDay0)
end
node_cache[:hour_of_day][start_index] = r0
r0
end
|
#_nt_hour_of_halfday ⇒ Object
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
|
# File 'lib/stud/time/format.rb', line 926
def _nt_hour_of_halfday
start_index = index
if node_cache[:hour_of_halfday].has_key?(index)
cached = node_cache[:hour_of_halfday][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
s0, i0 = [], index
loop do
if has_terminal?("K", false, index)
r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
@index += 1
else
terminal_parse_failure("K")
r1 = nil
end
if r1
s0 << r1
else
break
end
end
if s0.empty?
@index = i0
r0 = nil
else
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
r0.extend(HourOfHalfday0)
end
node_cache[:hour_of_halfday][start_index] = r0
r0
end
|
#_nt_minute_of_hour ⇒ Object
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
|
# File 'lib/stud/time/format.rb', line 1106
def _nt_minute_of_hour
start_index = index
if node_cache[:minute_of_hour].has_key?(index)
cached = node_cache[:minute_of_hour][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
s0, i0 = [], index
loop do
if has_terminal?("m", false, index)
r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
@index += 1
else
terminal_parse_failure("m")
r1 = nil
end
if r1
s0 << r1
else
break
end
end
if s0.empty?
@index = i0
r0 = nil
else
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
r0.extend(MinuteOfHour0)
end
node_cache[:minute_of_hour][start_index] = r0
r0
end
|
#_nt_month_of_year ⇒ Object
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
|
# File 'lib/stud/time/format.rb', line 791
def _nt_month_of_year
start_index = index
if node_cache[:month_of_year].has_key?(index)
cached = node_cache[:month_of_year][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
s0, i0 = [], index
loop do
if has_terminal?("M", false, index)
r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
@index += 1
else
terminal_parse_failure("M")
r1 = nil
end
if r1
s0 << r1
else
break
end
end
if s0.empty?
@index = i0
r0 = nil
else
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
r0.extend(MonthOfYear0)
end
node_cache[:month_of_year][start_index] = r0
r0
end
|
#_nt_quote_char ⇒ Object
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
|
# File 'lib/stud/time/format.rb', line 345
def _nt_quote_char
start_index = index
if node_cache[:quote_char].has_key?(index)
cached = node_cache[:quote_char][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
if has_terminal?("''", false, index)
r0 = instantiate_node(SyntaxNode,input, index...(index + 2))
r0.extend(QuoteChar0)
@index += 2
else
terminal_parse_failure("''")
r0 = nil
end
node_cache[:quote_char][start_index] = r0
r0
end
|
#_nt_second_of_minute ⇒ Object
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
|
# File 'lib/stud/time/format.rb', line 1151
def _nt_second_of_minute
start_index = index
if node_cache[:second_of_minute].has_key?(index)
cached = node_cache[:second_of_minute][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
s0, i0 = [], index
loop do
if has_terminal?("s", false, index)
r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
@index += 1
else
terminal_parse_failure("s")
r1 = nil
end
if r1
s0 << r1
else
break
end
end
if s0.empty?
@index = i0
r0 = nil
else
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
r0.extend(SecondOfMinute0)
end
node_cache[:second_of_minute][start_index] = r0
r0
end
|
#_nt_string ⇒ Object
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
|
# File 'lib/stud/time/format.rb', line 233
def _nt_string
start_index = index
if node_cache[:string].has_key?(index)
cached = node_cache[:string][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
i0, s0 = index, []
if has_terminal?("'", false, index)
r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
@index += 1
else
terminal_parse_failure("'")
r1 = nil
end
s0 << r1
if r1
s2, i2 = [], index
loop do
if has_terminal?('\G[^\']', true, index)
r3 = true
@index += 1
else
r3 = nil
end
if r3
s2 << r3
else
break
end
end
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
s0 << r2
if r2
if has_terminal?("'", false, index)
r4 = instantiate_node(SyntaxNode,input, index...(index + 1))
@index += 1
else
terminal_parse_failure("'")
r4 = nil
end
s0 << r4
end
end
if s0.last
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
r0.extend(String0)
r0.extend(String1)
else
@index = i0
r0 = nil
end
node_cache[:string][start_index] = r0
r0
end
|
#_nt_symbol ⇒ Object
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
|
# File 'lib/stud/time/format.rb', line 301
def _nt_symbol
start_index = index
if node_cache[:symbol].has_key?(index)
cached = node_cache[:symbol][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
s0, i0 = [], index
loop do
if has_terminal?('\G[^A-Za-z\']', true, index)
r1 = true
@index += 1
else
r1 = nil
end
if r1
s0 << r1
else
break
end
end
if s0.empty?
@index = i0
r0 = nil
else
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
r0.extend(Symbol0)
end
node_cache[:symbol][start_index] = r0
r0
end
|
#_nt_text ⇒ Object
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
|
# File 'lib/stud/time/format.rb', line 186
def _nt_text
start_index = index
if node_cache[:text].has_key?(index)
cached = node_cache[:text][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
i0 = index
r1 = _nt_string
if r1
r0 = r1
else
r2 = _nt_symbol
if r2
r0 = r2
else
@index = i0
r0 = nil
end
end
node_cache[:text][start_index] = r0
r0
end
|
#_nt_time ⇒ Object
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
|
# File 'lib/stud/time/format.rb', line 61
def _nt_time
start_index = index
if node_cache[:time].has_key?(index)
cached = node_cache[:time][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
i0 = index
r1 = _nt_era
if r1
r0 = r1
else
r2 = _nt_century_of_era
if r2
r0 = r2
else
r3 = _nt_year_of_era
if r3
r0 = r3
else
r4 = _nt_weekyear
if r4
r0 = r4
else
r5 = _nt_week_of_weekyear
if r5
r0 = r5
else
r6 = _nt_day_of_week_number
if r6
r0 = r6
else
r7 = _nt_day_of_week_text
if r7
r0 = r7
else
r8 = _nt_year
if r8
r0 = r8
else
r9 = _nt_day_of_year
if r9
r0 = r9
else
r10 = _nt_month_of_year
if r10
r0 = r10
else
r11 = _nt_day_of_month
if r11
r0 = r11
else
r12 = _nt_halfday_of_day
if r12
r0 = r12
else
r13 = _nt_hour_of_halfday
if r13
r0 = r13
else
r14 = _nt_clockhour_of_halfday
if r14
r0 = r14
else
r15 = _nt_hour_of_day
if r15
r0 = r15
else
r16 = _nt_clockhour_of_day
if r16
r0 = r16
else
r17 = _nt_minute_of_hour
if r17
r0 = r17
else
r18 = _nt_second_of_minute
if r18
r0 = r18
else
r19 = _nt_fraction_of_second
if r19
r0 = r19
else
r20 = _nt_time_zone_text
if r20
r0 = r20
else
r21 = _nt_time_zone_offset_or_id
if r21
r0 = r21
else
@index = i0
r0 = nil
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
node_cache[:time][start_index] = r0
r0
end
|
#_nt_time_zone_offset_or_id ⇒ Object
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
|
# File 'lib/stud/time/format.rb', line 1279
def _nt_time_zone_offset_or_id
start_index = index
if node_cache[:time_zone_offset_or_id].has_key?(index)
cached = node_cache[:time_zone_offset_or_id][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
s0, i0 = [], index
loop do
if has_terminal?("Z", false, index)
r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
@index += 1
else
terminal_parse_failure("Z")
r1 = nil
end
if r1
s0 << r1
else
break
end
end
if s0.empty?
@index = i0
r0 = nil
else
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
r0.extend(TimeZoneOffsetOrId0)
end
node_cache[:time_zone_offset_or_id][start_index] = r0
r0
end
|
#_nt_time_zone_text ⇒ Object
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
|
# File 'lib/stud/time/format.rb', line 1235
def _nt_time_zone_text
start_index = index
if node_cache[:time_zone_text].has_key?(index)
cached = node_cache[:time_zone_text][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
s0, i0 = [], index
loop do
if has_terminal?("z", false, index)
r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
@index += 1
else
terminal_parse_failure("z")
r1 = nil
end
if r1
s0 << r1
else
break
end
end
if s0.empty?
@index = i0
r0 = nil
else
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
end
node_cache[:time_zone_text][start_index] = r0
r0
end
|
#_nt_week_of_weekyear ⇒ Object
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
|
# File 'lib/stud/time/format.rb', line 566
def _nt_week_of_weekyear
start_index = index
if node_cache[:week_of_weekyear].has_key?(index)
cached = node_cache[:week_of_weekyear][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
s0, i0 = [], index
loop do
if has_terminal?("w", false, index)
r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
@index += 1
else
terminal_parse_failure("w")
r1 = nil
end
if r1
s0 << r1
else
break
end
end
if s0.empty?
@index = i0
r0 = nil
else
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
r0.extend(WeekOfWeekyear0)
end
node_cache[:week_of_weekyear][start_index] = r0
r0
end
|
#_nt_weekyear ⇒ Object
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
|
# File 'lib/stud/time/format.rb', line 522
def _nt_weekyear
start_index = index
if node_cache[:weekyear].has_key?(index)
cached = node_cache[:weekyear][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
s0, i0 = [], index
loop do
if has_terminal?("x", false, index)
r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
@index += 1
else
terminal_parse_failure("x")
r1 = nil
end
if r1
s0 << r1
else
break
end
end
if s0.empty?
@index = i0
r0 = nil
else
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
end
node_cache[:weekyear][start_index] = r0
r0
end
|
#_nt_year ⇒ Object
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
|
# File 'lib/stud/time/format.rb', line 698
def _nt_year
start_index = index
if node_cache[:year].has_key?(index)
cached = node_cache[:year][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
s0, i0 = [], index
loop do
if has_terminal?("y", false, index)
r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
@index += 1
else
terminal_parse_failure("y")
r1 = nil
end
if r1
s0 << r1
else
break
end
end
if s0.empty?
@index = i0
r0 = nil
else
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
end
node_cache[:year][start_index] = r0
r0
end
|
#_nt_year_of_era ⇒ Object
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
|
# File 'lib/stud/time/format.rb', line 464
def _nt_year_of_era
start_index = index
if node_cache[:year_of_era].has_key?(index)
cached = node_cache[:year_of_era][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
i0 = index
s1, i1 = [], index
loop do
if has_terminal?("Y", false, index)
r2 = instantiate_node(SyntaxNode,input, index...(index + 1))
@index += 1
else
terminal_parse_failure("Y")
r2 = nil
end
if r2
s1 << r2
else
break
end
end
if s1.empty?
@index = i1
r1 = nil
else
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
end
if r1
r0 = r1
r0.extend(YearOfEra0)
else
r3 = _nt_weekyear
if r3
r0 = r3
r0.extend(YearOfEra0)
else
r4 = _nt_year
if r4
r0 = r4
r0.extend(YearOfEra0)
else
@index = i0
r0 = nil
end
end
end
node_cache[:year_of_era][start_index] = r0
r0
end
|
#root ⇒ Object
7
8
9
|
# File 'lib/stud/time/format.rb', line 7
def root
@root ||= :format
end
|