55# responsible for verification of the configuration file data.
66#
77# COPYRIGHT: Copyright (C) 2022-2024 Kamil Deć github.com/deckamil
8- # DATE: 8 FEB 2024
8+ # DATE: 25 FEB 2024
99#
1010# LICENSE:
1111# This file is part of Mod Code Generator (MCG).
@@ -552,6 +552,20 @@ def check_operation_body_details(operation_body_start_index, operation_body_end_
552552 operation_body_section = ConfigChecker .config_file [operation_body_start_index :
553553 operation_body_end_index ]
554554
555+ # get first line of operation body section
556+ operation_body_first_line = operation_body_section [0 ]
557+
558+ # if first line contains unexpected operation body marker
559+ if (operation_body_first_line .find ("$EIF " ) == ConfigChecker .BASE_MARKER_POSITION ) or \
560+ (operation_body_first_line .find ("$ELS" ) == ConfigChecker .BASE_MARKER_POSITION ) or \
561+ (operation_body_first_line .find ("$INP " ) == ConfigChecker .BASE_MARKER_POSITION ) or \
562+ (operation_body_first_line .find ("$OUT " ) == ConfigChecker .BASE_MARKER_POSITION ) or \
563+ (operation_body_first_line .find ("$OPE -end" ) == ConfigChecker .BASE_MARKER_POSITION ) or \
564+ (operation_body_first_line .find ("$IFC -end" ) == ConfigChecker .BASE_MARKER_POSITION ):
565+
566+ # record error
567+ ErrorHandler .record_error (ErrorHandler .CHK_ERR_FAULTY_BODY , operation_body_start_index + 1 , "" )
568+
555569 # get last line of operation body section
556570 operation_body_last_line = operation_body_section [- 1 ]
557571
@@ -568,6 +582,35 @@ def check_operation_body_details(operation_body_start_index, operation_body_end_
568582 # record error
569583 ErrorHandler .record_error (ErrorHandler .CHK_ERR_FAULTY_BODY , operation_body_end_index , "" )
570584
585+ # check corrects of operation call definition
586+ for i in range (0 , len (operation_body_section )- 1 ):
587+
588+ # if operation call marker is found and next line does not contain operation input interface marker
589+ if ((operation_body_section [i ].find ("$OPE " ) == ConfigChecker .BASE_MARKER_POSITION ) and
590+ (operation_body_section [i ].find ("$OPE -end" ) != ConfigChecker .BASE_MARKER_POSITION ) and
591+ (operation_body_section [i + 1 ].find ("$INP " ) != ConfigChecker .BASE_MARKER_POSITION )):
592+
593+ # record error
594+ ErrorHandler .record_error (ErrorHandler .CHK_ERR_FAULTY_BODY , operation_body_start_index + i + 2 , "" )
595+
596+ # if operation input interface marker is found and next line does not contain
597+ # operation input interface marker or operation output interface marker
598+ if ((operation_body_section [i ].find ("$INP " ) == ConfigChecker .BASE_MARKER_POSITION ) and
599+ ((operation_body_section [i + 1 ].find ("$INP " ) != ConfigChecker .BASE_MARKER_POSITION ) and
600+ (operation_body_section [i + 1 ].find ("$OUT " ) != ConfigChecker .BASE_MARKER_POSITION ))):
601+
602+ # record error
603+ ErrorHandler .record_error (ErrorHandler .CHK_ERR_FAULTY_BODY , operation_body_start_index + i + 2 , "" )
604+
605+ # if operation output interface marker is found and next line does not contain
606+ # operation output interface marker or operation call end marker
607+ if ((operation_body_section [i ].find ("$OUT " ) == ConfigChecker .BASE_MARKER_POSITION ) and
608+ ((operation_body_section [i + 1 ].find ("$OUT " ) != ConfigChecker .BASE_MARKER_POSITION ) and
609+ (operation_body_section [i + 1 ].find ("$OPE -end" ) != ConfigChecker .BASE_MARKER_POSITION ))):
610+
611+ # record error
612+ ErrorHandler .record_error (ErrorHandler .CHK_ERR_FAULTY_BODY , operation_body_start_index + i + 2 , "" )
613+
571614 # Description:
572615 # This method checks correctness of module end section in the configuration file.
573616 @staticmethod
0 commit comments