LPEX
3.6.5

com.ibm.lpex.cobol
Class CobolWords

java.lang.Object
  extended by com.ibm.lpex.cobol.CobolWords

public final class CobolWords
extends Object

Keywords and keyword-related functions for the COBOL document parsers.


Nested Class Summary
static class CobolWords.Word
          This class is used to combine a keyword String with an id int.
 
Field Summary
static int AUTHOR
          COBOL reserved word id.
static int CBL
          COBOL reserved word id.
static int CONTROL
          COBOL reserved word id.
static int DATE
          COBOL reserved word id.
static int DATE_COMPILED
          COBOL reserved word id.
static int DATE_WRITTEN
          COBOL reserved word id.
static int DIVISION
          COBOL reserved word id.
static int EJECT
          COBOL reserved word id.
static int FORMAT
          COBOL reserved word id.
static int FUNCTION
          COBOL reserved word id.
static int INSTALLATION
          COBOL reserved word id.
static int IS
          COBOL reserved word id.
static int LAST_ID
          COBOL reserved word id.
static int PICTURE
          COBOL reserved word id.
static int PROGRAM_ID
          COBOL reserved word id.
static int SECTION
          COBOL reserved word id.
static int SECURITY
          COBOL reserved word id.
static int SKIP
          COBOL reserved word id.
static int TITLE
          COBOL reserved word id.
 
Method Summary
static String[] controlOptions()
          Returns an array of the control options defined in here.
static String[] dateFormats()
          Returns an array of the date formats defined in here.
static String[] directives()
          Returns an array of the directives defined in here.
static CobolWords.Word findDirective(StringBuffer stringBuffer)
          Returns whether the specified string is a directive (compiler-directing statement keyword).
static CobolWords.Word findReservedWord(StringBuffer stringBuffer)
          Returns whether the specified string is a reserved word.
static Object findWord(Object[] _words, StringBuffer word)
          Performs a binary search for the specified word in an array of Words or Strings.
static String[] functionNames()
          Returns an array of the function names defined in here.
static boolean isControlOption(StringBuffer stringBuffer)
          Returns whether the specified string is a valid option for the *CONTROL (*CBL) directive.
static boolean isDateFormat(StringBuffer stringBuffer)
          Returns whether the specified string is a date format.
static boolean isFunctionName(StringBuffer stringBuffer)
          Returns whether the specified string is a function name.
static String[] listWords(Object[] _words)
          Utility method to return an array of all the strings in an array of Words or Strings.
static String[] reservedWords()
          Returns an array of the reserved words defined in here.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AUTHOR

public static final int AUTHOR
COBOL reserved word id.

See Also:
Constant Field Values

DATE

public static final int DATE
COBOL reserved word id.

See Also:
Constant Field Values

DATE_COMPILED

public static final int DATE_COMPILED
COBOL reserved word id.

See Also:
Constant Field Values

DATE_WRITTEN

public static final int DATE_WRITTEN
COBOL reserved word id.

See Also:
Constant Field Values

DIVISION

public static final int DIVISION
COBOL reserved word id.

See Also:
Constant Field Values

FORMAT

public static final int FORMAT
COBOL reserved word id.

See Also:
Constant Field Values

FUNCTION

public static final int FUNCTION
COBOL reserved word id.

See Also:
Constant Field Values

INSTALLATION

public static final int INSTALLATION
COBOL reserved word id.

See Also:
Constant Field Values

IS

public static final int IS
COBOL reserved word id.

See Also:
Constant Field Values

PICTURE

public static final int PICTURE
COBOL reserved word id.

See Also:
Constant Field Values

PROGRAM_ID

public static final int PROGRAM_ID
COBOL reserved word id.

See Also:
Constant Field Values

SECTION

public static final int SECTION
COBOL reserved word id.

See Also:
Constant Field Values

SECURITY

public static final int SECURITY
COBOL reserved word id.

See Also:
Constant Field Values

CBL

public static final int CBL
COBOL reserved word id.

See Also:
Constant Field Values

CONTROL

public static final int CONTROL
COBOL reserved word id.

See Also:
Constant Field Values

EJECT

public static final int EJECT
COBOL reserved word id.

See Also:
Constant Field Values

SKIP

public static final int SKIP
COBOL reserved word id.

See Also:
Constant Field Values

TITLE

public static final int TITLE
COBOL reserved word id.

See Also:
Constant Field Values

LAST_ID

public static final int LAST_ID
COBOL reserved word id.

See Also:
Constant Field Values
Method Detail

findReservedWord

public static CobolWords.Word findReservedWord(StringBuffer stringBuffer)
Returns whether the specified string is a reserved word.


reservedWords

public static String[] reservedWords()
Returns an array of the reserved words defined in here.


isFunctionName

public static boolean isFunctionName(StringBuffer stringBuffer)
Returns whether the specified string is a function name.


functionNames

public static String[] functionNames()
Returns an array of the function names defined in here.


isDateFormat

public static boolean isDateFormat(StringBuffer stringBuffer)
Returns whether the specified string is a date format.


dateFormats

public static String[] dateFormats()
Returns an array of the date formats defined in here.


findDirective

public static CobolWords.Word findDirective(StringBuffer stringBuffer)
Returns whether the specified string is a directive (compiler-directing statement keyword).


directives

public static String[] directives()
Returns an array of the directives defined in here.


isControlOption

public static boolean isControlOption(StringBuffer stringBuffer)
Returns whether the specified string is a valid option for the *CONTROL (*CBL) directive.


controlOptions

public static String[] controlOptions()
Returns an array of the control options defined in here.


listWords

public static String[] listWords(Object[] _words)
Utility method to return an array of all the strings in an array of Words or Strings.


findWord

public static Object findWord(Object[] _words,
                              StringBuffer word)
Performs a binary search for the specified word in an array of Words or Strings. Returns the word if found, otherwise returns null. The array of words is assumed to be sorted and uppercase. The search word may be any case, but will match case insensitively.


LPEX
3.6.5

Copyright © 2012 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.