|
LPEX 4.4.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.lpex.core.LpexCommonParser com.ibm.lpex.cobol.CobolParser
public class CobolParser
Document parser for z/OS Enterprise COBOL (COBOL/390). This also serves as the base class for other COBOL document parsers.
Editor actions and assigned keys added by this document parser:
Keys already defined (for example, by the active base editor profile and by the user profile) to an action different from nullAction are not redefined in here.
Editor action modified by this document parser:
Parser properties handled directly by this parser:
bidi
TODO
).
Nested Class Summary | |
---|---|
class |
CobolParser.ParseElement
A ParseElement 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 COBOL parser element class. |
protected long |
_classAreaA
Bitmask for COBOL parser element class. |
protected long |
_classAreaB
Bitmask for COBOL parser element class. |
protected long |
_classBackwardLink
Bitmask for COBOL parser element class. |
protected long |
_classBlank
Bitmask for COBOL parser element class. |
protected long |
_classCics
Bitmask for COBOL parser element class. |
protected long |
_classComment
Bitmask for COBOL parser element class. |
protected long |
_classCommentTask
Bitmask for COBOL parser element class. |
protected long |
_classDirective
Bitmask for COBOL parser element class. |
protected long |
_classDivision
Bitmask for COBOL parser element class. |
protected long |
_classDli
Bitmask for COBOL parser element class. |
protected long |
_classError
Bitmask for COBOL parser element class. |
protected long |
_classForwardLink
Bitmask for COBOL parser element class. |
protected long |
_classPreprocessor
Bitmask for COBOL parser element class. |
protected long |
_classSection
Bitmask for COBOL parser element class. |
protected long |
_classSql
Bitmask for COBOL parser element class. |
protected int |
_currentBytePosition
The current COBOL-line byte position (column) of the current character (ZERO-based). |
protected int |
_currentCharacterPosition
The current character position in the text string being parsed (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 int |
_directiveStartBytePosition
The byte position of the start of the compiler directive. |
protected int |
_directiveTokenStartBytePosition
The byte position of the compiler directive keyword. |
protected StringBuffer |
_directiveTokenText
The current directive token. |
protected int |
_endElement
The last element in the current parse range. |
protected int |
_errorCount
The number of error messages embedded during one total or incremental parse operation. |
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 boolean |
_nSymbolNational
The NSYMBOL compiler option, as defined in the parser profile. |
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 source length 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 int |
_rightMarginOfAreaB
Column at which area B ends As of AIX COBOL 4.1 this might be 252 as well as 72. |
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 boolean |
_sequenceNumbers16
Indicates whether columns 1-6 are set as sequence numbers in the editor. |
protected boolean |
_sequenceNumbers7380
Indicates whether columns 73-80 are set as sequence numbers in the editor. |
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 StringBuffer |
_tokenText
The current token. |
static String |
AREA_B_RIGHT_MARGIN_PARAM
Lpex editor parameter indicating the column after area B ends |
static String |
CLASS_AREAA
COBOL parser element class. |
static String |
CLASS_AREAB
COBOL parser element class. |
static String |
CLASS_BLANK
COBOL parser element class. |
static String |
CLASS_BWDLINK
COBOL parser element class. |
static String |
CLASS_CICS
COBOL parser element class. |
static String |
CLASS_COMMENT
COBOL parser element class. |
static String |
CLASS_COMMENTTASK
COBOL parser element class. |
static String |
CLASS_DIRECTIVE
COBOL parser element class. |
static String |
CLASS_DIVISION
COBOL parser element class. |
static String |
CLASS_DLI
COBOL parser element class. |
static String |
CLASS_ERROR
COBOL parser element class. |
static String |
CLASS_FWDLINK
COBOL parser element class. |
static String |
CLASS_PREPROCESSOR
COBOL parser element class. |
static String |
CLASS_SECTION
COBOL parser element class. |
static String |
CLASS_SQL
COBOL parser element class. |
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 defined. |
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 detected the word "EXEC". |
protected static int |
PARSE_MODE_PSEUDO_TEXT
An opening pseudo-text delimiter has been detected. |
protected static char |
STYLE_COMPILER_DIRECTIVE
|
protected static char |
STYLE_FUNCTION
|
protected static char |
STYLE_PICTURE_STRING
|
protected static char |
STYLE_PREPROCESSOR_STRING
|
protected static char |
STYLE_RESERVED_WORD
|
protected static char |
STYLE_USER_DEFINED_WORD
|
Constructor Summary | |
---|---|
CobolParser(LpexView lpexView)
Constructor. |
Method Summary | |
---|---|
protected void |
addErrorMessage(int element,
String message)
Adds an error message for the specified document element. |
protected void |
addErrorMessage(int element,
String message,
String argument)
Adds an error message with an argument for the specified document element. |
protected void |
backSpace()
Override the default backspace behaviour. |
protected void |
checkExtendedLengthSetting()
Checks whether the right margin of Area B is at column 72 or 252. |
protected boolean |
checkSequenceNumbersSetting()
Checks the sequence numbers setting for columns 73 - 80 and columns 1 - 6. |
protected void |
completeCurrentElement()
Completes the parsing of the current line. |
protected boolean |
continueParse()
Returns true if parsing should be continued (we are currently
inside a COBOL construct). |
protected void |
delete()
Override the default delete behaviour. |
LpexDocumentLocation |
documentLocationUsingFullText()
Like LpexView.documentLocation() except position is
relevant to fullText. |
String |
elementStyleUsingFullText(int element)
Like LpexView.elementStyle(int) except that the style string
will have style characters for "hidden" sequence numbers. |
protected int |
evaluateBeginElement(int element)
Evaluates a parse range for incremental parse from the specified element up to the top of the document. |
protected int |
evaluateEndElement(int element)
Evaluates a parse range for incremental parse from the specified element to the bottom of the document. |
protected CobolWords.Word |
findDirective()
Returns the directive word indicated by the current directive token. |
protected CobolParser.ParseElement |
findParseElement(int element)
Finds the active ParseElement for the specified element. |
protected void |
flushElements()
Flushes any of the cached elements with which we are finished. |
protected CicsLexer |
getCicsLexer(LpexCharStream stream)
Returns the CicsLexer. |
String |
getCommentStyleCharacters()
Returns the style characters used for styling comments ("cs$"). |
protected boolean |
getDirectiveToken()
Returns the potential compiler-directive keyword. |
protected LpexSubparser |
getDliLexer(LpexCharStream stream)
Returns the DliLexer. |
String |
getLanguage()
Returns "COBOL", the language supported by this parser. |
String |
getLanguage(LpexDocumentLocation loc)
Returns a string identifying the language segment at the specified location. |
String |
getLshToken()
Returns the current token for language-sensitive help (LSH). |
protected void |
getNSYMBOL()
Sets _nSymbolNational for the current setting for the NSYMBOL compiler option. |
protected String |
getPopupItem(String key)
|
protected String |
getPopupItems(int popupLocation)
Returns this parser's contribution to the popup. |
ResourceBundle |
getProfile()
Returns this parser's profile. |
protected SqlLexer |
getSqlLexer(LpexCharStream stream)
Returns the SqlLexer. |
protected boolean |
getToken()
Returns the next token in the current element. |
LpexDocumentLocation |
getTokenLocationUsingFullText(LpexDocumentLocation fullTextLoc)
Like getTokenLocation(LpexDocumentLocation loc), except that loc is expected to be relative to the fullText of the line (i.e. |
String |
getTokenUsingFullText(LpexDocumentLocation loc)
Like getToken(LpexDocumentLocation loc), except that loc is expected to be relative to the fullText of the line (i.e. |
protected void |
initCurrentElement()
Initializes the current element for parsing. |
protected void |
initializeParser()
Initializes the parser. |
protected void |
initParser()
Initializes the parser. |
protected boolean |
isCommaOrSemicolon()
Returns true if the current token is a comma or semicolon. |
protected boolean |
isDirectiveLine()
Returns true if the current line is a directive line. |
protected boolean |
isFloatingComment()
|
protected boolean |
isFunctionName()
Returns true if the current token is a function name. |
protected boolean |
isNonnumericLiteral()
Returns true if the current token is a nonnumeric literal. |
protected boolean |
isNumericLiteral()
Returns true if the current token is a numeric literal. |
protected boolean |
isPeriod()
Returns true if the current token is a period. |
protected boolean |
isPreprocessorStart()
Returns true if the current token is "EXEC". |
protected boolean |
isPseudoTextStart()
Returns true if the current token is an opening
pseudo-text delimiter. |
protected boolean |
isReservedWord()
Returns true if the current token is a reserved word. |
protected boolean |
isSeparator()
Returns true if the current token is a separator. |
boolean |
isTokenDelimiter(char ch)
Returns whether the specified character is a token delimiter. |
protected boolean |
isUserDefinedWord()
Returns true if the current token is a user-defined word. |
protected int |
join()
Override the default join behaviour. |
protected int |
join(boolean undoCheck)
Override the default join behaviour. |
protected void |
linkElements(int startElement,
int endElement)
Links the specified elements together if necessary. |
protected void |
linkLexedElements(int startElement,
int endElement)
Links the specified lexed elements if necessary. |
protected int |
maxDigits()
Returns the maximum number of digits allowed in a numeric literal. |
protected int |
maxExponent()
Returns the maximum number of digits allowed in the exponent of a floating-point literal. |
protected int |
maxMantissa()
Returns the maximum number of digits allowed in the mantissa of a floating-point literal. |
protected int |
maxPicture()
Returns the maximum number of characters allowed in the picture string. |
protected void |
nextCharacter()
Advances to the next character in the current element. |
protected boolean |
nextTokenCharacter()
Advances to the next token character. |
protected boolean |
nextTokenElement()
Advances to the next token (non-show) element in the parse range. |
protected String |
nonnumericLiteralTypes()
Returns a string indicating valid nonnumeric literal types. |
protected void |
parse()
Parses the affected range of elements. |
void |
parseAll()
Total parse of the entire document. |
protected void |
parseCodeToken()
Parses the current code token (_tokenText). |
protected boolean |
parseComment()
|
protected void |
parseCommentEntryToken()
Parses the current comment entry token. |
protected void |
parseDateFormatIsToken()
Parses the current date format is clause token. |
protected void |
parseDateFormatString()
Parses the current date format. |
protected void |
parseDateFormatToken()
Parses the current date format clause token. |
protected void |
parseDateToken()
Parses the current date clause token. |
protected void |
parseDirectiveLine()
Parses a directive line. |
void |
parseElement(int element)
Incremental parse. |
protected void |
parseErrorToken()
Parses the current error token. |
protected void |
parseFloatingCommentToken()
|
protected void |
parseFunctionToken()
Parses the current function clause token. |
protected boolean |
parseIndicatorArea()
Parses the indicator area. |
protected void |
parseNonnumericLiteral()
Parses the current nonnumeric literal. |
protected void |
parseNumericLiteral()
Parses the current numeric literal. |
protected void |
parseOptionalIdParagraphToken()
Parses the current identification division optional paragraph token. |
protected void |
parsePictureIsToken()
Parses the current token in the PICTURE IS clause. |
protected void |
parsePictureString()
Parses the current picture string. |
protected void |
parsePictureToken()
Parses the current token in the PICTURE clause. |
protected void |
parsePreprocessorStart()
Parse the current "EXEC" token. |
protected void |
parsePreprocessorToken()
Parses the current preprocessor string token. |
protected void |
parsePseudoTextStart()
Parses the current opening pseudo-text delimiter. |
protected void |
parsePseudoTextToken()
Parses the current pseudo-text token. |
protected void |
parseReservedWord()
Parse the current reserved word. |
protected void |
parseSeparator()
Parses the current separator token. |
protected void |
parseToken()
Parses the current token. |
protected void |
parseUserDefinedWord()
Parses the current user-defined word. |
protected void |
propertySet(String key)
Listens to changes to any of our parser properties in this view. |
protected void |
reInitCurrentElement(int currentCharacterPosition)
Reinitializes the current element for parsing. |
protected void |
saveTokenCharacter()
Saves the current token character. |
protected void |
setCommentToken()
Sets the style characters for the current comment token. |
protected void |
setDocumentElementText(LpexView view,
int iElement,
String strElement)
Associates the text with the editor element line Removes the null at the end of the string |
void |
setStyleAttributes()
Defines this parser's style attributes. |
protected void |
setToken(char styleCharacter)
Sets the style character for the current token. |
protected void |
setToken(char styleCharacter,
long classes)
Sets the style character and classes for the current token. |
protected void |
setToken(char styleCharacter,
long classes,
String message)
Sets the style character, classes and error message for the current token. |
protected void |
setToken(char styleCharacter,
long classes,
String message,
String argument)
Sets the style character, classes, error message and error message argument for the current token. |
protected void |
setTokenEnd()
Sets the (saved) current character as the end of the current token. |
protected void |
splitLine()
Override the default splitLine behaviour. |
protected void |
splitLine(boolean undoCheck)
Override the default splitLine behaviour. |
protected String |
toUpperCase(String name)
Utility method for selectively uppercasing the characters in a string, for use as an IBM i *NAME value. |
protected void |
upperCaseCOBOLLines(LpexView lpexView)
|
protected void |
upperCaseElement(int _startElement,
int _endElement,
int topPosition,
int bottomPosition)
Performs uppercasing of Elements if requested |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int PARSE_MODE_CODE
protected static final int PARSE_MODE_PSEUDO_TEXT
protected static final int PARSE_MODE_PICTURE
protected static final int PARSE_MODE_PICTURE_IS
protected static final int PARSE_MODE_OPTIONAL_ID_PARAGRAPH
protected static final int PARSE_MODE_COMMENT_ENTRY
protected static final int PARSE_MODE_FUNCTION
protected static final int PARSE_MODE_DATE
protected static final int PARSE_MODE_DATE_FORMAT
protected static final int PARSE_MODE_DATE_FORMAT_IS
protected static final int PARSE_MODE_PREPROCESSOR
protected static final int PARSE_MODE_LAST
public static final String AREA_B_RIGHT_MARGIN_PARAM
public static final String CLASS_FWDLINK
public static final String CLASS_BWDLINK
public static final String CLASS_BLANK
public static final String CLASS_ERROR
public static final String CLASS_COMMENT
public static final String CLASS_COMMENTTASK
public static final String CLASS_DIRECTIVE
public static final String CLASS_DIVISION
public static final String CLASS_SECTION
public static final String CLASS_AREAA
public static final String CLASS_AREAB
public static final String CLASS_PREPROCESSOR
public static final String CLASS_SQL
public static final String CLASS_CICS
public static final String CLASS_DLI
protected long _classForwardLink
protected long _classBackwardLink
protected long _classBlank
protected long _classError
protected long _classComment
protected long _classCommentTask
protected long _classDirective
protected long _classDivision
protected long _classSection
protected long _classAreaA
protected long _classAreaB
protected long _classPreprocessor
protected long _classSql
protected long _classCics
protected long _classDli
protected long _classAll
protected boolean _nSymbolNational
protected boolean _sequenceNumbers7380
checkSequenceNumbersSetting()
at the beginning of each parse operation.
When set as sequence numbers (see the sequenceNumbers editor parameter), they are not part of the edit area. The COBOL/390 parser must be aware of this, so it doesn't attempt to set styles for text found in these columns (which are now actually columns 81-88 in the document!).
_sequenceNumbers16
protected boolean _sequenceNumbers16
checkSequenceNumbersSetting()
at the beginning of each parse operation.
_sequenceNumbers7380
protected int _rightMarginOfAreaB
protected int _startElement
protected int _endElement
protected int _currentElement
protected int _currentCharacterPosition
protected int _currentBytePosition
protected int _previousCharacterWidth
protected boolean _currentElementCompleted
protected CobolParser.ParseElement _parseElements
protected CobolParser.ParseElement _freeParseElements
protected int _saveTokenCharacterElement
protected int _saveTokenCharacterBytePosition
protected int _saveTokenCharacterPosition
protected char _saveTokenCharacter
protected boolean _saveTokenCharacterValid
protected StringBuffer _directiveTokenText
protected int _directiveTokenStartBytePosition
protected int _directiveStartBytePosition
protected int _parseMode
protected CobolParser.TokenFragment _firstTokenFragment
protected CobolParser.TokenFragment _lastTokenFragment
protected StringBuffer _tokenText
protected boolean _inNonnumericLiteral
protected boolean _tokenHasDelimiter
protected CobolWords.Word _reservedWord
protected int _integerLength
protected int _decimalLength
protected int _exponentLength
protected boolean _dbcsUserDefinedWord
protected char _nonnumericLiteralType
'\''
'"'
'G'
- DBCS literal: G"..", or N".." when the NSYMBOL(DBCS)
compiler option is in effect'N'
- national literal N".."'X'
'x'
- hex national literal NX".."'Z'
.
protected char _nonnumericLiteralDelimiter
protected int _nonnumericLiteralLength
protected boolean _nonnumericLiteralHasClosingDelimiter
protected boolean _nonnumericLiteralHasNonhexadecimal
protected boolean _nonnumericLiteralHasNonbinary
protected boolean _nonnumericLiteralHasDBCS
protected boolean _nonnumericLiteralHasSBCS
protected int _multiTokenStartElement
protected int _errorCount
protected static final char STYLE_USER_DEFINED_WORD
protected static final char STYLE_RESERVED_WORD
protected static final char STYLE_FUNCTION
protected static final char STYLE_COMPILER_DIRECTIVE
protected static final char STYLE_PREPROCESSOR_STRING
protected static final char STYLE_PICTURE_STRING
Constructor Detail |
---|
public CobolParser(LpexView lpexView)
lpexView
- the document view associated with this parserMethod Detail |
---|
protected void initParser()
initParser
in class LpexCommonParser
public void parseAll()
This method sets the parse range (_startElement .. _endElement) to the
entire document, and calls parse()
to do the work.
parseAll
in class LpexCommonParser
public void parseElement(int element)
parse()
to do the work. During parse(),
_endElement may be further extended. Before this method returns, all the
elements in the final parse range are removed from the associated view's
parse-pending list.
Extenders of this parser should not alter the document in a subclass of
this method, or the element
argument may become incorrect.
For example, in order to add and remove error-message show lines (e.g., from
a COBOL syntax checker), you must use the LpexCommonParser methods addMessage()
and removeMessages().
parseElement
in class LpexCommonParser
element
- an element affected by a committed change in this viewLpexView.parsePending(int)
,
LpexView.elementParsed(int)
,
Total and incremental parseprotected void parse()
This method assumes that _startElement and _endElement have been determined and set. While the parse is performed in here, the initial _endElement may be further extended; in this case, removeMessages() will be called to delete this parser's default embedded error messages in the extended range.
Extenders of this parser should not alter the document in a subclass of this method, or the established _startElement and _endElement may become incorrect. For example, in order to add and remove error-message show lines (e.g., from a COBOL syntax checker), you must use the LpexCommonParser methods addMessage() and removeMessages().
protected void reInitCurrentElement(int currentCharacterPosition)
currentCharacterPosition
- the next character position to handle inside
the effective text of _currentElementprotected void initCurrentElement()
A directive or comment line will be parsed in its entirety before this method returns.
protected boolean parseComment()
protected boolean parseIndicatorArea()
initCurrentElement()
to parse the indicator
area (column 7). If it returns true
, then initCurrentElement()
continues parsing until the first token character in the line, otherwise it
just returns.
protected CobolWords.Word findDirective()
protected boolean isDirectiveLine()
true
if the current line is a directive line.
protected void parseDirectiveLine()
protected boolean getDirectiveToken()
true
if a possible compiler directive was foundprotected void completeCurrentElement()
protected void flushElements()
protected CobolParser.ParseElement findParseElement(int element)
null
if there is no ParseElement for the given elementprotected boolean continueParse()
true
if parsing should be continued (we are currently
inside a COBOL construct).
protected boolean getToken()
true
a token was foundprotected void setTokenEnd()
protected boolean nextTokenCharacter()
false
is returned: at that moment _currentCharacterPosition
will point to the next non-space character (the next token, possibly in the next
element), and the intervening spaces will have been styled to '_'
.
true
if the next token character is contiguous
(no intervening spaces) to the current token characterprotected boolean nextTokenElement()
true
if another token element was found, or
false
if no more token elements are found within the
current parse rangeprotected void nextCharacter()
protected void saveTokenCharacter()
protected void parseToken()
protected void parseCodeToken()
protected boolean isSeparator()
true
if the current token is a separator.
protected boolean isCommaOrSemicolon()
true
if the current token is a comma or semicolon.
protected boolean isFloatingComment()
protected boolean isPeriod()
true
if the current token is a period.
protected void parseSeparator()
protected boolean isReservedWord()
true
if the current token is a reserved word.
protected void parseReservedWord()
protected boolean isNumericLiteral()
true
if the current token is a numeric literal.
protected int maxDigits()
protected int maxMantissa()
protected int maxExponent()
protected void parseNumericLiteral()
protected boolean isPreprocessorStart()
true
if the current token is "EXEC".
protected void parsePreprocessorStart()
protected boolean isUserDefinedWord()
true
if the current token is a user-defined word.
protected void parseUserDefinedWord()
protected String nonnumericLiteralTypes()
protected boolean isNonnumericLiteral()
true
if the current token is a nonnumeric literal.
protected void parseNonnumericLiteral()
protected boolean isPseudoTextStart()
true
if the current token is an opening
pseudo-text delimiter.
protected void parsePseudoTextStart()
protected void parseErrorToken()
protected void parsePseudoTextToken()
protected void parsePictureToken()
protected void parsePictureIsToken()
protected int maxPicture()
protected void parsePictureString()
protected void parseOptionalIdParagraphToken()
protected void parseFloatingCommentToken()
protected void parseCommentEntryToken()
protected boolean isFunctionName()
true
if the current token is a function name.
protected void parseFunctionToken()
protected void parseDateToken()
protected void parseDateFormatToken()
protected void parseDateFormatIsToken()
protected void parseDateFormatString()
protected void parsePreprocessorToken()
protected void setToken(char styleCharacter)
protected void setToken(char styleCharacter, long classes)
protected void setToken(char styleCharacter, long classes, String message)
protected void setToken(char styleCharacter, long classes, String message, String argument)
protected void setCommentToken()
protected void linkElements(int startElement, int endElement)
startElement
and endElement
are the same element.
Multiple elements belonging to one construct are doubly-linked with the _classForwardLink and _classBackwardLink.
protected void linkLexedElements(int startElement, int endElement)
linkElements(int,int)
public ResourceBundle getProfile()
getProfile
in class LpexCommonParser
LpexCommonParser.getProperty(java.lang.String)
,
Parser propertiespublic String getLanguage()
getLanguage
in class LpexCommonParser
LpexCommonParser.LANGUAGE_COBOL
public String getLanguage(LpexDocumentLocation loc)
getLanguage
in class LpexCommonParser
loc
- document location
LpexCommonParser.getLanguage()
,
Mixed content documentsprotected void initializeParser()
protected void checkExtendedLengthSetting()
_rightMarginOfAreaB
to the correct value.
protected boolean checkSequenceNumbersSetting()
protected String getPopupItems(int popupLocation)
getPopupItems
in class LpexCommonParser
popupLocation
- the location on the pop-up menu of the items
requested, one of: LpexCommonParser.POPUP_TOP
, LpexCommonParser.POPUP_FILTERVIEW
,
LpexCommonParser.POPUP_SOURCE
, LpexCommonParser.POPUP_END
null
if noneLpexCommonParser.defineFilterAction(java.lang.String, java.lang.String)
protected String getPopupItem(String key)
public void setStyleAttributes()
'_'
(layout blanks),
'b'
(separator),
'u'
(user-defined word),
'r'
(reserved word),
'f'
(function),
'a'
(date format),
'n'
(numeric literal),
'p'
(picture string),
'l'
(nonnumeric literal),
't'
(pseudo-text),
'c'
(comment),
'$'
(comment task tag),
's'
(sequence number),
'i'
(indicator area),
'd'
(compiler directive keyword),
'v'
(compiler directive),
'e'
(error),
'h'
(preprocessor string).
public String getCommentStyleCharacters()
getCommentStyleCharacters
in class LpexCommonParser
public boolean isTokenDelimiter(char ch)
isTokenDelimiter
in class LpexCommonParser
ch
- character queried, for example ')'LpexCommonParser.getToken(com.ibm.lpex.core.LpexDocumentLocation)
,
LpexCommonParser.tokenBegin(com.ibm.lpex.core.LpexDocumentLocation)
,
LpexCommonParser.tokenEnd(com.ibm.lpex.core.LpexDocumentLocation)
protected void propertySet(String key)
propertySet
in class LpexCommonParser
key
- base name of the parser property that was set, for example "autoIndent"LpexCommonParser.setProperty(String,String)
,
LpexCommonParser.getProperty(java.lang.String)
,
Parser propertiesprotected void getNSYMBOL()
protected int evaluateBeginElement(int element)
protected int evaluateEndElement(int element)
protected void addErrorMessage(int element, String message, String argument)
element
- the text element the message refers tomessage
- base message key in the editor resourcesargument
- substitution argument used in formatting the messageprotected void addErrorMessage(int element, String message)
element
- the text element the message refers tomessage
- base message key in the editor resourcespublic String getLshToken()
In addition to language keywords, this parser generates the following 'tokens' for special situations:
getLshToken
in class LpexCommonParser
protected SqlLexer getSqlLexer(LpexCharStream stream)
stream
- input character stream for the lexerprotected CicsLexer getCicsLexer(LpexCharStream stream)
stream
- input character stream for the lexerprotected LpexSubparser getDliLexer(LpexCharStream stream)
stream
- input character stream for the lexerprotected void splitLine()
splitLine
in class LpexCommonParser
LpexCommonParser.getTextIndent(int)
protected void splitLine(boolean undoCheck)
undoCheck
- set undo checkpoints within the actionprotected int join()
protected int join(boolean undoCheck)
undoCheck
- set undo checkpoints within the action
protected void backSpace()
protected void delete()
public String getTokenUsingFullText(LpexDocumentLocation loc)
loc
- location with position within the fullText of the linepublic LpexDocumentLocation getTokenLocationUsingFullText(LpexDocumentLocation fullTextLoc)
loc
- location with position within the fullText of the linepublic String elementStyleUsingFullText(int element)
LpexView.elementStyle(int)
except that the style string
will have style characters for "hidden" sequence numbers.
element
- elementpublic LpexDocumentLocation documentLocationUsingFullText()
LpexView.documentLocation()
except position is
relevant to fullText.
protected void upperCaseElement(int _startElement, int _endElement, int topPosition, int bottomPosition)
protected void setDocumentElementText(LpexView view, int iElement, String strElement)
protected String toUpperCase(String name)
name
- The name to be uppercased.
protected void upperCaseCOBOLLines(LpexView lpexView)
|
LPEX 4.4.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |