Commit 08e9df2
James K. Lowden
cobol: Introduce vendor-compatibility layer as user-defined functions.
Install COBOL UDFs in a target directory that includes the GCC version
in its path, to permit side-by-side installation. Support compat
library with COBOL POSIX bindings; support those binding with C
functions in libgcobol as needed.
Changes to the compiler to support POSIX binding and testing.
Include developer conveniences -- Makefiles, bin/ and t/ directories --
to ensure UDFs compile and return reasonable results. These are
not installed and do not affect how libgcobol is built.
gcc/cobol/ChangeLog:
* cdf.y: Install literals in symbol table.
* genapi.cc (parser_alphabet): Use std::string for currency.
(initialize_the_data): Rely on constructor.
(parser_file_add): Better #pragma message.
(parser_exception_file): Return early if not generating code.
* parse.y: Allow library programs to act as functions.
* parse_ante.h (dialect_proscribed): Standardize message.
(intrinsic_call_2): Correct s/fund/func/ misspelling.
* scan.l: Comment.
* symbols.cc (symbols_update): Add unreachable assertion.
(symbol_field_parent_set): Reduce error to debug message.
(cdf_literalize): Declare.
(symbol_table_init): Insert CDF constants as literals.
* symbols.h (cbl_dialect_str): Provide string values for enum.
(is_working_storage): Remove function.
(struct cbl_field_data_t): Add manhandle_initial for Numeric Edited.
(struct cbl_field_t): Initialize name to zeros.
(struct cbl_section_t): Delete unused attr() function.
(symbol_unique_index): Declare.
* token_names.h: Regenerate.
* util.cc (cdf_literalize): Construct a cbl_field_t from a CDF literal.
(symbol_unique_index): Supply "globally" unique number for a program.
libgcobol/ChangeLog:
* Makefile.am: Move UDF-support to posix/shim, add install targets
* Makefile.in: Regenerate
* charmaps.cc (__gg__currency_signs): Use std::string.
* charmaps.h: Include string and vector headers.
(class charmap_t): Use std::string and vector for currency.
* config.h.in: Regenerate.
* configure: Regenerate.
* configure.ac: Check for libxml2.
* intrinsic.cc (numval_c): Constify.
* libgcobol.cc (struct program_state): Use std::string and vector.
(__gg__inspect_format_2): Add debug messages.
* libgcobol.h (__gg__get_default_currency_string): Constify.
* valconv.cc (expand_picture): Use std::string and vector.
(__gg__string_to_numeric_edited): Use std::string and vector.
(__gg__currency_sign_init): Use std::string and vector.
(__gg__currency_sign): Use std::string and vector.
* xmlparse.cc (xml_push_parse): Reformat.
* posix/stat.cc: Removed.
* posix/stat.h: Removed.
* .gitignore: New file.
* compat/README.md: New file.
* compat/lib/gnu/CBL_ALLOC_MEM.cbl: New file.
* compat/lib/gnu/CBL_CHECK_FILE_EXIST.cbl: New file.
* compat/lib/gnu/CBL_DELETE_FILE.cbl: New file.
* compat/lib/gnu/CBL_FREE_MEM.cbl: New file.
* compat/t/Makefile: New file.
* compat/t/smoke.cbl: New file.
* posix/README.md: New file.
* posix/bin/Makefile: New file for UDF-developer.
* posix/bin/headers: New file.
* posix/bin/scrape.awk: New file.
* posix/bin/sizeofs.c: New file.
* posix/bin/udf-gen: New file.
* posix/cpy/posix-errno.cbl: New file.
* posix/cpy/statbuf.cpy: New file.
* posix/cpy/tm.cpy: New file.
* posix/errno.cc: Removed.
* posix/localtime.cc: Removed.
* posix/shim/stat.cc: New file.
* posix/shim/stat.h: New file.
* posix/t/Makefile: New file.
* posix/t/errno.cbl: New file.
* posix/t/exit.cbl: New file.
* posix/t/localtime.cbl: New file.
* posix/t/stat.cbl: New file.
* posix/tm.h: Removed.
* posix/udf/posix-exit.cbl: New file.
* posix/udf/posix-localtime.cbl: New file.
* posix/udf/posix-mkdir.cbl: New file.
* posix/udf/posix-stat.cbl: New file.
* posix/udf/posix-unlink.cbl: New file.1 parent a784ed8 commit 08e9df2
File tree
55 files changed
+2211
-657
lines changed- gcc/cobol
- libgcobol
- compat
- lib/gnu
- t
- posix
- bin
- cpy
- shim
- t
- udf
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
55 files changed
+2211
-657
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
154 | 157 | | |
155 | 158 | | |
156 | 159 | | |
| |||
353 | 356 | | |
354 | 357 | | |
355 | 358 | | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
356 | 364 | | |
357 | 365 | | |
358 | 366 | | |
| |||
952 | 960 | | |
953 | 961 | | |
954 | 962 | | |
| 963 | + | |
| 964 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5145 | 5145 | | |
5146 | 5146 | | |
5147 | 5147 | | |
5148 | | - | |
5149 | | - | |
| 5148 | + | |
| 5149 | + | |
5150 | 5150 | | |
5151 | 5151 | | |
5152 | 5152 | | |
| |||
7166 | 7166 | | |
7167 | 7167 | | |
7168 | 7168 | | |
7169 | | - | |
7170 | 7169 | | |
7171 | 7170 | | |
7172 | 7171 | | |
| |||
9911 | 9910 | | |
9912 | 9911 | | |
9913 | 9912 | | |
9914 | | - | |
9915 | | - | |
| 9913 | + | |
| 9914 | + | |
9916 | 9915 | | |
9917 | 9916 | | |
9918 | 9917 | | |
| |||
14608 | 14607 | | |
14609 | 14608 | | |
14610 | 14609 | | |
| 14610 | + | |
14611 | 14611 | | |
14612 | 14612 | | |
14613 | 14613 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2397 | 2397 | | |
2398 | 2398 | | |
2399 | 2399 | | |
2400 | | - | |
| 2400 | + | |
2401 | 2401 | | |
2402 | 2402 | | |
2403 | 2403 | | |
| |||
2528 | 2528 | | |
2529 | 2529 | | |
2530 | 2530 | | |
2531 | | - | |
| 2531 | + | |
2532 | 2532 | | |
2533 | 2533 | | |
2534 | 2534 | | |
| |||
4842 | 4842 | | |
4843 | 4843 | | |
4844 | 4844 | | |
4845 | | - | |
| 4845 | + | |
| 4846 | + | |
4846 | 4847 | | |
4847 | 4848 | | |
4848 | 4849 | | |
4849 | 4850 | | |
4850 | 4851 | | |
4851 | | - | |
| 4852 | + | |
| 4853 | + | |
4852 | 4854 | | |
4853 | 4855 | | |
4854 | 4856 | | |
| |||
4938 | 4940 | | |
4939 | 4941 | | |
4940 | 4942 | | |
| 4943 | + | |
| 4944 | + | |
4941 | 4945 | | |
4942 | 4946 | | |
4943 | 4947 | | |
4944 | | - | |
| 4948 | + | |
| 4949 | + | |
4945 | 4950 | | |
4946 | 4951 | | |
4947 | 4952 | | |
| |||
10338 | 10343 | | |
10339 | 10344 | | |
10340 | 10345 | | |
| 10346 | + | |
10341 | 10347 | | |
10342 | 10348 | | |
10343 | 10349 | | |
10344 | 10350 | | |
10345 | 10351 | | |
| 10352 | + | |
10346 | 10353 | | |
10347 | 10354 | | |
10348 | 10355 | | |
| |||
10708 | 10715 | | |
10709 | 10716 | | |
10710 | 10717 | | |
10711 | | - | |
10712 | | - | |
10713 | | - | |
10714 | | - | |
10715 | | - | |
| 10718 | + | |
| 10719 | + | |
| 10720 | + | |
| 10721 | + | |
10716 | 10722 | | |
10717 | 10723 | | |
10718 | 10724 | | |
| |||
12083 | 12089 | | |
12084 | 12090 | | |
12085 | 12091 | | |
| 12092 | + | |
12086 | 12093 | | |
12087 | 12094 | | |
12088 | 12095 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
114 | 123 | | |
115 | 124 | | |
116 | 125 | | |
| |||
180 | 189 | | |
181 | 190 | | |
182 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
183 | 201 | | |
184 | 202 | | |
185 | 203 | | |
| |||
2521 | 2539 | | |
2522 | 2540 | | |
2523 | 2541 | | |
2524 | | - | |
2525 | | - | |
2526 | | - | |
| 2542 | + | |
| 2543 | + | |
| 2544 | + | |
2527 | 2545 | | |
2528 | 2546 | | |
2529 | 2547 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
572 | 572 | | |
573 | 573 | | |
574 | 574 | | |
575 | | - | |
| 575 | + | |
576 | 576 | | |
577 | 577 | | |
578 | 578 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1862 | 1862 | | |
1863 | 1863 | | |
1864 | 1864 | | |
| 1865 | + | |
1865 | 1866 | | |
1866 | 1867 | | |
1867 | 1868 | | |
| |||
2187 | 2188 | | |
2188 | 2189 | | |
2189 | 2190 | | |
2190 | | - | |
2191 | | - | |
2192 | | - | |
2193 | | - | |
2194 | | - | |
2195 | | - | |
| 2191 | + | |
| 2192 | + | |
| 2193 | + | |
2196 | 2194 | | |
2197 | 2195 | | |
2198 | 2196 | | |
| |||
2250 | 2248 | | |
2251 | 2249 | | |
2252 | 2250 | | |
| 2251 | + | |
| 2252 | + | |
2253 | 2253 | | |
2254 | 2254 | | |
2255 | 2255 | | |
| |||
2455 | 2455 | | |
2456 | 2456 | | |
2457 | 2457 | | |
| 2458 | + | |
| 2459 | + | |
| 2460 | + | |
| 2461 | + | |
| 2462 | + | |
| 2463 | + | |
| 2464 | + | |
| 2465 | + | |
2458 | 2466 | | |
2459 | 2467 | | |
2460 | 2468 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
60 | 71 | | |
61 | 72 | | |
62 | 73 | | |
| |||
143 | 154 | | |
144 | 155 | | |
145 | 156 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | 157 | | |
152 | 158 | | |
153 | 159 | | |
| |||
391 | 397 | | |
392 | 398 | | |
393 | 399 | | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
394 | 420 | | |
395 | 421 | | |
396 | 422 | | |
| |||
630 | 656 | | |
631 | 657 | | |
632 | 658 | | |
633 | | - | |
| 659 | + | |
634 | 660 | | |
635 | 661 | | |
636 | 662 | | |
| |||
1539 | 1565 | | |
1540 | 1566 | | |
1541 | 1567 | | |
1542 | | - | |
1543 | | - | |
1544 | | - | |
1545 | | - | |
1546 | | - | |
1547 | | - | |
1548 | | - | |
1549 | | - | |
1550 | | - | |
1551 | 1568 | | |
1552 | 1569 | | |
1553 | 1570 | | |
| |||
2273 | 2290 | | |
2274 | 2291 | | |
2275 | 2292 | | |
| 2293 | + | |
| 2294 | + | |
2276 | 2295 | | |
2277 | 2296 | | |
2278 | 2297 | | |
| |||
0 commit comments