com.ibm.lpex.cobol
Class CobolWords

java.lang.Object
  |
  +--com.ibm.lpex.cobol.CobolWords

public final class CobolWords
extends java.lang.Object

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


Inner Class Summary
static class CobolWords.Word
          This class is used to combine a word with an id.
 
Field Summary
static int AUTHOR
           
static int CBL
           
static int CONTROL
           
static int DATE
           
static int DATE_COMPILED
           
static int DATE_WRITTEN
           
static int DIVISION
           
static int EJECT
           
static int FORMAT
           
static int FUNCTION
           
static int INSTALLATION
           
static int IS
           
static int LAST_ID
           
static int PICTURE
           
static int PROGRAM_ID
           
static int SECTION
           
static int SECURITY
           
static int SKIP
           
static int TITLE
           
 
Constructor Summary
CobolWords()
           
 
Method Summary
static int compare(java.lang.Object object, java.lang.StringBuffer stringBuffer)
          Compare object to stringBuffer.
static boolean equals(java.lang.String word, java.lang.StringBuffer stringBuffer)
          Compare word to stringBuffer.
static CobolWords.Word findDirective(java.lang.StringBuffer stringBuffer)
          Determine if the specified string is a directive.
static CobolWords.Word findReservedWord(java.lang.StringBuffer stringBuffer)
          Determine if the specified string is a reserved word.
static java.lang.Object findWord(java.lang.Object[] _words, java.lang.StringBuffer word)
          Perform a binary search for the specified word in an array of words.
static boolean isControlOption(java.lang.StringBuffer stringBuffer)
          Determine if the specified string is a valid option for the *CONTROL (*CBL) directive.
static boolean isDateFormat(java.lang.StringBuffer stringBuffer)
          Determine if the specified string is a date format.
static boolean isFunctionName(java.lang.StringBuffer stringBuffer)
          Determine if the specified string is a function name.
 
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

DATE

public static final int DATE

DATE_COMPILED

public static final int DATE_COMPILED

DATE_WRITTEN

public static final int DATE_WRITTEN

DIVISION

public static final int DIVISION

FORMAT

public static final int FORMAT

FUNCTION

public static final int FUNCTION

INSTALLATION

public static final int INSTALLATION

IS

public static final int IS

PICTURE

public static final int PICTURE

PROGRAM_ID

public static final int PROGRAM_ID

SECTION

public static final int SECTION

SECURITY

public static final int SECURITY

CBL

public static final int CBL

CONTROL

public static final int CONTROL

EJECT

public static final int EJECT

SKIP

public static final int SKIP

TITLE

public static final int TITLE

LAST_ID

public static final int LAST_ID
Constructor Detail

CobolWords

public CobolWords()
Method Detail

findReservedWord

public static CobolWords.Word findReservedWord(java.lang.StringBuffer stringBuffer)
Determine if the specified string is a reserved word.

isFunctionName

public static boolean isFunctionName(java.lang.StringBuffer stringBuffer)
Determine if the specified string is a function name.

isDateFormat

public static boolean isDateFormat(java.lang.StringBuffer stringBuffer)
Determine if the specified string is a date format.

findDirective

public static CobolWords.Word findDirective(java.lang.StringBuffer stringBuffer)
Determine if the specified string is a directive.

isControlOption

public static boolean isControlOption(java.lang.StringBuffer stringBuffer)
Determine if the specified string is a valid option for the *CONTROL (*CBL) directive.

findWord

public static java.lang.Object findWord(java.lang.Object[] _words,
                                        java.lang.StringBuffer word)
Perform a binary search for the specified word in an array of words. 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.

compare

public static int compare(java.lang.Object object,
                          java.lang.StringBuffer stringBuffer)
Compare object to stringBuffer. The string value of object is assumed to be uppercase; stringBuffer may be in any case, as it is uppercased before the comparison is made.
Returns:
0 if the values are equal, or an integer > 0 if object is greater than stringBuffer, or an integer < 0 if object is less than stringBuffer

equals

public static boolean equals(java.lang.String word,
                             java.lang.StringBuffer stringBuffer)
Compare word to stringBuffer. The string value of word is assumed to be uppercase; stringBuffer may be in any case, as it is uppercased before the comparison is made.
Returns:
true if the values are equal, or false if the values are not equal