LPEX
4.4.0

com.ibm.lpex.cobol
Class Cobol400Parser

java.lang.Object
  extended by com.ibm.lpex.core.LpexCommonParser
      extended by com.ibm.lpex.cobol.CobolParser
          extended by com.ibm.lpex.cobol.Cobol400Parser
All Implemented Interfaces:
LpexConstants, LpexParser
Direct Known Subclasses:
Cobol400SqlCicsParser

public class Cobol400Parser
extends CobolParser

Document parser for COBOL/400.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.ibm.lpex.cobol.CobolParser
CobolParser.ParseElement, CobolParser.TokenFragment
 
Field Summary
protected static int PARSE_MODE_PROCESS
          "PROCESS" has been detected.
 
Fields inherited from class com.ibm.lpex.cobol.CobolParser
_classAll, _classAreaA, _classAreaB, _classBackwardLink, _classBlank, _classCics, _classComment, _classCommentTask, _classDirective, _classDivision, _classDli, _classError, _classForwardLink, _classPreprocessor, _classSection, _classSql, _currentBytePosition, _currentCharacterPosition, _currentElement, _currentElementCompleted, _dbcsUserDefinedWord, _decimalLength, _directiveStartBytePosition, _directiveTokenStartBytePosition, _directiveTokenText, _endElement, _errorCount, _exponentLength, _firstTokenFragment, _freeParseElements, _inNonnumericLiteral, _integerLength, _lastTokenFragment, _multiTokenStartElement, _nonnumericLiteralDelimiter, _nonnumericLiteralHasClosingDelimiter, _nonnumericLiteralHasDBCS, _nonnumericLiteralHasNonbinary, _nonnumericLiteralHasNonhexadecimal, _nonnumericLiteralHasSBCS, _nonnumericLiteralLength, _nonnumericLiteralType, _nSymbolNational, _parseElements, _parseMode, _previousCharacterWidth, _reservedWord, _rightMarginOfAreaB, _saveTokenCharacter, _saveTokenCharacterBytePosition, _saveTokenCharacterElement, _saveTokenCharacterPosition, _saveTokenCharacterValid, _sequenceNumbers16, _sequenceNumbers7380, _startElement, _tokenHasDelimiter, _tokenText, AREA_B_RIGHT_MARGIN_PARAM, CLASS_AREAA, CLASS_AREAB, CLASS_BLANK, CLASS_BWDLINK, CLASS_CICS, CLASS_COMMENT, CLASS_COMMENTTASK, CLASS_DIRECTIVE, CLASS_DIVISION, CLASS_DLI, CLASS_ERROR, CLASS_FWDLINK, CLASS_PREPROCESSOR, CLASS_SECTION, CLASS_SQL, PARSE_MODE_CODE, PARSE_MODE_COMMENT_ENTRY, PARSE_MODE_DATE, PARSE_MODE_DATE_FORMAT, PARSE_MODE_DATE_FORMAT_IS, PARSE_MODE_FUNCTION, PARSE_MODE_LAST, PARSE_MODE_OPTIONAL_ID_PARAGRAPH, PARSE_MODE_PICTURE, PARSE_MODE_PICTURE_IS, PARSE_MODE_PREPROCESSOR, PARSE_MODE_PSEUDO_TEXT, STYLE_COMPILER_DIRECTIVE, STYLE_FUNCTION, STYLE_PICTURE_STRING, STYLE_PREPROCESSOR_STRING, STYLE_RESERVED_WORD, STYLE_USER_DEFINED_WORD
 
Fields inherited from class com.ibm.lpex.core.LpexCommonParser
ATTRIBUTES_COMMENT, ATTRIBUTES_COMMENT_KEYWORD, ATTRIBUTES_COMMENT1, ATTRIBUTES_DEFAULT, ATTRIBUTES_DIRECTIVE, ATTRIBUTES_ERROR, ATTRIBUTES_ERROR1, ATTRIBUTES_KEYWORD, ATTRIBUTES_KEYWORD1, ATTRIBUTES_LIBRARY, ATTRIBUTES_NONSOURCE, ATTRIBUTES_NUMERAL, ATTRIBUTES_STRING, ATTRIBUTES_STRING1, BACKGROUND_COLOR, CLASS_MESSAGE, LANGUAGE_CCPP, LANGUAGE_CICS, LANGUAGE_CL, LANGUAGE_COBOL, LANGUAGE_COBOL400, LANGUAGE_COBOLILE, LANGUAGE_DDS, LANGUAGE_DLI, LANGUAGE_FORTRAN, LANGUAGE_HLASM, LANGUAGE_HTML, LANGUAGE_JAVA, LANGUAGE_JCL, LANGUAGE_LISP, LANGUAGE_PERL, LANGUAGE_PLI, LANGUAGE_REXX, LANGUAGE_RPG, LANGUAGE_RPGLEFIXED, LANGUAGE_RPGLEFREE, LANGUAGE_SABRETALK, LANGUAGE_SQL, LANGUAGE_XMI, LANGUAGE_XML, LANGUAGE_XSL, LEXER_RC_END, LEXER_RC_EOF, LEXER_RC_MORE, LEXER_RC_OK, POPUP_END, POPUP_FILTERVIEW, POPUP_SOURCE, POPUP_TOP, PROTOKEY_EMPTY, STYLE_MESSAGE, STYLE_NAME, view
 
Fields inherited from interface com.ibm.lpex.core.LpexConstants
HELP_COMMAND_MAP, LPEX_VERSION, MSG_POPUP_COMMENT, MSG_POPUP_ERRORS, MSG_POPUP_EXCLUDESELECTION, MSG_POPUP_FILTERVIEWMENU, MSG_POPUP_INSERTMENU, MSG_POPUP_SELECTEDMENU, MSG_POPUP_SHOWALL, MSG_POPUP_SOURCEMENU, MSG_POPUP_TASKS, MSG_POPUP_UNCOMMENT, PARSE_PENDING_CHANGE_MASK, PARSE_PENDING_INSERT_MASK, PARSE_PENDING_NEXT_DELETED_MASK, PARSE_PENDING_NEXT_SHOW_DELETED_MASK, PARSE_PENDING_PREV_DELETED_MASK, PARSE_PENDING_PREV_SHOW_DELETED_MASK, PARSE_PENDING_UNDO_MASK, PLATFORM_AWT, PLATFORM_SWT, PLATFORM_SWT_KEY, SHOW_ALL, SHOW_DOCUMENT, SHOW_NONE, SHOW_VIEW, STATUS_FIELDS_NOINSERT, STATUS_FIELDS_TRUNCATE, STATUS_FILE_ERRORREADING, STATUS_FILE_INCORRECTENCODING, 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, STATUS_TEXTLIMIT_ENFORCED, STATUS_TEXTLIMIT_OVERFLOW, STATUS_UNDO_NOTHINGUNDONE
 
Constructor Summary
Cobol400Parser(LpexView lpexView)
          Constructor for the parser.
 
Method Summary
protected  CobolWords.Word findDirective()
          Returns the directive word indicated by the current directive token (_directiveTokenText).
 String getLanguage()
          Returns "COBOL400", the language supported by this parser.
 ResourceBundle getProfile()
          Overridden to return Profile400.properties in the com.ibm.lpex.cobol package.
 String getStyleName(char styleCharacter)
          Overridden because style names are defined in LPEX's resources with a COBOL-prefixed key for all the COBOL flavors.
protected  boolean isDirectiveLine()
          Returns whether the current line is a directive line.
protected  boolean isNumericLiteral()
          Returns whether the current token is a numeric literal.
protected  boolean isProcessOption()
          Returns whether the current token is a process statement option.
protected  boolean isReservedWord()
          Returns whether the current token is a reserved word.
protected  boolean isUserDefinedWord()
          Returns whether the current token is a user defined word.
protected  String nonnumericLiteralTypes()
          Returns a string indicating valid nonnumeric literal types.
protected  void parseNonnumericLiteral()
          Parses the current nonnumeric literal.
protected  void parseProcessOption()
          Parses the current process statement option.
protected  void parseProcessToken()
          Parses a PROCESS statement token.
protected  void parseReservedWord()
          Parses the current reserved word.
protected  void parseToken()
          Parses the current token.
 
Methods inherited from class com.ibm.lpex.cobol.CobolParser
addErrorMessage, addErrorMessage, backSpace, checkExtendedLengthSetting, checkSequenceNumbersSetting, completeCurrentElement, continueParse, delete, documentLocationUsingFullText, elementStyleUsingFullText, evaluateBeginElement, evaluateEndElement, findParseElement, flushElements, getCicsLexer, getCommentStyleCharacters, getDirectiveToken, getDliLexer, getLanguage, getLshToken, getNSYMBOL, getPopupItem, getPopupItems, getSqlLexer, getToken, getTokenLocationUsingFullText, getTokenUsingFullText, initCurrentElement, initializeParser, initParser, isCommaOrSemicolon, isFloatingComment, isFunctionName, isNonnumericLiteral, isPeriod, isPreprocessorStart, isPseudoTextStart, isSeparator, isTokenDelimiter, join, join, linkElements, linkLexedElements, maxDigits, maxExponent, maxMantissa, maxPicture, nextCharacter, nextTokenCharacter, nextTokenElement, parse, parseAll, parseCodeToken, parseComment, parseCommentEntryToken, parseDateFormatIsToken, parseDateFormatString, parseDateFormatToken, parseDateToken, parseDirectiveLine, parseElement, parseErrorToken, parseFloatingCommentToken, parseFunctionToken, parseIndicatorArea, parseNumericLiteral, parseOptionalIdParagraphToken, parsePictureIsToken, parsePictureString, parsePictureToken, parsePreprocessorStart, parsePreprocessorToken, parsePseudoTextStart, parsePseudoTextToken, parseSeparator, parseUserDefinedWord, propertySet, reInitCurrentElement, saveTokenCharacter, setCommentToken, setDocumentElementText, setStyleAttributes, setToken, setToken, setToken, setToken, setTokenEnd, splitLine, splitLine, toUpperCase, upperCaseCOBOLLines, upperCaseElement
 
Methods inherited from class com.ibm.lpex.core.LpexCommonParser
addDocumentMessage, addMessage, addMessage, addMessage, blockMarkWord, copyDocumentMessages, cursorIndent, defineFilterAction, defineFilterAction, expandProtoKeyword, getInstallStyleAttributes, getProperty, getStyles, getTextIndent, getToken, getTokenLocation, indentText, indentText, indentText, isDebuggable, isPrimaryParser, isWordCharacter, lineComment, lpexView, matchToken, newLine, openLine, parse, removeDocumentMessages, removeMessages, removeMessages, resetParser, setProperty, setStyle, styleString, terminateParser, 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_PROCESS

protected static final int PARSE_MODE_PROCESS
"PROCESS" has been detected. The parser will now look for a reserved word that is not a PROCESS statement option or a period separator.

See Also:
Constant Field Values
Constructor Detail

Cobol400Parser

public Cobol400Parser(LpexView lpexView)
Constructor for the parser.

Parameters:
lpexView - the document view associated with this parser
Method Detail

getLanguage

public String getLanguage()
Returns "COBOL400", the language supported by this parser.

Overrides:
getLanguage in class CobolParser
See Also:
LpexCommonParser.LANGUAGE_COBOL400

getProfile

public ResourceBundle getProfile()
Overridden to return Profile400.properties in the com.ibm.lpex.cobol package.

Overrides:
getProfile in class CobolParser
See Also:
LpexCommonParser.getProperty(java.lang.String), Parser properties

getStyleName

public String getStyleName(char styleCharacter)
Overridden because style names are defined in LPEX's resources with a COBOL-prefixed key for all the COBOL flavors.

Overrides:
getStyleName in class LpexCommonParser
Parameters:
styleCharacter - the style character queried, for example, 'c'
Returns:
the name assigned to the given style character, for example, "Comment", or
null if none
See Also:
LpexCommonParser.STYLE_NAME

findDirective

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

Overrides:
findDirective in class CobolParser

isDirectiveLine

protected boolean isDirectiveLine()
Returns whether the current line is a directive line.

Overrides:
isDirectiveLine in class CobolParser

parseToken

protected void parseToken()
Parses the current token.

Overrides:
parseToken in class CobolParser

isReservedWord

protected boolean isReservedWord()
Returns whether the current token is a reserved word.

Overrides:
isReservedWord in class CobolParser

parseReservedWord

protected void parseReservedWord()
Parses the current reserved word.

Overrides:
parseReservedWord in class CobolParser

isUserDefinedWord

protected boolean isUserDefinedWord()
Returns whether the current token is a user defined word.

Overrides:
isUserDefinedWord in class CobolParser

nonnumericLiteralTypes

protected String nonnumericLiteralTypes()
Returns a string indicating valid nonnumeric literal types.

Overrides:
nonnumericLiteralTypes in class CobolParser

parseNonnumericLiteral

protected void parseNonnumericLiteral()
Parses the current nonnumeric literal.

Overrides:
parseNonnumericLiteral in class CobolParser

isNumericLiteral

protected boolean isNumericLiteral()
Returns whether the current token is a numeric literal.

Overrides:
isNumericLiteral in class CobolParser

isProcessOption

protected boolean isProcessOption()
Returns whether the current token is a process statement option.


parseProcessOption

protected void parseProcessOption()
Parses the current process statement option.


parseProcessToken

protected void parseProcessToken()
Parses a PROCESS statement token.


LPEX
4.4.0

Copyright � 2016 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.