Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.parsers
Class ISeriesEditorCLParser

java.lang.Object
  extended by LpexCommonParser
      extended by com.ibm.etools.iseries.parsers.ISeriesEditorParser
          extended by com.ibm.etools.iseries.parsers.ISeriesEditorCLParser
All Implemented Interfaces:
IISeriesCompileErrorInfoViewHandler, IISeriesEditorConstants, IISeriesEditorConstantsColors, IISeriesEditorConstantsCL, IISeriesEditorParser, ISystemEditorConstants, ISystemTextEditorAdapterContributor, ISystemTextEditorContextContributor, ISystemTextEditorDebugContributor, ISystemTextEditorHelpContributor, ISystemTextEditorParser, ISystemTextEditorSourceViewerConfigurationContributor

public class ISeriesEditorCLParser
extends ISeriesEditorParser
implements IISeriesEditorConstantsCL


Nested Class Summary
protected  class ISeriesEditorCLParser.ParserState
           
 
Nested classes/interfaces inherited from class com.ibm.etools.iseries.parsers.ISeriesEditorParser
ISeriesEditorParser.DataLineMarkListener, ISeriesEditorParser.RunnableParseAll
 
Field Summary
protected static ResourceBundle _bundle
          the resource bundle for the menus
protected  int _iCLType
          the CL type for the parser to use
protected  long _lClassCallKeywords
           
protected  long _lClassCode
           
protected  long _lClassComment
           
protected  long _lClassContinuation
           
protected  long _lClassControl
           
protected  long _lClassError
           
protected  long _lClassInclude
           
protected  long _lClassLabel
           
protected  long _lClassMask
           
protected  long _lClassMessage
           
protected  long _lClassPGMKeywords
           
protected  long _lClassSpace
           
protected  long _lClassSubroutine
           
protected  ISeriesEditorCLModel _model
           
protected  ISeriesEditorCLPrefixProcessor _prefixer
          the CL prefix processor
protected  String _strCommandFromPrompter
           
protected static String _strEmpty
           
protected  ISeriesEditorCLSyntaxChecker _syntaxChecker
          the Cl syntax checker
protected  Vector<String> _vectorCallKeywords
           
protected  Vector<String> _vectorControlWords
           
protected  Vector<String> _vectorKeywords
           
protected  Vector<String> _vectorPGMKeywords
           
protected  Vector<String> _vectorSubroutineWords
           
protected  Vector<String> _vectorSymbols
           
static String copyright
           
 
Fields inherited from class com.ibm.etools.iseries.parsers.ISeriesEditorParser
_action, _bDataElementChanged, _bDebugMode, _bFromStylePreview, _bIgnoreParseExtras, _bIsPrimaryLpexView, _bLocal, _bOutlineViewNeedsResetting, _bParseAll, _bParsing, _compileEditManager, _compileErrorMarkerListener, _compileMarkNames, _dataLineMarkID, _dataLineMarkListener, _editor, _helpResourceBundle, _iCCSID, _iFile, _labelProvider, _member, _menuLanguageHelp, _menuSource, _outlinePage, _strImagePath, _strLocalFileName, _strSpecialChars, _view, DATA_LINE
 
Fields inherited from interface com.ibm.etools.iseries.editor.IISeriesEditorConstantsCL
_straCallKeywords, _straControlWords, _straKeywords, _straLoopStart, _straPGMKeywords, _straSubroutineWords, _straSymbols, _strLoopEnd, _strPgmExpEnd, _strPgmExpStart, _strSelectEnd, _strSelectStart, _strSubroutineEnd, _strSubroutineStart, CL_PARSE_TABLE, CL_PRODUCT_CODE, CLASS_CALL_KEYWORDS, CLASS_COMMENTS, CLASS_CONTINUATION, CLASS_INCLUDE, CLASS_LABEL, CLASS_PGM_KEYWORDS, CLASS_SUBROUTINE, FONT_BUILTIN, FONT_COMMANDS, FONT_COMMENT, FONT_ERROR, FONT_KEYWORD, FONT_LABEL, FONT_LANGUAGE, FONT_LAYOUT, FONT_LITERAL, FONT_NAME, FONT_NUMBER, FONT_PARAMETER, FONT_SYMBOLS, FONT_VALUE, INDENT_CMD_TO_PARM, INDENT_CMD_TO_PARM_CONT, INDENT_COMMAND, INDENT_COMMAND_BATCH, INDENT_COMMAND_BATCH_CONT, INDENT_LABEL, INDENT_LABEL_BATCH, INDENT_MAX_CMD_LEN, INDENT_MAX_LABEL_LEN, INDENT_MAX_NOLIB_CMD_LEN, INDENT_TO_CONT, ISERIES_BND, ISERIES_CL, ISERIES_CLLE, ISERIES_CLP, ISERIES_CMD, ISERIES_UNKNOWN_FILE, MAX_CONTROLS, MAX_FILENAME_LEN, MAX_KEYWORDS, MAX_MESSAGE_LEN, MAX_PARSE_DATA_LEN, MAX_SERVERINFO, MAX_STMT_LEN, MAX_SYMBOLS, MAX_TOKEN_LEN, MAX_VAR_TEXT, MSG_BUFFER_SIZE, PREF_CL_PREFIX, TYPE_COMMAND, TYPE_KEYWORD, TYPE_LABEL, TYPE_NAME
 
Fields inherited from interface com.ibm.etools.iseries.parsers.IISeriesEditorParser
Copyright
 
Fields inherited from interface com.ibm.etools.systems.editor.ISystemTextEditorAdapterContributor
Copyright
 
Fields inherited from interface com.ibm.etools.systems.editor.ISystemTextEditorContextContributor
Copyright
 
Fields inherited from interface com.ibm.etools.systems.editor.ISystemTextEditorDebugContributor
Copyright
 
Fields inherited from interface com.ibm.etools.systems.editor.ISystemTextEditorHelpContributor
Copyright
 
Fields inherited from interface com.ibm.etools.systems.editor.ISystemTextEditorSourceViewerConfigurationContributor
Copyright
 
Fields inherited from interface com.ibm.etools.iseries.edit.IISeriesEditorConstantsColors
COLOR_BLACK_WHITE, COLOR_BLUE_WHITE, COLOR_BRIGHTBLUE_WHITE, COLOR_BRIGHTGREEN_WHITE, COLOR_BRIGHTGREY_WHITE, COLOR_BRIGHTPINK_WHITE, COLOR_BRIGHTRED_WHITE, COLOR_BRIGHTRED_WHITE_SQUIGGLE, COLOR_BROWN_WHITE, COLOR_CYAN_WHITE, COLOR_DARK_BROWN_WHITE, COLOR_ERROR_HIGHLIGHT, COLOR_GREEN_WHITE, COLOR_GREY_WHITE, COLOR_HIGHLIGHT, COLOR_MAGENTA_WHITE, COLOR_PINK_WHITE, COLOR_RED_WHITE, COLOR_WHITE_BRIGHTRED
 
Fields inherited from interface com.ibm.etools.iseries.edit.IISeriesEditorConstants
ACTION_VERIFYPROGRAM_ID, APPLICATION_DIAGRAM, COMPILE_ERROR_MESSAGE_STYLE, FILE_TYPE_CL, FILE_TYPE_DDS, FILE_TYPE_OTHER, FILE_TYPE_RPGILE, FILE_TYPE_RPGOPM, MAX_DS_NESTING, OUTLINE_VIEW, PREF_AUTO_FORMAT, PREF_AUTO_FORMAT_T, PREF_AUTO_UPPER, PREF_AUTO_UPPER_T, PREF_BASE_PREFIX, PREF_BLANK, PREF_BLANK_SUFFIX, PREF_BLANK_T, PREF_COMMAND_POS, PREF_COMMAND_POS_T, PREF_HIGHLIGHT, PREF_HIGHLIGHT_BACKGROUND, PREF_HIGHLIGHT_BACKGROUND_T, PREF_HIGHLIGHT_T, PREF_INDENT, PREF_INDENT_T, PREF_INDENTATION, PREF_INDENTATION_T, PREF_LABEL_ABOVE_CMD, PREF_LABEL_ABOVE_CMD_T, PREF_LABEL_POS, PREF_LABEL_POS_T, PREF_LINE_LENGTH, PREF_LINE_LENGTH_T, PREF_ONE_PARM_PER_LINE, PREF_ONE_PARM_PER_LINE_T, PREF_PARSER_ASSOC, PREF_PARSER_STYLES, PREF_SIGNATURE_T, PREF_SQL_SYNTAX_CHECK, PREF_SQL_SYNTAX_CHECK_T, PREF_SYNTAX_CHECK, PREF_SYNTAX_CHECK_T, PREF_TAB, PREF_TAB_GENERAL, PREF_TAB_GENERAL_T, PREF_TAB_T, PREF_TOOLTIP_SUFFIX, PROGRAM_VERIFICATION
 
Fields inherited from interface com.ibm.etools.systems.editor.ISystemEditorConstants
COMPILE_ERROR_CLASS_NAME, ICON_EDITOR_COMPILE, ICON_EDITOR_COMPILE_D, ICON_EDITOR_COMPILE_D_ID, ICON_EDITOR_COMPILE_D_ROOT, ICON_EDITOR_COMPILE_ID, ICON_EDITOR_COMPILE_ROOT, ICON_EDITOR_NEXT_ERROR, ICON_EDITOR_NEXT_ERROR_D, ICON_EDITOR_NEXT_ERROR_D_ID, ICON_EDITOR_NEXT_ERROR_D_ROOT, ICON_EDITOR_NEXT_ERROR_ID, ICON_EDITOR_NEXT_ERROR_ROOT, ICON_EDITOR_PREVIOUS_ERROR, ICON_EDITOR_PREVIOUS_ERROR_D, ICON_EDITOR_PREVIOUS_ERROR_D_ID, ICON_EDITOR_PREVIOUS_ERROR_D_ROOT, ICON_EDITOR_PREVIOUS_ERROR_ID, ICON_EDITOR_PREVIOUS_ERROR_ROOT, ICON_EXT, ICON_RELATIVE_PATH_DLCL16, ICON_RELATIVE_PATH_ELCL16, ICON_RELATIVE_PATH_FULL, ICON_SUFFIX, PREFIX, SYNTAX_ERROR_CLASS_NAME
 
Constructor Summary
ISeriesEditorCLParser(LpexView view)
          Constructor
 
Method Summary
 void cleanupMenu(ITextEditor editor, IMenuManager menuManager)
          Removes the Source and Compile menu items
 void cleanupToolBar(ITextEditor editor, IToolBarManager toolBarManager)
          removes the next and previous error toolbar buttons
protected  void contributeMenuItems(IMenuManager menuRoot, boolean bPopupMenu)
          Adds common menu items to the top of the root menu.
 void contributeToMenu(ITextEditor editor, IMenuManager menuManager)
          Contributes menu bar items.
 void contributeToPopupMenu(ITextEditor editor, IMenuManager menuRoot)
          Contributes popup menu bar items.
 void contributeToToolBar(ITextEditor editor, IToolBarManager toolBarManager)
          Contributes tool bar items.
protected  void createActions(ITextEditor editor)
          Creates menubar and toolbar actions.
 int cursorIndent(int element)
           
 void disableFormatting()
           
 void disableUppercasing()
           
 void doRefresh()
          Remove block nesting in the prefix area
 void enableFormatting()
           
 void enableUppercasing()
           
 void finishedSaving(ITextEditor editor)
          Method finishedSaving Does nothing for the CL Parser
 void focusGained(FocusEvent event)
          Method focusGained.
 boolean getAutoFormatting()
          Method getAutoFormatting.
 int getAutoFormattingCommandPosition()
          Method getAutoFormattingCommandPosition.
 int getAutoFormattingContinuedLineIndent()
          Method getAutoFormattingContinuedLineIndent.
 boolean getAutoFormattingLabelAboveCommand()
          Method getAutoFormattingLabelAboveCommand.
 int getAutoFormattingLabelPosition()
          Method getAutoFormattingLabelPosition.
 int getAutoFormattingLineLength()
          Retrieves the line length to use for fomatting
 boolean getAutoFormattingOneParmPerLine()
          Method getAutoFormattingOneParmPerLine.
 boolean getAutoIndent()
          Method getAutoIndent.
 boolean getAutoUppercase()
          Method getAutoUppercase.
 String getCommentStyleCharacters()
           
 IQSYSFile getFieldFile()
          Method getFieldFile.
 SystemTextEditorHelpHandler getHelpHandler()
          Returns the help handler.
 String getHelpPage(LpexView view)
          This is called from the editor whenever F1 is pressed.
 IQSYSMember getIncludeMember()
          Subclasses should override if implementing the action ActionOpenInclude
 String getLanguage()
          Declared in ISystemEditorParser
 String getLshToken()
          Declared in LpexLanguageHelp.
 SystemTextEditorHelpHandler getMessageHelpHandler()
          Returns the message help handler for this parser.
 LanguageModel getModel(boolean bUpdate)
          Returns the element tree model for the outline view.
 String getPopupItems(int popupLocation)
          56708 Return the popup menu items
 ResourceBundle getProfile()
           
 IISeriesEditorPromptAdapter getPromptAdapter()
          Method declared on ISeriesEditorParser.
protected  String getRegularTextIndent(int iElement)
          Method getRegularTextIndent.
 int getStatementEndElement(int iElement)
          This method accepts the first line in a statement and finds the last line in the statement.
protected  int getStatementEndLine(int iLine)
          Deprecated.  
 int getStatementStartElement(int iElement)
          This method accepts an element number and searches backward to find the first Element in the statement that contains the specified Element.
protected  int getStatementStartLine(int iLine)
          Deprecated.  
 String getStatementString(int iElementStart, int iElementEnd)
          Generates a statement string from the statement's, start and end line numbers.
protected  String getStatementWithoutCommand(String strStatement, StringBuffer strbLabel, StringBuffer strbCommand)
          Method getStatementWithoutCommand.
 IISeriesEditorSyntaxChecker getSyntaxChecker()
          Returns the syntax checker.
 String getTextIndent(int iElement)
          Method getTextIndent.
protected  void initializeColors()
          Initializes the display colors.
 void initializeElementClassTypes()
          Registers the element class types with Lpex
 void initializeLpexView(LpexView lpexView)
          Declared in IISeriesEditorParser
protected  void initializeTabs()
          Initializes tab stops.
protected  void initParser()
          initialize parser
protected  boolean isElementContinued(int iElement)
          Returns true if there is a continuation character at the end of the line.
protected  boolean isLineContinued(int iLine)
          Deprecated.  
 boolean isLineDebuggable(int iLine)
          Method isLineDebuggable.
 boolean isValidFieldAction()
          Method isValidFieldAction.
 boolean isValidIncludeAction()
          Method isValidIncludeAction.
protected  boolean isWordContinued(String strLine, int iPosition)
           
protected  LpexDocumentLocation matchToken(LpexDocumentLocation loc)
          Method matchToken Matches the token that the location specifies.
protected  void newLine()
          Method newLine enhanced version which reparses appropriately
protected  void openLine()
          Method openLine.
 void parseElement(int iElement)
          CL must override the version in ISeriesEditorParser because it needs to handle continued lines
 void parseElements(int iElementFirst, int iElementLast, int iElementCurrent)
          Parse range of elements This just calls parseLine(i) for each element, subclasses can handle it differently if they want (e.g.
 void parseLine(int iElement)
          Called by the JLpex editor whenever a line has been changed by the user.
protected  void parseLine(int iElement, ISeriesEditorCLParser.ParserState state)
          Port of l4clprs.c, ParseLine
protected  void parseLineIdentifier(String strLine, int iIndex, ISeriesEditorCLParser.ParserState state, int iElement)
          Port of l4clprs.c, subset of ParseLine.
 void parseRegion(int iElementFirst, int iElementLast, IProgressMonitor progressMonitor)
          Subclasses must subclass.
 void parseRegion(int iElementFirst, int iElementLast, IProgressMonitor progressMonitor, ISeriesEditorCLParser.ParserState state)
          Parse the entire document.
 void populateModel()
          Populate the model for the Outline view with labels and subroutines
 void prompt()
          Called by the editor to display the iSeries toolkit prompt dialog.
 void promptRequest()
          Called when the F4 key was just pressed.
protected  int readComment(String strLine, int iIndex, ISeriesEditorCLParser.ParserState state)
          This method will read characters in the given line buffer from the specified position up to the end comment character sequence or the end of line.
protected  int readLayout(String strLine, int iIndex)
          This method reads characters comprising layout space in the given line buffer starting from the specified position.
protected  int readLiteral(String strLine, int iIndex, ISeriesEditorCLParser.ParserState state)
          This method will read characters in the given line buffer from the specified position up to the matching (single or double) quote or the end of line.
protected  int readNumber(String strLine, int iIndex)
          This routine reads the next number in the given line buffer starting from the specified position.
protected  int readSymbol(String strLine, int iIndex)
          This method checks if the next token in the given line buffer is one of the special symbols listed in the parse table.
protected  String readWord(String strLine, int iIndex)
          This method reads the next word in the given line buffer starting from the specified position.
 void setCLType(String strName)
          Sets the CL type from the file name extension.
 void setEditor(LpexTextEditor editor)
          Method setEditor.
protected  void setElementsFromStatement(int iElementStart, int iElementEnd, String strStatement)
          Converts a single statement into multiple Elements of text, if the text is longer than the allowed Element length.
protected  void setLinesFromStatement(int iLineStart, int iLineEnd, String strStatement)
          Deprecated.  
protected  String showPromptDialog(IBMiConnection as400, String strCommand)
          Displays the prompt dialog given the prompt command string.
protected  void split()
          Method split.
protected  void splitLine()
          Method splitLine.
protected  boolean supportsOutlineView()
          CL supports outline view for specific types
 void terminateParser()
          When parsing is disabled, turn off model
protected  void upperCaseElement(int iElement)
          Method upperCaseElement.
protected  void upperCaseLine(int iLine)
          Deprecated.  
 
Methods inherited from class com.ibm.etools.iseries.parsers.ISeriesEditorParser
addCompileError, addError, cleanupPopupMenu, copyCompileErrorInfo, createOutlineView, doLpexAction, doPromptAction, elementChanged, focusLost, getAdapter, getAS400, getEditor, getFieldsProvider, getFormatLine, getIFile, getImage, getISeriesConnection, getISeriesMember, getLocalFileName, getLpexLanguageHelpHandler, getLpexView, getProgramVerifier, getProperty, getPropertySheet, getSourceViewerConfiguration, getSpecialChars, getTextLimit, hasSequenceNumbers, isDebugMode, isElementAboveDataRegion, isLineAboveDataRegion, isLocal, isReadOnly, match, modelBuiltAsynchronous, parseAll, queryDataLine, removeErrors, removeErrors, resetOutlineView, saving, selectionLinesChanged, selectionLinesChanged, selectionLinesChanged, setAS400, setCompileErrorInfo, setDebugMode, setEnableParseExtras, setLocal, updateProfileForActions, updateProfileForTabbing, upperCase
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_bundle

protected static ResourceBundle _bundle
the resource bundle for the menus


_strEmpty

protected static final String _strEmpty
See Also:
Constant Field Values

copyright

public static final String copyright
See Also:
Constant Field Values

_iCLType

protected int _iCLType
the CL type for the parser to use


_lClassCode

protected long _lClassCode

_lClassComment

protected long _lClassComment

_lClassContinuation

protected long _lClassContinuation

_lClassControl

protected long _lClassControl

_lClassError

protected long _lClassError

_lClassMask

protected long _lClassMask

_lClassMessage

protected long _lClassMessage

_lClassSpace

protected long _lClassSpace

_lClassSubroutine

protected long _lClassSubroutine

_lClassLabel

protected long _lClassLabel

_lClassInclude

protected long _lClassInclude

_lClassCallKeywords

protected long _lClassCallKeywords

_lClassPGMKeywords

protected long _lClassPGMKeywords

_prefixer

protected ISeriesEditorCLPrefixProcessor _prefixer
the CL prefix processor


_strCommandFromPrompter

protected String _strCommandFromPrompter

_syntaxChecker

protected ISeriesEditorCLSyntaxChecker _syntaxChecker
the Cl syntax checker


_vectorControlWords

protected Vector<String> _vectorControlWords

_vectorKeywords

protected Vector<String> _vectorKeywords

_vectorSymbols

protected Vector<String> _vectorSymbols

_vectorSubroutineWords

protected Vector<String> _vectorSubroutineWords

_vectorCallKeywords

protected Vector<String> _vectorCallKeywords

_vectorPGMKeywords

protected Vector<String> _vectorPGMKeywords

_model

protected ISeriesEditorCLModel _model
Constructor Detail

ISeriesEditorCLParser

public ISeriesEditorCLParser(LpexView view)
Constructor

Method Detail

initParser

protected void initParser()
initialize parser

Overrides:
initParser in class ISeriesEditorParser

cleanupToolBar

public void cleanupToolBar(ITextEditor editor,
                           IToolBarManager toolBarManager)
Description copied from class: ISeriesEditorParser
removes the next and previous error toolbar buttons

subclasses which add other toolbar buttons should subclass and call super

Specified by:
cleanupToolBar in interface ISystemTextEditorContextContributor
Overrides:
cleanupToolBar in class ISeriesEditorParser
See Also:
ISystemTextEditorContextContributor.cleanupToolBar(ITextEditor, IToolBarManager)

contributeMenuItems

protected void contributeMenuItems(IMenuManager menuRoot,
                                   boolean bPopupMenu)
Adds common menu items to the top of the root menu.


contributeToMenu

public void contributeToMenu(ITextEditor editor,
                             IMenuManager menuManager)
Contributes menu bar items.

Specified by:
contributeToMenu in interface ISystemTextEditorContextContributor
Overrides:
contributeToMenu in class ISeriesEditorParser

contributeToPopupMenu

public void contributeToPopupMenu(ITextEditor editor,
                                  IMenuManager menuRoot)
Contributes popup menu bar items.

Specified by:
contributeToPopupMenu in interface ISystemTextEditorContextContributor

contributeToToolBar

public void contributeToToolBar(ITextEditor editor,
                                IToolBarManager toolBarManager)
Contributes tool bar items.

Specified by:
contributeToToolBar in interface ISystemTextEditorContextContributor
Overrides:
contributeToToolBar in class ISeriesEditorParser

createActions

protected void createActions(ITextEditor editor)
Creates menubar and toolbar actions.


cursorIndent

public int cursorIndent(int element)
See Also:
com.ibm.lpex.core.LpexCommonParser#cursorIndent(int)

disableFormatting

public void disableFormatting()

disableUppercasing

public void disableUppercasing()

enableFormatting

public void enableFormatting()

enableUppercasing

public void enableUppercasing()

finishedSaving

public void finishedSaving(ITextEditor editor)
Method finishedSaving Does nothing for the CL Parser

Specified by:
finishedSaving in interface ISystemTextEditorContextContributor
See Also:
ISystemTextEditorContextContributor.finishedSaving(ITextEditor)

focusGained

public void focusGained(FocusEvent event)
Method focusGained. In addition to the default parser focusGained method, it resets tabs if changed in the preferences

Overrides:
focusGained in class ISeriesEditorParser
See Also:
FocusListener

getAutoFormatting

public boolean getAutoFormatting()
Method getAutoFormatting. returns whether or not preference store indicates that auto-formatting is on

Returns:
boolean

getAutoFormattingCommandPosition

public int getAutoFormattingCommandPosition()
Method getAutoFormattingCommandPosition. returns zero-based position for command for when auto-formatting is on

Returns:
int

getAutoFormattingContinuedLineIndent

public int getAutoFormattingContinuedLineIndent()
Method getAutoFormattingContinuedLineIndent. returns indentation for a continued line

Returns:
int

getAutoFormattingLabelAboveCommand

public boolean getAutoFormattingLabelAboveCommand()
Method getAutoFormattingLabelAboveCommand. returns whether or not preference store indicates that label should be on line above command when autoformatting

Returns:
boolean

getAutoFormattingLabelPosition

public int getAutoFormattingLabelPosition()
Method getAutoFormattingLabelPosition. returns zero-based position for label for when auto-formatting is on

Returns:
boolean

getAutoFormattingOneParmPerLine

public boolean getAutoFormattingOneParmPerLine()
Method getAutoFormattingOneParmPerLine. returns whether or not preference store indicates that one parameter per line when autoformatting

Returns:
boolean

getAutoFormattingLineLength

public int getAutoFormattingLineLength()
Retrieves the line length to use for fomatting

Returns:
the line length to use for formatting
Since:
7.1

getAutoIndent

public boolean getAutoIndent()
Method getAutoIndent. returns whether or not preference store indicates that auto-Indent is on

See Also:
com.ibm.lpex.core.LpexCommonParser#getAutoIndent()

getAutoUppercase

public boolean getAutoUppercase()
Method getAutoUppercase. returns whether or not the preference store indicates that auto-uppercasing is on

Overrides:
getAutoUppercase in class ISeriesEditorParser
Returns:
boolean

getCommentStyleCharacters

public String getCommentStyleCharacters()
See Also:
com.ibm.lpex.core.LpexCommonParser#getCommentStyleCharacters()

getFieldFile

public IQSYSFile getFieldFile()
Method getFieldFile. returns an ISeriesFile object if the cursor is on a line with a DCLF, null otherwise.

Specified by:
getFieldFile in interface IISeriesEditorParser
Overrides:
getFieldFile in class ISeriesEditorParser
Returns:
an object that the action can run against
See Also:
com.ibm.etools.iseries.editor.IISeriesEditorParser#getFieldFile()

getHelpHandler

public SystemTextEditorHelpHandler getHelpHandler()
Returns the help handler. None in this case.

Specified by:
getHelpHandler in interface IISeriesEditorParser

getHelpPage

public String getHelpPage(LpexView view)
This is called from the editor whenever F1 is pressed. Since we have not give the editor a help handler, the editor calls this method. A null is returned so that JLpex does nothing. The help is displayed here.


getLanguage

public String getLanguage()
Declared in ISystemEditorParser

Specified by:
getLanguage in interface ISystemTextEditorParser
Specified by:
getLanguage in class ISeriesEditorParser

getLshToken

public String getLshToken()
Declared in LpexLanguageHelp. Return the token to find help for, in this case the command (with library if specified)

Overrides:
getLshToken in class ISeriesEditorParser

getMessageHelpHandler

public SystemTextEditorHelpHandler getMessageHelpHandler()
Returns the message help handler for this parser.


getPopupItems

public String getPopupItems(int popupLocation)
56708 Return the popup menu items

Overrides:
getPopupItems in class ISeriesEditorParser
See Also:
com.ibm.lpex.core.LpexCommonParser#getPopupItems(int)

getProfile

public ResourceBundle getProfile()

getPromptAdapter

public IISeriesEditorPromptAdapter getPromptAdapter()
Method declared on ISeriesEditorParser. Returns an adapter used to communicate between the editor and a prompt view. This implementation does not use the prompt viewer, but asks the iSeries toolbox to present a prompt dialog.

Specified by:
getPromptAdapter in interface IISeriesEditorParser
Specified by:
getPromptAdapter in class ISeriesEditorParser

getRegularTextIndent

protected String getRegularTextIndent(int iElement)
Method getRegularTextIndent. This method calculated the text indent of a line without a DO or ENDDO on it

Parameters:
iElement - the element to find the indent for
Returns:
String the indent String

getStatementEndElement

public int getStatementEndElement(int iElement)
This method accepts the first line in a statement and finds the last line in the statement. Port of l4clprs.c, GetStatement.


getStatementEndLine

protected int getStatementEndLine(int iLine)
Deprecated. 

This method accepts the first line in a statement and finds the last line in the statement. Port of l4clprs.c, GetStatement.


getStatementStartElement

public int getStatementStartElement(int iElement)
This method accepts an element number and searches backward to find the first Element in the statement that contains the specified Element. The Element number of the statement's first Element is returned. Port of l4clprs.c, GetStartingLine.


getStatementStartLine

protected int getStatementStartLine(int iLine)
Deprecated. 

This method accepts a line number and searches backward to find the first line in the statement that contains the specified line. The line number of the statement's first line is returned. Port of l4clprs.c, GetStartingLine.


getStatementString

public String getStatementString(int iElementStart,
                                 int iElementEnd)
Generates a statement string from the statement's, start and end line numbers. The start and end line numbers must be the statement's true start and end line numbers. Port of l4clprs.c BuildStatement.


getStatementWithoutCommand

protected String getStatementWithoutCommand(String strStatement,
                                            StringBuffer strbLabel,
                                            StringBuffer strbCommand)
Method getStatementWithoutCommand. Removes the command and label

Parameters:
strStatement - the statement to strip the command and label from
strbCommand - the command stripped
Returns:
String the label stripped

getSyntaxChecker

public IISeriesEditorSyntaxChecker getSyntaxChecker()
Returns the syntax checker.

Specified by:
getSyntaxChecker in interface IISeriesEditorParser
Overrides:
getSyntaxChecker in class ISeriesEditorParser
See Also:
com.ibm.etools.iseries.editor.IISeriesEditorParser#getSyntaxChecker()

getTextIndent

public String getTextIndent(int iElement)
Method getTextIndent. Returns the string value to indent for the specified element

Parameters:
iElement - the element to determine the indent
Returns:
the string to indent the element with.
See Also:
com.ibm.lpex.core.LpexCommonParser#getTextIndent(int)

initializeColors

protected void initializeColors()
Initializes the display colors.


initializeElementClassTypes

public void initializeElementClassTypes()
Registers the element class types with Lpex


initializeLpexView

public void initializeLpexView(LpexView lpexView)
Declared in IISeriesEditorParser

Specified by:
initializeLpexView in interface IISeriesEditorParser
Overrides:
initializeLpexView in class ISeriesEditorParser

initializeTabs

protected void initializeTabs()
Initializes tab stops.


isElementContinued

protected boolean isElementContinued(int iElement)
Returns true if there is a continuation character at the end of the line.


isLineContinued

protected boolean isLineContinued(int iLine)
Deprecated. 

Returns true if there is a continuation character at the end of the line.


isLineDebuggable

public boolean isLineDebuggable(int iLine)
Method isLineDebuggable. Returns true to let the super class know that this line is debuggable.

Specified by:
isLineDebuggable in interface ISystemTextEditorDebugContributor
Parameters:
iLine - the line to check
Returns:
true if the line has executable code, is not a DCL statement and is the last line of the statement (only the last line of a CL statement is executable)

isValidFieldAction

public boolean isValidFieldAction()
Method isValidFieldAction. checks whther the current line is valid for the show fields action

Specified by:
isValidFieldAction in interface IISeriesEditorParser
Overrides:
isValidFieldAction in class ISeriesEditorParser
Returns:
true if the current line has DCLF, false otherwise
See Also:
com.ibm.etools.iseries.editor.IISeriesEditorParser#isValidFieldAction()

isWordContinued

protected boolean isWordContinued(String strLine,
                                  int iPosition)

matchToken

protected LpexDocumentLocation matchToken(LpexDocumentLocation loc)
Method matchToken Matches the token that the location specifies. In the case of CL, DO and ENDDOs are matched in addition to brackets and quotes

Parameters:
loc - the location of the token to match
Returns:
the location of the matching token, null if the token DO or ENDDO is not found
See Also:
com.ibm.lpex.core.LpexCommonParser#matchToken(LpexDocumentLocation)

newLine

protected void newLine()
Method newLine enhanced version which reparses appropriately

See Also:
com.ibm.lpex.core.LpexCommonParser#newLine()

openLine

protected void openLine()
Method openLine. enhanced version which reparses appropriately

See Also:
com.ibm.lpex.core.LpexCommonParser#openLine()

parseElements

public void parseElements(int iElementFirst,
                          int iElementLast,
                          int iElementCurrent)
Description copied from class: ISeriesEditorParser
Parse range of elements This just calls parseLine(i) for each element, subclasses can handle it differently if they want (e.g. only calling a syntax checker once for the whole range of lines instead of once per line).

Overrides:
parseElements in class ISeriesEditorParser
See Also:
com.ibm.etools.iseries.editor.ISeriesEditorParser#parseElements(int, int, int)

parseLine

public void parseLine(int iElement)
Called by the JLpex editor whenever a line has been changed by the user.

Specified by:
parseLine in class ISeriesEditorParser
See Also:
com.ibm.etools.iseries.editor.ISeriesEditorParser#parseLine(int)

parseLine

protected void parseLine(int iElement,
                         ISeriesEditorCLParser.ParserState state)
Port of l4clprs.c, ParseLine


parseLineIdentifier

protected void parseLineIdentifier(String strLine,
                                   int iIndex,
                                   ISeriesEditorCLParser.ParserState state,
                                   int iElement)
Port of l4clprs.c, subset of ParseLine.


parseRegion

public void parseRegion(int iElementFirst,
                        int iElementLast,
                        IProgressMonitor progressMonitor)
Description copied from class: ISeriesEditorParser
Subclasses must subclass.

Specified by:
parseRegion in class ISeriesEditorParser

parseRegion

public void parseRegion(int iElementFirst,
                        int iElementLast,
                        IProgressMonitor progressMonitor,
                        ISeriesEditorCLParser.ParserState state)
Parse the entire document. Port of l4clprs.c,


prompt

public void prompt()
Called by the editor to display the iSeries toolkit prompt dialog. This method does the following:
  1. Determines the statement's first line number
  2. Determines the statement's last line number
  3. Combines the lines into one statement string
  4. Removes the label and comments from the statement string
  5. Asks the iSeries to display its prompt dialog
  6. Obtains the modified string from the iSeries
  7. Reintegrates the label and comments into the modified string
  8. Formats the reintegrated statement for the editor
  9. Replaces the statement lines with the new statement
Port of l4clprs.c, PromptStatement.

Overrides:
prompt in class ISeriesEditorParser

promptRequest

public void promptRequest()
Called when the F4 key was just pressed. Parse and tokenize the line.

Specified by:
promptRequest in class ISeriesEditorParser

readComment

protected int readComment(String strLine,
                          int iIndex,
                          ISeriesEditorCLParser.ParserState state)
This method will read characters in the given line buffer from the specified position up to the end comment character sequence or the end of line. It returns the length of the (incomplete) comment token. It also sets the 'InsideComment' flag if the end of the line is encountered the comment ends. Port of l4clprs.c, ReadComment.


readLayout

protected int readLayout(String strLine,
                         int iIndex)
This method reads characters comprising layout space in the given line buffer starting from the specified position. It returns the length of the white space. Port of l4clprs.c, ReadLayout.


readLiteral

protected int readLiteral(String strLine,
                          int iIndex,
                          ISeriesEditorCLParser.ParserState state)
This method will read characters in the given line buffer from the specified position up to the matching (single or double) quote or the end of line. It returns the length of the complete or incomplete literal token. A -1 is returned if either the literal is incomplete, or there is no continuation character as the last character of the line. Port of l4clprs.c, ReadLiteral.


readNumber

protected int readNumber(String strLine,
                         int iIndex)
This routine reads the next number in the given line buffer starting from the specified position. It returns the length of the numeric token. Port of l4clprs.c, ReadNumber.


readSymbol

protected int readSymbol(String strLine,
                         int iIndex)
This method checks if the next token in the given line buffer is one of the special symbols listed in the parse table. Choose the longest possible special symbol. It returns the length of the symbol, or zero if there isn't a match. This method assumes that symbols are ordered from the longest to the shortest for symbols that start with he same character. Port of l4clprs.c, TestSymbol.


readWord

protected String readWord(String strLine,
                          int iIndex)
This method reads the next word in the given line buffer starting from the specified position. It returns the word. Port of l4clprs.c, ReadWord.


setCLType

public void setCLType(String strName)
Sets the CL type from the file name extension. The input name is a fully qualified file name.


setEditor

public void setEditor(LpexTextEditor editor)
Description copied from interface: IISeriesEditorParser
Method setEditor. Sets up the editor and related info for the parser

Specified by:
setEditor in interface IISeriesEditorParser
Overrides:
setEditor in class ISeriesEditorParser
Parameters:
editor - the editor for this parser
See Also:
The CCSID is set here. If the file CCSID is invalid, the job CCSID is used. The CCSID is used later to obtain the special translation characters in getSpecialChars.

IMPORTANT!!!!!!!! NOTE: if you modify this method, you NEED to propate all changes to all 4 COBOL parsers


setElementsFromStatement

protected void setElementsFromStatement(int iElementStart,
                                        int iElementEnd,
                                        String strStatement)
Converts a single statement into multiple Elements of text, if the text is longer than the allowed Element length. Port of l4clprs.c FormatStatement.


setLinesFromStatement

protected void setLinesFromStatement(int iLineStart,
                                     int iLineEnd,
                                     String strStatement)
Deprecated. 

Converts a single statement into multiple lines of text, if the text is longer than the allowed line length. Port of l4clprs.c FormatStatement.


showPromptDialog

protected String showPromptDialog(IBMiConnection as400,
                                  String strCommand)
Displays the prompt dialog given the prompt command string.


split

protected void split()
Method split. Enhanced version which reparses split Elements


splitLine

protected void splitLine()
Method splitLine. Enhanced version which reparses split lines

See Also:
com.ibm.lpex.core.LpexCommonParser#splitLine()

upperCaseElement

protected void upperCaseElement(int iElement)
Method upperCaseElement. This method uppercases the specified Elements, excluding comments and strings in quotes

Parameters:
iElement - the Element to uppercase

upperCaseLine

protected void upperCaseLine(int iLine)
Deprecated. 

Method upperCaseLine. This method uppercases the specified lines, excluding comments and strings in quotes

Parameters:
iLine - the line to uppercase

supportsOutlineView

protected boolean supportsOutlineView()
CL supports outline view for specific types

Overrides:
supportsOutlineView in class ISeriesEditorParser

getModel

public LanguageModel getModel(boolean bUpdate)
Returns the element tree model for the outline view.

Specified by:
getModel in interface IISeriesEditorParser
Overrides:
getModel in class ISeriesEditorParser

cleanupMenu

public void cleanupMenu(ITextEditor editor,
                        IMenuManager menuManager)
Description copied from class: ISeriesEditorParser
Removes the Source and Compile menu items

subclasses which add other menus should subclass and call super

Specified by:
cleanupMenu in interface ISystemTextEditorContextContributor
Overrides:
cleanupMenu in class ISeriesEditorParser
See Also:
ISystemTextEditorContextContributor.cleanupMenu(ITextEditor, IMenuManager)

terminateParser

public void terminateParser()
When parsing is disabled, turn off model

Overrides:
terminateParser in class ISeriesEditorParser
See Also:
com.ibm.lpex.core.LpexCommonParser#terminateParser()

parseElement

public void parseElement(int iElement)
CL must override the version in ISeriesEditorParser because it needs to handle continued lines

Overrides:
parseElement in class ISeriesEditorParser
Since:
6.0.1.3
See Also:
com.ibm.etools.iseries.editor.ISeriesEditorParser#parseElement(int), com.ibm.lpex.core.LpexCommonParser#parseElement(int)

doRefresh

public void doRefresh()
Remove block nesting in the prefix area

Specified by:
doRefresh in interface ISystemTextEditorParser
Overrides:
doRefresh in class ISeriesEditorParser
See Also:
ISystemTextEditorParser.doRefresh()

populateModel

public void populateModel()
Populate the model for the Outline view with labels and subroutines


isValidIncludeAction

public boolean isValidIncludeAction()
Method isValidIncludeAction. checkw whether the current line is valid for showing INCLUDE members

Specified by:
isValidIncludeAction in interface IISeriesEditorParser
Overrides:
isValidIncludeAction in class ISeriesEditorParser
Returns:
true if the current line is an INCLUDE line
See Also:
com.ibm.etools.iseries.editor.IISeriesEditorParser#isValidIncludeAction()

getIncludeMember

public IQSYSMember getIncludeMember()
Description copied from class: ISeriesEditorParser
Subclasses should override if implementing the action ActionOpenInclude

Specified by:
getIncludeMember in interface IISeriesEditorParser
Overrides:
getIncludeMember in class ISeriesEditorParser
Returns:
the ISeriesMember to edit/browse
See Also:
com.ibm.etools.iseries.editor.IISeriesEditorParser#getIncludeMember()

Rational Developer for Power Systems Software
V7.6

Copyright 2011 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.