Package com.ibm.etools.cobol.application.model.cobol

COBOL Application Model API Specification

See: Description

Package com.ibm.etools.cobol.application.model.cobol Description

COBOL Application Model API Specification

This package contains interfaces that represent the nodes of a syntax tree for a COBOL program. Each node of the syntax tree represents part of a COBOL program.

This documentation was generated from an Eclipse Modeling Framework model, but you do not need to use the EMF capabilities unless they are useful to you. Here is a brief description of some of the terms in the documentation that you might not be familiar with:

  • feature - Each class in an EMF model consists of features, which are either attributes or references.
  • attribute - An EMF attribute has a name and a data type, like int, short, etc. Each attribute is represented by two accessor methods, one for setting the attribute value, and one for getting the attribute value.
  • reference - An EMF reference represents a relationship between classes. If the relationship is a 1 to 1 relationship, it is represented by two accessor methods, one for setting the reference value and one for getting the reference value. If the relationship is a one to many relationship, it is represented by an accessor method that returns a list, where each item in the list is a related object. Some references are containment references, meaning the object that has the reference is a container for the related objects, but the Java representation is the same as for other references.

In the model, when a list is returned, if there are no items in the list, an empty list is returned, rather than returning null.

The ProgramSourceFile node represents the contents of the entire source file.

The Program node represents a COBOL program.

The ENVIRONMENT division consists of the CONFIGURATION section and the INPUT-OUTPUT section.

All of the sections in the data division are represented in the API. The file section has file description entries. The linkage section, local storage section, and working storage section have top level variables, which are level 1 data items and level 77 data items.

There is a hierarchy of interfaces representing data items (excluding level 1, level 77, and level 88 data items). The root of the hierarchy is AbstractDataItem. The following table contains some of the clauses in data description entries with a link to the API where the clauses can be accessed.

Data Item ClauseAPI
BLANK WHEN ZERO NumericEditedItem
EXTERNAL Level01Item
GLOBAL Level01Item
JUSTIFIED AlphabeticItem
AlphaNumericItem
OCCURS FixedTableDataItem
OCCURS DEPENDING ON VariableTableDataItem
PICTURE ElementaryDataItem
REDEFINES DataItem
SIGN NumericItem
USAGE ElementaryDataItem

The model representation for indexes that are declared in the INDEXED BY clause of a data item declaration is IndexVariable. The model representation of data items that are declared with USAGE IS INDEX is NumericItem.

Each kind of statement in the procedure division is represented by an interface. The name of the interface in the model is the name of the statement followed by 'Stmt'. For example, the interface representing a search statement is 'SearchStmt'.

There is a hierarchy of interfaces that represents the different kinds of expressions in a COBOL program. The top of the hierarchy is Expr.

LIMITATIONS

The following list contains the known limitations of the COBOL Application Model. These areas are subject to change in a future release.

  • Deprecated methods in version 8.5.0.1 are not supported, and may be removed from the model in a future version.
  • Object-oriented COBOL features such as the INVOKE statement are not supported.
  • NumericItem does not model the presence or absence of the SIGN IS TRAILING clause.
  • The following compiler directing statements are currently unsupported: *CONTROL, *CBL, BASIS, DELETE, INSERT.
  • The following compiler directing statements are no longer supported by COBOL and are not supported in the model: ENTER, READY TRACE, RESET TRACE, SERVICE RELOAD.
  • In the representation of CICS statements, the options that appear in classes that represent clauses of CICS statements are not contiguous, other options can appear between the options in the clause. For example, the CicsInputMessageClause represents the INPUTMSG and INPUTMSGLEN options in CicsReturnStmt. Other options in that statement can appear between the INPUTMSG and INPUTMSGLEN options. As a result, the offsets of CICS clauses may contain more options in the offset range than just those options present in the clause.
  • CICS statement syntax is limited to API commands. FEPI and SPI commands are not supported.
  • SQL statements are represented by ExecSqlStmt, which has a string containing the text of the SQL statement.

ADDITIONAL INFORMATION

Several classes in the model implement java.io.Serializable, but the serialized forms are not supported, and the classes may be changed without regard to their serialized forms.

MODEL API UPDATES SINCE 8.5

To remove the limitations that existed in the previous version of the model API, the API has been updated. Some of these updates may result in compiler errors in your code, and you may want to modify your code as a result of these changes. Also, all deprecated methods are not supported, and they may not return the same values as in 8.5. The model updates are:

MODEL API UPDATES SINCE 9.0

The API has been updated to support EXEC CICS commands. CICS Version 5 Release 1, as well as previous versions of CICS, are supported.

The options of the CICS commands that have been superseded do not have a representation in the API. These commands are:

The API has also been updated to support COBOL Version 5 Release 1. The model updates are:

The API has been updated to support unresolved references (references to data items that have not been declared) by adding the UnresolvedDataRef class. Unresolved references to COBOL elements that are not data items, such as paragraphs, sections, or alphabets, are not represented in the model.

MODEL API UPDATES SINCE 9.1

The API has been updated to support CICS Version 5 Release 2. The model updates are:

The API has been updated to support DFHRESP and DFHVALUE literal types:

MODEL API UPDATES SINCE 9.5

The model was updated to support SQL statements in the DATA DIVISION:

The model was updated to support COBOL Version 5 Release 2. The model updates are:

The model was updated to support comments. Comments are modeled as child items of the ProgramSourceFile. The CommentUtils class can be used to relate comments to program structures and statements.

The model was updated to support abbreviated combined relational conditions. The model elements are:

MODEL API UPDATES SINCE 9.5.1

The model was updated to support new CICS 5.3 syntax including: