Mainframe Analyser specificities¶
Note
This documentation applies to CAIP >= 8.3.26 and com.castsoftware.mainframe >= 1.0.3-funcrel.
A complete sample can be found here : Starter kits.
Mainframe Extension¶
- class cast.analysers.mainframe.Extension¶
Extension points for Mainframe analyzer.
Events¶
Equivalence tree events¶
Extensions receive a tree though depth first traversal events start_<node> end_<node>.
Compatibility over time¶
The AST is a partial one. What is guaranteed is - the relative order of events - the number of occurrences of a node type under a given node
But we can add new nodes under a node. It means that in a future version we can add intermediate nodes or nodes with new kind.
Accessing sub nodes¶
You can use cast.analyzers.mainframe.UnsavedObject.get_sub_nodes() that will resist future AST changes.
Dumping AST¶
For debugging purpose one can log the AST of a section, paragraph, statement the following way:
from cast.analysers import log, mainframe # @UnresolvedImport
def display_node(node, indent=0):
"""
Display the AST node in the log for debugging.
Do not work at top level (for program).
"""
text = ' '*indent + node.get_kind()
name = node.get_name()
if name:
text += ' ' + name
try:
text += ' ' + str(node.get_value())
except:
pass
text += ' line ' + str(node.get_position().get_begin_line()) + ' -> ' + str(node.get_position().get_end_line())
log.info(text)
for child in node.get_children():
display_node(child, indent+2)
class MyExtension(mainframe.Extension):
def start_paragraph(self, node):
# display the content of the paragraph
display_node(node)
Global events¶
COBOL Program¶
- class cast.analysers.mainframe.Extension
Extension points for Mainframe analyzer.
- start_program(program)¶
Called at the beginning of analysis of a program
Parameters: program (cast.analysers.mainframe.Program) – the program
- end_program(program)¶
Called at the end of analysis of a program
Parameters: program (cast.analysers.mainframe.Program) – the program
- start_program_id(program)¶
Called on a node PROGRAM-ID.
Parameters: program (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.0.1-funcrel.
- end_program_id(program)¶
Called on a node PROGRAM-ID.
Parameters: program (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.0.1-funcrel.
- start_function_id(function)¶
Called on a node FUNCTION-ID.
Parameters: function (cast.analysers.mainframe.Node) – the node Function name is available through function.get_name()
New in version com.castsoftware.mainframe.1.3.5-funcrel.
- end_function_id(function)¶
Called on a node FUNCTION-ID.
Parameters: function (cast.analysers.mainframe.Node) – the node Function name is available through function.get_name()
New in version com.castsoftware.mainframe.1.3.5-funcrel.
- start_end_of_line_comment(node)¶
Comment at end of line *> ... // ...
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- end_end_of_line_comment(node)¶
Comment at end of line *> ... // ...
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- start_nested_program(program)¶
Called at the beginning of analysis of a nested program
Parameters: program (cast.analysers.mainframe.SavedObject) – the program New in version com.castsoftware.mainframe.1.0.0-alpha2.
- end_nested_program(program)¶
Called at the end of analysis of a nested program
Parameters: program (cast.analysers.mainframe.SavedObject) – the program New in version com.castsoftware.mainframe.1.0.0-alpha2.
- start_division(division)¶
Called at the beginning of analysis of a COBOL division
Parameters: division (cast.analysers.BaseObject) – the division
- end_division(division)¶
Called at the end of analysis of a COBOL division
Parameters: division (cast.analysers.BaseObject) – the division
- start_section(section)¶
Called at the beginning of analysis of a section
Parameters: division (cast.analysers.BaseObject) – the section
- end_section(section)¶
Called at the end of analysis of a section
Parameters: division (cast.analysers.BaseObject) – the section
- start_paragraph(paragraph)¶
Called at the beginning of analysis of a paragraph
Parameters: division (cast.analysers.BaseObject) – the paragraph
- end_paragraph(paragraph)¶
Called at the end of analysis of a paragraph
Parameters: division (cast.analysers.BaseObject) – the paragraph
Environment division¶
- class cast.analysers.mainframe.Extension
Extension points for Mainframe analyzer.
- start_with_debugging_mode(node)¶
WITH DEBUGGING MODE.
Parameters: add (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- end_with_debugging_mode(node)¶
WITH DEBUGGING MODE.
Parameters: add (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- start_select(node)¶
SELECT
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- end_select(node)¶
SELECT
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- start_assign_to(node)¶
SELECT ... ASSIGN TO
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- end_assign_to(node)¶
SELECT ... ASSIGN TO
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- start_file_status(node)¶
SELECT ... FILE STATUS identifier
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- end_file_status(node)¶
SELECT ... FILE STATUS identifier
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- start_external_file_name(node)¶
SELECT ... ASSIGN TO external_fine_name
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- end_external_file_name(node)¶
SELECT ... ASSIGN TO external_fine_name
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- start_organization_is_relative(node)¶
SELECT ... ORGANIZATION IS RELATIVE
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- end_organization_is_relative(node)¶
SELECT ... ORGANIZATION IS RELATIVE
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- start_organization_is_indexed(node)¶
SELECT ... ORGANIZATION IS INDEXED
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- end_organization_is_indexed(node)¶
SELECT ... ORGANIZATION IS INDEXED
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- start_organization_is_sequential(node)¶
SELECT ... ORGANIZATION IS SEQUENTIAL
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- end_organization_is_sequential(node)¶
SELECT ... ORGANIZATION IS SEQUENTIAL
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- start_decimal_point_is_comma(node)¶
DECIMAL POINT IS COMMA
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.0.25-funcrel.
- end_decimal_point_is_comma(node)¶
DECIMAL POINT IS COMMA
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.0.25-funcrel.
- start_function_intrinsic(node)¶
- REPOSITORY paragraph.
- FUNCTION specifier INTRINSIC clause.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.3.0-alpha2.
- end_function_intrinsic(node)¶
- REPOSITORY paragraph.
- FUNCTION specifier INTRINSIC clause.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.3.0-alpha2.
>>JAVA-SHAREABLE OFF compilation directive
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.3.0-funcrel.
>>JAVA-SHAREABLE OFF compilation directive
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.3.0-funcrel.
>>JAVA-SHAREABLE ON compilation directive
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.3.0-funcrel.
>>JAVA-SHAREABLE ON compilation directive
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.3.0-funcrel.
- start_java_callable(node)¶
>>JAVA-CALLABLE compilation directive
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.3.0-funcrel.
- end_java_callable(node)¶
>>JAVA-CALLABLE compilation directive
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.3.0-funcrel.
- start_data_31bit(node)¶
>>DATA 31 directive
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.3.0-funcrel.
- end_data_31bit(node)¶
>>DATA 31 directive
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.3.0-funcrel.
- start_data_64bit(node)¶
>>DATA 64 directive
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.3.0-funcrel.
- end_data_64bit(node)¶
>>DATA 64 directive
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.3.0-funcrel.
- start_function_user_defined(node)¶
- REPOSITORY paragraph.
- FUNCTION user defined function.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.3.0-funcrel.
- end_function_user_defined(node)¶
- REPOSITORY paragraph.
- FUNCTION user defined function.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.3.0-funcrel.
Data division¶
- class cast.analysers.mainframe.Extension
Extension points for Mainframe analyzer.
- start_file_description(fd)¶
FD ...
Parameters: fd (cast.analysers.mainframe.SavedObject) – the node @type fd:SavedObject
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- end_file_description(fd)¶
FD ...
Parameters: fd (cast.analysers.mainframe.SavedObject) – the node @type fd:SavedObject
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- start_sort_description(sd)¶
SD ...
Parameters: sd (cast.analysers.mainframe.SavedObject) – the node @type sd:SavedObject
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- end_sort_description(sd)¶
SD ...
Parameters: sd (cast.analysers.mainframe.SavedObject) – the node @type sd:SavedObject
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- start_block_contains(node)¶
BLOCK CONTAINS ...
For example: BLOCK CONTAINS ZERO RECORDS first child is integer_literal and second child is records node BLOCK CONTAINS ZERO TO 10 CHARACTERS first child is integer_literal for ZERO, second child is integer_literal for 10, third child is characters node
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- end_block_contains(node)¶
BLOCK CONTAINS ...
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- start_records(node)¶
BLOCK CONTAINS ... RECORDS
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- end_records(node)¶
BLOCK CONTAINS ... RECORDS
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- start_characters(node)¶
BLOCK CONTAINS ... CHARACTERS
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- end_characters(node)¶
BLOCK CONTAINS ... CHARACTERS
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- start_data(data)¶
Called at the beginning of a data
data is either of type cast.analyzers.mainframe.SavedData or cast.analyzers.mainframe.UnsavedData
- end_data(data)¶
Called at the end of analysis of a data
data is either of type cast.analyzers.mainframe.SavedData or cast.analyzers.mainframe.UnsavedData
- start_value(node)¶
Called at the begining of a VALUE clause
node is either of type cast.analyzers.mainframe.SavedData or cast.analyzers.mainframe.UnsavedData
- end_value(move)¶
Called at the end of a VALUE clause
node is either of type cast.analyzers.mainframe.SavedData or cast.analyzers.mainframe.UnsavedData
- start_value_through(node)¶
Called at the beginning of a THROUGH ...
node is either of type cast.analyzers.mainframe.SavedData or cast.analyzers.mainframe.UnsavedData
New in version com.castsoftware.mainframe.1.3.1-funcrel.
- end_value_through(node)¶
Called at the end of a THROUGH ...
node is either of type cast.analyzers.mainframe.SavedData or cast.analyzers.mainframe.UnsavedData
New in version com.castsoftware.mainframe.1.3.1-funcrel.
- start_occurs_depending(node)¶
Called at the begining of a OCCURS ... DEPENDING ON
node is either of type cast.analyzers.mainframe.SavedData or cast.analyzers.mainframe.UnsavedData
- end_occurs_depending(move)¶
Called at the end of a OCCURS ... DEPENDING ON
node is either of type cast.analyzers.mainframe.SavedData or cast.analyzers.mainframe.UnsavedData
- start_redefines(node)¶
Called at the beginning of a REDEFINES ...
node is either of type cast.analyzers.mainframe.SavedData or cast.analyzers.mainframe.UnsavedData
New in version com.castsoftware.mainframe.1.0.0-alpha3.
- end_redefines(node)¶
Called at the end of a REDEFINES ...
node is either of type cast.analyzers.mainframe.SavedData or cast.analyzers.mainframe.UnsavedData
New in version com.castsoftware.mainframe.1.0.0-alpha3.
- start_renames(node)¶
Called at the beginning of a RENAMES ...
node is either of type cast.analyzers.mainframe.SavedData or cast.analyzers.mainframe.UnsavedData
New in version com.castsoftware.mainframe.1.2.1-funcrel.
- end_renames(node)¶
Called at the end of a RENAMES ...
node is either of type cast.analyzers.mainframe.SavedData or cast.analyzers.mainframe.UnsavedData
New in version com.castsoftware.mainframe.1.2.1-funcrel.
- start_dynamic_length(node)¶
Called at the beginning of a DYNAMIC ...
node is either of type cast.analyzers.mainframe.SavedData or cast.analyzers.mainframe.UnsavedData
New in version com.castsoftware.mainframe.1.3.0-alpha2.
- end_dynamic_length(node)¶
Called at the end of a DYNAMIC ...
node is either of type cast.analyzers.mainframe.SavedData or cast.analyzers.mainframe.UnsavedData
New in version com.castsoftware.mainframe.1.3.0-alpha2.
- start_limit(node)¶
Called at the beginning of a LIMIT ...
node is either of type cast.analyzers.mainframe.SavedData or cast.analyzers.mainframe.UnsavedData
New in version com.castsoftware.mainframe.1.3.0-alpha2.
- end_limit(node)¶
Called at the end of a LIMIT ...
node is either of type cast.analyzers.mainframe.SavedData or cast.analyzers.mainframe.UnsavedData
New in version com.castsoftware.mainframe.1.3.0-alpha2.
- start_indexed_by(node)¶
Called at the beginning of a INDEXED BY ...
node is either of type cast.analyzers.mainframe.SavedData or cast.analyzers.mainframe.UnsavedData
New in version com.castsoftware.mainframe.1.0.0-alpha3.
- end_indexed_by(node)¶
Called at the end of a INDEXED BY ...
node is either of type cast.analyzers.mainframe.SavedData or cast.analyzers.mainframe.UnsavedData
New in version com.castsoftware.mainframe.1.0.0-alpha3.
- start_index(index)¶
Called on an index. index is of type cast.analyzers.mainframe.Index
New in version com.castsoftware.mainframe.1.0.0-alpha3.
- end_index(index)¶
Called on an index. index is of type cast.analyzers.mainframe.Index
New in version com.castsoftware.mainframe.1.0.0-alpha3.
- start_when_set_to_false(node)¶
Called at the beginning of a WHEN SET TO FALSE ...
node is either of type cast.analyzers.mainframe.SavedData or cast.analyzers.mainframe.UnsavedData
New in version com.castsoftware.mainframe.1.3.1-funcrel.
- end_when_set_to_false(node)¶
Called at the end of a WHEN SET TO FALSE ...
node is either of type cast.analyzers.mainframe.SavedData or cast.analyzers.mainframe.UnsavedData
New in version com.castsoftware.mainframe.1.3.1-funcrel.
Procedure Division¶
- class cast.analysers.mainframe.Extension
Extension points for Mainframe analyzer.
- start_declaratives(declaratives)¶
DECLARATIVES
Parameters: declaratives (cast.analysers.BaseObject) – the declaratives part
- end_declaratives(declaratives)¶
New in version com.castsoftware.mainframe.1.0.0-alpha2.
DECLARATIVES
Parameters: declaratives (cast.analysers.BaseObject) – the declaratives part New in version com.castsoftware.mainframe.1.0.0-alpha2.
- start_declaratives_section(section)¶
Called at the beginning of analysis of a section in DECLARATIVES
Parameters: division (cast.analysers.BaseObject) – the section New in version com.castsoftware.mainframe.1.0.0-alpha2.
- end_declaratives_section(section)¶
Called at the end of analysis of a section in DECLARATIVES
Parameters: division (cast.analysers.BaseObject) – the section New in version com.castsoftware.mainframe.1.0.0-alpha2.
- start_declaratives_paragraph(paragraph)¶
Called at the beginning of analysis of a paragraph in DECLARATIVES
Parameters: division (cast.analysers.BaseObject) – the paragraph New in version com.castsoftware.mainframe.1.0.0-alpha2.
- end_declaratives_paragraph(paragraph)¶
Called at the end of analysis of a paragraph in DECLARATIVES
Parameters: division (cast.analysers.BaseObject) – the paragraph New in version com.castsoftware.mainframe.1.0.0-alpha2.
Statements ACCEPT - FREE¶
- class cast.analysers.mainframe.Extension
Extension points for Mainframe analyzer.
- start_accept(accept)¶
ACCEPT statement.
Parameters: accept (cast.analysers.mainframe.Node) – the node @type accept:Node
- end_accept(accept)¶
ACCEPT statement.
Parameters: accept (cast.analysers.mainframe.Node) – the node @type accept:Node
- start_add(add)¶
ADD statement.
Parameters: add (cast.analysers.mainframe.Node) – the node @type add:Node
- end_add(add)¶
ADD statement.
Parameters: add (cast.analysers.mainframe.Node) – the node @type add:Node
- start_add_source(add)¶
The source part in an ADD statement.
Parameters: add (cast.analysers.mainframe.Node) – the node @type add:Node
- end_add_source(add)¶
The source part in an ADD statement.
Parameters: add (cast.analysers.mainframe.Node) – the node @type add:Node
- start_add_destination(add)¶
The destination part in an ADD statement.
Parameters: add (cast.analysers.mainframe.Node) – the node @type add:Node
- end_add_destination(add)¶
The destination part in an ADD statement.
Parameters: add (cast.analysers.mainframe.Node) – the node @type add:Node
- start_allocate(node)¶
ALLOCATE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type alter:Node
New in version com.castsoftware.mainframe.1.0.18-funcrel.
- start_initialized(node)¶
INITIALIZED in ALLOCATE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type alter:Node
New in version com.castsoftware.mainframe.1.0.18-funcrel.
- end_initialized(node)¶
INITIALIZED in ALLOCATE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type alter:Node
New in version com.castsoftware.mainframe.1.0.18-funcrel.
- end_allocate(node)¶
ALLOCATE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type alter:Node
New in version com.castsoftware.mainframe.1.0.18-funcrel.
- start_alter(alter)¶
ALTER statement.
Parameters: alter (cast.analysers.mainframe.Node) – the node @type alter:Node
- end_alter(alter)¶
ALTER statement.
Parameters: alter (cast.analysers.mainframe.Node) – the node @type alter:Node
- start_call(call)¶
CALL statement.
Parameters: call (cast.analysers.mainframe.Node) – the node @type call:Node
- end_call(call)¶
CALL statement.
Parameters: call (cast.analysers.mainframe.Node) – the node @type call:Node
- start_call_target(target)¶
What is called by a CALL statement.
Parameters: call (cast.analysers.mainframe.Node) – the node @type target:Node
- end_call_target(target)¶
What is called by a CALL statement.
Parameters: call (cast.analysers.mainframe.Node) – the node @type target:Node
- start_call_interface(node)¶
>>CALLINTERFACE compilation directive
Parameters: node (cast.analysers.mainframe.Node) – the node node.get_name() will take following values: - “” - “DLL” - “STATIC” - “DYNAMIC”
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- end_call_interface(node)¶
>>CALLINTERFACE compilation directive
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.0.19-funcrel.
- start_cancel(cancel)¶
CANCEL statement.
Parameters: cancel (cast.analysers.mainframe.Node) – the node @type cancel:Node
- end_cancel(cancel)¶
CANCEL statement.
Parameters: cancel (cast.analysers.mainframe.Node) – the node @type cancel:Node
- start_close(close)¶
CLOSE statement.
Parameters: close (cast.analysers.mainframe.Node) – the node @type close:Node
- end_close(close)¶
CLOSE statement.
Parameters: close (cast.analysers.mainframe.Node) – the node @type close:Node
- start_compute(compute)¶
COMPUTE statement.
Parameters: compute (cast.analysers.mainframe.Node) – the node @type compute:Node
- end_compute(compute)¶
COMPUTE statement.
Parameters: compute (cast.analysers.mainframe.Node) – the node @type compute:Node
- start_rounded(rounded)¶
ROUNDED in COMPUTE statement.
Parameters: rounded (cast.analysers.mainframe.Node) – the node @type rounded:Node
New in version com.castsoftware.mainframe.1.0.3-funcrel.
- end_rounded(rounded)¶
ROUNDED in COMPUTE statement.
Parameters: rounded (cast.analysers.mainframe.Node) – the node @type rounded:Node
New in version com.castsoftware.mainframe.1.0.3-funcrel.
- start_copy(node)¶
COPY statement.
Warning
This node is available only when the copybook has not been found, otherwise the code is expansed.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha3.
From version com.castsoftware.mainframe.1.0.1-funcrel copybook name is available through node.get_name()
- end_copy(node)¶
COPY statement.
Warning
This node is available only when the copybook has not been found, otherwise the code is expansed.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha3.
- start_replacement(node)¶
REPLACING ... BY ... clause in an COPY or REPLACE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- end_replacement(node)¶
REPLACING ... BY ... clause in an COPY or REPLACE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- start_replacement_leading(node)¶
REPLACING LEADING ... BY ... clause in an COPY or REPLACE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- end_replacement_leading(node)¶
REPLACING LEADING ... BY ... clause in an COPY or REPLACE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- start_replacement_trailing(node)¶
REPLACING TRAILING ... BY ... clause in an COPY or REPLACE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- end_replacement_trailing(node)¶
REPLACING TRAILING ... BY ... clause in an COPY or REPLACE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- start_delete(delete)¶
DELETE statement.
Parameters: delete (cast.analysers.mainframe.Node) – the node @type delete:Node
- end_delete(delete)¶
DELETE statement.
Parameters: delete (cast.analysers.mainframe.Node) – the node @type delete:Node
- start_display(display)¶
DISPLAY statement.
Parameters: display (cast.analysers.mainframe.Node) – the node @type display:Node
- end_display(display)¶
DISPLAY statement.
Parameters: display (cast.analysers.mainframe.Node) – the node @type display:Node
- start_divide_by(divide)¶
DIVIDE ... BY ... statement.
Parameters: divide (cast.analysers.mainframe.Node) – the node @type divide:Node
- end_divide_by(divide)¶
DIVIDE ... BY ... statement.
Parameters: divide (cast.analysers.mainframe.Node) – the node @type divide:Node
- start_divide_into(divide)¶
DIVIDE ... INTO ... statement.
Parameters: divide (cast.analysers.mainframe.Node) – the node @type divide:Node
- end_divide_into(divide)¶
DIVIDE ... INTO ... statement.
Parameters: divide (cast.analysers.mainframe.Node) – the node @type divide:Node
- start_remainder(node)¶
REMAINDER ... in a DIVIDE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.1-funcrel.
- end_remainder(node)¶
REMAINDER ... in a DIVIDE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.1-funcrel.
- start_evaluate(evaluate)¶
EVALUATE statement.
Parameters: evaluate (cast.analysers.mainframe.Node) – the node @type evaluate:Node
- end_evaluate(evaluate)¶
EVALUATE statement.
Parameters: evaluate (cast.analysers.mainframe.Node) – the node @type evaluate:Node
- start_evaluate_expression(node)¶
Child is the evaluated expression in the EVALUATE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
- end_evaluate_expression(node)¶
Child is the evaluated expression in the EVALUATE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
- start_evaluate_directive(evaluate)¶
>>EVALUATE directive statement.
Parameters: evaluate (cast.analysers.mainframe.Node) – the node @type evaluate:Node
New in version com.castsoftware.mainframe.1.3.0-alpha3.
- end_evaluate_directive(evaluate)¶
>>EVALUATE directive statement.
Parameters: evaluate (cast.analysers.mainframe.Node) – the node @type evaluate:Node
New in version com.castsoftware.mainframe.1.3.0-alpha3.
- start_evaluate_directive_expression(node)¶
Child is the evaluated expression in the >>EVALUATE directive statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.3.0-alpha3.
- end_evaluate_directive_expression(node)¶
Child is the evaluated expression in the >>EVALUATE directive statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.3.0-alpha3.
- start_examine(node)¶
EXAMINE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- start_examine_tayling(node)¶
EXAMINE ... TALLYING ... statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- end_examine_tallying(node)¶
EXAMINE ... TALLYING ... statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- start_examine_replacing(node)¶
EXAMINE ... REPLACING ... statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- end_examine_replacing(node)¶
EXAMINE ... REPLACING ... statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- start_examine_all(node)¶
EXAMINE ... ALL ... statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- end_examine_all(node)¶
EXAMINE ... ALL ... statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- start_examine_leading(node)¶
EXAMINE ... LEADING ... statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- end_examine_leading(node)¶
EXAMINE ... LEADING ... statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- start_examine_until_first(node)¶
EXAMINE ... UNTIL FIRST ... statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- end_examine_until_first(node)¶
EXAMINE ... UNTIL FIRST ... statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- start_examine_first(node)¶
EXAMINE ... FIRST ... statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- end_examine_first(node)¶
EXAMINE ... FIRST ... statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- end_examine(node)¶
EXAMINE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- start_exec_cics(exec)¶
EXEC CICS statement.
exec.get_name() will give the content. :param cast.analysers.mainframe.Node exec: the node
@type exec:Node
- end_exec_cics(exec)¶
EXEC CICS statement.
exec.get_name() will give the content. :param cast.analysers.mainframe.Node exec: the node
@type exec:Node
- start_exec_dli(exec)¶
EXEC DLI statement.
exec.get_name() will give the content. :param cast.analysers.mainframe.Node exec: the node
@type exec:Node
- end_exec_dli(exec)¶
EXEC DLI statement.
exec.get_name() will give the content. :param cast.analysers.mainframe.Node exec: the node
@type exec:Node
- start_exec_sql(exec)¶
EXEC SQL statement.
exec.get_name() will give the content. :param cast.analysers.mainframe.Node exec: the node
@type exec:Node
- end_exec_sql(exec)¶
EXEC SQL statement.
exec.get_name() will give the content. :param cast.analysers.mainframe.Node exec: the node
@type exec:Node
- start_exhibit(node)¶
EXHIBIT statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- start_exhibit_named(node)¶
EXHIBIT ... NAMED ... statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- end_exhibit_named(node)¶
EXHIBIT ... NAMED ... statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- start_exhibit_changed(node)¶
EXHIBIT ... CHANGED ... statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- end_exhibit_changed(node)¶
EXHIBIT ... CHANGED ... statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- end_exhibit(node)¶
EXHIBIT statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- start_exit(exit)¶
EXIT statement.
Parameters: exit (cast.analysers.mainframe.Node) – the node @type exit:Node
- end_exit(exit)¶
EXIT statement.
Parameters: exit (cast.analysers.mainframe.Node) – the node @type exit:Node
- start_exit_method(node)¶
EXIT METHOD statement
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.0.19-funcrel.
- end_exit_method(node)¶
EXIT METHOD statement
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.0.19-funcrel.
- start_exit_paragraph(node)¶
EXIT PARAGRAPH statement
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.0.19-funcrel.
- end_exit_paragraph(node)¶
EXIT PARAGRAPH statement
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.0.19-funcrel.
- start_exit_perform(node)¶
EXIT PERFORM statement
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.0.19-funcrel.
- end_exit_perform(node)¶
EXIT PERFORM statement
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.0.19-funcrel.
- start_exit_perform_cycle(node)¶
EXIT PERFORM CYCLE statement
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.0.19-funcrel.
- end_exit_perform_cycle(node)¶
EXIT PERFORM CYCLE statement
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.0.19-funcrel.
- start_exit_program(node)¶
EXIT PROGRAM statement
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.0.19-funcrel.
- end_exit_program(node)¶
EXIT PROGRAM statement
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.0.19-funcrel.
- start_exit_section(node)¶
EXIT SECTION statement
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.0.19-funcrel.
- end_exit_section(node)¶
EXIT SECTION statement
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.0.19-funcrel.
- start_free(node)¶
FREE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type alter:Node
New in version com.castsoftware.mainframe.1.0.18-funcrel.
- end_free(node)¶
FREE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type alter:Node
New in version com.castsoftware.mainframe.1.0.18-funcrel.
Statements GOBACK - PERFORM¶
- class cast.analysers.mainframe.Extension
Extension points for Mainframe analyzer.
- start_goback(goback)¶
GOBACK statement.
Parameters: goback (cast.analysers.mainframe.Node) – the node @type goback:Node
- end_goback(goback)¶
GOBACK statement.
Parameters: goback (cast.analysers.mainframe.Node) – the node @type goback:Node
- start_goto(goto)¶
GO TO statement.
Parameters: goto (cast.analysers.mainframe.Node) – the node @type goto:Node
- end_goto(procedure)¶
GO TO statement.
Parameters: goto (cast.analysers.mainframe.Node) – the node @type goto:Node
- start_if(_if)¶
IF statement.
Parameters: _if (cast.analysers.mainframe.Node) – the node @type goto:Node
- end_if(_if)¶
IF statement.
Parameters: _if (cast.analysers.mainframe.Node) – the node @type goto:Node
- start_if_directive(_if)¶
>>IF directive statement.
Parameters: _if (cast.analysers.mainframe.Node) – the node @type goto:Node
New in version com.castsoftware.mainframe.1.3.0-alpha3.
- end_if_directive(_if)¶
>>IF directive statement.
Parameters: _if (cast.analysers.mainframe.Node) – the node @type goto:Node
New in version com.castsoftware.mainframe.1.3.0-alpha3.
- start_then_directive(then)¶
THEN part in a >>IF directive statement.
Parameters: then (cast.analysers.mainframe.Node) – the node @type goto:Node
New in version com.castsoftware.mainframe.1.3.0-alpha3.
- end_then_directive(then)¶
THEN part in a >>IF directive statement.
Parameters: then (cast.analysers.mainframe.Node) – the node @type goto:Node
New in version com.castsoftware.mainframe.1.3.0-alpha3.
- start_else_directive(_else)¶
>>ELSE part in a >>IF directive statement.
Parameters: _else (cast.analysers.mainframe.Node) – the node @type goto:Node
New in version com.castsoftware.mainframe.1.3.0-alpha3.
- end_else_directive(_else)¶
>>ELSE part in a >>IF directive statement.
Parameters: _else (cast.analysers.mainframe.Node) – the node @type goto:Node
New in version com.castsoftware.mainframe.1.3.0-alpha3.
- start_define(define)¶
>>DEFINE directive clause.
Parameters: default (cast.analysers.mainframe.Node) – the node @type default:Node
New in version com.castsoftware.mainframe.1.3.0-alpha3.
- end_define(define)¶
>>DEFINE directive clause.
Parameters: default (cast.analysers.mainframe.Node) – the node @type default:Node
New in version com.castsoftware.mainframe.1.3.0-alpha3.
- start_compilation_variable(define)¶
>>compilation variable definition.
Parameters: default (cast.analysers.mainframe.CompilationVariable) – the node @type default:CompilationVariable
New in version com.castsoftware.mainframe.1.3.0-alpha3.
- end_compilation_variable(define)¶
>>compilation variable definition.
Parameters: default (cast.analysers.mainframe.CompilationVariable) – the node @type default:CompilationVariable
New in version com.castsoftware.mainframe.1.3.0-alpha3.
- start_when_directive(when)¶
Begin of a >>WHEN directive clause.
Parameters: when (cast.analysers.mainframe.Node) – the node @type when:Node
New in version com.castsoftware.mainframe.1.3.0-alpha3.
- end_when_directive(when)¶
End of a >>WHEN directive clause.
Parameters: when (cast.analysers.mainframe.Node) – the node @type when:Node
New in version com.castsoftware.mainframe.1.3.0-alpha3.
- start_when_directive_expression(node)¶
Child is the evaluated expression in a >>WHEN directive clause.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.3.0-alpha3.
- end_when_directive_expression(node)¶
Child is the evaluated expression in a >>WHEN directive clause.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.3.0-alpha3.
- start_other_directive(other)¶
OTHER expression in a >>WHEN OTHER directive
Parameters: other (cast.analysers.mainframe.Node) – the node @type other:cast.analyzer.mainframe.Node
New in version com.castsoftware.mainframe.1.3.0-alpha3.
- end_other_directive(other)¶
- OTHER expression in a >>WHEN OTHER directive
Parameters: other (cast.analysers.mainframe.Node) – the node @type other:cast.analyzer.mainframe.Node
New in version com.castsoftware.mainframe.1.3.0-alpha3.
- start_inline_off(node)¶
>>INLINE OFF compilation directive
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.0.19-funcrel.
- end_inline_off(node)¶
>>INLINE OFF compilation directive
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.0.19-funcrel.
- start_inline_on(node)¶
>>INLINE ON compilation directive
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.0.19-funcrel.
- end_inline_on(node)¶
>>INLINE ON compilation directive
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.0.19-funcrel.
- start_then(then)¶
THEN part in a IF statement.
Parameters: then (cast.analysers.mainframe.Node) – the node @type goto:Node
- end_then(then)¶
THEN part in a IF statement.
Parameters: then (cast.analysers.mainframe.Node) – the node @type goto:Node
- start_else(_else)¶
ELSE part in a IF statement.
Parameters: _else (cast.analysers.mainframe.Node) – the node @type goto:Node
- end_else(_else)¶
ELSE part in a IF statement.
Parameters: _else (cast.analysers.mainframe.Node) – the node @type goto:Node
- start_initialize(initialize)¶
INITIALIZE statement.
Parameters: initialize (cast.analysers.mainframe.Node) – the node @type initialize:Node Children: initialized identifiers, with_filler clause, to_value, replacing, to_default
- start_with_filler(filler)¶
WITH FILLER clause in an INITIALIZE statement.
Parameters: filler (cast.analysers.mainframe.Node) – the node @type filler:Node
New in version com.castsoftware.mainframe.1.0.18-funcrel.
- end_with_filler(filler)¶
WITH FILLER clause in an INITIALIZE statement.
Parameters: filler (cast.analysers.mainframe.Node) – the node @type filler:Node
New in version com.castsoftware.mainframe.1.0.18-funcrel.
- start_value_phrase(value)¶
... TO VALUE clause in an INITIALIZE statement.
Parameters: value (cast.analysers.mainframe.Node) – the node @type value:Node
New in version com.castsoftware.mainframe.1.0.18-funcrel.
- end_value_phrase(value)¶
... TO VALUE clause in an INITIALIZE statement.
Parameters: value (cast.analysers.mainframe.Node) – the node @type value:Node
New in version com.castsoftware.mainframe.1.0.18-funcrel.
- start_replacing(replacing)¶
REPLACING ... BY ... clause in an INITIALIZE statement.
Parameters: replacing (cast.analysers.mainframe.Node) – the node @type replacing:Node
replacing.has_then() will be True in case of THEN REPLACING.
New in version com.castsoftware.mainframe.1.0.18-funcrel.
- end_replacing(replacing)¶
REPLACING ... BY ... clause in an INITIALIZE statement.
Parameters: replacing (cast.analysers.mainframe.Node) – the node @type replacing:Node
New in version com.castsoftware.mainframe.1.0.18-funcrel.
- start_to_default(default)¶
THEN TO DEFAULT clause in an INITIALIZE statement.
Parameters: default (cast.analysers.mainframe.Node) – the node @type default:Node
New in version com.castsoftware.mainframe.1.0.18-funcrel.
- end_to_default(default)¶
THEN TO DEFAULT clause in an INITIALIZE statement.
Parameters: default (cast.analysers.mainframe.Node) – the node @type default:Node
New in version com.castsoftware.mainframe.1.0.18-funcrel.
- end_initialize(initialize)¶
INITIALIZE statement.
Parameters: initialize (cast.analysers.mainframe.Node) – the node @type initialize:Node
- start_inspect(inspect)¶
INSPECT statement.
Parameters: inspect (cast.analysers.mainframe.Node) – the node @type inspect:Node Children: identifiers
- end_inspect(inspect)¶
INSPECT statement.
Parameters: inspect (cast.analysers.mainframe.Node) – the node @type inspect:Node
- start_json_generate(node)¶
JSON GENERATE statement
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.0.18-funcrel.
- end_json_generate(node)¶
JSON GENERATE statement
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.0.18-funcrel.
- start_json_parse(node)¶
JSON PARSE statement
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.0.18-funcrel.
- end_json_parse(node)¶
JSON PARSE statement
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.0.18-funcrel.
- start_count_in(node)¶
COUNT IN ... clause in an JSON GENERATE, XML GENERATE or UNSTRING statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- end_count_in(node)¶
COUNT IN ... clause in an JSON GENERATE, XML GENERATE or UNSTRING statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- start_name_of(node)¶
NAME OF ... clause in an JSON GENERATE or XML GENERATE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- end_name_of(node)¶
NAME OF ... clause in an JSON GENERATE or XML GENERATE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- start_suppress(node)¶
SUPPRESS ... clause in an JSON GENERATE or XML GENERATE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- end_suppress(node)¶
SUPPRESS ... clause in an JSON GENERATE or XML GENERATE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- start_suppress_when(node)¶
WHEN ... clause in an JSON GENERATE or XML GENERATE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- end_suppress_when(node)¶
WHEN ... clause in an JSON GENERATE or XML GENERATE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- start_converting(node)¶
CONVERTING ... clause in an JSON GENERATE or JSON PARSE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.3.0-alpha2.
- end_converting(node)¶
CONVERTING ... clause in an JSON GENERATE or JSON PARSE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.3.0-alpha2.
- start_with_detail(node)¶
WITH DETAIL ... clause in an JSON PARSE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- end_with_detail(node)¶
WITH DETAIL ... clause in an JSON PARSE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- start_with_encoding(node)¶
WITH ENCODING ... clause in an XML GENERATE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- end_with_encoding(node)¶
WITH ENCODING ... clause in an XML GENERATE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- start_with_xml_declaration(node)¶
WITH XML-DECLARATION clause in an XML GENERATE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- end_with_xml_declaration(node)¶
WITH XML-DECLARATION clause in an XML GENERATE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- start_with_attributes(node)¶
WITH ATTRIBUTES clause in an XML GENERATE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- end_with_attributes(node)¶
WITH ATTRIBUTES clause in an XML GENERATE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- start_namespace(node)¶
NAMESPACE ... clause in an XML GENERATE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- end_namespace(node)¶
NAMESPACE ... clause in an XML GENERATE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- start_type_of(node)¶
TYPE OF ... clause in an XML GENERATE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- end_type_of(node)¶
TYPE OF ... clause in an XML GENERATE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- start_xml_type(node)¶
One of - ATTRIBUTE - ELEMENT - CONTENT - NUMERIC - NUMERIC ATTRIBUTE - NUMERIC ELEMENT - NUMERIC CONTENT - NONNUMERIC - NONNUMERIC ATTRIBUTE - NONNUMERIC ELEMENT - NONNUMERIC CONTENT in an XML GENERATE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node node.get_name() will give the value
@type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- end_xml_type(node)¶
One of - ATTRIBUTE - ELEMENT - CONTENT - NUMERIC - NUMERIC ATTRIBUTE - NUMERIC ELEMENT - NUMERIC CONTENT - NONNUMERIC - NONNUMERIC ATTRIBUTE - NONNUMERIC ELEMENT - NONNUMERIC CONTENT in an XML GENERATE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node node.get_name() will give the value
@type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- start_merge(merge)¶
MERGE statement.
Parameters: merge (cast.analysers.mainframe.Node) – the node @type merge:Node
- end_merge(merge)¶
MERGE statement.
Parameters: merge (cast.analysers.mainframe.Node) – the node @type merge:Node
- start_move(move)¶
MOVE statement.
Parameters: move (cast.analysers.mainframe.Node) – the node @type move:Node
Example:
MOVE A TO B * move * move_source * identifier (A) * move_destination * identifier (B)
- end_move(move)¶
MOVE statement.
Parameters: move (cast.analysers.mainframe.Node) – the node @type move:Node
- start_move_source(move)¶
What is moved in a MOVE statement.
Parameters: move (cast.analysers.mainframe.Node) – the node @type move:Node
- end_move_source(move)¶
What is moved in a MOVE statement.
Parameters: move (cast.analysers.mainframe.Node) – the node @type move:Node
- start_move_destination(move)¶
What is moved to in a MOVE statement.
Parameters: move (cast.analysers.mainframe.Node) – the node @type move:Node
- end_move_destination(move)¶
What is moved to in a MOVE statement.
Parameters: move (cast.analysers.mainframe.Node) – the node @type move:Node
- start_is_corresponding(move)¶
When the MOVE statement is CORRESPONDING
Parameters: move (cast.analysers.mainframe.Node) – the node @type move:Node
- end_is_corresponding(move)¶
When the MOVE statement is CORRESPONDING
Parameters: move (cast.analysers.mainframe.Node) – the node @type move:Node
- start_multiply(multiply)¶
MULTIPLY statement.
Parameters: multiply (cast.analysers.mainframe.Node) – the node @type multiply:Node
- end_multiply(multiply)¶
MULTIPLY statement.
Parameters: multiply (cast.analysers.mainframe.Node) – the node @type multiply:Node
- start_note(node)¶
NOTE ... statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- end_note(node)¶
NOTE ... statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- start_on(node)¶
ON ... statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- start_every(node)¶
ON ... EVERY ... statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- end_every(node)¶
ON ... EVERY ... statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- end_on(node)¶
ON ... statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- start_open(_open)¶
OPEN statement.
Parameters: _open (cast.analysers.mainframe.Node) – the node @type _open:Node
- end_open(_open)¶
OPEN statement.
Parameters: _open (cast.analysers.mainframe.Node) – the node @type _open:Node
- start_open_input(_input)¶
INPUT phrase in an OPEN statement.
Parameters: _input (cast.analysers.mainframe.Node) – the node @type _input:Node
- end_open_input(_input)¶
INPUT phrase in an OPEN statement.
Parameters: _input (cast.analysers.mainframe.Node) – the node @type _input:Node
- start_open_output(_output)¶
OUTPUT phrase in an OPEN statement.
Parameters: _output (cast.analysers.mainframe.Node) – the node @type _output:Node
- end_open_output(_output)¶
OUTPUT phrase in an OPEN statement.
Parameters: _output (cast.analysers.mainframe.Node) – the node @type _output:Node
- start_perform_procedure(perform)¶
PERFORM X THROUGH Y statement.
Parameters: perform (cast.analysers.mainframe.Node) – the node @type perform:Node
- end_perform_procedure(perform)¶
PERFORM X THROUGH Y statement.
Parameters: perform (cast.analysers.mainframe.Node) – the node @type perform:Node
- start_perform_inline(perform)¶
PERFORM ... <statements> END-PERFORM statement
Parameters: perform (cast.analysers.mainframe.Node) – the node @type perform:Node
- end_perform_inline(perform)¶
PERFORM ... <statements> END-PERFORM statement
Parameters: perform (cast.analysers.mainframe.Node) – the node @type perform:Node
- start_times(perform)¶
X TIMES phrase of a PERFORM
Parameters: perform (cast.analysers.mainframe.Node) – the node @type perform:Node
- end_times(perform)¶
X TIMES phrase of a PERFORM
Parameters: perform (cast.analysers.mainframe.Node) – the node @type perform:Node
- start_until(perform)¶
UNTIL ... phrase of a PERFORM
Parameters: perform (cast.analysers.mainframe.Node) – the node @type perform:Node
- end_until(perform)¶
UNTIL ... phrase of a PERFORM
Parameters: perform (cast.analysers.mainframe.Node) – the node @type perform:Node
- start_until_exit(perform)¶
UNTIL EXIT ... phrase of a PERFORM
Parameters: perform (cast.analysers.mainframe.Node) – the node @type perform:Node .. versionadded:: com.castsoftware.mainframe.1.3.0-funcrel
- end_until_exit(perform)¶
UNTIL EXIT... phrase of a PERFORM
Parameters: perform (cast.analysers.mainframe.Node) – the node @type perform:Node .. versionadded:: com.castsoftware.mainframe.1.3.0-funcrel
- start_varying(perform)¶
VARYING ... FROM ... BY ... UNTIL ... phrase of a PERFORM
Parameters: perform (cast.analysers.mainframe.Node) – the node @type perform:Node
- end_varying(perform)¶
VARYING ... FROM ... BY ... UNTIL ... phrase of a PERFORM
Parameters: perform (cast.analysers.mainframe.Node) – the node @type perform:Node
- start_with_test_after(perform)¶
WITH TEST AFTER phrase of a PERFORM
Parameters: perform (cast.analysers.mainframe.Node) – the node @type perform:Node
- end_with_test_after(perform)¶
WITH TEST AFTER phrase of a PERFORM
Parameters: perform (cast.analysers.mainframe.Node) – the node @type perform:Node
- start_with_test_before(perform)¶
WITH TEST AFTER phrase of a PERFORM
Parameters: perform (cast.analysers.mainframe.Node) – the node @type perform:Node
- end_with_test_before(perform)¶
WITH TEST AFTER phrase of a PERFORM
Parameters: perform (cast.analysers.mainframe.Node) – the node @type perform:Node
Statements PROCESS - XML PARSE¶
- class cast.analysers.mainframe.Extension
Extension points for Mainframe analyzer.
- start_process(close)¶
PROCESS/CBL statement.
Parameters: close (cast.analysers.mainframe.Node) – the node @type close:Node
New in version com.castsoftware.mainframe.1.0.0-alpha3.
- end_process(close)¶
PROCESS/CBL statement.
Parameters: close (cast.analysers.mainframe.Node) – the node @type close:Node
New in version com.castsoftware.mainframe.1.0.0-alpha3.
- start_compilation_option(node)¶
Option inside a PROCESS statement
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
option.get_name() gives the option value
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- end_compilation_option(node)¶
Option inside a PROCESS statement
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
option.get_name() gives the option value
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- start_read(_read)¶
READ statement.
Parameters: _read (cast.analysers.mainframe.Node) – the node @type _read:Node
- end_read(_read)¶
READ statement.
Parameters: _read (cast.analysers.mainframe.Node) – the node @type _read:Node
- start_read_source(_read)¶
source part of READ statement.
Parameters: _read (cast.analysers.mainframe.Node) – the node @type _read:Node
- end_read_source(_read)¶
source part of READ statement.
Parameters: _read (cast.analysers.mainframe.Node) – the node @type _read:Node
- start_read_destination(_read)¶
INTO ... of READ statement.
Parameters: _read (cast.analysers.mainframe.Node) – the node @type _read:Node
- end_read_destination(_read)¶
INTO ... of READ statement.
Parameters: _read (cast.analysers.mainframe.Node) – the node @type _read:Node
- start_ready_trace(node)¶
READY TRACE statement
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha3.
- end_ready_trace(node)¶
READY TRACE statement
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha3.
- start_replace(node)¶
REPLACE statement
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.0.19-funcrel.
- end_replace(node)¶
REPLACE statement
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.0.19-funcrel.
- start_reset_trace(node)¶
RESET TRACE statement
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha3.
- end_reset_trace(node)¶
RESET TRACE statement
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha3.
- start_rewrite(write)¶
REWRITE statement.
Parameters: write (cast.analysers.mainframe.Node) – the node @type write:Node
- end_rewrite(write)¶
REWRITE statement.
Parameters: write (cast.analysers.mainframe.Node) – the node @type write:Node
- start_search(_search)¶
SEARCH statement.
Parameters: _search (cast.analysers.mainframe.Node) – the node @type _search:Node
- end_search(_search)¶
SEARCH statement.
Parameters: _search (cast.analysers.mainframe.Node) – the node @type _search:Node
- start_search_all(_search)¶
ALL in a SEARCH statement.
Parameters: _search (cast.analysers.mainframe.Node) – the node @type _search:Node
- end_search_all(_search)¶
ALL in a SEARCH statement.
Parameters: _search (cast.analysers.mainframe.Node) – the node @type _search:Node
- start_set(_set)¶
SET statement.
Parameters: _set (cast.analysers.mainframe.Node) – the node @type _set:Node
- end_set(_set)¶
SET statement.
Parameters: _set (cast.analysers.mainframe.Node) – the node @type _set:Node
- start_up_by(node)¶
UP BY ... in SET statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.1-funcrel.
- end_up_by(_set)¶
UP BY ... in SET statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.1-funcrel.
- start_down_by(node)¶
DOWN BY ... in SET statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.1-funcrel.
- end_down_by(_set)¶
DOWN BY ... in SET statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.1-funcrel.
- start_sort(_sort)¶
SORT statement.
Parameters: _sort (cast.analysers.mainframe.Node) – the node @type _sort:Node
- end_sort(_sort)¶
SORT statement.
Parameters: _sort (cast.analysers.mainframe.Node) – the node @type _sort:Node
- start_start(_start)¶
START statement.
Parameters: _start (cast.analysers.mainframe.Node) – the node @type _start:Node
- end_start(_start)¶
START statement.
Parameters: _start (cast.analysers.mainframe.Node) – the node @type _start:Node
- start_stop_run(stop)¶
STOP RUN statement.
Parameters: stop (cast.analysers.mainframe.Node) – the node @type stop:Node
- end_stop_run(stop)¶
STOP RUN statement.
Parameters: stop (cast.analysers.mainframe.Node) – the node @type stop:Node
- start_string(string)¶
STRING statement.
Parameters: string (cast.analysers.mainframe.Node) – the node @type string:Node
- end_string(string)¶
STRING statement.
Parameters: string (cast.analysers.mainframe.Node) – the node @type string:Node
- start_subtract(subtract)¶
SUBTRACT statement.
Parameters: subtract (cast.analysers.mainframe.Node) – the node @type subtract:Node
- end_subtract(subtract)¶
SUBTRACT statement.
Parameters: subtract (cast.analysers.mainframe.Node) – the node @type subtract:Node
- start_subtract_source(subtract)¶
Source in a SUBTRACT statement.
Parameters: subtract (cast.analysers.mainframe.Node) – the node @type subtract:Node
- end_subtract_source(subtract)¶
Source in a SUBTRACT statement.
Parameters: subtract (cast.analysers.mainframe.Node) – the node @type subtract:Node
- start_subtract_destination(subtract)¶
Destination in a SUBTRACT statement.
Parameters: subtract (cast.analysers.mainframe.Node) – the node @type subtract:Node
- end_subtract_destination(subtract)¶
Destination in a SUBTRACT statement.
Parameters: subtract (cast.analysers.mainframe.Node) – the node @type subtract:Node
- start_transform(node)¶
TRANSFORM statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- end_transform(node)¶
TRANSFORM statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- start_unstring(node)¶
UNSTRING statement
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.0.1-funcrel.
- end_unstring(node)¶
UNSTRING statement
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.0.1-funcrel.
- start_write(write)¶
WRITE statement.
Parameters: write (cast.analysers.mainframe.Node) – the node @type write:Node
- end_write(write)¶
WRITE statement.
Parameters: write (cast.analysers.mainframe.Node) – the node @type write:Node
- start_write_source(write)¶
Source in a WRITE statement.
Parameters: write (cast.analysers.mainframe.Node) – the node @type write:Node
- end_write_source(write)¶
Source in a WRITE statement.
Parameters: write (cast.analysers.mainframe.Node) – the node @type write:Node
- start_write_destination(write)¶
Destination in a WRITE statement.
Parameters: write (cast.analysers.mainframe.Node) – the node @type write:Node
- end_write_destination(write)¶
Destination in a WRITE statement.
Parameters: write (cast.analysers.mainframe.Node) – the node @type write:Node
- start_xml_generate(node)¶
XML GENERATE statement
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.0.1-funcrel.
- end_xml_generate(node)¶
XML GENERATE statement
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.0.1-funcrel.
- start_xml_parse(node)¶
XML PARSE statement
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.0.1-funcrel.
- end_xml_parse(node)¶
XML PARSE statement
Parameters: node (cast.analysers.mainframe.Node) – the node New in version com.castsoftware.mainframe.1.0.1-funcrel.
- start_returning_national(node)¶
RETURNING NATIONAL clause in an XML PARSE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- end_returning_national(node)¶
RETURNING NATIONAL clause in an XML PARSE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- start_validating(node)¶
VALIDATING ... clause in an XML PARSE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- end_validating(node)¶
VALIDATING ... clause in an XML PARSE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- start_validating_with_file(node)¶
VALIDATING WITH FILE ... clause in an XML PARSE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- end_validating_with_file(node)¶
VALIDATING WITH FILE ... clause in an XML PARSE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- start_processing_procedure(node)¶
PROCESSING PROCEDURE ... clause in an XML PARSE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- end_processing_procedure(node)¶
PROCESSING PROCEDURE ... clause in an XML PARSE statement.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.19-funcrel.
Common sub nodes¶
Those events/nodes can be found in several statements.
- class cast.analysers.mainframe.Extension
Extension points for Mainframe analyzer.
- start_when(when)¶
Begin of a WHEN clause.
Parameters: when (cast.analysers.mainframe.Node) – the node @type when:Node
- end_when(when)¶
End of a WHEN clause.
Parameters: when (cast.analysers.mainframe.Node) – the node @type when:Node
- start_when_expression(node)¶
Child is the evaluated expression in a WHEN clause.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
- end_when_expression(node)¶
Child is the evaluated expression in a WHEN clause.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
- start_using(node)¶
USING ... clause.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
- end_using(node)¶
USING ... clause.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
- start_by_reference(node)¶
BY REFERENCE ... clause.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha3.
- end_by_reference(node)¶
BY REFERENCE ... clause.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha3.
- start_by_value(node)¶
BY VALUE ... clause.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha3.
- end_by_value(node)¶
BY VALUE ... clause.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha3.
- start_by_content(node)¶
BY CONTENT ... clause.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha3.
- end_by_content(node)¶
BY CONTENT ... clause.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha3.
- start_giving(node)¶
Start a GIVING clause.
Parameters: node (cast.analysers.mainframe.Node) – the node Can be present in - CALL - ADD - ...
- end_giving(node)¶
End a GIVING clause.
Parameters: node (cast.analysers.mainframe.Node) – the node Can be present in - CALL - ADD - ...
- start_from(_from)¶
Start a FROM clause.
Parameters: _from (cast.analysers.mainframe.Node) – the node Can be present in - PERFORM - MERGE - SORT - ...
- end_from(_from)¶
End a FROM clause.
Parameters: _from (cast.analysers.mainframe.Node) – the node Can be present in - PERFORM Can be present in - PERFORM - MERGE - SORT - ...
- start_through(through)¶
Start a THROUGH clause.
Parameters: through (cast.analysers.mainframe.Node) – the node Can be present in - PERFORM Can be present in - PERFORM - MERGE - SORT - ...
- end_through(through)¶
End a THROUGH clause.
Parameters: through (cast.analysers.mainframe.Node) – the node Can be present in - PERFORM - MERGE - SORT - ...
- start_filename(filename)¶
The referenced file name in a MERGE or SORT statement.
Parameters: filename (cast.analysers.mainframe.Node) – the node @type filename:Node
- end_filename(filename)¶
The referenced file name in a MERGE or SORT statement.
Parameters: filename (cast.analysers.mainframe.Node) – the node @type filename:Node
- start_output_procedure(procedure)¶
Output procedure in a MERGE statement.
Parameters: procedure (cast.analysers.mainframe.Node) – the node @type procedure:Node
- end_output_procedure(procedure)¶
Output procedure in a MERGE statement.
Parameters: procedure (cast.analysers.mainframe.Node) – the node @type procedure:Node
- start_input_procedure(procedure)¶
INPUT PROCEDURE ... in a SORT statement.
Parameters: procedure (cast.analysers.mainframe.Node) – the node @type procedure:Node
- end_input_procedure(procedure)¶
INPUT PROCEDURE ... in a SORT statement.
Parameters: procedure (cast.analysers.mainframe.Node) – the node @type procedure:Node
- start_at_end(end)¶
Start a AT END clause.
Parameters: end (cast.analysers.mainframe.Node) – the node
- end_at_end(end)¶
End a AT END clause.
Parameters: end (cast.analysers.mainframe.Node) – the node
- start_not_at_end(end)¶
Start a NOT AT END clause.
Parameters: end (cast.analysers.mainframe.Node) – the node
- end_not_at_end(end)¶
End a NOT AT END clause.
Parameters: end (cast.analysers.mainframe.Node) – the node
- start_at_end_of_page(end)¶
Start a AT END OF PAGE clause.
Parameters: end (cast.analysers.mainframe.Node) – the node
- end_at_end_of_page(end)¶
End a AT END OF PAGE clause.
Parameters: end (cast.analysers.mainframe.Node) – the node
- start_not_at_end_of_page(end)¶
Start a NOT AT END OF PAGE clause.
Parameters: end (cast.analysers.mainframe.Node) – the node
- end_not_at_end_of_page(end)¶
End a NOT AT END OF PAGE clause.
Parameters: end (cast.analysers.mainframe.Node) – the node
- start_invalid_key(end)¶
Start a INVALID KEY clause.
Parameters: end (cast.analysers.mainframe.Node) – the node
- end_invalid_key(end)¶
End a INVALID KEY clause.
Parameters: end (cast.analysers.mainframe.Node) – the node
- start_not_invalid_key(end)¶
Start a NOT INVALID KEY clause.
Parameters: end (cast.analysers.mainframe.Node) – the node
- end_not_invalid_key(end)¶
End a NOT INVALID KEY clause.
Parameters: end (cast.analysers.mainframe.Node) – the node
- start_on_exception(end)¶
Start a ON EXCEPTION clause.
Parameters: end (cast.analysers.mainframe.Node) – the node
- end_on_exception(end)¶
End a ON EXCEPTION clause.
Parameters: end (cast.analysers.mainframe.Node) – the node
- start_not_on_exception(end)¶
Start a NOT ON EXCEPTION clause.
Parameters: end (cast.analysers.mainframe.Node) – the node
- end_not_on_exception(end)¶
End a NOT ON EXCEPTION clause.
Parameters: end (cast.analysers.mainframe.Node) – the node
- start_on_overflow(end)¶
Start a ON OVERFLOW clause.
Parameters: end (cast.analysers.mainframe.Node) – the node
- end_on_overflow(end)¶
End a ON OVERFLOW clause.
Parameters: end (cast.analysers.mainframe.Node) – the node
- start_not_on_overflow(end)¶
Start a NOT ON OVERFLOW clause.
Parameters: end (cast.analysers.mainframe.Node) – the node
- end_not_on_overflow(end)¶
End a NOT ON OVERFLOW clause.
Parameters: end (cast.analysers.mainframe.Node) – the node
- start_on_size_error(end)¶
Start a ON SIZE ERROR clause.
Parameters: end (cast.analysers.mainframe.Node) – the node
- end_on_size_error(end)¶
End a ON SIZE ERROR clause.
Parameters: end (cast.analysers.mainframe.Node) – the node
- start_not_on_size_error(end)¶
Start a NOT ON SIZE ERROR clause.
Parameters: end (cast.analysers.mainframe.Node) – the node
- end_not_on_size_error(end)¶
End a NOT ON SIZE ERROR clause.
Parameters: end (cast.analysers.mainframe.Node) – the node
- start_procedure_name(procedure)¶
A reference to a section or paragraph.
Parameters: procedure (cast.analysers.mainframe.ProcedureName) – the node
- end_procedure_name(procedure)¶
A reference to a section or paragraph.
Parameters: procedure (cast.analysers.mainframe.ProcedureName) – the node
Expressions¶
- class cast.analysers.mainframe.Extension
Extension points for Mainframe analyzer.
- start_string_literal(literal)¶
Parameters: literal (cast.analysers.mainframe.StringLiteral) – the node @type literal:cast.analyzer.mainframe.StringLiteral
- end_string_literal(literal)¶
Parameters: literal (cast.analysers.mainframe.StringLiteral) – the node @type literal:cast.analyzer.mainframe.StringLiteral
- start_integer_literal(literal)¶
Parameters: literal (cast.analysers.mainframe.IntegerLiteral) – the node @type literal:cast.analyzer.mainframe.IntegerLiteral
- end_integer_literal(literal)¶
Parameters: literal (cast.analysers.mainframe.IntegerLiteral) – the node @type literal:cast.analyzer.mainframe.IntegerLiteral
- start_real_literal(literal)¶
Parameters: literal (cast.analysers.mainframe.RealLiteral) – the node - @type literal:cast.analyzer.mainframe.IntegerLiteral
New in version com.castsoftware.mainframe.1.3.0-alpha2.
- end_real_literal(literal)¶
Parameters: literal (cast.analysers.mainframe.RealLiteral) – the node - @type literal:cast.analyzer.mainframe.RealLiteral
New in version com.castsoftware.mainframe.1.3.0-alpha2.
- start_boolean_literal(literal)¶
Parameters: literal (cast.analysers.mainframe.BooleanLiteral) – the node @type literal:cast.analyzer.mainframe.BooleanLiteral
- end_boolean_literal(literal)¶
Parameters: literal (cast.analysers.mainframe.BooleanLiteral) – the node @type literal:cast.analyzer.mainframe.BooleanLiteral
- start_identifier(identifier)¶
Parameters: identifier (cast.analysers.mainframe.Identifier) – the node @type identifier:cast.analyzer.mainframe.Identifier
- end_identifier(identifier)¶
Parameters: identifier (cast.analysers.mainframe.Identifier) – the node @type identifier:cast.analyzer.mainframe.Identifier
- start_array_access(expression)¶
Parameters: expression (cast.analysers.mainframe.Node) – the node @type expression:cast.analyzer.mainframe.Node
A(I) First child is A and second child is I.
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- end_array_access(expression)¶
Parameters: expression (cast.analysers.mainframe.Node) – the node @type expression:cast.analyzer.mainframe.Node
A(I) First child is A and second child is I.
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- start_position_length(expression)¶
Parameters: expression (cast.analysers.mainframe.Node) – the node @type expression:cast.analyzer.mainframe.Node
A(I:3)
First child is A, second child I and third child is 3.
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- end_position_length(expression)¶
Parameters: expression (cast.analysers.mainframe.Node) – the node @type expression:cast.analyzer.mainframe.Node
A(I:3)
First child is A, second child I and third child is 3.
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- start_arithmetic_expression(expression)¶
Parameters: expression (cast.analysers.mainframe.Node) – the node @type expression:cast.analyzer.mainframe.Node
get_name() will give ‘+’, ‘-‘, ‘*’, ‘/’, ‘**’
- end_arithmetic_expression(expression)¶
Parameters: expression (cast.analysers.mainframe.Node) – the node @type identifier:cast.analyzer.mainframe.Node
- start_relation_condition(expression)¶
Parameters: expression (cast.analysers.mainframe.Node) – the node @type identifier:cast.analyzer.mainframe.Node
get_name() will give ‘=’, ‘<’, ‘>’, ‘<=’, ‘>=’, ‘EQUAL’, etc...
- end_relation_condition(expression)¶
Parameters: expression (cast.analysers.mainframe.Node) – the node @type identifier:cast.analyzer.mainframe.Node
- start_logical_expression(expression)¶
Parameters: expression (cast.analysers.mainframe.Node) – the node @type identifier:cast.analyzer.mainframe.Node
get_name() will give ‘AND’, ‘OR’, ‘NOT’
- end_logical_expression(expression)¶
Parameters: expression (cast.analysers.mainframe.Node) – the node @type identifier:cast.analyzer.mainframe.Node
- start_other(other)¶
OTHER expression in a WHEN OTHER
Parameters: other (cast.analysers.mainframe.Node) – the node @type other:cast.analyzer.mainframe.Node
- end_other(other)¶
OTHER expression in a WHEN OTHER
Parameters: other (cast.analysers.mainframe.Node) – the node @type other:cast.analyzer.mainframe.Node
- start_address_of(node)¶
ADDRESS OF ... clause.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha3.
- end_address_of(node)¶
ADDRESS OF ... clause.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha3.
- start_length_of(node)¶
LENGTH OF ... clause.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha3.
- end_length_of(node)¶
LENGTH OF ... clause.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.0-alpha3.
- start_function_call(node)¶
FUNCTION ... clause.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.7-funcrel: From version com.castsoftware.mainframe.1.3.0-alpha2 function name is available through node.get_name()
- end_function_call(node)¶
FUNCTION ... clause.
Parameters: node (cast.analysers.mainframe.Node) – the node @type node:Node
New in version com.castsoftware.mainframe.1.0.7-funcrel.
Specific objects¶
Some objects are saved in the knowledge base and some are not.
- class cast.analysers.mainframe.SavedObject¶
A COBOL element that is saved in the knowledge base.
- get_position_without_header()¶
Get the position of an object without header comments.
Return type: cast.analysers.Bookmark @rtype: cast.analysers.Bookmark
New in version com.castsoftware.mainframe.1.0.1-funcrel.
- is_debug()¶
True if statement starts on a debug line.
New in version com.castsoftware.mainframe.1.0.3-funcrel.
For :
- COBOL Program
- COBOL Section
- COBOL Paragraph
- class cast.analysers.mainframe.UnsavedObject¶
A COBOL element that is not saved in the knowledge base. For example: - AST nodes for statements - data when option Save Data is False - Section/Paragraph when option Save Section Paragraph is False
- get_name()¶
Get the object name
Return type: str @rtype: str
- get_fullname()¶
Get the object fullname
Return type: str @rtype: string
- get_children()¶
Get the children
Return type: list of cast.analysers.mainframe.UnsavedObject @rtype: [cast.analysers.mainframe.UnsavedObject]
- get_position()¶
Get the position of an object.
Includes lines of header comments for objects fd, sd, data, division, section and procedure.
Return type: cast.analysers.Bookmark @rtype: cast.analysers.Bookmark
- get_positions()¶
Get the positions of an object
Return type: list of cast.analysers.Bookmark @rtype: [cast.analysers.Bookmark]
- get_position_without_header()¶
Get the position of an object without header comments.
Return type: cast.analysers.Bookmark @rtype: cast.analysers.Bookmark
New in version com.castsoftware.mainframe.1.0.1-funcrel.
- get_typename()¶
Returns the name of the metamodel type of the object.
Return type: str
- get_kind()¶
Returns the kind of the object.
Return type: str
- is_statement()¶
Return True when this is an AST node of a statement.
Return type: bool
- get_sub_nodes(kind)¶
Get the list of descendant of a certain kind. Stops recursion on : - nodes of that kind - nodes that are statements
Return type: list of cast.analysers.mainframe.UnsavedObject @rtype: [cast.analysers.mainframe.UnsavedObject]
- get_parent()¶
Access to parent.
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- is_debug()¶
True if statement starts on a debug line.
New in version com.castsoftware.mainframe.1.0.3-funcrel.
Data¶
Data have a special API to access specific information such as PIC, OCCURS, ...
Depending on the analysis options, data can be saved or not.
- class cast.analysers.mainframe.SavedData¶
A COBOL data element that is saved.
- get_level()¶
Return the level of the data. For example
01 VAR PIC X(10). --> 1
Return type: int New in version com.castsoftware.mainframe.1.0.0-alpha3.
- get_picture()¶
Return the PICTURE value of the data. For example
01 VAR PIC X(10). --> "X(10)"
Return type: str
- get_usage()¶
Return the USAGE value of the data. For example
01 VAR PIC X(10) DISPLAY. --> "DISPLAY" 01 VAR PIC X(10) COMP. --> "COMPUTATIONAL" 01 VAR PIC X(10). --> ""
Possible values :
- “”
- “DISPLAY”
- “COMPUTATIONAL” : for COMP and BINARY
- “COMPUTATIONAL-1”
- “COMPUTATIONAL-2”
- “COMPUTATIONAL-3” : for COMP-3, PACKED-DECIMAL, PACKED
- “COMPUTATIONAL-4”
- “COMPUTATIONAL-5”
- “COMPUTATIONAL-6”
- “COMPUTATIONAL-X”
- “INDEX”
- “POINTER”
- “PROCEDURE-POINTER”
Return type: str
- get_sharing()¶
Return the sharing value of the data. For example
01 VAR PIC X(10) EXTERNAL. --> "EXTERNAL" 01 VAR PIC X(10) GLOBAL. --> "GLOBAL"
Return type: str
- get_occurs_from()¶
Return the OCCURS value of the data. For example
01 VAR PIC X(10) OCCURS 10. --> 10 01 VAR PIC X(10) OCCURS 10 TO 20. --> 10
Return type: int or None
- get_occurs_to()¶
Return the OCCURS TO value of the data. For example
01 VAR PIC X(10) OCCURS 10. --> None 01 VAR PIC X(10) OCCURS 10 TO 20. --> 20 01 VAR PIC X(10) OCCURS 10 TO UNBOUNDED DEPENDING ON VAR2. --> -1
Return type: int or None
- is_condition_name()¶
Returns True if data is a CONDITION NAME, i.e., a level 88. For example
01 VAR PIC X. --> False 01 A PIC X. --> False 88 B VALUE 'A'. --> True
- is_constant()¶
Returns True if data is a constant, i.e., a level 78. For example
01 VAR PIC X. --> False 78 C VALUE 'A'. --> True
- is_synchronized()¶
Returns True if data is SYNCHRONIZED. For example
01 VAR PIC X. --> False 78 C VALUE 'A' SYNCHRONIZED. --> True
- is_volatile()¶
Retuns True if data is VOLATILE
For example
01 VAR PIC X. --> False 78 C VALUE 'A' VOLATILE. --> True
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- is_data()¶
Retuns True
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- is_index()¶
Retuns False
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- is_file_description()¶
Retuns False
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- is_sort_description()¶
Retuns False
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- class cast.analysers.mainframe.UnsavedData¶
A COBOL data element that is not saved.
- get_level()¶
Return the level of the data. For example
01 VAR PIC X(10). --> 1
Return type: int New in version com.castsoftware.mainframe.1.0.0-alpha3.
- get_picture()¶
Return the PICTURE value of the data. For example
01 VAR PIC X(10). --> "X(10)"
Return type: str
- get_usage()¶
Return the USAGE value of the data. For example
01 VAR PIC X(10) DISPLAY. --> "DISPLAY" 01 VAR PIC X(10) COMP. --> "COMPUTATIONAL" 01 VAR PIC X(10). --> ""
Possible values :
- “”
- “DISPLAY”
- “COMPUTATIONAL” : for COMP and BINARY
- “COMPUTATIONAL-1”
- “COMPUTATIONAL-2”
- “COMPUTATIONAL-3” : for COMP-3, PACKED-DECIMAL, PACKED
- “COMPUTATIONAL-4”
- “COMPUTATIONAL-5”
- “COMPUTATIONAL-6”
- “COMPUTATIONAL-X”
- “INDEX”
- “POINTER”
- “PROCEDURE-POINTER”
Return type: str
- get_sharing()¶
Return the sharing value of the data. For example :/
01 VAR PIC X(10) EXTERNAL. –> “EXTERNAL” 01 VAR PIC X(10) GLOBAL. –> “GLOBAL”Return type: str
- get_occurs_from()¶
Return the OCCURS value of the data. For example
01 VAR PIC X(10) OCCURS 10. --> 10 01 VAR PIC X(10) OCCURS 10 TO 20. --> 10
Return type: int or None
- get_occurs_to()¶
Return the OCCURS TO value of the data. For example
01 VAR PIC X(10) OCCURS 10. --> None 01 VAR PIC X(10) OCCURS 10 TO 20. --> 20 01 VAR PIC X(10) OCCURS 10 TO UNBOUNDED DEPENDING ON VAR2. --> -1
Return type: int or None
- is_condition_name()¶
Returns True if data is a CONDITION NAME, i.e., a level 88. For example
01 VAR PIC X. --> False 01 A PIC X. --> False 88 B VALUE 'A'. --> True
- is_constant()¶
Returns True if data is a constant, i.e., a level 78. For example
01 VAR PIC X. --> False 78 C VALUE 'A'. --> True
- is_synchronized()¶
Returns True if data is SYNCHRONIZED. For example
01 VAR PIC X. --> False 78 C VALUE 'A' SYNCHRONIZED. --> True
- is_volatile()¶
Retuns True if data is VOLATILE
For example
01 VAR PIC X. --> False 78 C VALUE 'A' VOLATILE. --> True
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- is_data()¶
Retuns True
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- is_index()¶
Retuns False
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- is_file_description()¶
Retuns False
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- is_sort_description()¶
Retuns False
New in version com.castsoftware.mainframe.1.0.19-funcrel.
Index have their own type
- class cast.analysers.mainframe.Index¶
A COBOL Index.
New in version com.castsoftware.mainframe.1.0.0-alpha3.
- is_data()¶
Retuns False
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- is_index()¶
Retuns True
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- is_file_description()¶
Retuns False
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- is_sort_description()¶
Retuns False
New in version com.castsoftware.mainframe.1.0.19-funcrel.
File¶
FD objects.
- class cast.analysers.mainframe.SavedFileDescription¶
- is_data()¶
Retuns False
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- is_index()¶
Retuns False
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- is_file_description()¶
Retuns True
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- is_sort_description()¶
Retuns False
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- class cast.analysers.mainframe.UnsavedFileDescription¶
- is_data()¶
Retuns False
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- is_index()¶
Retuns False
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- is_file_description()¶
Retuns True
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- is_sort_description()¶
Retuns False
New in version com.castsoftware.mainframe.1.0.19-funcrel.
SD objects.
- class cast.analysers.mainframe.SavedSortDescription¶
- is_data()¶
Retuns False
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- is_index()¶
Retuns False
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- is_file_description()¶
Retuns False
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- is_sort_description()¶
Retuns True
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- class cast.analysers.mainframe.UnsavedSortDescription¶
- is_data()¶
Retuns False
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- is_index()¶
Retuns False
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- is_file_description()¶
Retuns False
New in version com.castsoftware.mainframe.1.0.19-funcrel.
- is_sort_description()¶
Retuns True
New in version com.castsoftware.mainframe.1.0.19-funcrel.
AST Node types¶
The generic node
- class cast.analysers.mainframe.Node¶
Bases: cast.analysers.mainframe.UnsavedObject
Generic node for AST.
- has_explicit_end()¶
True when statement is closed by an explicit END XXX
New in version com.castsoftware.mainframe.1.0.0-alpha2.
- has_then()¶
True for a THEN REPLACING clause.
New in version com.castsoftware.mainframe.1.0.19-funcrel.
Variable identifier represent usage of a data inside the code. Those identifiers are resolved to the data declaration. When the data is unresolved, the resolution returns an empty list. In normal case it return a list with the data resolvec, and when the data is ambiguous, it returns all possible data.
- class cast.analysers.mainframe.Identifier¶
Bases: cast.analysers.mainframe.UnsavedObject
An identifier of a data inside the AST.
For example
MOVE "FOO" to VAR. ---
- get_resolved_datas()¶
Returns the list of data/index/fd/sd it points to, generally only one value. For example
01 VAR PIC X. <-- the data ... MOVE "FOO" TO VAR. <-- the identifier
- class cast.analysers.mainframe.CompilationVariable¶
Bases: cast.analysers.mainframe.UnsavedObject
A COBOL Compilation Variable.
New in version com.castsoftware.mainframe.1.3.0-alpha3.
- is_data()¶
Retuns False
New in version com.castsoftware.mainframe.1.3.0-alpha3.
- is_index()¶
Retuns False
New in version com.castsoftware.mainframe.1.3.0-alpha3.
- is_file_description()¶
Retuns False
New in version com.castsoftware.mainframe.1.3.0-alpha3.
- is_sort_description()¶
Retuns False
New in version com.castsoftware.mainframe.1.3.0-alpha3.
- is_compilation_variable()¶
Retuns True
New in version com.castsoftware.mainframe.1.3.0-alpha3.
Procedure identifier represent a usage of a section or paragraph name in the code. Those are resolved.
- class cast.analysers.mainframe.ProcedureName¶
Bases: cast.analysers.mainframe.UnsavedObject
An identifier of a section or paragraph inside the AST.
For example
GO TO PARA1. -----
- get_resolved_procedures()¶
Returns the list of sections/paragraphs it points to, generally only one. For example
PARA1. <-- the paragraph ... GO TO PARA1. <-- the procedure name
Constants
- class cast.analysers.mainframe.StringLiteral¶
Bases: cast.analysers.mainframe.UnsavedObject
A string literal in an AST.
For example
MOVE "FOO" to VAR. -----
- get_value()¶
Return the string value.
Return type: str
- class cast.analysers.mainframe.IntegerLiteral¶
Bases: cast.analysers.mainframe.UnsavedObject
An integer literal in an AST.
For example
MOVE 1 to VAR. -
- get_value()¶
Return the integer value.
Return type: int
- class cast.analysers.mainframe.BooleanLiteral¶
Bases: cast.analysers.mainframe.UnsavedObject
An boolean literal in an AST.
For example
IF TRUE -
- get_value()¶
Return the boolean value.
Return type: bool
- class cast.analysers.mainframe.RealLiteral¶
Bases: cast.analysers.mainframe.UnsavedObject
A real literal in an AST.
For example
MOVE -3.4 to VAR. -
- get_value()¶
Return the real value.
Return type: float
Note
Figurative constants come into those classes and the method get_name() will give the constant. get_value() will give the interpreted value.
Writing tests¶
Use :
- class cast.analysers.test.MainframeTestAnalysis
Bases: cast.analysers.test.TestAnalysis
Specialised case for Mainframe Analyser.
Simplest way of use is :
analysis = MainframeTestAnalysis()
analysis.add_selection(‘path to my php code’)
analysis.run()
- set_cics_extensions(extensions)
Indicate the file extensions for CICS default values is “.csd;.bms”
- set_cobol_extensions(extensions)
Indicate the file extensions for COBOL default values is “.cob;.cpy”
- set_ims_extensions(extensions)
Indicate the file extensions for IMS default values is “.psb;.dbd”
- set_jcl_extensions(extensions)
Indicate the file extensions for JCL default values is “.jcl;.prc”
- set_keep_end_of_line()
By default, end of lines are truncated. Call this to keep end of line
- set_mainframe_environment()
By default, we are not in mainframe environment (program names truncated to 8 chars) Call this to change to mainframe_environment.
- set_cobol_tabulation_length(length)
Default is 4.
- set_starting_column(length)
Default is 7.
Sample of a test
import unittest
from cast.analysers.test import MainframeTestAnalysis
class Test(unittest.TestCase):
def test_ok1(self):
analysis = MainframeTestAnalysis()
analysis.add_dependency(r'C:\ProgramData\CAST\CAST\Extensions\com.castsoftware.internal.platform.0.9.4')
analysis.add_dependency(r'C:\ProgramData\CAST\CAST\Extensions\com.castsoftware.mainframe.1.0.11-funcrel')
analysis.add_selection('binary_depending/pgmok1.cob')
analysis.run()
program = analysis.get_object_by_name('PGM1', 'CAST_COBOL_SavedProgram')
self.assertTrue(program)
self.assertFalse(analysis.get_violations(program, 'CAST_COBOL_SavedProgram.useBinaryForDepending'))
if __name__ == '__main__':
unittest.main()
Note
You need to add a dependency to the folder containing com.castsoftaware.mainframe, for example
analysis.add_dependency(r'C:\ProgramData\CAST\CAST\Extensions\com.castsoftware.mainframe.1.0.0-alpha1')
For that you need to have downloaded the extension through CAST ExtensionDowloader: see https://doc.castsoftware.com/display/EXTEND/CAST+Extension+Downloader
Categories and types for quality rules¶
For adding a quality rule on
- COBOL programs: Category CAST_MetricAssistant_WithMetrics_Cobol
- COBOL Copybook: Type CAST_COBOL_Copybook
Quality rule scopes¶
Existing quality rule scopes are :
100 | COBOL programs |
110 | COBOL programs that contains EXEC CICS Macros |
120 | COBOL programs that contains EXEC SQL |
140 | COBOL Copybooks |
Mainframe technologies¶
Values for technology to be used in IMPLTechnologies.xml for filter value
Cobol | -4 |