Common Lisp Package: COBSTOR-GENERATOR

README:

FUNCTION

Public

GENERATE-COBSTOR-INTERFACE (FILES-LIST &KEY PACKAGE (COMPILE T) FORCE)

Generate all the proxy stubs and agent in FILES-LIST. If PACKAGE is specified the generated Lisp code will be part of it. If COMPILE is true (the default) the generated code is compiled as well. If FORCE is true the generation takes place even if the module looks to be up to date.

MAKE-COBOL-AGENT (DATA-FILE-NAME RECORDS KEYS OUTPUT-PROGRAM-PATHNAME)

Generate the agent programs for the remote access to the Cobol field.

MAKE-COBOL-PROXY-STUB (OUTPUT-FILE RECORDS KEYS &KEY PACKAGE RECORD-NAME)

Compile a Cobol record declaration from records into a Lisp record declaration written into OUTPUT-FILE. If PACKAGE is specified the Lisp code will be populated in that package. If RECORD-NAME is not specified, the output record name will be the name of the first INPUT-FILE with "-RECORD" appended to it.

READ-FIELD-DECLARATIONS (PATHNAME)

Return the list of field declarations layed in a hyerarchical form, found in Cobol file at PATHNAME.

Private

CASE-STRING (STRING)

Up/down-case STRING according to the value of *PRINT-CASE*.

COMPILE-PROXY-STUB (PATHNAME)

Compile a proxy stub. Thi is at the moment just a wrapper for compile-file.

COPY-FILE-PATHNAME (NAME)

Given a copy file NAME (possibly a pathname) return an absolute pathname. The defaults are relative to COBSTOR-DYNAMIC logial pathname host.

EXPAND-PICTURE (PICTURE)

Return a new picture string where all repeated characters in a PICTURE have been expanded. Pictures of the form "9(5)" are expanded to "99999".

KEYS-DECLARATION (KEYS &OPTIONAL PREFIX)

Return a string for the Cobol keys declaration of KEYS. Optionally add PREFIX to each key name. This declaration is normally part of a SELECT Cobol statement.

MAKE-FIELD-DECLARATION (FIELD)

Get a parsed field and return a FIELD-DECLARATION object. Guess from the picture string (property :PICTURE) of FIELD the missing parameters such as the type, length, decimals, and so on and so forth. The input FIELD is a list of at least two elements: (LEVEL NAME . PROPERTIES) where NAME can be NIL for fillers.

PARSE-FILE (SOURCE-PATHNAME)

Parse a Cobol file containing a data record description (and only that) and return a list of its fields.

PARSE-PICTURE (PICTURE)

Interprete the meaning of a Cobol picture returning useful facts like: the type, the total length of the field, the decimals and the presence of the sign.

PPRINT-COBOL-FIELD (STREAM DEFINITION)

Pretty print on *STANDARD-OUTPUT* a cobol field as Lisp code.

PPRINT-DEFINE-COBOL-RECORD (STREAM NAME FIELDS &KEY ALTERNATES)

Pretty print on *STANDARD-OUTPUT* a Cobol record definition in Lisp language. FIELDS are composing the record.

SEXP->FIELD-DECLARATION (SEXP)

Create FIELD-DECLARATION object from a sexp of the form found in a DEFINE-COBOL-RECORD macro. See FIELD-DECLARATION->SEXP for further details.

STRUCTURE-RECORDS (PARSED-FIELDS)

Structure a list of fields into a list of trees according to the level number which appears in front of each cbfield. If in FIELDS there is only one record (just one level 01) the returned list will contain just one tree. The PARSED-FIELDS list is made up of elements of the kind: (LEVEL NAME TYPE . PROPERTIES-LIST) TYPE can be NIL if field is a composite field (with subfields).

WRITE-PROCEDURE-DIVISION (STREAM DATA-FILE-NAME KEYS)

Write a standard procedure division body to STREAM. All the agents have this code in common.

WRITE-WORKING-STORAGE-SECTION (STREAM)

Write a constant working-storage section to STREAM.

Undocumented

COMPILE-COBOL-AGENT (PATHNAME)

FIELD-NAME-AS-COBOL (DECL)

FIELD-TYPE-STRING (FIELD)

LONGEST-RECORD-SIZE (RECORDS)

MAKE-AGENT-AND-PROXY-STUB (NAME KEYS INPUT-FILES PACKAGE COMPILE FORCE)

MAKE-PARSER-STREAM (PATHNAME-OR-STREAM GRAMMAR)

MAKE-PRESENCE-TABLE (CHARS)

NEW-TOKEN-POSITION (STREAM)

OPEN (FILENAME &REST OPTIONS &KEY STATEFUL &ALLOW-OTHER-KEYS)

POPULATE-GRAMMAR

PPRINT-COBOL-SUBFIELDS (STREAM SUBFIELDS)

PPRINT-PLIST (STREAM PROPERTIES)

PROXY-STUB-FILE-PATHNAME (NAME)

READ-INTEGER (STREAM FIRST-DIGIT)

READ-NUMBER (STREAM FIRST-DIGIT)

READ-PICTURE (STREAM)

READ-STRING (STREAM)

READ-WORD (STREAM FIRST-CHARS)

SKIP-TO-EOL (STREAM)

SKIP-WHITESPACE (STREAM)

SPC (STREAM)

WORD-COMPONENT-P (C)

WORD-START-P (C)

WRITE-DATA-DIVISION (STREAM RECORDS)

WRITE-ENVIRONMENT-DIVISION (STREAM KEYS)

WRITE-FILE-SECTION (STREAM RECORDS)

WRITE-IDENTIFICATION-DIVISION (STREAM FILE-NAME PROGRAM)

WRITE-READ-PARAGRAPH (STREAM KEYS)

WRITE-START-PARAGRAPHS (STREAM KEYS)

MACRO

Private

Undocumented

WITH-PARSER-STREAM ((VAR PATHNAME-OR-STREAM GRAMMAR) &BODY BODY)

GENERIC-FUNCTION

Private

COMPUTE-FIELD-SIZE (FIELD)

Return the size in bytes occupied by the binary encoding of field. This doesn't take in count repetitions as for TIMES.

FIELD-DECLARATION->SEXP (FIELD-DECLARATION)

Return a sexp of a FIELD-DECLARATION object suitable to be used in a DEFINE-COBOL-RECORD macro. The sexp has the form: (name ToS . properties) where ToS is a storage type in the case leaf fields, and it's a list of subfields (same sexp format) in case of container fields.

FIELD-NAMES (FIELD-DECLARATION)

Return a list of all field names at all level of nesting.

WRITE-FIELD-DECLARATION-AS-COBOL (FIELD-DECLARATION STREAM)

Write to STREAM a FIELD-DECLARATION in Cobol syntax.

SLOT-ACCESSOR

Public

FIELD-DECIMALS (OBJECT)

The number of decimals places in a numeric field. These are included in length.

FIELD-LENGTH (OBJECT)

The size in charcater positions the field occupies. This is not its size in bytes.

FIELD-NAME (OBJECT)

Name of the field or NIL if it's a filler.

SETFFIELD-NAME (NEW-VALUE OBJECT)

Name of the field or NIL if it's a filler.

FIELD-SIGNED (OBJECT)

True if field is a signed numeric field.

FIELD-SIZE (OBJECT)

The size of the field in bytes. This is not multiplied by times (below).

FIELD-TIMES (OBJECT)

Cardinality of this field.

Undocumented

FIELD-ALTERNATES (OBJECT)

SETFFIELD-ALTERNATES (NEW-VALUE OBJECT)

FIELD-LEVEL (OBJECT)

FIELD-PICTURE (OBJECT)

FIELD-REDEFINES (OBJECT)

FIELD-SIGN-POSITION (OBJECT)

FIELD-SIGN-SEPARATED (OBJECT)

FIELD-SUBFIELDS (OBJECT)

SETFFIELD-SUBFIELDS (NEW-VALUE OBJECT)

FIELD-TYPE (OBJECT)

Private

Undocumented

OFF-FILE (OBJECT)

OFF-TOKEN (OBJECT)

TOKEN (OBJECT)

VARIABLE

Public

*DECIMAL-POINT*

The character used to represent a decimal point in numbers. This can be changes any time according to local national conventions.

Private

Undocumented

DEFINE-GRAMMAR

CLASS

Public

CONTAINER-FIELD-DECLARATION

Class for container objects; those made up of subfields.

FIELD-DECLARATION

Abstract base class for field declarations. This is not the kind of objects instantiated at run-time in the proxy library.

LEAF-FIELD-DECLARATION

Class for Cobol simple field declarations; those without subfields.

Private

PARSER-OFFSET

Type of objects returned by GET-POSITION applied to PARSER-STREAMs.

PARSER-STREAM

Type of stream used by cobstor parser.

CONSTANT

Private

Undocumented

+WORD-COMPONENT-TABLE+

+WORD-START-TABLE+