BankTS language reference
BankTS is a small banking language that compiles to COBOL. Its types are
TypeScript's (decimal<18, 2>, string<16>, record, aliases), and its
statements are its own: transaction, file … sequential input, cursor,
queue, on error. The goal is safety, auditability, and predictable COBOL
generation, not TypeScript compatibility; a BankTS module is not a TypeScript
module and tsc cannot read one.
This page is the contents. Every rule lives on one of the pages below, one topic per page, and every diagnostic cites the page its rule comes from.
New to the language? Read Programs and modules, then Types, then Records. Those three cover any program that does arithmetic on money, and the rest of the pages are there when you reach a subsystem that needs them.
The whole language, formally
| Page | What is in it |
|---|---|
| Grammar | Every production in EBNF, and every word the language reserves |
| Stability | What is settled, what is not, and what a change to the language costs |
The program
| Page | What is in it |
|---|---|
| Programs and modules | What a module is, how names are chosen, what BankTS will not let you write, and what the backend needs before it can build |
The data
| Page | What is in it |
|---|---|
| Types | Primitives and how each is stored, dates and times, edited fields, currency, nullability |
| Records | Layout, inheritance, generics, variant records, bounded arrays, imported copybooks |
The code
| Page | What is in it |
|---|---|
| Functions and calls | Functions, strings, calls between routines and to another program |
| Control flow and operators | Branching and loops, and every operator with the COBOL it becomes |
| Transactions | Entry points, ledger postings, failures, audit events |
The environment
| Page | What is in it |
|---|---|
| Files | Declarations, organisation, keys, file status |
| Batch operations | The PARM, sorting, procedures on the way through, restart |
| Reports | Report Writer: control breaks, totals, pagination |
| Db2 and embedded SQL | Statements, host variables, SQLCODE, cursors, units of work |
| CICS | Online transactions, the communication area, response handling |
| IMS DL/I | Databases, segments, the PCB list |
| IBM MQ | Queues, messages, syncpoint |
Where these rules are enforced
Every rule on these pages that can be broken has a diagnostic, and every
diagnostic names the page it came from. bankc explain BANK-LED-001 prints any
of them with an explanation and a remediation.
- Diagnostics: the full catalogue
- Generated code standards: what the output looks like, as a contract
- Target conformance: the Enterprise COBOL rules the output obeys, each with a manual citation
- Status and limits: what none of this claims
Trying it
examples/ carries twenty-three worked examples, each with its
generated COBOL, copybooks, JCL and verification report. The
playground runs the whole compiler in a browser.