Giter VIP home page Giter VIP logo

jclparser's Introduction

Synopsis

This project enables z/OS developers to parse JCL and to then walk the parse tree. The default build creates a jcl2jcl program that can be used to just generate JCL from JCL. This is meant for testing and understanding of the code. A real use case would be to walk the parse trees to do some sort of analysis.

The altsrc and alttest and alttestsrc directories are historical and were used for testing the parser was working well. I am changing over to now just generate JCL from JCL so that I can 'diff' the output.

Code Example

Here is an example of jcl2jcl being used to parse orig.jcl and print it out.

jcl2jcl --input=testsrc/commented.jcl

The code works on z/OS or off. It has been tested on z/OS and on MacOS using clang.

Motivation

I am not a big fan of JCL, even though I have worked on z/OS forever. I also try to use Unix System Services as much as possible to develop software. jcl2jcl generates JCL from JCL - which can be handy if you want to 'normalize' or 'clean up' JCL.

Installation

To install jcl2jcl:

  • copy the files to z/OS Unix System Services directory. For this example, we assume it is /u/ibmuser/JCLParser
  • cd to the directory (/u/ibmuser/JCLParser)
  • install CMake, Ninja, GNU Make, clang if you haven't already and use the provided CMake code.
  • Alternately, just compile all the C code in src and link it.
  • The resultant program should be called jcl2jcl to use the sample parser.

Building on z/OS

  • Use z/OS Open Tools to download cmake, ninja, gnu make, and install clang.
  • export CLANG_ROOT to the root directory where you installed the clang compiler.
  • Generate build files if first build:
cd JCLParser
mkdir build
cd build
export CC=${CLANG_ROOT}/usr/lpp/IBM/oelcpp/v2r0/bin/clang
export CXX=${CLANG_ROOT}/usr/lpp/IBM/oelcpp/v2r0/bin/clang++ 
cmake ../
  • Re-build code:
cmake --build .

This will create a jcl2jcl binary in your build directory

Building on MacOS

  • Tailor the files in the .vscode directory to suit your needs.
  • cd /u/ibmuser/JCLParser
  • mkdir build
  • cd build
  • cmake ..
  • cmake --build .

API Reference

To get started reading the code, begin in jcl2jcl.c, which has main and drives all the functions in the other files.

Tests

Basic regression testing can be done after building jcl2jcl with:

  • cd tests
  • ./regression.sh

There should be no output. As bugs fixed, files with a filetype of skipjcl should be renamed to jcl to get included in regression testing.

Work to be done

The parser is complete as far as I know. Bug reports welcome. Providing interesting tools with the parser is TBD.

Contributors

Mike Fulton (IBM Canada) is the sole contributor at this point. I am happy to change this :)

The code still needs work. Error messages can (always) be improved and there are missing features people may need. If anyone wants to contribute, please reach out to [email protected] (Mike Fulton)

License

The code uses the Apache license

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.