Skip to main content

Crate ironwork_syntax

Crate ironwork_syntax 

Source
Expand description

ironwork for COBOL: from fixed-format source text to a syntax tree. Nothing here knows about storage or execution.

Modules§

ast
bms
BMS map source (the DFHMSD, DFHMDI and DFHMDF assembler macros) as a mapset model, and the COBOL symbolic map a program COPYs for it.
copy
COPY and COPY REPLACING, applied to the logical text before it is lexed. Matching is by text-words, as the standard defines them, and replacement edits the text itself, so a pseudo-text such as ==:TAG:== can replace part of a word like :TAG:-RECORD.
csd
The CICS system definition as DFHCSDUP reads it: DEFINE commands naming resources, with KEYWORD(value) attributes running on to the next command.
dli
EXEC DLI commands as the IMS translator reads them (IMS Application Programming: EXEC DLI Commands for CICS and IMS, SC18-7811-04, chapters 4-6): each command, the longer spellings it has, and the options it takes.
extended
What --compliance extended does to the tokens before the parser reads them: each constant entry comes out and every later use of its name stands for its value, literals joined by & become one literal, BINARY-SHORT, BINARY-LONG and BINARY-DOUBLE become COMP-5 PICTUREs, and RETURNING OMITTED leaves a program’s PROCEDURE DIVISION header (docs/compliance.md).
feedback
CEEIGZCT, ironwork’s own declaration of Language Environment’s feedback codes for a COPY CEEIGZCT that no library answers. The conditions and their tokens are rt::feedback.
jni
The JNI member: ironwork’s own declaration of the JNI function table (rt::jni) in COBOL, for a COPY JNI no library answers.
lexer
messages
ironwork’s message catalogue: each compile-time message’s id, the severity it is given and its text, the parts a site fills in between braces. docs/messages.md is written from it. Once released, an id keeps its meaning and is never given to another message; its wording may change.
parser
report
The REPORT SECTION as written: report descriptions with their report groups, the INITIATE, GENERATE, TERMINATE and SUPPRESS statements, and USE BEFORE REPORTING procedures.
source
Fixed-format reference format: columns 1-6 sequence, 7 indicator, 8-72 program text, 73 on ignored. The result is one logical text with continuation lines joined, and the options of any CBL or PROCESS cards ahead of the program. Under --compliance extended a file may be read in free form instead (docs/compliance.md).
sql
EXEC SQL statements, typed: what each one sends, what it receives into, and the WHENEVER actions in force where it stands in the listing. The text a backend runs is the statement with each input host variable replaced by ? and any INTO list removed, in one canonical spelling.
system
The copy members IBM’s translators and products supply, as ironwork’s own declarations of the layouts and names IBM documents: Db2 13 for z/OS SQL Reference (“The included SQLCA”, “The included SQLDA”), CICS TS Data Areas (“EIB - EXEC interface block”) and CICS TS Application Programming Reference, “BMS-related constants” (DFHAID, DFHBMSCA); and CEEIGZCT, Language Environment’s symbolic feedback codes (crate::feedback). A library member of the same name is found first, as it would be ahead of the system library on z/OS.

Structs§

Error
A compiler message; Error::at makes a severe one, and messages::Message::at one from the catalogue, with its id.
Pos
Where a diagnostic points: 1-based source line and column.

Enums§

Severity
The severity of a compiler message, IBM’s five levels in order (Programming Guide SC27-8714-03, Table 38, p. 282).

Functions§

most_severe
The message a refusal names: the first of the most severe.
parse
The first program in the source.
parse_all_with
Every program in the source, in order, nested programs after the one that contains them. The libraries’ compliance level says how the source and its members are read. Debugging lines are program text through COPY and REPLACE, and comments after them outside a program compiled WITH DEBUGGING MODE (Language Reference SC27-8713-03, p. 693). Outside debugging mode Enterprise COBOL accepts a debugging line that does not read as text, such as one holding an unclosed literal; then every debugging line is read as a comment.
parse_with
The first program in the source, with COPY members resolved from libraries.
program_ids
The names after each PROGRAM-ID in the source, read without COPY members or a parse; empty for a source that does not lex.
return_code
The return code of a compilation that gave these messages: the highest of theirs, 0 for none.