Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
time.cpp
Go to the documentation of this file.
1
29#include "def.h" // for Def
30#include "diagnostic.h" // for issue_diag()
31#include "path.h" // for get_pathname()
32#include "scanner.h" // for scanner
33
34#include <cassert> // for assert()
35#include <cstdio> // for fscanf()
36#include <cstring> // for strcmp(), strtok()
37#include <fstream> // for ofstream
38
39
40static const char lc_name[] = "LC_TIME";
41
42
43void Def::
44parse_era (const token_t& tok)
45{
46 // to make processing the era a little easier, first convert
47 // the era_str with possible symbolic names to a narrow string
48 // without symbolic names
49 std::string era = convert_string (tok.name);
50
51 if (era.empty ())
52 return;
53
54 // we need to also parse the wide version of this string so that we
55 // may get the wide version of the era name and format
56 const std::wstring wera = convert_wstring (tok);
57
58 char* const erap = _RWSTD_CONST_CAST (char*, era.c_str ());
59
60 const wchar_t* const werap = wera.c_str ();
61
62 // first get the direction
63 char* tokp = std::strtok (erap, ":");
64 const char direction = tokp ? *tokp : '\0';
65
66 era_st tmp_era = era_st ();
67
68 // now get the offset
69 tokp = std::strtok (0, ":");
70 if (0 == tokp)
71 issue_diag (E_SYNTAX, true, &tok,
72 "expected ':' in era definition\n");
73
74 assert (0 != tokp);
75
76 std::sscanf (tokp, "%d", &tmp_era.era_out.offset);
77 if (direction == '-')
78 tmp_era.era_out.offset *= -1;
79
80 // now get the start date
81 tokp = std::strtok (0, ":");
82 if (0 == tokp)
83 issue_diag (E_SYNTAX, true, &tok,
84 "expected ':' in era definition\n");
85
86 assert (0 != tokp);
87
88 unsigned int tmp_mon, tmp_day;
89 std::sscanf (tokp, "%d/%u/%u", &tmp_era.era_out.year[0],
90 &tmp_mon, &tmp_day);
91 // the month is offset by one ot be in the range [0-11]
92 tmp_era.era_out.month[0] = char(tmp_mon - 1);
93 tmp_era.era_out.day[0] = char(tmp_day);
94
95
96 // now get the end date (this may be the beginning or end of time
97 tokp = std::strtok (0, ":");
98 if (0 == tokp)
99 issue_diag (E_SYNTAX, true, &tok,
100 "expected ':' in era definition\n");
101
102 assert (0 != tokp);
103
104 if (std::strcmp (tokp, "-*") == 0) {
105 tmp_era.era_out.year[1] = _RWSTD_INT_MIN;
106 tmp_era.era_out.month[1] = _RWSTD_CHAR_MIN;
107 tmp_era.era_out.day[1] = _RWSTD_CHAR_MIN;
108 }
109 else if (std::strcmp (tokp, "+*") == 0) {
110 tmp_era.era_out.year[1] = _RWSTD_INT_MAX;
111 tmp_era.era_out.month[1] = _RWSTD_CHAR_MAX;
112 tmp_era.era_out.day[1] = _RWSTD_CHAR_MAX;
113 }
114 else {
115 std::sscanf (tokp, "%d/%u/%u", &tmp_era.era_out.year[1],
116 &tmp_mon, &tmp_day);
117 // the month is offset by one to be in the range [0-11]
118 tmp_era.era_out.month[1] = char(tmp_mon - 1);
119 tmp_era.era_out.day[1] = char(tmp_day);
120
121 }
122 // now get the name of the era
123 tokp = std::strtok (0, ":");
124 tmp_era.name = tokp;
125
126 // finally get the format string if one is available
127 tokp = std::strtok (0, ":");
128 if (0 != tokp)
129 tmp_era.fmt = tokp;
130
131 // FIXME: check the values
132 //advance to name of the era inside the wide char string
133 const wchar_t *wtokp = werap;
134 for (int i = 0; i < 4 && *wtokp; i++)
135 while (*wtokp && *(wtokp++) != L':');
136
137 if (*wtokp) {
138 while (*wtokp != L':')
139 tmp_era.wname += *wtokp++;
140
141 // advance past the current ':'
142 wtokp++;
143 }
144
145 if (*wtokp)
146 tmp_era.wfmt = wtokp;
147
148 era_list_.push_back (tmp_era);
149 time_out_.num_eras++;
150}
151
152
154extract_string_array (std::string *str,
155 std::wstring *wstr,
156 std::size_t nelems)
157{
158 assert (0 != str);
159 assert (0 != wstr);
160
162
163 for (std::size_t i = 0; i != nelems; ++i) {
164
165 tok = scanner_.next_token ();
166
167 if (tok.token != Scanner::tok_string) {
168 issue_diag (W_MISSING, false, &tok, "expected string");
169 break;
170 }
171
172 str [i] = convert_string (tok.name);
173 wstr [i] = convert_wstring (tok);
174 }
175
176 return tok;
177}
178
179
180void Def::process_time ()
181{
182 issue_diag (I_STAGE, false, 0, "processing %s section\n", lc_name);
183
184 // nesting level
185 int nesting_level = 0;
186
187 time_def_found_ = true;
188
189 while ((next = scanner_.next_token ()).token != Scanner::tok_time) {
190
191 switch (next.token) {
192
193 case Scanner::tok_end:
194 next = scanner_.next_token ();
195 if (next.token == Scanner::tok_time) {
196 // end of numeric block
197 if (nesting_level == 0)
198 return;
199
200 --nesting_level;
201 scanner_.close ();
202 }
203 else
204 issue_diag (E_SYNTAX, true, &next,
205 "wrong section name in END directive\n");
206 break;
207
208 case Scanner::tok_copy: {
209 next = scanner_.next_token();
210 if (next.token != Scanner::tok_string)
211 issue_diag (E_SYNTAX, true, &next,
212 "expected string following \"copy\" directive\n");
213
214 // bump up the nesting level
215 ++nesting_level;
216
217 // open the file
218 scanner_.open (get_pathname (strip_quotes (next.name), next.file));
219
220 // get comment char and escape char;
221 // these informations are stored by the scanner
222 while ((next = scanner_.next_token ()).token != Scanner::tok_time) {
223 // the LC_IDENTIFICATION section may also have a
224 // LC_TIME token that will mess up the parsing
225 if (next.token == Scanner::tok_ident) {
226 while ((next = scanner_.next_token ()).token
228 next = scanner_.next_token ();
229 }
230 }
231 break;
232 }
233
234 case Scanner::tok_abday: {
235
236 const std::size_t nelems =
237 sizeof time_st_.abday / sizeof *time_st_.abday;
238
239 next = extract_string_array (time_st_.abday,
240 time_st_.wabday,
241 nelems);
242 break;
243 }
244
245 case Scanner::tok_day: {
246
247 const std::size_t nelems =
248 sizeof time_st_.day / sizeof *time_st_.day;
249
250 next = extract_string_array (time_st_.day,
251 time_st_.wday,
252 nelems);
253 break;
254 }
255
256 case Scanner::tok_abmon: {
257
258 const std::size_t nelems =
259 sizeof time_st_.abmon / sizeof *time_st_.abmon;
260
261 next = extract_string_array (time_st_.abmon,
262 time_st_.wabmon,
263 nelems);
264 break;
265 }
266
267 case Scanner::tok_mon: {
268
269 const std::size_t nelems =
270 sizeof time_st_.mon / sizeof *time_st_.mon;
271
272 next = extract_string_array (time_st_.mon,
273 time_st_.wmon,
274 nelems);
275 break;
276 }
277
279 next = scanner_.next_token();
280 time_st_.d_t_fmt = convert_string (next.name);
281 time_st_.wd_t_fmt = convert_wstring (next);
282 break;
283
285 next = scanner_.next_token();
286 time_st_.d_fmt = convert_string (next.name);
287 time_st_.wd_fmt = convert_wstring (next);
288 break;
290 next = scanner_.next_token();
291 time_st_.t_fmt = convert_string (next.name);
292 time_st_.wt_fmt = convert_wstring (next);
293 break;
294
295 case Scanner::tok_am_pm: {
296 const std::size_t nelems =
297 sizeof time_st_.am_pm / sizeof *time_st_.am_pm;
298
299 next = extract_string_array (time_st_.am_pm,
300 time_st_.wam_pm,
301 nelems);
302 break;
303 }
304
306 next = scanner_.next_token();
307 time_st_.t_fmt_ampm = convert_string (next.name);
308 time_st_.wt_fmt_ampm = convert_wstring (next);
309 break;
310 // The time_get and time_put facets do not make use of eras or
311 // alternate digits, so we will ignore this part of the locale
312 // definition
313 case Scanner::tok_era:
314 while ((next = scanner_.next_token()).token == Scanner::tok_string)
315 parse_era (next);
316 break;
318 next = scanner_.next_token();
319 time_st_.era_d_fmt = convert_string (next.name);
320 time_st_.wera_d_fmt = convert_wstring (next);
321 break;
323 next = scanner_.next_token();
324 time_st_.era_t_fmt = convert_string (next.name);
325 time_st_.wera_t_fmt = convert_wstring (next);
326 break;
328 next = scanner_.next_token();
329 time_st_.era_d_t_fmt = convert_string (next.name);
330 time_st_.wera_d_t_fmt = convert_wstring (next);
331 break;
333 while ((next = scanner_.next_token()).token == Scanner::tok_string)
334 {
335 alt_digit_t digit;
336 digit.n_alt_digit = convert_string (next.name);
337 digit.w_alt_digit = convert_wstring (next);
338 digit.n_offset = 0;
339 digit.w_offset = 0;
340 alt_digits_.push_back (digit);
341 }
342 break;
343 default:
344 break;
345 }
346
347 }
348}
349
350
351void Def::write_time(std::string dir_name)
352{
353 assert (!dir_name.empty());
354
355 if (time_written_)
356 return;
357
358 if (!time_def_found_) {
359 issue_diag (I_SKIP, false, 0,
360 "%s section not found, skipping\n", lc_name);
361 return;
362 }
363
364 // write out all the information in the LC_TIME category
365
366 (dir_name += _RWSTD_PATH_SEP) += lc_name;
367
368 issue_diag (I_OPENWR, false, 0, "writing %s\n", dir_name.c_str ());
369
370 std::ofstream out (dir_name.c_str(), std::ios::binary);
371 out.exceptions (std::ios::failbit | std::ios::badbit);
372
373 int i;
374
375#define UINT(x) _RWSTD_STATIC_CAST(unsigned, x)
376
377 time_out_.num_alt_digits = UINT (alt_digits_.size());
378 time_out_.era_off = 0;
379
380 time_out_.alt_digits_off = UINT (time_out_.era_off +
381 sizeof (_RW::__rw_time_t::era_t) * era_list_.size());
382
383 // now calculate all the offsets for the wide string representations
384 time_out_.abday_off[1][0] = UINT (time_out_.alt_digits_off +
385 2 * sizeof (unsigned int) * time_out_.num_alt_digits);
386
387 for (i = 1; i < 7; i++) {
388 time_out_.abday_off[1][i] = UINT (time_out_.abday_off[1][i-1]
389 + (time_st_.wabday[i-1].size() * sizeof (wchar_t))
390 + sizeof(wchar_t));
391 }
392
393 time_out_.day_off[1][0] = UINT (time_out_.abday_off[1][6]
394 + time_st_.wabday[6].size() * sizeof (wchar_t)
395 + sizeof (wchar_t));
396 for (i = 1; i < 7; i++) {
397 time_out_.day_off[1][i] = UINT (time_out_.day_off[1][i-1]
398 + time_st_.wday[i-1].size() * sizeof (wchar_t)
399 + sizeof (wchar_t));
400 }
401
402 time_out_.abmon_off[1][0] = UINT (time_out_.day_off[1][6]
403 + time_st_.wday[6].size() * sizeof (wchar_t) + sizeof (wchar_t));
404 for (i = 1; i < 12; i++) {
405 time_out_.abmon_off[1][i] = UINT (time_out_.abmon_off[1][i-1]
406 + time_st_.wabmon[i-1].size() * sizeof (wchar_t)
407 + sizeof (wchar_t));
408 }
409
410 time_out_.mon_off[1][0] = UINT (time_out_.abmon_off[1][11]
411 + time_st_.wabmon[11].size() * sizeof (wchar_t)
412 + sizeof (wchar_t));
413 for (i = 1; i < 12; i++) {
414 time_out_.mon_off[1][i] = UINT (time_out_.mon_off[1][i-1]
415 + time_st_.wmon[i-1].size() * sizeof (wchar_t)
416 + sizeof (wchar_t));
417 }
418
419 time_out_.am_pm_off[1][0] = UINT (time_out_.mon_off[1][11]
420 + time_st_.wmon[11].size() * sizeof (wchar_t) + sizeof (wchar_t));
421 time_out_.am_pm_off[1][1] = UINT (time_out_.am_pm_off[1][0]
422 + time_st_.wam_pm[0].size() * sizeof (wchar_t) + sizeof (wchar_t));
423
424 time_out_.d_t_fmt_off[1] = UINT (time_out_.am_pm_off[1][1]
425 + time_st_.wam_pm[1].size() * sizeof (wchar_t)
426 + sizeof (wchar_t));
427 time_out_.d_fmt_off[1] = UINT (time_out_.d_t_fmt_off[1]
428 + time_st_.wd_t_fmt.size() * sizeof (wchar_t) + sizeof (wchar_t));
429 time_out_.t_fmt_off[1] = UINT (time_out_.d_fmt_off[1]
430 + time_st_.wd_fmt.size() * sizeof (wchar_t) + sizeof (wchar_t));
431 time_out_.t_fmt_ampm_off[1] = UINT (time_out_.t_fmt_off[1]
432 + time_st_.wt_fmt.size() * sizeof (wchar_t) + sizeof (wchar_t));
433
434 time_out_.era_d_t_fmt_off[1] = UINT (time_out_.t_fmt_ampm_off[1]
435 + time_st_.wt_fmt_ampm.size() * sizeof (wchar_t)
436 + sizeof (wchar_t));
437 time_out_.era_d_fmt_off[1] = UINT (time_out_.era_d_t_fmt_off[1]
438 + time_st_.wera_d_t_fmt.size() * sizeof (wchar_t)
439 + sizeof (wchar_t));
440 time_out_.era_t_fmt_off[1] = UINT (time_out_.era_d_fmt_off[1]
441 + time_st_.wera_d_fmt.size() * sizeof (wchar_t) + sizeof (wchar_t));
442
443 unsigned int next_off = UINT (time_out_.era_t_fmt_off[1]
444 + time_st_.wera_t_fmt.size() * sizeof (wchar_t) + sizeof (wchar_t));
445 era_list_iter era_list_it;
446 for (era_list_it = era_list_.begin(); era_list_it != era_list_.end();
447 era_list_it ++) {
448 era_list_it->era_out.name_off[1] = next_off;
449 next_off += UINT (era_list_it->wname.size()
450 * sizeof (wchar_t) + sizeof (wchar_t));
451 era_list_it->era_out.fmt_off[1] = next_off;
452 next_off += UINT (era_list_it->wfmt.size()
453 * sizeof (wchar_t) + sizeof (wchar_t));
454 }
455
456 alt_digits_iter alt_digits_it;
457 for (alt_digits_it = alt_digits_.begin();
458 alt_digits_it != alt_digits_.end(); alt_digits_it ++ ){
459 alt_digits_it->w_offset = next_off;
460 next_off += UINT ((alt_digits_it->w_alt_digit.size() + 1)
461 * sizeof(wchar_t));
462 }
463
464 time_out_.abday_off[0][0] = next_off;
465
466 for (i = 1; i < 7; i++) {
467 // calculate the offsets for the abreviated days
468 time_out_.abday_off[0][i] = UINT (time_out_.abday_off[0][i-1]
469 + time_st_.abday[i - 1].size() + 1);
470 }
471
472 time_out_.day_off[0][0] = UINT (time_out_.abday_off[0][6]
473 + time_st_.abday[6].size() + 1);
474 for (i = 1; i < 7; i++) {
475 // calculate the offsets for the days
476 time_out_.day_off[0][i] = UINT (time_out_.day_off[0][i-1]
477 + time_st_.day[i-1].size() + 1);
478 }
479
480 time_out_.abmon_off[0][0] = UINT (time_out_.day_off[0][6]
481 + time_st_.day[6].size() + 1);
482 for (i = 1; i < 12; i++) {
483 // calculate the offsets for the abreviated months
484 time_out_.abmon_off[0][i] = UINT (time_out_.abmon_off[0][i-1]
485 + time_st_.abmon[i-1].size() + 1);
486 }
487
488 time_out_.mon_off[0][0] = UINT (time_out_.abmon_off[0][11]
489 + time_st_.abmon[11].size() + 1);
490 for (i = 1; i < 12; i++) {
491 // calculate the offsets for the months
492 time_out_.mon_off[0][i] = UINT (time_out_.mon_off[0][i-1]
493 + time_st_.mon[i-1].size() + 1);
494 }
495
496 // calculate the offsets for am and pm
497 time_out_.am_pm_off[0][0] = UINT (time_out_.mon_off[0][11]
498 + time_st_.mon[11].size() + 1);
499 time_out_.am_pm_off[0][1] = UINT (time_out_.am_pm_off[0][0]
500 + time_st_.am_pm[0].size() + 1);
501
502 time_out_.d_t_fmt_off[0] = UINT (time_out_.am_pm_off[0][1]
503 + time_st_.am_pm[1].size() + 1);
504 time_out_.d_fmt_off[0] = UINT (time_out_.d_t_fmt_off[0]
505 + time_st_.d_t_fmt.size() + 1);
506 time_out_.t_fmt_off[0] = UINT (time_out_.d_fmt_off[0]
507 + time_st_.d_fmt.size() + 1);
508 time_out_.t_fmt_ampm_off[0] = UINT (time_out_.t_fmt_off[0]
509 + time_st_.t_fmt.size() + 1);
510
511 time_out_.era_d_t_fmt_off[0] = UINT (time_out_.t_fmt_ampm_off[0]
512 + time_st_.t_fmt_ampm.size() + 1);
513 time_out_.era_d_fmt_off[0] = UINT (time_out_.era_d_t_fmt_off[0]
514 + time_st_.era_d_t_fmt.size() + 1);
515 time_out_.era_t_fmt_off[0] = UINT (time_out_.era_d_fmt_off[0]
516 + time_st_.era_d_fmt.size() + 1);
517
518
519
520 next_off = UINT (time_out_.era_t_fmt_off[0]
521 + time_st_.era_t_fmt.size() + 1);
522
523 for (era_list_it = era_list_.begin(); era_list_it != era_list_.end();
524 era_list_it ++) {
525 era_list_it->era_out.name_off[0] = next_off;
526 next_off += UINT (era_list_it->name.size() + 1);
527 era_list_it->era_out.fmt_off[0] = next_off;
528 next_off += UINT (era_list_it->fmt.size() + 1);
529 }
530
531 for (alt_digits_it = alt_digits_.begin();
532 alt_digits_it != alt_digits_.end(); alt_digits_it ++ ){
533 alt_digits_it->n_offset = next_off;
534 next_off += UINT (alt_digits_it->n_alt_digit.size() + 1);
535 }
536
537
538 time_out_.codeset_off = next_off;
539
540 time_out_.charmap_off = UINT (time_out_.codeset_off
541 + charmap_.get_code_set_name().size() + 1);
542
543 // write the time struct
544 out.write ((char*)&time_out_, sizeof(time_out_));
545
546 // first write out the era structs
547 for (era_list_it = era_list_.begin(); era_list_it != era_list_.end();
548 era_list_it ++) {
549 out.write ((const char*) &era_list_it->era_out,
550 sizeof (era_list_it->era_out));
551 }
552
553 // next write out the offsets to where the alternate digits are stored
554 for (alt_digits_it = alt_digits_.begin();
555 alt_digits_it != alt_digits_.end(); alt_digits_it ++ ){
556 out.write ((const char*) &alt_digits_it->n_offset,
557 sizeof (alt_digits_it->n_offset));
558 out.write ((const char*) &alt_digits_it->w_offset,
559 sizeof (alt_digits_it->w_offset));
560 }
561
562 // now write out the wchar_t version of LC_TIME
563 for (i = 0; i < 7; i++){
564 out.write ((const char*)time_st_.wabday[i].c_str(),
565 (time_st_.wabday[i].size() + 1) * sizeof (wchar_t));
566 }
567 for (i = 0; i < 7; i++)
568 out.write ((const char*)time_st_.wday[i].c_str(),
569 (time_st_.wday[i].size() + 1) * sizeof (wchar_t));
570 for (i = 0; i < 12; i++)
571 out.write ((const char*)time_st_.wabmon[i].c_str(),
572 (time_st_.wabmon[i].size() + 1) * sizeof (wchar_t));
573 for (i = 0; i < 12; i++)
574 out.write ((const char*)time_st_.wmon[i].c_str(),
575 (time_st_.wmon[i].size() + 1) * sizeof (wchar_t));
576 for (i = 0; i < 2; i++)
577 out.write ((const char*)time_st_.wam_pm[i].c_str(),
578 (time_st_.wam_pm[i].size() + 1) * sizeof (wchar_t));
579 out.write ((const char*)time_st_.wd_t_fmt.c_str(),
580 (time_st_.wd_t_fmt.size() + 1) * sizeof (wchar_t));
581 out.write ((const char*)time_st_.wd_fmt.c_str(),
582 (time_st_.wd_fmt.size() + 1) * sizeof (wchar_t));
583 out.write ((const char*)time_st_.wt_fmt.c_str(),
584 (time_st_.wt_fmt.size() + 1) * sizeof (wchar_t));
585 out.write ((const char*)time_st_.wt_fmt_ampm.c_str(),
586 (time_st_.wt_fmt_ampm.size() + 1) * sizeof (wchar_t));
587 out.write ((const char*)time_st_.wera_d_t_fmt.c_str(),
588 (time_st_.wera_d_t_fmt.size() + 1) * sizeof (wchar_t));
589 out.write ((const char*)time_st_.wera_d_fmt.c_str(),
590 (time_st_.wera_d_fmt.size() + 1) * sizeof (wchar_t));
591 out.write ((const char*)time_st_.wera_t_fmt.c_str(),
592 (time_st_.wera_t_fmt.size() + 1) * sizeof (wchar_t));
593 for (era_list_it = era_list_.begin(); era_list_it != era_list_.end();
594 era_list_it ++) {
595 out.write ((const char*) era_list_it->wname.c_str(),
596 (era_list_it->wname.size() + 1) * sizeof (wchar_t));
597 out.write ((const char*) era_list_it->wfmt.c_str(),
598 (era_list_it->wfmt.size() + 1) * sizeof (wchar_t));
599 }
600 for (alt_digits_it = alt_digits_.begin();
601 alt_digits_it != alt_digits_.end(); alt_digits_it ++ ){
602 out.write ((const char*) alt_digits_it->w_alt_digit.c_str(),
603 (alt_digits_it->w_alt_digit.size() + 1)
604 * sizeof (wchar_t));
605 }
606
607 // write out the char version of LC_TIME
608 for (i = 0; i < 7; i++)
609 out << time_st_.abday[i] << std::ends;
610 for (i = 0; i < 7; i++)
611 out << time_st_.day[i] << std::ends;
612 for (i = 0; i < 12; i++)
613 out << time_st_.abmon[i] << std::ends;
614 for (i = 0; i < 12; i++)
615 out << time_st_.mon[i] << std::ends;
616 for (i = 0; i < 2; i++)
617 out << time_st_.am_pm[i] << std::ends;
618 out << time_st_.d_t_fmt << std::ends;
619 out << time_st_.d_fmt << std::ends;
620 out << time_st_.t_fmt << std::ends;
621 out << time_st_.t_fmt_ampm << std::ends;
622 out << time_st_.era_d_t_fmt << std::ends;
623 out << time_st_.era_d_fmt << std::ends;
624 out << time_st_.era_t_fmt << std::ends;
625 for (era_list_it = era_list_.begin(); era_list_it != era_list_.end();
626 era_list_it ++) {
627 out << era_list_it->name << std::ends;
628 out << era_list_it->fmt << std::ends;
629 }
630 for (alt_digits_it = alt_digits_.begin();
631 alt_digits_it != alt_digits_.end(); alt_digits_it ++ ){
632 out << alt_digits_it->n_alt_digit << std::ends;
633 }
634
635 out << charmap_.get_code_set_name() << std::ends;
636 out << charmap_.get_charmap_name() << std::ends;
637}
#define i
Definition 17.names.cpp:126
#define UINT
Definition 17.names.cpp:565
const int out
#define assert(expr)
Definition _cassert.h:40
#define _RWSTD_PATH_SEP
Definition _config.h:297
#define _RWSTD_CONST_CAST(T, x)
Definition _defs.h:536
const std::string & get_code_set_name() const
Definition charmap.h:112
std::string get_charmap_name() const
Definition charmap.cpp:475
void write_time(std::string dir_name)
Definition time.cpp:351
void open(std::string, char='#', char='\\')
Definition scanner.cpp:142
void close()
Definition scanner.cpp:169
token_t next_token()
Definition scanner.cpp:352
@ tok_d_t_fmt
Definition scanner.h:141
@ tok_end
Definition scanner.h:66
@ tok_abday
Definition scanner.h:137
@ tok_era_t_fmt
Definition scanner.h:148
@ tok_am_pm
Definition scanner.h:144
@ tok_era
Definition scanner.h:146
@ tok_mon
Definition scanner.h:140
@ tok_t_fmt
Definition scanner.h:143
@ tok_string
Definition scanner.h:99
@ tok_era_d_fmt
Definition scanner.h:147
@ tok_alt_digits
Definition scanner.h:150
@ tok_day
Definition scanner.h:138
@ tok_abmon
Definition scanner.h:139
@ tok_copy
Definition scanner.h:166
@ tok_time
Definition scanner.h:57
@ tok_era_d_t_fmt
Definition scanner.h:149
@ tok_ident
Definition scanner.h:60
@ tok_t_fmt_ampm
Definition scanner.h:145
@ tok_d_fmt
Definition scanner.h:142
std::string strip_quotes(const std::string &str)
Definition def.h:604
bool issue_diag(int type, bool, const Scanner::token_t *token, const char *fmt,...)
@ I_OPENWR
Definition diagnostic.h:83
@ W_MISSING
Definition diagnostic.h:66
@ I_SKIP
Definition diagnostic.h:86
@ I_STAGE
Definition diagnostic.h:81
@ E_SYNTAX
Definition diagnostic.h:49
const char * str
Definition exec.cpp:170
std::string get_pathname(const std::string &fname, const std::string &other)
Definition path.cpp:129
std::string name
Definition scanner.h:178
token_id token
Definition scanner.h:179
const char * file
Definition scanner.h:186