Skip to content

Fix cics inquire #2604

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Dec 20, 2024
Merged

Conversation

chacebot
Copy link
Contributor

Special Notes

Compiler options - CICS translator option designation

Need to have this specified for use with INQUIRE system programming commands. This can be done by adding this line directly above the IDENTIFICATION DIVISION. of your code:
CBL CICS ("SP")

Browsing

About half of the INQUIRE system programming commands enable the CICS browsing function. Where you can iterate over the resources using START END NEXT and sometimes AT keywords. More details on this are explained here. However this documentation does not fully cover the intricacies of how the compiler enforces this behavior. Some of the unit tests identify the edge cases.

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Unit Tests
  • Compiler Verification

Checklist:

  • Each of my commits contains one meaningful change
  • I have performed rebase of my branch on top of the development
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have checked my code and corrected any misspellings

@chacebot
Copy link
Contributor Author

@slavek-kucera
Copy link
Contributor

Could you please

  • undo the damage to copyright headers
  • reorganize the PR, so that formatting changes are separated from functional ones
    ?

@chacebot
Copy link
Contributor Author

Could you please

  • undo the damage to copyright headers
  • reorganize the PR, so that formatting changes are separated from functional ones
    ?

Let me know if the latest commit does not address your suggestion.

compilerOpts
: (XOPTS LPARENCHAR compilerXOptsOption (commaClause? compilerXOptsOption)* RPARENCHAR) | cicsOptions;

cicsOptions: CICS LPARENCHAR NONNUMERICLITERAL RPARENCHAR;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not accept the simple (with the CBL prefix)

       CBL CICS(SP)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the compiler I get when i omit quotes as you suggest:

0Invocation parameters:
  OPTFILE
0PROCESS(CBL) statements:
  CBL CICS(SP)                                                     0032120

         IGYOS4066-E   The "CICS" suboptions string was invalid.  The suboptions string was discarded.

0Options from SYSOPTF:
  CICS                                                                   00320900```

Comment on lines 963 to 966
checkBrowseMutuallyExclusive(atomserviceContext);
if (!atomserviceContext.START().isEmpty() || !atomserviceContext.END().isEmpty()) {
checkBrowsingInvalidOptions(atomserviceContext, CICSParser.ATOMSERVICE);
checkBrowsingHasNotParameter(atomserviceContext, CICSParser.ATOMSERVICE);
} else checkStatementHasParameter(atomserviceContext, CICSParser.ATOMSERVICE);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to handle this check via a common code path? Maybe another map that contains the details needed to execute the check?
Only the CICSParser.ATOMSERVICE part seems variable - maybe another map ruleindex->token?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be a great redundancy consolidation. However since it is dependent on the logic above evaluating to false we would still need to call this check in every case like this in the switch statement. Unless you can think of a better high level implementation that can handle the logic above i.e.

if(not START or END) {..}
else checkHasParameter

in a generic way that can be called agnostic of the context then I am all ears. But this is tricky since these commands have different requirements within if(not START or END) {..}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The checkBrowseMutuallyExclusive almost implements the check.

@chacebot chacebot force-pushed the fix-cics-inquire branch 2 times, most recently from 87ab1f3 to 73dee01 Compare December 11, 2024 16:38
update: added parser and lexer deps for inquire association sp

update: added association list

update: added parser rule for inquire atom service

update: added INQUIRE sp parser rules for autinstmodel autoinstall and brfacility

update: add cics sp inquire commands

commit: sorted and merged latest state of CICS correct tokens

chore: comment out test for code change in progress

update: language keywords

update: autocomplete keywords for inquire sp

update: populated missing Language.txt words from CICS lexer and enforced order

update lexer and parser keywords

update: add parser options and rules for inquire

fix: lexer tokens

fix: lexer

fix: lexer and autocomplete list

update: add missing lexer token and further cleanup

update: add new inquire system commands to parser

update: add cfdtpool and db2conn inquire cics parser rules

update: add cics system commands db2tran and db2entry

update: added in inquire cics sp statements

update: add sp cics doctemplate and dsname parser rules

update: add cics sp inquire parser rules for dumpds and enq

update: add inquire sp epadapter and enqmodel parser rules

updaaet: adin in inquire cics sp parser rules

update: add inquire cics sp parser rules

update: add more cics sp parser rules and grammar
…r rules

update: finish new additions to parser and lexer for cics inquire sp

chore: fix incorrect parser rule syntax

update: implement inquire sp options check utility start

update: established route for SP options checking

chore: fix broken unit test and checkstyle errors

update: added transaction inquire parser validation and started refactor of sp parser rules for main keyword first

update: added inquire tests and update parser rules for mandatory positional first options

update: started parser validation for cics inquire sp

update: start on parser implementation for BROWSE functionality

update: added in more browse capability for inquire sp

update: changed compiler options for translator selection from xopts to cics

update: change cics compiler options to match documentation string type

update: add logic to enforce option parens

update: change compiler options area to enforce literal values

update: inquire cics sp for browse functionality

update: added in validation for browsing rules

update: improve parser rule validation for browse

update: add in browse checks with test

update: add in more browse statement parser validation

update: variable keywords

update: added parser rule validations for cics inquire sp

update: added parser rule validation for exitprogram

update: validate inquire featurekey

update: refactored check mutually exclusive for browsing and added validation for AT browsing

update: merge lexer words from rebase

fix: changes from merge conflicts

chore: repair old unit test

fix: remove vs code settings change

chore: remove dev comments

fix: invalid option check and add test

chore: fix formatting and copyright

chore: revert modified copyright

chore: clean up formatting for cleaner PR

chore: revert more formatting changes

chore: revert formatting changes

chore: revert formatting changes
updating changes from rebase

update: feedback from pr

chore: update kct

chore: fix formatting
@slavek-kucera slavek-kucera merged commit 2b97c07 into eclipse-che4z:development Dec 20, 2024
18 checks passed
ap891843 pushed a commit that referenced this pull request Mar 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants