@cobol-ts/layout 0.0.14 → 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @cobol-ts/layout
|
|
2
2
|
|
|
3
3
|
`@cobol-ts/layout` turns a parsed COBOL copybook into a **reusable description of where bytes belong**. It determines the physical extent of declarations, the positions of fields within their containing groups, alignment gaps, repeated storage, and overlapping `REDEFINES` views. It does **not** decode a record into a COBOL object, select a business interpretation, or read an `OCCURS DEPENDING ON` (ODO) count from a byte buffer.
|
|
4
4
|
|
|
@@ -8,6 +8,20 @@ The implementation targets an **IBM Enterprise COBOL for z/OS-oriented subset**
|
|
|
8
8
|
|
|
9
9
|
For the broader architectural decision, see [COBOL Layout Compilation](https://docs.google.com/document/d/1dALb84lfj2HpKNBerqIXkXV4qYUxv7m3MXW3CSXRHRA/edit?usp=drivesdk). For test cases, source provenance, and what each test actually proves, see [README.tests.md](README.tests.md).
|
|
10
10
|
|
|
11
|
+
## Quick orientation
|
|
12
|
+
|
|
13
|
+
**In this README:** [The mental model](#the-mental-model) · [How the compiler works](#how-the-compiler-works) · [A worked `REDEFINES` example](#a-worked-redefines-example) · [The corner cases that shape the design](#the-corner-cases-that-shape-the-design) · [The symbolic size algebra](#the-symbolic-size-algebra) · [Using the API](#using-the-api) · [Where this stops and projection begins](#where-this-stops-and-projection-begins) · [Source map](#source-map)
|
|
14
|
+
|
|
15
|
+
**Responsibility.** Compile structural COBOL declarations into storage geometry, including alignment, overlays and ODO-dependent locations.
|
|
16
|
+
|
|
17
|
+
**Boundary.** This is a layout compiler, not a source decoder: byte reads belong to `cursor-loader-cobol` and `codec`.
|
|
18
|
+
|
|
19
|
+
**Public modules.** [cobol.alignment.ts](./src/cobol.alignment.ts), [cobol.layout.location.ts](./src/cobol.layout.location.ts), [cobol.overlay.alignment.ts](./src/cobol.overlay.alignment.ts), [cobol.layout.ts](./src/cobol.layout.ts), [cobol.padding.ts](./src/cobol.padding.ts) (and 2 more exports in [`index.ts`](index.ts)).
|
|
20
|
+
|
|
21
|
+
**Tests.** [cobol.alignment.spec.ts](src/cobol.alignment.spec.ts), [cobol.layout.aws.emprec.spec.ts](src/cobol.layout.aws.emprec.spec.ts), [cobol.layout.carddemo.coordinates.spec.ts](src/cobol.layout.carddemo.coordinates.spec.ts) (+16 more)
|
|
22
|
+
|
|
23
|
+
**Related packages.** [@cobol-ts/copybook](../copybook/README.md) · [@cobol-ts/size](../size/README.md).
|
|
24
|
+
|
|
11
25
|
## The mental model
|
|
12
26
|
|
|
13
27
|
A compiled layout is a tree with one node per storage declaration (plus explicit compiler-generated padding nodes). Every node has three expressions, all measured in **bits**:
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cobol-ts/layout",
|
|
3
3
|
"description": "Compiles COBOL copybook ASTs into immutable physical storage layouts, including canonical size expressions, field offsets, and dependency resolution.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.17",
|
|
5
5
|
"main": "dist/index",
|
|
6
6
|
"types": "dist/index",
|
|
7
7
|
"browserslist": {
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
]
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@cobol-ts/copybook": "0.0.
|
|
21
|
-
"@cobol-ts/errors": "0.0.
|
|
22
|
-
"@cobol-ts/partial_functions": "0.0.
|
|
23
|
-
"@cobol-ts/size": "0.0.
|
|
24
|
-
"@cobol-ts/trees": "0.0.
|
|
20
|
+
"@cobol-ts/copybook": "0.0.17",
|
|
21
|
+
"@cobol-ts/errors": "0.0.17",
|
|
22
|
+
"@cobol-ts/partial_functions": "0.0.17",
|
|
23
|
+
"@cobol-ts/size": "0.0.17",
|
|
24
|
+
"@cobol-ts/trees": "0.0.17"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"typescript": "^5.2.2",
|