com.ibm.lpex.cobol
Class CobolParser

java.lang.Object
  |
  +--com.ibm.lpex.core.LpexCommonParser
        |
        +--com.ibm.lpex.cobol.CobolParser
All Implemented Interfaces:
LpexConstants, LpexParser
Direct Known Subclasses:
Cobol400Parser, CobolSqlCicsParser, ILECobolParser

public class CobolParser
extends LpexCommonParser

Document parser for COBOL.

Actions added by this tokenizer: comments, divisions, areaA, preprocessor for selective views of the document: comments, divisions, a logical outline, embedded SQL/CICS.


Inner Class Summary
 class CobolParser.ParseElement
          The ParseElement class contains cached information about a document element.
 class CobolParser.TokenFragment
          A TokenFragment contains information about part of a token.
 
Field Summary
protected  long _classAll
          Bitmask for element class used by this parser.
protected  long _classAreaA
          Bitmask for element class used by this parser.
protected  long _classAreaB
          Bitmask for element class used by this parser.
protected  long _classBackwardLink
          Bitmask for element class used by this parser.
protected  long _classBlank
          Bitmask for element class used by this parser.
protected  long _classCics
          Bitmask for element class used by this parser.
protected  long _classComment
          Bitmask for element class used by this parser.
protected  long _classDirective
          Bitmask for element class used by this parser.
protected  long _classDivision
          Bitmask for element class used by this parser.
protected  long _classError
          Bitmask for element class used by this parser.
protected  long _classForwardLink
          Bitmask for element class used by this parser.
protected  long _classPreprocessor
          Bitmask for element class used by this parser.
protected  long _classSection
          Bitmask for element class used by this parser.
protected  long _classSql
          Bitmask for element class used by this parser.
protected  int _currentBytePosition
          The current byte position of the current character (ZERO-based).
protected  int _currentCharacterPosition
          The current character position of the current character (ZERO-based).
protected  int _currentElement
          The current element being parsed.
protected  boolean _currentElementCompleted
          Indicates that the current line has bee parsed to the end.
protected  boolean _dbcsUserDefinedWord
          If the current token is a user defined word then this indicates if it is a DBCS user defined word.
protected  int _decimalLength
          If the current token is a numeric literal then this indicates the number of digits after the decimal.
protected  boolean _directiveError
          Indicates that the current directive is in error.
protected  int _directiveStartBytePosition
          The character position of the start of the directive token.
protected  int _directiveTokenStartBytePosition
          The byte position of the start of the directive token.
protected  java.lang.StringBuffer _directiveTokenText
          The current directive token.
protected  int _endElement
          The last element in the current parse range.
protected  int _exponentLength
          If the current token is a numeric literal then this indicates the number of digits in the exponent.
protected  CobolParser.TokenFragment _firstTokenFragment
          A reference to the first token fragment of a multiline token.
protected  CobolParser.ParseElement _freeParseElements
          A reference to the first ParseElement in a list of unused ParseElements.
protected  boolean _inNonnumericLiteral
          Indicates that the current token character is within a nonnumeric literal.
protected  int _integerLength
          If the current token is a numeric literal then this indicates the number of digits before the decimal.
protected  CobolParser.TokenFragment _lastTokenFragment
          A reference to the last token fragment of a multiline token.
protected  int _multiTokenStartElement
          This contains the starting element of a group of tokens that must be parsed together.
protected  char _nonnumericLiteralDelimiter
          If the current token is a nonnumeric literal then this indicates the delimiter.
protected  boolean _nonnumericLiteralHasClosingDelimiter
          If the current token is a nonnumeric literal then this indicates if the closing delimiter was found.
protected  boolean _nonnumericLiteralHasDBCS
          If the current token is a nonnumeric literal then this indicates if a DBCS character was found.
protected  boolean _nonnumericLiteralHasNonbinary
          If the current token is a nonnumeric literal then this indicates if a non binary (0 or 1) character was found.
protected  boolean _nonnumericLiteralHasNonhexadecimal
          If the current token is a nonnumeric literal then this indicates if a non hexadecimal character was found.
protected  boolean _nonnumericLiteralHasSBCS
          If the current token is a nonnumeric literal then this indicates if a SBCS character was found.
protected  int _nonnumericLiteralLength
          If the current token is a nonnumeric literal then this indicates the length.
protected  char _nonnumericLiteralType
          If the current token is a nonnumeric literal then this indicates the type.
protected  CobolParser.ParseElement _parseElements
          A reference to the first ParseElement in a list of active ParseElements.
protected  int _parseMode
          The current parse mode.
protected  int _previousCharacterWidth
          The width of the previous character.
protected  CobolWords.Word _reservedWord
          If the current token is a reserved word then this contains a reference to that word.
protected  char _saveTokenCharacter
          The saved character.
protected  int _saveTokenCharacterBytePosition
          The byte position of the saved character.
protected  int _saveTokenCharacterElement
          The element number of the saved character.
protected  int _saveTokenCharacterPosition
          The character position of the saved character.
protected  boolean _saveTokenCharacterValid
          Indicates that the saved character is valid.
protected  int _startElement
          The first element in the current parse range.
protected  boolean _tokenHasDelimiter
          Indicates that the current token has at least quote or apostrophe.
protected  java.lang.StringBuffer _tokenText
          The current token.
static java.lang.String CLASS_AREAA
          Element class used by this parser.
static java.lang.String CLASS_AREAB
          Element class used by this parser.
static java.lang.String CLASS_BLANK
          Element class used by this parser.
static java.lang.String CLASS_BWDLINK
          Element class used by this parser.
static java.lang.String CLASS_CICS
          Element class used by this parser.
static java.lang.String CLASS_COMMENT
          Element class used by this parser.
static java.lang.String CLASS_DIRECTIVE
          Element class used by this parser.
static java.lang.String CLASS_DIVISION
          Element class used by this parser.
static java.lang.String CLASS_ERROR
          Element class used by this parser.
static java.lang.String CLASS_FWDLINK
          Element class used by this parser.
static java.lang.String CLASS_PREPROCESSOR
          Element class used by this parser.
static java.lang.String CLASS_SECTION
          Element class used by this parser.
static java.lang.String CLASS_SQL
          Element class used by this parser.
protected static int PARSE_MODE_CODE
          Normal parse mode.
protected static int PARSE_MODE_COMMENT_ENTRY
          The parser is in the middle of a comment entry in one of the identification divisions optional paragraphs.
protected static int PARSE_MODE_DATE
          The reserved word "DATE" has been detected.
protected static int PARSE_MODE_DATE_FORMAT
          "DATE FORMAT" has been detected.
protected static int PARSE_MODE_DATE_FORMAT_IS
          "DATE FORMAT IS" has been detected.
protected static int PARSE_MODE_FUNCTION
          The reserved word "FUNCTION" has been detected.
protected static int PARSE_MODE_LAST
          The last parse mode value used.
protected static int PARSE_MODE_OPTIONAL_ID_PARAGRAPH
          One of the identification division optional paragraph reserved words has been detected.
protected static int PARSE_MODE_PICTURE
          Either "PIC" or PICTURE has been detected.
protected static int PARSE_MODE_PICTURE_IS
          Either "PIC IS" or "PICTURE IS" has been detected.
protected static int PARSE_MODE_PREPROCESSOR
          The parser has found the word "EXEC".
protected static int PARSE_MODE_PSEUDO_TEXT
          An opening pseudo-text delimiter has been detected.
 
Fields inherited from class com.ibm.lpex.core.LpexCommonParser
ATTRIBUTES_COMMENT, ATTRIBUTES_DEFAULT, ATTRIBUTES_DIRECTIVE, ATTRIBUTES_ERROR, ATTRIBUTES_KEYWORD, ATTRIBUTES_LIBRARY, ATTRIBUTES_NONSOURCE, ATTRIBUTES_NUMERAL, ATTRIBUTES_STRING, BACKGROUND_COLOR, CLASS_MESSAGE, LANGUAGE_CCPP, LANGUAGE_CICS, LANGUAGE_CL, LANGUAGE_COBOL, LANGUAGE_DDS, LANGUAGE_FORTRAN, LANGUAGE_HLASM, LANGUAGE_HTML, LANGUAGE_JAVA, LANGUAGE_JCL, LANGUAGE_PLI, LANGUAGE_REXX, LANGUAGE_RPG, LANGUAGE_SQL, LANGUAGE_XMI, LANGUAGE_XML, LANGUAGE_XSL, LEXER_RC_END, LEXER_RC_EOF, LEXER_RC_MORE, LEXER_RC_OK, PROTOKEY_EMPTY, STYLE_MESSAGE, view
 
Fields inherited from interface com.ibm.lpex.core.LpexConstants
ACTION_APPEND_TO_ACTION_ARGUMENT, ACTION_BACK_SPACE, ACTION_BLOCK_COPY, ACTION_BLOCK_DELETE, ACTION_BLOCK_FILL, ACTION_BLOCK_LOWER_CASE, ACTION_BLOCK_MARK_ALL, ACTION_BLOCK_MARK_BOTTOM, ACTION_BLOCK_MARK_CHARACTER, ACTION_BLOCK_MARK_DOWN, ACTION_BLOCK_MARK_ELEMENT, ACTION_BLOCK_MARK_ELEMENT_AT_MOUSE, ACTION_BLOCK_MARK_END, ACTION_BLOCK_MARK_HOME, ACTION_BLOCK_MARK_LEFT, ACTION_BLOCK_MARK_NEXT_WORD, ACTION_BLOCK_MARK_PAGE_DOWN, ACTION_BLOCK_MARK_PAGE_LEFT, ACTION_BLOCK_MARK_PAGE_RIGHT, ACTION_BLOCK_MARK_PAGE_UP, ACTION_BLOCK_MARK_PREV_WORD, ACTION_BLOCK_MARK_RECTANGLE, ACTION_BLOCK_MARK_RECTANGLE_AT_MOUSE, ACTION_BLOCK_MARK_RIGHT, ACTION_BLOCK_MARK_TO_MOUSE, ACTION_BLOCK_MARK_TOP, ACTION_BLOCK_MARK_UP, ACTION_BLOCK_MARK_WORD, ACTION_BLOCK_MARK_WORD_AT_MOUSE, ACTION_BLOCK_MOVE, ACTION_BLOCK_OVERLAY, ACTION_BLOCK_SHIFT_LEFT, ACTION_BLOCK_SHIFT_RIGHT, ACTION_BLOCK_UNMARK, ACTION_BLOCK_UPPER_CASE, ACTION_BOTTOM, ACTION_CAPITALIZE_WORD, ACTION_CLEAR_PREFIX, ACTION_COMMAND_LINE, ACTION_COMPARE, ACTION_COMPARE_CLEAR, ACTION_COMPARE_NEXT, ACTION_COMPARE_PREVIOUS, ACTION_COMPARE_REFRESH, ACTION_COPY, ACTION_CURSOR_TO_MOUSE, ACTION_CUT, ACTION_DELETE, ACTION_DELETE_BLANK_LINES, ACTION_DELETE_LINE, ACTION_DELETE_NEXT_WORD, ACTION_DELETE_PREV_WORD, ACTION_DELETE_TO_LINE_START, ACTION_DELETE_WHITE_SPACE, ACTION_DOWN, ACTION_DUPLICATE_LINE, ACTION_ECLIPSE_COPY, ACTION_ECLIPSE_CUT, ACTION_ECLIPSE_DELETE, ACTION_ECLIPSE_PASTE, ACTION_ECLIPSE_PREFIX, ACTION_ECLIPSE_PRINT, ACTION_ECLIPSE_REDO, ACTION_ECLIPSE_SELECT_ALL, ACTION_ECLIPSE_SHIFT_LEFT, ACTION_ECLIPSE_SHIFT_RIGHT, ACTION_ECLIPSE_STRIP_PREFIX, ACTION_ECLIPSE_UNDO, ACTION_END, ACTION_EXEC_COMMAND, ACTION_EXPAND_HIDE_AT_MOUSE, ACTION_FILTER_SELECTION, ACTION_FIND, ACTION_FIND_AND_REPLACE, ACTION_FIND_AND_REPLACE_NEXT, ACTION_FIND_AND_REPLACE_UP, ACTION_FIND_BLOCK_END, ACTION_FIND_BLOCK_START, ACTION_FIND_LAST_CHANGE, ACTION_FIND_MARK, ACTION_FIND_NEXT, ACTION_FIND_QUICK_MARK, ACTION_FIND_SELECTION, ACTION_FIND_UP, ACTION_GET, ACTION_HELP, ACTION_HEX_EDIT_LINE, ACTION_HOME, ACTION_INSERT_FILE_NAME, ACTION_INSERT_LEFT_BRACE, ACTION_INSERT_NOT, ACTION_INSERT_RIGHT_BRACE, ACTION_INSERT_TAB, ACTION_INSERT_TO_TAB, ACTION_INVALID, ACTION_JOIN, ACTION_KEY_RECORDER_PLAY, ACTION_KEY_RECORDER_START, ACTION_KEY_RECORDER_STOP, ACTION_KILL_LINE, ACTION_KILL_REGION, ACTION_LEFT, ACTION_LOCATE_LINE, ACTION_LOWER_CASE_REGION, ACTION_LOWER_CASE_WORD, ACTION_NAME_MARK, ACTION_NEW_LINE, ACTION_NEXT_TAB_STOP, ACTION_NEXT_WORD, ACTION_NULL_ACTION, ACTION_ONE_SPACE, ACTION_OPEN_LINE, ACTION_PAGE_DOWN, ACTION_PAGE_LEFT, ACTION_PAGE_RIGHT, ACTION_PAGE_UP, ACTION_PASTE, ACTION_POPUP_AT_CURSOR, ACTION_POPUP_AT_MOUSE, ACTION_PREFERENCES, ACTION_PREFIX_BACK_SPACE, ACTION_PREFIX_DELETE, ACTION_PREFIX_END, ACTION_PREFIX_HOME, ACTION_PREFIX_LEFT, ACTION_PREFIX_RIGHT, ACTION_PREFIX_TRUNCATE, ACTION_PREV_TAB_STOP, ACTION_PREV_WORD, ACTION_PRINT, ACTION_PROCESS_PREFIX, ACTION_REDO, ACTION_RELOAD, ACTION_RENAME, ACTION_RIGHT, ACTION_SAVE, ACTION_SAVE_AS, ACTION_SAVE_TO_WRITER, ACTION_SCROLL_BOTTOM, ACTION_SCROLL_CENTER, ACTION_SCROLL_TOP, ACTION_SET_ACTION_ARGUMENT, ACTION_SET_PARSER, ACTION_SET_QUICK_MARK, ACTION_SET_QUICK_MARK_ALL, ACTION_SET_QUICK_MARK_WORD, ACTION_SHOW_ALL, ACTION_SPLIT, ACTION_SPLIT_AND_SHIFT, ACTION_SPLIT_LINE, ACTION_TEXT_WINDOW, ACTION_TOGGLE_CASE_SENSITIVE, ACTION_TOGGLE_INSERT, ACTION_TOGGLE_KEY_RECORDING, ACTION_TOGGLE_REGULAR_EXPRESSION, ACTION_TOP, ACTION_TRANSPOSE_CHARACTERS, ACTION_TRANSPOSE_LINES, ACTION_TRANSPOSE_WORDS, ACTION_TRUNCATE, ACTION_UNDO, ACTION_UP, ACTION_UPPER_CASE_REGION, ACTION_UPPER_CASE_WORD, ACTION_USER, ACTION_WINDOW_BOTTOM, ACTION_WINDOW_TOP, ACTION_WORD_END, ACTION_WORD_START, ACTION_YANK, ACTION_YANK_PREVIOUS, BLOCK_PARAMETER_BOTTOM_ELEMENT, BLOCK_PARAMETER_BOTTOM_POSITION, BLOCK_PARAMETER_DEFAULT_TYPE, BLOCK_PARAMETER_ELEMENT_TEXT, BLOCK_PARAMETER_IN_VIEW, BLOCK_PARAMETER_TEXT, BLOCK_PARAMETER_TOP_ELEMENT, BLOCK_PARAMETER_TOP_POSITION, BLOCK_PARAMETER_TYPE, COMPARE_PARAMETER_IGNOREALLBLANKS, COMPARE_PARAMETER_IGNORECASE, COMPARE_PARAMETER_IGNORELEADINGBLANKS, COMPARE_PARAMETER_IGNORETRAILINGBLANKS, FIND_TEXT_PARAMETER_ASIS, FIND_TEXT_PARAMETER_BLOCK, FIND_TEXT_PARAMETER_COLUMNS, FIND_TEXT_PARAMETER_EMPHASIS, FIND_TEXT_PARAMETER_END_COLUMN, FIND_TEXT_PARAMETER_FIND_TEXT, FIND_TEXT_PARAMETER_MARK, FIND_TEXT_PARAMETER_REGULAR_EXPRESSION, FIND_TEXT_PARAMETER_REPLACE_TEXT, FIND_TEXT_PARAMETER_START_COLUMN, FIND_TEXT_PARAMETER_WRAP, HELP_BLOCK_PANEL, HELP_CCPP, HELP_COBOL, HELP_COMMAND_MAP, HELP_COMPARE_PANEL, HELP_CONTROLS_PANEL, HELP_DEFAULT_PROPERTIES_FILE, HELP_FINDTEXT_PANEL, HELP_FONT_PANEL, HELP_HEXEDITLINE_DIALOG, HELP_HLASM, HELP_JAVA, HELP_JCL, HELP_PALETTE_PANEL, HELP_PARAMETER_CONFIGURATION, HELP_PARAMETER_HOMEPAGE, HELP_PARAMETER_LOCATION, HELP_PARSERASSOCIATIONS_PANEL, HELP_PARSERS_PANEL, HELP_PLI, HELP_POPUP_PANEL, HELP_PREFERENCE_PANELS, HELP_PRINT_PANEL, HELP_PRINTFONT_PANEL, HELP_ROOT_PANEL, HELP_SAVE_PANEL, HELP_SEQUENCENUMBERS_PANEL, HELP_SQL, HELP_TABS_PANEL, HELP_USERACTIONS_PANEL, HELP_USERCOMMANDS_PANEL, HELP_USERKEYACTIONS_PANEL, HELP_USERMOUSEACTIONS_PANEL, HELP_USERPROFILE_PANEL, HELP_VIEWPARSER_PANEL, HELP_VIEWROOT_PANEL, HELP_VIEWSAVE_PANEL, HELP_VIEWSEQUENCENUMBERS_PANEL, HELP_VIEWSOURCEENCODING_PANEL, LPEX_VERSION, MSG_ACTION_ALT, MSG_ACTION_CONTROL, MSG_ACTION_INCOMPLETE, MSG_ACTION_INVALID, MSG_ACTION_KEYACTIONSINVALID, MSG_ACTION_KEYINVALID, MSG_ACTION_META, MSG_ACTION_MOUSEACTIONSINVALID, MSG_ACTION_MOUSEEVENTINVALID, MSG_ACTION_SHIFT, MSG_ACTION_USERACTIONSINVALID, MSG_CLASS_INVALID, MSG_CLASS_NOTFOUND, MSG_CLASSNAME_INVALID, MSG_COMMAND_INCOMPLETE, MSG_COMMAND_INTEGERMISSING, MSG_COMMAND_INVALID, MSG_COMMAND_INVALID_QUOTED_PARAMETER, MSG_COMMAND_INVALIDPARAMETER, MSG_COMMAND_NOPARAMETERS, MSG_COMMAND_USER_COMMANDS_INVALID, MSG_COMMANDLINE_ALL, MSG_COMMANDLINE_CASE_SENSITIVE, MSG_COMMANDLINE_END_COLUMN, MSG_COMMANDLINE_FILE_NAME, MSG_COMMANDLINE_FILL_CHARACTER, MSG_COMMANDLINE_FIND, MSG_COMMANDLINE_FIND_MARK, MSG_COMMANDLINE_LINE_NUMBER, MSG_COMMANDLINE_NAME_MARK, MSG_COMMANDLINE_NEXT, MSG_COMMANDLINE_PREV, MSG_COMMANDLINE_REGULAR_EXPRESSION, MSG_COMMANDLINE_REPLACE, MSG_COMMANDLINE_REPLACE_ALL, MSG_COMMANDLINE_REPLACE_NEXT, MSG_COMMANDLINE_RESTRICT_SEARCH_TO_COLUMNS, MSG_COMMANDLINE_RESTRICT_SEARCH_TO_SELECTION, MSG_COMMANDLINE_SELECT_FOUND_TEXT, MSG_COMMANDLINE_SEQUENCE_NUMBER, MSG_COMMANDLINE_SET_PARSER, MSG_COMMANDLINE_START_COLUMN, MSG_COMMANDLINE_WRAP, MSG_COMPARE_FILENOTFOUND, MSG_COMPARE_MISMATCHES, MSG_COMPARE_NOMISMATCHES, MSG_COMPARE_NOMOREMISMATCHES, MSG_ENCODING_INVALID, MSG_FILE_CREATED, MSG_FILE_ERROR_READING, MSG_FILE_ERROR_WRITING, MSG_FILE_NOT_FOUND, MSG_FILE_SAVE_NONAME, MSG_FILE_SAVE_TRUNCATION, MSG_FILEDIALOG_COMPARE, MSG_FILEDIALOG_GET, MSG_FILEDIALOG_SAVEAS, MSG_FINDTEXTCOMMAND_COLUMNSMISSING, MSG_FINDTEXTCOMMAND_INVALIDPATTERN, MSG_FINDTEXTCOMMAND_NOFINDTEXT, MSG_FINDTEXTCOMMAND_NOTFOUND, MSG_FINDTEXTCOMMAND_ONLYOCCURRENCE, MSG_FINDTEXTCOMMAND_WRAPPED, MSG_HELP_ERROR, MSG_HELP_OPEN, MSG_LOCATECOMMAND_ELEMENTNOTFOUND, MSG_LOCATECOMMAND_LINENOTFOUND, MSG_LOCATECOMMAND_MARKNOTFOUND, MSG_LOCATECOMMAND_NOSEQUENCETEXT, MSG_LOCATECOMMAND_SEQUENCENUMBERNOTFOUND, MSG_LOCATECOMMAND_SEQUENCETEXTNOTFOUND, MSG_MARK_1_LINE_EXCLUDED, MSG_MARK_N_LINES_EXCLUDED, MSG_MARK_QUICK_MARK_SET, MSG_POPUP_BLOCKCOPY, MSG_POPUP_BLOCKDELETE, MSG_POPUP_BLOCKMARKALL, MSG_POPUP_BLOCKMARKCHARACTER, MSG_POPUP_BLOCKMARKLINE, MSG_POPUP_BLOCKMARKRECTANGLE, MSG_POPUP_BLOCKMOVE, MSG_POPUP_BLOCKOVERLAY, MSG_POPUP_BLOCKUNMARK, MSG_POPUP_COPY, MSG_POPUP_CUT, MSG_POPUP_ERRORS, MSG_POPUP_FILTERSELECTION, MSG_POPUP_FILTERVIEW, MSG_POPUP_FINDSELECTION, MSG_POPUP_PASTE, MSG_POPUP_SHOWALL, MSG_PREFERENCES_APPEARANCE_DESCRIPTION, MSG_PREFERENCES_APPEARANCE_TITLE, MSG_PREFERENCES_APPLY, MSG_PREFERENCES_BLOCK_DEFAULT_TYPE, MSG_PREFERENCES_BLOCK_DESCRIPTION, MSG_PREFERENCES_BLOCK_TITLE, MSG_PREFERENCES_CANCEL, MSG_PREFERENCES_CHANGE, MSG_PREFERENCES_COMPARE_DESCRIPTION, MSG_PREFERENCES_COMPARE_IGNOREALLBLANKS, MSG_PREFERENCES_COMPARE_IGNORECASE, MSG_PREFERENCES_COMPARE_IGNORELEADINGBLANKS, MSG_PREFERENCES_COMPARE_IGNORETRAILINGBLANKS, MSG_PREFERENCES_COMPARE_TITLE, MSG_PREFERENCES_CONTROLS_COMMANDLINE, MSG_PREFERENCES_CONTROLS_DESCRIPTION, MSG_PREFERENCES_CONTROLS_EXPANDHIDE, MSG_PREFERENCES_CONTROLS_FORMATLINE, MSG_PREFERENCES_CONTROLS_HIDESEQUENCENUMBERS, MSG_PREFERENCES_CONTROLS_MESSAGELINE, MSG_PREFERENCES_CONTROLS_PREFIXAREA, MSG_PREFERENCES_CONTROLS_STATUSLINE, MSG_PREFERENCES_CONTROLS_TITLE, MSG_PREFERENCES_DEFAULT, MSG_PREFERENCES_DELETE, MSG_PREFERENCES_FIND_TEXT_ASIS, MSG_PREFERENCES_FIND_TEXT_BLOCK, MSG_PREFERENCES_FIND_TEXT_COLUMNS, MSG_PREFERENCES_FIND_TEXT_DESCRIPTION, MSG_PREFERENCES_FIND_TEXT_EMPHASIS, MSG_PREFERENCES_FIND_TEXT_END_COLUMN, MSG_PREFERENCES_FIND_TEXT_FIND_TEXT, MSG_PREFERENCES_FIND_TEXT_MARK, MSG_PREFERENCES_FIND_TEXT_REGULAR_EXPRESSION, MSG_PREFERENCES_FIND_TEXT_REPLACE_TEXT, MSG_PREFERENCES_FIND_TEXT_START_COLUMN, MSG_PREFERENCES_FIND_TEXT_TITLE, MSG_PREFERENCES_FIND_TEXT_WRAP, MSG_PREFERENCES_FONT_BOLD, MSG_PREFERENCES_FONT_DESCRIPTION, MSG_PREFERENCES_FONT_ITALIC, MSG_PREFERENCES_FONT_NAME, MSG_PREFERENCES_FONT_SAMPLE, MSG_PREFERENCES_FONT_SIZE, MSG_PREFERENCES_FONT_STYLE, MSG_PREFERENCES_FONT_TITLE, MSG_PREFERENCES_HELP, MSG_PREFERENCES_INCORRECT_VALUE, MSG_PREFERENCES_OK, MSG_PREFERENCES_PALETTE_DESCRIPTION, MSG_PREFERENCES_PALETTE_PALETTE, MSG_PREFERENCES_PALETTE_TITLE, MSG_PREFERENCES_PARSER_ASSOCIATIONS_DESCRIPTION, MSG_PREFERENCES_PARSER_ASSOCIATIONS_EXTENSION, MSG_PREFERENCES_PARSER_ASSOCIATIONS_PARSER, MSG_PREFERENCES_PARSER_ASSOCIATIONS_TABLEEXTENSION, MSG_PREFERENCES_PARSER_ASSOCIATIONS_TABLEPARSER, MSG_PREFERENCES_PARSER_ASSOCIATIONS_TITLE, MSG_PREFERENCES_PARSERS_CLASSNAME, MSG_PREFERENCES_PARSERS_DESCRIPTION, MSG_PREFERENCES_PARSERS_NAME, MSG_PREFERENCES_PARSERS_TABLECLASSNAME, MSG_PREFERENCES_PARSERS_TABLENAME, MSG_PREFERENCES_PARSERS_TITLE, MSG_PREFERENCES_POPUP_ACTION, MSG_PREFERENCES_POPUP_ADD_AFTER, MSG_PREFERENCES_POPUP_ADD_AS_CHILD, MSG_PREFERENCES_POPUP_DESCRIPTION, MSG_PREFERENCES_POPUP_MENU_ITEM, MSG_PREFERENCES_POPUP_SEPARATOR, MSG_PREFERENCES_POPUP_SUBMENU, MSG_PREFERENCES_POPUP_TEXT, MSG_PREFERENCES_POPUP_TITLE, MSG_PREFERENCES_PRINT_BOTTOM_MARGIN, MSG_PREFERENCES_PRINT_DESCRIPTION, MSG_PREFERENCES_PRINT_FONT_DESCRIPTION, MSG_PREFERENCES_PRINT_FONT_SCREEN, MSG_PREFERENCES_PRINT_FONT_TITLE, MSG_PREFERENCES_PRINT_LEFT_MARGIN, MSG_PREFERENCES_PRINT_LINE_NUMBERS, MSG_PREFERENCES_PRINT_RIGHT_MARGIN, MSG_PREFERENCES_PRINT_TITLE, MSG_PREFERENCES_PRINT_TOKENIZED, MSG_PREFERENCES_PRINT_TOP_MARGIN, MSG_PREFERENCES_RESET, MSG_PREFERENCES_ROOT_DESCRIPTION, MSG_PREFERENCES_ROOT_EDITOR_PROFILE, MSG_PREFERENCES_ROOT_NO_PARSER, MSG_PREFERENCES_ROOT_TITLE, MSG_PREFERENCES_SAVE_DESCRIPTION, MSG_PREFERENCES_SAVE_TEXT_LIMIT, MSG_PREFERENCES_SAVE_TITLE, MSG_PREFERENCES_SAVE_TRIM, MSG_PREFERENCES_SEQUENCE_NUMBERS_COLUMN, MSG_PREFERENCES_SEQUENCE_NUMBERS_DESCRIPTION, MSG_PREFERENCES_SEQUENCE_NUMBERS_TITLE, MSG_PREFERENCES_SEQUENCE_NUMBERS_WIDTH, MSG_PREFERENCES_SEQUENCE_TEXT_COLUMN, MSG_PREFERENCES_SEQUENCE_TEXT_WIDTH, MSG_PREFERENCES_SET, MSG_PREFERENCES_TABS_DESCRIPTION, MSG_PREFERENCES_TABS_EXPAND_TABS, MSG_PREFERENCES_TABS_TAB_INCREMENT, MSG_PREFERENCES_TABS_TAB_STOPS, MSG_PREFERENCES_TABS_TITLE, MSG_PREFERENCES_TITLE, MSG_PREFERENCES_USER_ACTIONS_CLASS_NAME, MSG_PREFERENCES_USER_ACTIONS_DESCRIPTION, MSG_PREFERENCES_USER_ACTIONS_NAME, MSG_PREFERENCES_USER_ACTIONS_TABLE_CLASS_NAME, MSG_PREFERENCES_USER_ACTIONS_TABLE_NAME, MSG_PREFERENCES_USER_ACTIONS_TITLE, MSG_PREFERENCES_USER_COMMANDS_CLASS_NAME, MSG_PREFERENCES_USER_COMMANDS_DESCRIPTION, MSG_PREFERENCES_USER_COMMANDS_NAME, MSG_PREFERENCES_USER_COMMANDS_TABLE_CLASS_NAME, MSG_PREFERENCES_USER_COMMANDS_TABLE_NAME, MSG_PREFERENCES_USER_COMMANDS_TITLE, MSG_PREFERENCES_USER_KEY_ACTIONS_ACTION, MSG_PREFERENCES_USER_KEY_ACTIONS_DESCRIPTION, MSG_PREFERENCES_USER_KEY_ACTIONS_KEY, MSG_PREFERENCES_USER_KEY_ACTIONS_TABLE_ACTION, MSG_PREFERENCES_USER_KEY_ACTIONS_TABLE_KEY, MSG_PREFERENCES_USER_KEY_ACTIONS_TITLE, MSG_PREFERENCES_USER_MOUSE_ACTIONS_ACTION, MSG_PREFERENCES_USER_MOUSE_ACTIONS_DESCRIPTION, MSG_PREFERENCES_USER_MOUSE_ACTIONS_MOUSE_EVENT, MSG_PREFERENCES_USER_MOUSE_ACTIONS_TABLE_ACTION, MSG_PREFERENCES_USER_MOUSE_ACTIONS_TABLE_MOUSE_EVENT, MSG_PREFERENCES_USER_MOUSE_ACTIONS_TITLE, MSG_PREFERENCES_USER_PROFILE_CLASS_NAME, MSG_PREFERENCES_USER_PROFILE_DESCRIPTION, MSG_PREFERENCES_USER_PROFILE_TITLE, MSG_PREFERENCES_VIEW_PARSER_DESCRIPTION, MSG_PREFERENCES_VIEW_PARSER_PARSER, MSG_PREFERENCES_VIEW_PARSER_TITLE, MSG_PREFERENCES_VIEW_ROOT_DESCRIPTION, MSG_PREFERENCES_VIEW_ROOT_NAME, MSG_PREFERENCES_VIEW_SOURCE_ENCODING_DESCRIPTION, MSG_PREFERENCES_VIEW_SOURCE_ENCODING_SOURCE_ENCODING, MSG_PREFERENCES_VIEW_SOURCE_ENCODING_TITLE, MSG_PRINTCOMMAND_FONTMISSING, MSG_REDO_1CHANGEUNDONE, MSG_REDO_ALLCHANGESREDONE, MSG_REDO_NCHANGESUNDONE, MSG_REDO_NOREDOABLECHANGES, MSG_RESEQUENCECOMMAND_OVERFLOW, MSG_SEQUENCENUMBERS_OUTOFORDER, MSG_SEQUENCENUMBERS_OVERFLOW, MSG_SEQUENCENUMBERS_RESEQUENCED, MSG_SEQUENCENUMBERS_SHOWELEMENT, MSG_SEQUENCENUMBERS_TOOBIG, MSG_STATUS_1CHANGE, MSG_STATUS_BROWSE, MSG_STATUS_COLUMN, MSG_STATUS_COMMAND, MSG_STATUS_INSERT, MSG_STATUS_NCHANGES, MSG_STATUS_REPLACE, MSG_STATUS_ROW, MSG_TEXTLIMIT_OVERFLOW, MSG_UNDO_1CHANGEUNDONE, MSG_UNDO_DOCUMENTATORIGINALSTATE, MSG_UNDO_NCHANGESUNDONE, MSG_UNDO_NOMORECHANGES, MSG_UNDO_NORECORDEDCHANGES, MSG_UNTITLED_DOCUMENT, MSG_USERPROFILE_INVALID, MSG_VI_EDITUNSAVEDCHANGES, MSG_VI_QUITUNSAVEDCHANGES, PARAMETER_ACTION_ARGUMENT, PARAMETER_ACTION_CLASS, PARAMETER_ACTION_KEY, PARAMETER_ACTION_KEY_TEXT, PARAMETER_ACTION_REPEAT, PARAMETER_ACTIONS, PARAMETER_AUTO_CHECK, PARAMETER_BASE_PROFILE, PARAMETER_BEEP, PARAMETER_BLOCK, PARAMETER_CHANGES, PARAMETER_CLASS, PARAMETER_CLASSES, PARAMETER_COMMAND_CLASS, PARAMETER_COMMAND_LINE, PARAMETER_COMMANDS, PARAMETER_COMPARE, PARAMETER_CURRENT, PARAMETER_CURRENT_KEY, PARAMETER_CURSOR_BLINK, PARAMETER_CURSOR_ROW, PARAMETER_DEFAULT, PARAMETER_DEFAULT_PROFILE, PARAMETER_DIRTY, PARAMETER_DISPLAY_POSITION, PARAMETER_DOCUMENT_ID, PARAMETER_ELEMENT, PARAMETER_ELEMENT_CLASSES, PARAMETER_ELEMENTS, PARAMETER_EMPHASIS_LENGTH, PARAMETER_EXCLUDED_CLASSES, PARAMETER_EXPAND_HIDE, PARAMETER_EXPAND_HIDE_AREA_WIDTH, PARAMETER_EXPAND_TABS, PARAMETER_EXPANDED, PARAMETER_FIELDS, PARAMETER_FIND_TEXT, PARAMETER_FONT, PARAMETER_FORCE_ALL_VISIBLE, PARAMETER_FORCE_VISIBLE, PARAMETER_FORMAT_LINE, PARAMETER_FORMAT_LINE_TEXT, PARAMETER_HEADER_MARK, PARAMETER_HELP, PARAMETER_HEX, PARAMETER_HIDE_SEQUENCE_NUMBERS, PARAMETER_IN_PREFIX, PARAMETER_INCLUDED_CLASSES, PARAMETER_INSERT_MODE, PARAMETER_INSTALL, PARAMETER_INSTALL_PROFILE, PARAMETER_KEY_ACTION, PARAMETER_KEYS, PARAMETER_LENGTH, PARAMETER_LINE, PARAMETER_LINES, PARAMETER_MAINTAIN_SEQUENCE_NUMBERS, PARAMETER_MARK, PARAMETER_MARK_EXCLUDED, PARAMETER_MARK_EXCLUDED_HEADER, PARAMETER_MARK_HIGHLIGHT, PARAMETER_MARK_ID, PARAMETER_MARK_INCLUDED, PARAMETER_MARK_PROTECT, PARAMETER_MARK_STYLE, PARAMETER_MESSAGE_LINE, PARAMETER_MESSAGE_TEXT, PARAMETER_MOUSE_ACTION, PARAMETER_MOUSE_EVENTS, PARAMETER_NAME, PARAMETER_PALETTE, PARAMETER_PARSER, PARAMETER_PIXEL_POSITION, PARAMETER_POPUP, PARAMETER_POSITION, PARAMETER_PREFIX_AREA, PARAMETER_PREFIX_AREA_TEXT, PARAMETER_PREFIX_AREA_WIDTH, PARAMETER_PREFIX_POSITION, PARAMETER_PREFIX_PROTECT, PARAMETER_PREFIX_TEXT, PARAMETER_PRINT, PARAMETER_READONLY, PARAMETER_RECORDING, PARAMETER_REPEAT, PARAMETER_ROW_HEIGHT, PARAMETER_ROWS, PARAMETER_SAVE, PARAMETER_SCROLL, PARAMETER_SEQUENCE_DEFAULT_TEXT, PARAMETER_SEQUENCE_NUMBER, PARAMETER_SEQUENCE_NUMBERS, PARAMETER_SEQUENCE_NUMBERS_FORMAT, PARAMETER_SEQUENCE_TEXT, PARAMETER_SHIFT_IN_CHARACTER, PARAMETER_SHIFT_OUT_CHARACTER, PARAMETER_SHOW, PARAMETER_SHOW_SOSI, PARAMETER_SOURCE_ENCODING, PARAMETER_STATUS, PARAMETER_STATUS_LINE, PARAMETER_STYLE, PARAMETER_STYLE_ATTRIBUTES, PARAMETER_SYSTEM_PROPERTY, PARAMETER_TABS, PARAMETER_TEXT, PARAMETER_TEXT_AREA_WIDTH, PARAMETER_TEXT_WIDTH, PARAMETER_TOP_EXPANDED, PARAMETER_UPDATE_PROFILE, PARAMETER_USE_SOURCE_COLUMNS, PARAMETER_VERSION, PARAMETER_VISIBLE, PARSE_PENDING_CHANGE_MASK, PARSE_PENDING_NEXT_DELETED_MASK, PARSE_PENDING_NEXT_SHOW_DELETED_MASK, PARSE_PENDING_PREV_DELETED_MASK, PARSE_PENDING_PREV_SHOW_DELETED_MASK, PLATFORM_AWT, PLATFORM_SWT, PLATFORM_SWT_KEY, PRINT_PARAMETER_BOTTOM_MARGIN, PRINT_PARAMETER_FONT, PRINT_PARAMETER_LEFT_MARGIN, PRINT_PARAMETER_LINE_NUMBERS, PRINT_PARAMETER_RIGHT_MARGIN, PRINT_PARAMETER_TOKENIZED, PRINT_PARAMETER_TOP_MARGIN, SAVE_PARAMETER_TEXT_LIMIT, SAVE_PARAMETER_TRIM, STATUS_FILE_ERRORREADING, STATUS_FILE_NOTFOUND, STATUS_FINDTEXT_INVALIDPATTERN, STATUS_FINDTEXT_NOTFOUND, STATUS_FINDTEXT_ONLYOCCURRENCE, STATUS_FINDTEXT_READONLY, STATUS_FINDTEXT_WRAPPED, STATUS_LOCATE_NOSEQUENCETEXT, STATUS_LOCATE_NOTFOUND, STATUS_LOCATE_WRAPPED, STATUS_SAVE_CANCELLED, STATUS_SAVE_FAILED, UPDATE_PROFILE_PARAMETER_BASE_PROFILE, UPDATE_PROFILE_PARAMETER_EXTENSIONS, UPDATE_PROFILE_PARAMETER_NO_PARSER, UPDATE_PROFILE_PARAMETER_PALETTE, UPDATE_PROFILE_PARAMETER_PALETTE_ATTRIBUTES, UPDATE_PROFILE_PARAMETER_PALETTES, UPDATE_PROFILE_PARAMETER_PARSER, UPDATE_PROFILE_PARAMETER_PARSER_ASSOCIATION, UPDATE_PROFILE_PARAMETER_PARSER_CLASS, UPDATE_PROFILE_PARAMETER_PARSERS, UPDATE_PROFILE_PARAMETER_USER_ACTIONS, UPDATE_PROFILE_PARAMETER_USER_COMMANDS, UPDATE_PROFILE_PARAMETER_USER_KEY_ACTIONS, UPDATE_PROFILE_PARAMETER_USER_MOUSE_ACTIONS, UPDATE_PROFILE_PARAMETER_USER_PROFILE
 
Constructor Summary
CobolParser(LpexView lpexView)
          Constructor for the parser.
 
Method Summary
protected  void addErrorMessage(int element, java.lang.String message)
          Display an error message for an element.
protected  void addErrorMessage(int element, java.lang.String message, java.lang.String argument)
          Display an error message with an argument for an element.
protected  void completeCurrentElement()
          Complete the parsing of the current line.
protected  boolean continueParse()
          Return true if parsing should be continued (we are currently inside a COBOL construct).
protected  int evaluateBeginElement(int element)
          Evaluate a parse range for incremental parse from the specified element up to the top of the file.
protected  int evaluateEndElement(int element)
          Evaluate a parse range for incremental parse from the specified element to the bottom of the file.
protected  CobolWords.Word findDirective()
          Return directive word indicated by the current directive token.
protected  CobolParser.ParseElement findParseElement(int element)
          Find the active ParseElement for the specified element.
protected  void flushElements()
          Flush any of the cached elements with which we are finished.
protected  CicsLexer getCicsLexer(LpexCharStream stream)
          Retrieve the CicsLexer.
protected  boolean getDirectiveToken()
          Get the next directive token.
 java.lang.String getHelpPage()
          Retrieve the name of the COBOL help page that the parser identifies as appropriate for the currently selected token
 java.lang.String getLanguage()
          Returns "COBOL", the language supported by this parser.
 java.lang.String getLanguage(LpexDocumentLocation loc)
          Retrieve a string identifying the language segment at the specified location.
 java.lang.String getPopupViewItems()
          Return parser's items for the popup View submenu: comments, divisions, areaA, preprocessor statements.
 java.util.ResourceBundle getProfile()
          Return the parser's properties profile resource bundle.
protected  SqlLexer getSqlLexer(LpexCharStream stream)
          Retrieve the SqlLexer.
protected  boolean getToken()
          Get the next token.
protected  void initCurrentElement()
          Initialize the current element for parsing.
protected  void initializeParser()
          Initialize the parser for an LPEX document view: set up style attributes for the styles we need, classes, etc., and initialize the view for the language-sensitive edit features supported.
protected  boolean isCommaOrSemicolon()
          Return true if the current token is a comma or semicolon.
protected  boolean isDirectiveLine()
          Return true if the current line is a directive line.
protected  boolean isFunctionName()
          Return true if the current token is a function name.
protected  boolean isNonnumericLiteral()
          Return true if the current token is a nonnumeric literal.
protected  boolean isNumericLiteral()
          Return true if the current token is a numeric literal.
protected  boolean isPeriod()
          Return true if the current token is a period.
protected  boolean isPreprocessorStart()
          Return true if the current token is "EXEC".
protected  boolean isPseudoTextStart()
          Return true if the current token is an opening pseudo-text delimiter.
protected  boolean isReservedWord()
          Return true if the current token is a reserved word.
protected  boolean isSeparator()
          Return true if the current token is a separator.
protected  boolean isUserDefinedWord()
          Return true if the current token is a user-defined word.
protected  void linkElements(int startElement, int endElement)
          Link the specified elements together if necessary.
protected  int maxDigits()
          Return the maximum number of digits allowed in a nonnumeric literal.
protected  int maxExponent()
          Return the maximum number of digits allowed in the exponent of a floating-point literal.
protected  int maxMantissa()
          Return the maximum number of digits allowed in the mantissa of a floating-point literal.
protected  int maxPicture()
          Return the maximum number of characters allowed in the picture string.
protected  void nextCharacter()
          Advance to the next character in the current element.
protected  boolean nextTokenCharacter()
          Advance to the next token character.
protected  boolean nextTokenElement()
          Advance to the next token (non-show) element in the parse range.
protected  java.lang.String nonnumericLiteralTypes()
          Return a string indicating valid nonnumeric literal types.
protected  void parse()
          Perform the parse.
 void parseAll()
          Total parse of the entire document.
protected  void parseCodeToken()
          Parse the current code token.
protected  void parseCommentEntryToken()
          Parse the current comment entry token.
protected  void parseDateFormatIsToken()
          Parse the current date format is clause token.
protected  void parseDateFormatString()
          Parse the current date format.
protected  void parseDateFormatToken()
          Parse the current date format clause token.
protected  void parseDateToken()
          Parse the current date clause token.
protected  void parseDirectiveLine()
          Parse a directive line.
 void parseElement(int element)
          Incremental parse.
protected  void parseErrorToken()
          Parse the current error token.
protected  void parseFunctionToken()
          Parse the current function clause token.
protected  void parseNonnumericLiteral()
          Parse the current nonnumeric literal.
protected  void parseNumericLiteral()
          Parse the current numeric literal.
protected  void parseOptionalIdParagraphToken()
          Parse the current identification division optional paragraph token.
protected  void parsePictureIsToken()
          Parse the current token in the PICTURE IS clause.
protected  void parsePictureString()
          Parse the current picture string.
protected  void parsePictureToken()
          Parse the current token in the PICTURE clause.
protected  void parsePreprocessorStart()
          Parse the current "EXEC" token.
protected  void parsePreprocessorToken()
          Parse the current preprocessor string token.
protected  void parsePseudoTextStart()
          Parse the current opening pseudo-text delimiter.
protected  void parsePseudoTextToken()
          Parse the current pseudo-text token.
protected  void parseReservedWord()
          Parse the current reserved word.
protected  void parseSeparator()
          Parse the current separator token.
protected  void parseToken()
          Parse the current token.
protected  void parseUserDefinedWord()
          Parse the current user-defined word.
protected  void reInitCurrentElement(int currentCharacterPosition)
          Reinitialize the current element for parsing.
protected  void saveTokenCharacter()
          Save the current token character.
 void setStyleAttributes(boolean colours)
          Define parser's style attributes.
protected  void setToken(char styleCharacter)
          Set the style character for the current token.
protected  void setToken(char styleCharacter, long classes)
          Set the style character and classes for the current token.
protected  void setToken(char styleCharacter, long classes, java.lang.String message)
          Set the style character, classes and error message for the current token.
protected  void setToken(char styleCharacter, long classes, java.lang.String message, java.lang.String argument)
          Set the style character, classes, error message and error message argument for the current token.
protected  void setTokenEnd()
          Set the (saved) current character as the end of the current token.
 
Methods inherited from class com.ibm.lpex.core.LpexCommonParser
addMessage, blockMarkWord, cursorIndent, getAutoIndent, getPopupParserItems, getProperty, getToken, indentText, indentText, isTokenDelimiter, lpexView, matchToken, newLine, openLine, parse, proto, removeMessages, resetParser, setAutoIndent, setErrorMessages, setProperty, setStyle, splitLine, styleString, terminateParser, textIndent, tokenBegin, tokenEnd, totalParse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARSE_MODE_CODE

protected static final int PARSE_MODE_CODE
Normal parse mode.

PARSE_MODE_PSEUDO_TEXT

protected static final int PARSE_MODE_PSEUDO_TEXT
An opening pseudo-text delimiter has been detected. Now the parser is searching for the closing delimiter.

PARSE_MODE_PICTURE

protected static final int PARSE_MODE_PICTURE
Either "PIC" or PICTURE has been detected. Now the parser is looking for either the reserved word "IS" or the picture string.

PARSE_MODE_PICTURE_IS

protected static final int PARSE_MODE_PICTURE_IS
Either "PIC IS" or "PICTURE IS" has been detected. Now the parser is looking for the picture string.

PARSE_MODE_OPTIONAL_ID_PARAGRAPH

protected static final int PARSE_MODE_OPTIONAL_ID_PARAGRAPH
One of the identification division optional paragraph reserved words has been detected. Now the parser is looking for the period that should follow that reserved word.

PARSE_MODE_COMMENT_ENTRY

protected static final int PARSE_MODE_COMMENT_ENTRY
The parser is in the middle of a comment entry in one of the identification divisions optional paragraphs.

PARSE_MODE_FUNCTION

protected static final int PARSE_MODE_FUNCTION
The reserved word "FUNCTION" has been detected. Now the parser is looking for the token that follows FUNCTION to see if it is a valid function name.

PARSE_MODE_DATE

protected static final int PARSE_MODE_DATE
The reserved word "DATE" has been detected. Now the parser is checking to see if the token that follows DATE is the reserved word "FORMAT".

PARSE_MODE_DATE_FORMAT

protected static final int PARSE_MODE_DATE_FORMAT
"DATE FORMAT" has been detected. Now the parser is looking for either the reserved word "IS" or the date format.

PARSE_MODE_DATE_FORMAT_IS

protected static final int PARSE_MODE_DATE_FORMAT_IS
"DATE FORMAT IS" has been detected. Now the parser is looking to see if the next token is a valid date format.

PARSE_MODE_PREPROCESSOR

protected static final int PARSE_MODE_PREPROCESSOR
The parser has found the word "EXEC". Now it is looking for the word "END-EXEC". If "SQL" or "CICS" is encountered, the appropriate SQL/CICS subparser may be activated.

PARSE_MODE_LAST

protected static final int PARSE_MODE_LAST
The last parse mode value used.

CLASS_FWDLINK

public static final java.lang.String CLASS_FWDLINK
Element class used by this parser.

CLASS_BWDLINK

public static final java.lang.String CLASS_BWDLINK
Element class used by this parser.

CLASS_BLANK

public static final java.lang.String CLASS_BLANK
Element class used by this parser.

CLASS_ERROR

public static final java.lang.String CLASS_ERROR
Element class used by this parser.

CLASS_COMMENT

public static final java.lang.String CLASS_COMMENT
Element class used by this parser.

CLASS_DIRECTIVE

public static final java.lang.String CLASS_DIRECTIVE
Element class used by this parser.

CLASS_DIVISION

public static final java.lang.String CLASS_DIVISION
Element class used by this parser.

CLASS_SECTION

public static final java.lang.String CLASS_SECTION
Element class used by this parser.

CLASS_AREAA

public static final java.lang.String CLASS_AREAA
Element class used by this parser.

CLASS_AREAB

public static final java.lang.String CLASS_AREAB
Element class used by this parser.

CLASS_PREPROCESSOR

public static final java.lang.String CLASS_PREPROCESSOR
Element class used by this parser.

CLASS_CICS

public static final java.lang.String CLASS_CICS
Element class used by this parser.

CLASS_SQL

public static final java.lang.String CLASS_SQL
Element class used by this parser.

_classForwardLink

protected long _classForwardLink
Bitmask for element class used by this parser.

_classBackwardLink

protected long _classBackwardLink
Bitmask for element class used by this parser.

_classBlank

protected long _classBlank
Bitmask for element class used by this parser.

_classError

protected long _classError
Bitmask for element class used by this parser.

_classComment

protected long _classComment
Bitmask for element class used by this parser.

_classDirective

protected long _classDirective
Bitmask for element class used by this parser.

_classDivision

protected long _classDivision
Bitmask for element class used by this parser.

_classSection

protected long _classSection
Bitmask for element class used by this parser.

_classAreaA

protected long _classAreaA
Bitmask for element class used by this parser.

_classAreaB

protected long _classAreaB
Bitmask for element class used by this parser.

_classPreprocessor

protected long _classPreprocessor
Bitmask for element class used by this parser.

_classCics

protected long _classCics
Bitmask for element class used by this parser.

_classSql

protected long _classSql
Bitmask for element class used by this parser.

_classAll

protected long _classAll
Bitmask for element class used by this parser.

_startElement

protected int _startElement
The first element in the current parse range.

_endElement

protected int _endElement
The last element in the current parse range.

_currentElement

protected int _currentElement
The current element being parsed.

_currentBytePosition

protected int _currentBytePosition
The current byte position of the current character (ZERO-based).

_currentCharacterPosition

protected int _currentCharacterPosition
The current character position of the current character (ZERO-based).

_previousCharacterWidth

protected int _previousCharacterWidth
The width of the previous character.

_currentElementCompleted

protected boolean _currentElementCompleted
Indicates that the current line has bee parsed to the end.

_parseElements

protected CobolParser.ParseElement _parseElements
A reference to the first ParseElement in a list of active ParseElements.

_freeParseElements

protected CobolParser.ParseElement _freeParseElements
A reference to the first ParseElement in a list of unused ParseElements.

_saveTokenCharacterElement

protected int _saveTokenCharacterElement
The element number of the saved character.

_saveTokenCharacterBytePosition

protected int _saveTokenCharacterBytePosition
The byte position of the saved character.

_saveTokenCharacterPosition

protected int _saveTokenCharacterPosition
The character position of the saved character.

_saveTokenCharacter

protected char _saveTokenCharacter
The saved character.

_saveTokenCharacterValid

protected boolean _saveTokenCharacterValid
Indicates that the saved character is valid.

_directiveTokenText

protected java.lang.StringBuffer _directiveTokenText
The current directive token.

_directiveTokenStartBytePosition

protected int _directiveTokenStartBytePosition
The byte position of the start of the directive token.

_directiveStartBytePosition

protected int _directiveStartBytePosition
The character position of the start of the directive token.

_directiveError

protected boolean _directiveError
Indicates that the current directive is in error.

_parseMode

protected int _parseMode
The current parse mode.

_firstTokenFragment

protected CobolParser.TokenFragment _firstTokenFragment
A reference to the first token fragment of a multiline token.

_lastTokenFragment

protected CobolParser.TokenFragment _lastTokenFragment
A reference to the last token fragment of a multiline token.

_tokenText

protected java.lang.StringBuffer _tokenText
The current token.

_inNonnumericLiteral

protected boolean _inNonnumericLiteral
Indicates that the current token character is within a nonnumeric literal.

_tokenHasDelimiter

protected boolean _tokenHasDelimiter
Indicates that the current token has at least quote or apostrophe.

_reservedWord

protected CobolWords.Word _reservedWord
If the current token is a reserved word then this contains a reference to that word.

_integerLength

protected int _integerLength
If the current token is a numeric literal then this indicates the number of digits before the decimal.

_decimalLength

protected int _decimalLength
If the current token is a numeric literal then this indicates the number of digits after the decimal.

_exponentLength

protected int _exponentLength
If the current token is a numeric literal then this indicates the number of digits in the exponent.

_dbcsUserDefinedWord

protected boolean _dbcsUserDefinedWord
If the current token is a user defined word then this indicates if it is a DBCS user defined word.

_nonnumericLiteralType

protected char _nonnumericLiteralType
If the current token is a nonnumeric literal then this indicates the type.

_nonnumericLiteralDelimiter

protected char _nonnumericLiteralDelimiter
If the current token is a nonnumeric literal then this indicates the delimiter.

_nonnumericLiteralLength

protected int _nonnumericLiteralLength
If the current token is a nonnumeric literal then this indicates the length.

_nonnumericLiteralHasClosingDelimiter

protected boolean _nonnumericLiteralHasClosingDelimiter
If the current token is a nonnumeric literal then this indicates if the closing delimiter was found.

_nonnumericLiteralHasNonhexadecimal

protected boolean _nonnumericLiteralHasNonhexadecimal
If the current token is a nonnumeric literal then this indicates if a non hexadecimal character was found.

_nonnumericLiteralHasNonbinary

protected boolean _nonnumericLiteralHasNonbinary
If the current token is a nonnumeric literal then this indicates if a non binary (0 or 1) character was found.

_nonnumericLiteralHasDBCS

protected boolean _nonnumericLiteralHasDBCS
If the current token is a nonnumeric literal then this indicates if a DBCS character was found.

_nonnumericLiteralHasSBCS

protected boolean _nonnumericLiteralHasSBCS
If the current token is a nonnumeric literal then this indicates if a SBCS character was found.

_multiTokenStartElement

protected int _multiTokenStartElement
This contains the starting element of a group of tokens that must be parsed together.
Constructor Detail

CobolParser

public CobolParser(LpexView lpexView)
Constructor for the parser. Add all of the parser specifics to the associated LPEX document view. Initializes the LpexView for the parser: it sets up all the style attributes, element classes, etc. for the language-sensitive edit features supported.
Parameters:
lpexView - the LPEX document view associated with this parser
Method Detail

parseAll

public void parseAll()
Total parse of the entire document.
Overrides:
parseAll in class LpexCommonParser

parseElement

public void parseElement(int element)
Incremental parse.
Overrides:
parseElement in class LpexCommonParser
Parameters:
element - the element whose committed change triggered the parse, or the element that precedes / follows a deleted block. The parser may identify other neighbouring elements that will have to be reparsed as a unit

parse

protected void parse()
Perform the parse. This routine assumes that _startElement and _endElement have been set.

reInitCurrentElement

protected void reInitCurrentElement(int currentCharacterPosition)
Reinitialize the current element for parsing. When a preprocessor lexer completes an "EXEC" .. "END-EXEC" construct, this method is called to get regular COBOL parsing going again.

initCurrentElement

protected void initCurrentElement()
Initialize the current element for parsing. It is cached into a ParseElement, and everything up to the first token character is parsed.

findDirective

protected CobolWords.Word findDirective()
Return directive word indicated by the current directive token.

isDirectiveLine

protected boolean isDirectiveLine()
Return true if the current line is a directive line.

parseDirectiveLine

protected void parseDirectiveLine()
Parse a directive line.

getDirectiveToken

protected boolean getDirectiveToken()
Get the next directive token.
Returns:
true if a directive token (_directiveTokenText) was found

completeCurrentElement

protected void completeCurrentElement()
Complete the parsing of the current line.

flushElements

protected void flushElements()
Flush any of the cached elements with which we are finished.

findParseElement

protected CobolParser.ParseElement findParseElement(int element)
Find the active ParseElement for the specified element.
Returns:
null if there is no ParseElement for the given element

continueParse

protected boolean continueParse()
Return true if parsing should be continued (we are currently inside a COBOL construct).

getToken

protected boolean getToken()
Get the next token. On exit, the new token is in _tokenText.
Returns:
true a token was found

setTokenEnd

protected void setTokenEnd()
Set the (saved) current character as the end of the current token.

nextTokenCharacter

protected boolean nextTokenCharacter()
Advance to the next token character.
Returns:
true if the next token character is contiguous to the current token character

nextTokenElement

protected boolean nextTokenElement()
Advance to the next token (non-show) element in the parse range. _currentElement is updated.
Returns:
true if another token element was found, or false if no more token elements are found within the current parse range

nextCharacter

protected void nextCharacter()
Advance to the next character in the current element.

saveTokenCharacter

protected void saveTokenCharacter()
Save the current token character.

parseToken

protected void parseToken()
Parse the current token. Calls the appropriate parseXxxToken() method based on the current parse mode.

parseCodeToken

protected void parseCodeToken()
Parse the current code token.

isSeparator

protected boolean isSeparator()
Return true if the current token is a separator.

isCommaOrSemicolon

protected boolean isCommaOrSemicolon()
Return true if the current token is a comma or semicolon.

isPeriod

protected boolean isPeriod()
Return true if the current token is a period.

parseSeparator

protected void parseSeparator()
Parse the current separator token.

isReservedWord

protected boolean isReservedWord()
Return true if the current token is a reserved word.

parseReservedWord

protected void parseReservedWord()
Parse the current reserved word.

isNumericLiteral

protected boolean isNumericLiteral()
Return true if the current token is a numeric literal.

maxDigits

protected int maxDigits()
Return the maximum number of digits allowed in a nonnumeric literal.

maxMantissa

protected int maxMantissa()
Return the maximum number of digits allowed in the mantissa of a floating-point literal.

maxExponent

protected int maxExponent()
Return the maximum number of digits allowed in the exponent of a floating-point literal.

parseNumericLiteral

protected void parseNumericLiteral()
Parse the current numeric literal.

isPreprocessorStart

protected boolean isPreprocessorStart()
Return true if the current token is "EXEC".

parsePreprocessorStart

protected void parsePreprocessorStart()
Parse the current "EXEC" token. Sets parse mode to PREPROCESSOR.

isUserDefinedWord

protected boolean isUserDefinedWord()
Return true if the current token is a user-defined word.

parseUserDefinedWord

protected void parseUserDefinedWord()
Parse the current user-defined word.

nonnumericLiteralTypes

protected java.lang.String nonnumericLiteralTypes()
Return a string indicating valid nonnumeric literal types.

isNonnumericLiteral

protected boolean isNonnumericLiteral()
Return true if the current token is a nonnumeric literal.

parseNonnumericLiteral

protected void parseNonnumericLiteral()
Parse the current nonnumeric literal.

isPseudoTextStart

protected boolean isPseudoTextStart()
Return true if the current token is an opening pseudo-text delimiter.

parsePseudoTextStart

protected void parsePseudoTextStart()
Parse the current opening pseudo-text delimiter.

parseErrorToken

protected void parseErrorToken()
Parse the current error token.

parsePseudoTextToken

protected void parsePseudoTextToken()
Parse the current pseudo-text token.

parsePictureToken

protected void parsePictureToken()
Parse the current token in the PICTURE clause.

parsePictureIsToken

protected void parsePictureIsToken()
Parse the current token in the PICTURE IS clause.

maxPicture

protected int maxPicture()
Return the maximum number of characters allowed in the picture string.

parsePictureString

protected void parsePictureString()
Parse the current picture string.

parseOptionalIdParagraphToken

protected void parseOptionalIdParagraphToken()
Parse the current identification division optional paragraph token.

parseCommentEntryToken

protected void parseCommentEntryToken()
Parse the current comment entry token.

isFunctionName

protected boolean isFunctionName()
Return true if the current token is a function name.

parseFunctionToken

protected void parseFunctionToken()
Parse the current function clause token.

parseDateToken

protected void parseDateToken()
Parse the current date clause token.

parseDateFormatToken

protected void parseDateFormatToken()
Parse the current date format clause token.

parseDateFormatIsToken

protected void parseDateFormatIsToken()
Parse the current date format is clause token.

parseDateFormatString

protected void parseDateFormatString()
Parse the current date format.

parsePreprocessorToken

protected void parsePreprocessorToken()
Parse the current preprocessor string token. If it is "END-EXEC", return parse mode to CODE. If it is "SQL" or "CICS", try to activate the appropriate lexer.

setToken

protected void setToken(char styleCharacter)
Set the style character for the current token.

setToken

protected void setToken(char styleCharacter,
                        long classes)
Set the style character and classes for the current token.

setToken

protected void setToken(char styleCharacter,
                        long classes,
                        java.lang.String message)
Set the style character, classes and error message for the current token.

setToken

protected void setToken(char styleCharacter,
                        long classes,
                        java.lang.String message,
                        java.lang.String argument)
Set the style character, classes, error message and error message argument for the current token.

linkElements

protected void linkElements(int startElement,
                            int endElement)
Link the specified elements together if necessary. No action is taken if startElement and endElement are the same element. Multiple elements belonging to one construct are doubly-linked with the _classForwardLink and _classBackwardLink.

getProfile

public java.util.ResourceBundle getProfile()
Return the parser's properties profile resource bundle.
Overrides:
getProfile in class LpexCommonParser
Following copied from class: com.ibm.lpex.core.LpexCommonParser
See Also:
LpexCommonParser.getProperty(java.lang.String)

getLanguage

public java.lang.String getLanguage()
Returns "COBOL", the language supported by this parser.
Overrides:
getLanguage in class LpexCommonParser
See Also:
LpexCommonParser.LANGUAGE_COBOL

getLanguage

public java.lang.String getLanguage(LpexDocumentLocation loc)
Retrieve a string identifying the language segment at the specified location. In mixed-content documents, this may differ from the main language of the document. The method assumes that no parse is pending.
Overrides:
getLanguage in class LpexCommonParser
Returns:
one of: LpexCommonParser.LANGUAGE_COBOL, LpexCommonParser.LANGUAGE_CICS, LpexCommonParser.LANGUAGE_SQL

initializeParser

protected void initializeParser()
Initialize the parser for an LPEX document view: set up style attributes for the styles we need, classes, etc., and initialize the view for the language-sensitive edit features supported.

getPopupViewItems

public java.lang.String getPopupViewItems()
Return parser's items for the popup View submenu: comments, divisions, areaA, preprocessor statements.
Overrides:
getPopupViewItems in class LpexCommonParser
Following copied from class: com.ibm.lpex.core.LpexCommonParser
See Also:
LpexCommonParser.getPopupParserItems()

setStyleAttributes

public void setStyleAttributes(boolean colours)
Define parser's style attributes.
Overrides:
setStyleAttributes in class LpexCommonParser
Parameters:
colours - true = token highlighting, false = no token highlighting

getHelpPage

public java.lang.String getHelpPage()
Retrieve the name of the COBOL help page that the parser identifies as appropriate for the currently selected token
Overrides:
getHelpPage in class LpexCommonParser
Following copied from interface: com.ibm.lpex.core.LpexParser
See Also:
LpexCommonParser.getHelpPage()

evaluateBeginElement

protected int evaluateBeginElement(int element)
Evaluate a parse range for incremental parse from the specified element up to the top of the file.
Returns:
new start element to parse from

evaluateEndElement

protected int evaluateEndElement(int element)
Evaluate a parse range for incremental parse from the specified element to the bottom of the file.
Returns:
new end element to parse to

addErrorMessage

protected void addErrorMessage(int element,
                               java.lang.String message,
                               java.lang.String argument)
Display an error message with an argument for an element.

addErrorMessage

protected void addErrorMessage(int element,
                               java.lang.String message)
Display an error message for an element.

getSqlLexer

protected SqlLexer getSqlLexer(LpexCharStream stream)
Retrieve the SqlLexer. The parser extending CobolParser to support embedded SQL statements must override this method to construct and return an SqlLexer object. The implementation of this method provided by CobolParser does nothing, except return null.
Parameters:
stream - input character stream for the SQL lexer

getCicsLexer

protected CicsLexer getCicsLexer(LpexCharStream stream)
Retrieve the CicsLexer. The parser extending CobolParser to support embedded CICS statements must override this method to construct and return a CicsLexer object. The implementation of this method provided by CobolParser does nothing, except return null.
Parameters:
stream - input character stream for the CICS lexer