Home | History | Annotate | Download | only in geshi
      1 <?php
      2 /*************************************************************************************
      3  * cobol.php
      4  * ----------
      5  * Author: BenBE (BenBE (at) omorphia.org)
      6  * Copyright: (c) 2007-2008 BenBE (http://www.omorphia.de/)
      7  * Release Version: 1.0.8.3
      8  * Date Started: 2007/07/02
      9  *
     10  * COBOL language file for GeSHi.
     11  *
     12  * CHANGES
     13  * -------
     14  *
     15  * TODO (updated 2007/07/02)
     16  * -------------------------
     17  *
     18  *************************************************************************************
     19  *
     20  *     This file is part of GeSHi.
     21  *
     22  *   GeSHi is free software; you can redistribute it and/or modify
     23  *   it under the terms of the GNU General Public License as published by
     24  *   the Free Software Foundation; either version 2 of the License, or
     25  *   (at your option) any later version.
     26  *
     27  *   GeSHi is distributed in the hope that it will be useful,
     28  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
     29  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     30  *   GNU General Public License for more details.
     31  *
     32  *   You should have received a copy of the GNU General Public License
     33  *   along with GeSHi; if not, write to the Free Software
     34  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
     35  *
     36  ************************************************************************************/
     37 
     38 $language_data = array (
     39     'LANG_NAME' => 'COBOL',
     40     'COMMENT_SINGLE' => array(),
     41     'COMMENT_MULTI' => array(),
     42     'COMMENT_REGEXP' => array(1 => '/^\*.*?$/m'),
     43     'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
     44     'QUOTEMARKS' => array('"', "'"),
     45     'ESCAPE_CHAR' => '\\',
     46     'NUMBERS' =>
     47         GESHI_NUMBER_INT_BASIC |
     48         GESHI_NUMBER_FLT_NONSCI |
     49         GESHI_NUMBER_FLT_SCI_SHORT |
     50         GESHI_NUMBER_FLT_SCI_ZERO,
     51     'KEYWORDS' => array(
     52         1 => array( //Compiler Directives
     53             'ANSI', 'BLANK', 'NOBLANK', 'CALL-SHARED', 'CANCEL', 'NOCANCEL',
     54             'CHECK', 'CODE', 'NOCODE', 'COLUMNS', 'COMPACT', 'NOCOMPACT',
     55             'COMPILE', 'CONSULT', 'NOCONSULT', 'CROSSREF', 'NOCROSSREF',
     56             'DIAGNOSE-74', 'NODIAGNOSE-74', 'DIAGNOSE-85', 'NODIAGNOSE-85',
     57             'DIAGNOSEALL', 'NODIAGNOSEALL', 'ENDIF', 'ENDUNIT', 'ENV',
     58             'ERRORFILE', 'ERRORS', 'FIPS', 'NOFIPS', 'FMAP', 'HEADING', 'HEAP',
     59             'HIGHPIN', 'HIGHREQUESTERS', 'ICODE', 'NOICODE', 'IF', 'IFNOT',
     60             'INNERLIST', 'NOINNERLIST', 'INSPECT', 'NOINSPECT', 'LARGEDATA',
     61             'LD', 'LESS-CODE', 'LIBRARY', 'LINES', 'LIST', 'NOLIST', 'LMAP',
     62             'NOLMAP', 'MAIN', 'MAP', 'NOMAP', 'NLD', 'NONSTOP', 'NON-SHARED',
     63             'OPTIMIZE', 'PERFORM-TRACE', 'PORT', 'NOPORT', 'RESETTOG',
     64             'RUNNABLE', 'RUNNAMED', 'SAVE', 'SAVEABEND', 'NOSAVEABEND',
     65             'SEARCH', 'NOSEARCH', 'SECTION', 'SETTOG', 'SHARED', 'SHOWCOPY',
     66             'NOSHOWCOPY', 'SHOWFILE', 'NOSHOWFILE', 'SOURCE', 'SQL', 'NOSQL',
     67             'SQLMEM', 'SUBSET', 'SUBTYPE', 'SUPPRESS', 'NOSUPPRESS', 'SYMBOLS',
     68             'NOSYMBOLS', 'SYNTAX', 'TANDEM', 'TRAP2', 'NOTRAP2', 'TRAP2-74',
     69             'NOTRAP2-74', 'UL', 'WARN', 'NOWARN'
     70             ),
     71         2 => array( //Statement Keywords
     72             'ACCEPT', 'ADD', 'TO', 'GIVING', 'CORRESPONDING', 'ALTER', 'CALL',
     73             'CHECKPOINT', 'CLOSE', 'COMPUTE', 'CONTINUE', 'COPY',
     74             'DELETE', 'DISPLAY', 'DIVIDE', 'INTO', 'REMAINDER', 'ENTER',
     75             'COBOL', 'EVALUATE', 'EXIT', 'GO', 'INITIALIZE',
     76             'TALLYING', 'REPLACING', 'CONVERTING', 'LOCKFILE', 'MERGE', 'MOVE',
     77             'MULTIPLY', 'OPEN', 'PERFORM', 'TIMES',
     78             'UNTIL', 'VARYING', 'RETURN',
     79             ),
     80         3 => array( //Reserved in some contexts
     81             'ACCESS', 'ADDRESS', 'ADVANCING', 'AFTER', 'ALL',
     82             'ALPHABET', 'ALPHABETIC', 'ALPHABETIC-LOWER', 'ALPHABETIC-UPPER',
     83             'ALPHANUMERIC', 'ALPHANUMERIC-EDITED', 'ALSO', 'ALTERNATE',
     84             'AND', 'ANY', 'APPROXIMATE', 'AREA', 'AREAS', 'ASCENDING', 'ASSIGN',
     85             'AT', 'AUTHOR', 'BEFORE', 'BINARY', 'BLOCK', 'BOTTOM', 'BY',
     86             'CD', 'CF', 'CH', 'CHARACTER', 'CHARACTERS',
     87             'CHARACTER-SET', 'CLASS', 'CLOCK-UNITS',
     88             'CODE-SET', 'COLLATING', 'COLUMN', 'COMMA',
     89             'COMMON', 'COMMUNICATION', 'COMP', 'COMP-3', 'COMP-5',
     90             'COMPUTATIONAL', 'COMPUTATIONAL-3', 'COMPUTATIONAL-5',
     91             'CONFIGURATION', 'CONTAINS', 'CONTENT', 'CONTROL',
     92             'CONTROLS', 'CORR', 'COUNT',
     93             'CURRENCY', 'DATA', 'DATE', 'DATE-COMPILED', 'DATE-WRITTEN', 'DAY',
     94             'DAY-OF-WEEK', 'DE', 'DEBUG-CONTENTS', 'DEBUG-ITEM', 'DEBUG-LINE',
     95             'DEBUG-SUB-2', 'DEBUG-SUB-3', 'DEBUGGING', 'DECIMAL-POINT',
     96             'DECLARATIVES', 'DEBUG-NAME', 'DEBUG-SUB-1', 'DELIMITED',
     97             'DELIMITER', 'DEPENDING', 'DESCENDING', 'DESTINATION', 'DETAIL',
     98             'DISABLE', 'DIVISION', 'DOWN', 'DUPLICATES',
     99             'DYNAMIC', 'EGI', 'ELSE', 'EMI', 'ENABLE', 'END', 'END-ADD',
    100             'END-COMPUTE', 'END-DELETE', 'END-DIVIDE', 'END-EVALUATE', 'END-IF',
    101             'END-MULTIPLY', 'END-OF-PAGE', 'END-PERFORM', 'END-READ',
    102             'END-RECEIVE', 'END-RETURN', 'END-REWRITE', 'END-SEARCH',
    103             'END-START', 'END-STRING', 'END-SUBTRACT', 'END-UNSTRING',
    104             'END-WRITE', 'EOP', 'EQUAL', 'ERROR', 'ESI',
    105             'EVERY', 'EXCEPTION', 'EXCLUSIVE', 'EXTEND',
    106             'EXTENDED-STORAGE', 'EXTERNAL', 'FALSE', 'FD', 'FILE',
    107             'FILE-CONTROL', 'FILLER', 'FINAL', 'FIRST', 'FOOTING', 'FOR',
    108             'FROM', 'FUNCTION', 'GENERATE', 'GENERIC', 'GLOBAL',
    109             'GREATER', 'GROUP', 'GUARDIAN-ERR', 'HIGH-VALUE',
    110             'HIGH-VALUES', 'I-O', 'I-O-CONTROL', 'IDENTIFICATION', 'IN',
    111             'INDEX', 'INDEXED', 'INDICATE', 'INITIAL', 'INITIATE',
    112             'INPUT', 'INPUT-OUTPUT', 'INSTALLATION',
    113             'INVALID', 'IS', 'JUST', 'JUSTIFIED', 'KEY', 'LABEL', 'LAST',
    114             'LEADING', 'LEFT', 'LESS', 'LIMIT', 'LIMITS', 'LINAGE',
    115             'LINAGE-COUNTER', 'LINE', 'LINE-COUNTER', 'LINKAGE', 'LOCK',
    116             'LOW-VALUE', 'LOW-VALUES', 'MEMORY', 'MESSAGE',
    117             'MODE', 'MODULES', 'MULTIPLE', 'NATIVE',
    118             'NEGATIVE', 'NEXT', 'NO', 'NOT', 'NULL', 'NULLS', 'NUMBER',
    119             'NUMERIC', 'NUMERIC-EDITED', 'OBJECT-COMPUTER', 'OCCURS', 'OF',
    120             'OFF', 'OMITTED', 'ON', 'OPTIONAL', 'OR', 'ORDER',
    121             'ORGANIZATION', 'OTHER', 'OUTPUT', 'OVERFLOW', 'PACKED-DECIMAL',
    122             'PADDING', 'PAGE', 'PAGE-COUNTER', 'PF', 'PH', 'PIC',
    123             'PICTURE', 'PLUS', 'POINTER', 'POSITION', 'POSITIVE', 'PRINTING',
    124             'PROCEDURE', 'PROCEDURES', 'PROCEED', 'PROGRAM', 'PROGRAM-ID',
    125             'PROGRAM-STATUS', 'PROGRAM-STATUS-1', 'PROGRAM-STATUS-2', 'PROMPT',
    126             'PROTECTED', 'PURGE', 'QUEUE', 'QUOTE', 'QUOTES', 'RD',
    127             'RECEIVE', 'RECEIVE-CONTROL', 'RECORD', 'RECORDS',
    128             'REDEFINES', 'REEL', 'REFERENCE', 'REFERENCES', 'RELATIVE',
    129             'REMOVAL', 'RENAMES', 'REPLACE',
    130             'REPLY', 'REPORT', 'REPORTING', 'REPORTS', 'RERUN',
    131             'RESERVE', 'RESET', 'REVERSED', 'REWIND', 'REWRITE', 'RF',
    132             'RH', 'RIGHT', 'ROUNDED', 'RUN', 'SAME', 'SD',
    133             'SECURITY', 'SEGMENT', 'SEGMENT-LIMIT', 'SELECT', 'SEND',
    134             'SENTENCE', 'SEPARATE', 'SEQUENCE', 'SEQUENTIAL', 'SET',
    135             'SIGN', 'SIZE', 'SORT', 'SORT-MERGE', 'SOURCE-COMPUTER',
    136             'SPACE', 'SPACES', 'SPECIAL-NAMES', 'STANDARD', 'STANDARD-1',
    137             'STANDARD-2', 'START', 'STARTBACKUP', 'STATUS', 'STOP', 'STRING',
    138             'SUB-QUEUE-1', 'SUB-QUEUE-2', 'SUB-QUEUE-3', 'SUBTRACT',
    139             'SYMBOLIC', 'SYNC', 'SYNCDEPTH', 'SYNCHRONIZED',
    140             'TABLE', 'TAL', 'TAPE', 'TERMINAL', 'TERMINATE', 'TEST',
    141             'TEXT', 'THAN', 'THEN', 'THROUGH', 'THRU', 'TIME',
    142             'TOP', 'TRAILING', 'TRUE', 'TYPE', 'UNIT', 'UNLOCK', 'UNLOCKFILE',
    143             'UNLOCKRECORD', 'UNSTRING', 'UP', 'UPON', 'USAGE', 'USE',
    144             'USING', 'VALUE', 'VALUES', 'WHEN', 'WITH', 'WORDS',
    145             'WORKING-STORAGE', 'WRITE', 'ZERO', 'ZEROES'
    146             ),
    147         4 => array( //Standard functions
    148             'ACOS', 'ANNUITY', 'ASIN', 'ATAN', 'CHAR', 'COS', 'CURRENT-DATE',
    149             'DATE-OF-INTEGER', 'DAY-OF-INTEGER', 'FACTORIAL', 'INTEGER',
    150             'INTEGER-OF-DATE', 'INTEGER-OF-DAY', 'INTEGER-PART', 'LENGTH',
    151             'LOG', 'LOG10', 'LOWER-CASE', 'MAX', 'MEAN', 'MEDIAN', 'MIDRANGE',
    152             'MIN', 'MOD', 'NUMVAL', 'NUMVAL-C', 'ORD', 'ORD-MAX', 'ORD-MIN',
    153             'PRESENT-VALUE', 'RANDOM', 'RANGE', 'REM', 'REVERSE', 'SIN', 'SQRT',
    154             'STANDARD-DEVIATION', 'SUM', 'TAN', 'UPPER-CASE', 'VARIANCE',
    155             'WHEN-COMPILED'
    156             ),
    157         5 => array( //Privileged Built-in Functions
    158             '#IN', '#OUT', '#TERM', '#TEMP', '#DYNAMIC', 'COBOL85^ARMTRAP',
    159             'COBOL85^COMPLETION', 'COBOL_COMPLETION_', 'COBOL_CONTROL_',
    160             'COBOL_GETENV_', 'COBOL_PUTENV_', 'COBOL85^RETURN^SORT^ERRORS',
    161             'COBOL_RETURN_SORT_ERRORS_', 'COBOL85^REWIND^SEQUENTIAL',
    162             'COBOL_REWIND_SEQUENTIAL_', 'COBOL85^SET^SORT^PARAM^TEXT',
    163             'COBOL_SET_SORT_PARAM_TEXT_', 'COBOL85^SET^SORT^PARAM^VALUE',
    164             'COBOL_SET_SORT_PARAM_VALUE_', 'COBOL_SET_MAX_RECORD_',
    165             'COBOL_SETMODE_', 'COBOL85^SPECIAL^OPEN', 'COBOL_SPECIAL_OPEN_',
    166             'COBOLASSIGN', 'COBOL_ASSIGN_', 'COBOLFILEINFO', 'COBOL_FILE_INFO_',
    167             'COBOLSPOOLOPEN', 'CREATEPROCESS', 'ALTERPARAMTEXT',
    168             'CHECKLOGICALNAME', 'CHECKMESSAGE', 'DELETEASSIGN', 'DELETEPARAM',
    169             'DELETESTARTUP', 'GETASSIGNTEXT', 'GETASSIGNVALUE', 'GETBACKUPCPU',
    170             'GETPARAMTEXT', 'GETSTARTUPTEXT', 'PUTASSIGNTEXT', 'PUTASSIGNVALUE',
    171             'PUTPARAMTEXT', 'PUTSTARTUPTEXT'
    172             )
    173         ),
    174     'SYMBOLS' => array(
    175         //Avoid having - in identifiers marked as symbols
    176         ' + ', ' - ', ' * ', ' / ', ' ** ',
    177         '.', ',',
    178         '=',
    179         '(', ')', '[', ']'
    180         ),
    181     'CASE_SENSITIVE' => array(
    182         GESHI_COMMENTS => false,
    183         1 => false,
    184         2 => false,
    185         3 => false,
    186         4 => false,
    187         5 => false
    188         ),
    189     'STYLES' => array(
    190         'KEYWORDS' => array(
    191             1 => 'color: #000080; font-weight: bold;',
    192             2 => 'color: #000000; font-weight: bold;',
    193             3 => 'color: #008000; font-weight: bold;',
    194             4 => 'color: #000080;',
    195             5 => 'color: #008000;',
    196             ),
    197         'COMMENTS' => array(
    198             1 => 'color: #a0a0a0; font-style: italic;',
    199             'MULTI' => 'color: #a0a0a0; font-style: italic;'
    200             ),
    201         'ESCAPE_CHAR' => array(
    202             0 => 'color: #000099; font-weight: bold;'
    203             ),
    204         'BRACKETS' => array(
    205             0 => 'color: #339933;'
    206             ),
    207         'STRINGS' => array(
    208             0 => 'color: #ff0000;'
    209             ),
    210         'NUMBERS' => array(
    211             0 => 'color: #993399;'
    212             ),
    213         'METHODS' => array(
    214             1 => 'color: #202020;'
    215             ),
    216         'SYMBOLS' => array(
    217             0 => 'color: #000066;'
    218             ),
    219         'REGEXPS' => array(
    220             ),
    221         'SCRIPT' => array(
    222             )
    223         ),
    224     'URLS' => array(
    225         1 => '',
    226         2 => '',
    227         3 => '',
    228         4 => '',
    229         5 => ''
    230         ),
    231     'OOLANG' => false,
    232     'OBJECT_SPLITTERS' => array(
    233         ),
    234     'REGEXPS' => array(
    235         ),
    236     'STRICT_MODE_APPLIES' => GESHI_NEVER,
    237     'SCRIPT_DELIMITERS' => array(
    238         ),
    239     'HIGHLIGHT_STRICT_BLOCK' => array(
    240         ),
    241     'TAB_WIDTH' => 4
    242     );
    243 
    244 ?>
    245