{ "info": { "author": "Denis Wallerich", "author_email": "denis.wallerich@datim.fr", "bugtrack_url": null, "classifiers": [ "Topic :: System :: Hardware :: Mainframes" ], "description": "=============================================\r\n Cobol IBM Mainframe syntax lexer for Pygments\r\n ============================================= \r\n **This package contains a Pygments Lexer for mainframe cobol.**\r\n \r\n **The lexer parses the Enterprise Cobol dialect (V3R4) for z/OS, including utilizing embedded Db2/Sql, Cics and DLi**\r\n\r\n .. _onlinePygmentsLexer: http://datim.fr/cobtools/pygments/ \r\n\r\n .. contents:: Contents\r\n :depth: 5\r\n \r\n mainframe cobol coding form\r\n ===========================\r\n Many early programming languages, including PL/1, Fortran, Cobol and the various IBM assembler languages,\r\n used only the first 7-72 columns of a 80-column card\r\n \r\n +----------+--------------------------------------------------------------------------+\r\n | Columns | |\r\n +==========+==========================================================================+\r\n | 1- 6 |Tags, Remarks or Sequence numbers identifying pages or lines of a program |\r\n +----------+--------------------------------------------------------------------------+\r\n | 7 | - ``*`` (asterisk) designates entire line as comment |\r\n | | - ``/`` (slash) forces page break when printing source listing |\r\n | | - ``-`` (dash) to indicate continuation of nonnumeric literal |\r\n | | - ``D`` to indicate debug line cobol statements |\r\n +----------+--------------------------------------------------------------------------+\r\n | 8 - 72 |COBOL program statements, divided into two areas : |\r\n | | - Area A : columns 8 to 11 |\r\n | | - Area B : columns 12 to 72 |\r\n +----------+--------------------------------------------------------------------------+\r\n | 73 - 80 | Tags, Remarks or Sequence numbers (often garbage...) |\r\n +----------+------------+-------------------------------------------------------------+\r\n \r\n Division, section and paragraph-names must all begin in Area A and end with a period.\r\n \r\n ``CBL/PROCESS`` directives statement can start in columns 1 through 70\r\n \r\n Installation\r\n ============ \r\n The lexer is available as a Pip package:\r\n \r\n ``$ sudo pip install pygments_ibm_cobol_lexer``\r\n \r\n Or using easy_install:\r\n \r\n ``$ sudo easy_install pygments_ibm_cobol_lexer``\r\n \r\n Usage\r\n ===== \r\n After installation the ibmcobol Lexer and ibmcobol Style automatically registers itself for files with the \".cbl\" extensions.\r\n \r\n Therefore, cmdline usage is easy:\r\n + Ascii input :\r\n \r\n ``pygmentize -O full,style=ibmcobol,encoding=latin1 -o HORREUR.html HORREUR.ascii.cbl``\r\n \r\n + Ebcdic input (in this case it's necessary to specify outencoding value): \r\n \r\n ``pygmentize -O full,style=ibmcobol,encoding=cp1147,outencoding=latin1 -o COB001.html COB001.cp1147.cbl``\r\n \r\n Or as library usage:\r\n \r\n ::\r\n \r\n from pygments import highlight\r\n from pygments.formatters import HtmlFormatter\r\n from pygments_ibm_cobol_lexer import IBMCOBOLLexer, IBMCOBOLStyle\r\n my_code = open(\"cobol_ebcdic.cbl\",'rb').read()\r\n highlight(my_code,IBMCOBOLLexer(encoding='cp1140'),\r\n \t HtmlFormatter(style=IBMCOBOLStyle, full=True),\r\n \t open('test.html','w'))\r\n \r\n Also see the ``pygments_tests/`` directory\r\n \r\n You can test this lexer online here: onlinePygmentsLexer_\r\n\r\n \r\n About cp1147\r\n ============\r\n I have files coded IBM1147 (EBCDIC french + euro sign), I was forced to write my own codec ``cp1147``, very close to the ``cp500`` (Canada, Belgium), it diverges on the characters \"@\\\u00b0{}\u00a7\u00f9\u00b5\u00a3\u00e0[\u20ac`\u00a8#]~\u00e9\u00e8\u00a6\u00e7\" :\r\n \r\n This codec is available as a Pip package:\r\n \r\n ``$ sudo pip install cp1147``\r\n \r\n Changelog\r\n =========\r\n 1.2 - (2013-11-25)\r\n - reordering variable,number,operator regex in cics/dli/sql\r\n - Tokenize cobol special-register\r\n - codec module cp1147 removed\r\n - change in DB2 and COBOL keywords \r\n - if encoding is in ('cp037','cp297','cp1140','cp1047','cp1147','cp500'), it's managed as 'latin-1' \r\n \r\n 1.1 - (2012-11-19)\r\n Minor Fix + EBCDIC enhancements:\r\n \r\n \t - Fix : float regex detection before integer detection\r\n - Add inline-commentaire ``*>`` (not the IBM default)\r\n - Change cics/dli keywords color...\r\n - Extend CICS_KEYWORDS, remove EJECT/SKIP from COBOL_KEYWORDS (treated as comments)\r\n - each ASCII input lines is padded to 80 columns\r\n - Add EBCDIC features:\r\n \r\n * add my own french codec cp1147\r\n * if EBCDIC encoding is passed (cp500,cp1140,...) or detected,convert the binary input raw text in 80 columns fixed lines\r\n * ``encoding=chardet`` (slowly) does not detect EBCDIC chart,it's override with ``encoding=guess`` \r\n * \"guess EBCDIC\" is defaulted to ``self.encoding='cp500'``\r\n \r\n 1.0 - (2012-11-12) \r\n Initial release.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://www.datim.fr", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "pygments-ibm-cobol-lexer", "package_url": "https://pypi.org/project/pygments-ibm-cobol-lexer/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pygments-ibm-cobol-lexer/", "project_urls": { "Homepage": "http://www.datim.fr" }, "release_url": "https://pypi.org/project/pygments-ibm-cobol-lexer/1.2/", "requires_dist": null, "requires_python": null, "summary": "Cobol IBM Mainframe syntax lexer for Pygments", "version": "1.2" }, "last_serial": 1151089, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "7fd1a3f273e7b4fb9a732e131539ff25", "sha256": "8e9698cbb81449047c42800bf0f0bfe475baccfb0d0fb2e9ecef6271c167741b" }, "downloads": -1, "filename": "pygments_ibm_cobol_lexer-1.0-py2.7.egg", "has_sig": false, "md5_digest": "7fd1a3f273e7b4fb9a732e131539ff25", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 42374, "upload_time": "2012-11-15T03:15:27", "url": "https://files.pythonhosted.org/packages/b2/22/7743a53e218f6fadd5b233737271a51e00f47f70e68679ccd3af4000342d/pygments_ibm_cobol_lexer-1.0-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "c743a867edc8071fa63dc2126a966e8c", "sha256": "7b6da4230d2ac9d194ec587edd0123c1145b24e5caaf1c68a20281e071c643bc" }, "downloads": -1, "filename": "pygments_ibm_cobol_lexer-1.0.tar.gz", "has_sig": false, "md5_digest": "c743a867edc8071fa63dc2126a966e8c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10391, "upload_time": "2012-11-14T01:34:21", "url": "https://files.pythonhosted.org/packages/4a/b6/280e50ba943b8a872b55d862ca443e724844498e7f336095fd341664e4e7/pygments_ibm_cobol_lexer-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "32cb006b17fc12718a500bdbdb66926c", "sha256": "3b8e42e4073eed145ba35aff7cc0f3a806e0b0874f111e2e4b1d5c2ff48632f9" }, "downloads": -1, "filename": "pygments_ibm_cobol_lexer-1.1-py2.7.egg", "has_sig": false, "md5_digest": "32cb006b17fc12718a500bdbdb66926c", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 31992, "upload_time": "2012-11-20T18:03:06", "url": "https://files.pythonhosted.org/packages/71/aa/d6b90f182b1b0c1217cb19c0f13e7c0f40d4cd7cead238adeb33f4ab2fef/pygments_ibm_cobol_lexer-1.1-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "6372eeadf4e69ff8b7b8dd48df9a09ba", "sha256": "14eaae59c8b24e84d519737adf78dbfdad92583257b5e642ecbcc0083906e169" }, "downloads": -1, "filename": "pygments_ibm_cobol_lexer-1.1.tar.gz", "has_sig": false, "md5_digest": "6372eeadf4e69ff8b7b8dd48df9a09ba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 78189, "upload_time": "2012-11-20T18:02:42", "url": "https://files.pythonhosted.org/packages/70/bb/bd2ca9a10a02b1759836c3536f2dde9f50bbab31577123ccf07833a74996/pygments_ibm_cobol_lexer-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "d1bdc9e544e4986f3f214e6da4413701", "sha256": "f84b236d812126fe15fbb2a6d8a5acda7e4cc0cfbbb267a478ece6588e1385ec" }, "downloads": -1, "filename": "pygments_ibm_cobol_lexer-1.2.tar.gz", "has_sig": false, "md5_digest": "d1bdc9e544e4986f3f214e6da4413701", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 78792, "upload_time": "2013-11-25T18:35:22", "url": "https://files.pythonhosted.org/packages/f7/b9/1973103f672c7379caf668dd972ab4ebf40821273ecb69ec02128dd5aac6/pygments_ibm_cobol_lexer-1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d1bdc9e544e4986f3f214e6da4413701", "sha256": "f84b236d812126fe15fbb2a6d8a5acda7e4cc0cfbbb267a478ece6588e1385ec" }, "downloads": -1, "filename": "pygments_ibm_cobol_lexer-1.2.tar.gz", "has_sig": false, "md5_digest": "d1bdc9e544e4986f3f214e6da4413701", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 78792, "upload_time": "2013-11-25T18:35:22", "url": "https://files.pythonhosted.org/packages/f7/b9/1973103f672c7379caf668dd972ab4ebf40821273ecb69ec02128dd5aac6/pygments_ibm_cobol_lexer-1.2.tar.gz" } ] }