Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.parsers
Class ISeriesEditorRPGILEParser

java.lang.Object
  extended by LpexCommonParser
      extended by com.ibm.etools.iseries.parsers.ISeriesEditorParser
          extended by com.ibm.etools.iseries.parsers.ISeriesEditorRPGILEParser
All Implemented Interfaces:
IISeriesCompileErrorInfoViewHandler, IISeriesEditorConstants, IISeriesEditorConstantsColors, IISeriesEditorConstantsRPG, IISeriesEditorConstantsRPGILE, IISeriesEditorParser, ISystemEditorConstants, ISystemTextEditorAdapterContributor, ISystemTextEditorContextContributor, ISystemTextEditorDebugContributor, ISystemTextEditorHelpContributor, ISystemTextEditorParser, ISystemTextEditorSourceViewerConfigurationContributor
Direct Known Subclasses:
ISeriesEditorRPGILESQLParser

public class ISeriesEditorRPGILEParser
extends ISeriesEditorParser
implements IISeriesEditorConstantsRPGILE

Port of evrilda.c


Nested Class Summary
 
Nested classes/interfaces inherited from class com.ibm.etools.iseries.parsers.ISeriesEditorParser
ISeriesEditorParser.DataLineMarkListener, ISeriesEditorParser.RunnableParseAll
 
Field Summary
protected  boolean _alreadyParseAll
           
protected  boolean _bInCF
           
protected  boolean _bInCFSQL
           
protected static ResourceBundle _bundle
           
protected  ISeriesEditorRPGILESourceViewerConfiguration _configuration
           
protected  ISeriesEditorRPGILEFreeFormConverter _freeFormConverter
           
protected  SystemTextEditorHelpHandler _helpHandler
           
protected  SystemTextEditorHelpHandler _helpMessageHandler
           
protected  long _lClass_CFree
           
protected  long _lClass_CFreeDirective
           
protected  long _lClass_EndCFreeDirective
           
protected  long _lClass_FixSQLEnd
           
protected  long _lClass_FixSQLStart
           
protected  long _lClassBackwardLink
           
protected  long _lClassComment
           
protected  long _lClassControl
           
protected  long _lClassError
           
protected  long _lClassForwardLink
           
protected  long _lClassMask
           
protected  long _lClassProcedure
           
protected  long _lClassSpace
           
protected  long _lClassSql
           
protected  long _lClassSubroutine
           
protected  int _lineClassChangedFlag
           
protected  ISeriesEditorRPGILEModel _model
           
protected  boolean _needToAutoSyntaxCheck
           
protected  ISeriesEditorRPGILEPrefixProcessor _prefixer
           
protected  IBMiEditorRPGILEProgramVerifier _programVerifier
           
protected  ISeriesEditorRPGILEPrompter _prompter
           
protected  ISeriesEditorRPGILEFormatLine _ruler
           
protected static IPreferenceStore _store
          the preference store with the ILE RPG preferences
 ISeriesEditorRPGILESyntaxChecker _syntaxChecker
           
protected  ISeriesEditorRPGILETokenizer _tokenizer
           
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.IISeriesEditorConstantsRPGILE
_straControlWords, _straDataWords, _straMacroWords, _straRPGFonts, _straXF2_opcodes, _straXF2_possible_opcodes, CHANGE_CFREE_DIRECTIVE_ADDED, CHANGE_CFREE_DIRECTIVE_REMOVED, CHANGE_CFREESQL_END_ADDED, CHANGE_CFREESQL_START_ADDED, CHANGE_CFREESQL_START_END_ADDED, CHANGE_CFREESQL_START_REMOVED, CHANGE_ENDCFREE_DIRECTIVE_ADDED, CHANGE_ENDCFREE_DIRECTIVE_REMOVED, CHANGE_FIXFORM_SQL_END_ADDED, CHANGE_FIXFORM_SQL_END_REMOVED, CHANGE_FIXFORM_SQL_START_ADDED, CHANGE_FIXFORM_SQL_START_REMOVED, CHANGE_NONE, CLASS_BWDLINK, CLASS_CFREE, CLASS_CFREE_DIRECTIVE, CLASS_CFREE_END, CLASS_CFREE_SQL, CLASS_CFREE_SQLEND, CLASS_CFREE_SQLEND_REAL, CLASS_CFREE_SQLSTART, CLASS_COMMENT, CLASS_CONTROL, CLASS_ENDCFREE_DIRECTIVE, CLASS_ERROR, CLASS_FIXFORM_SQL_END, CLASS_FIXFORM_SQL_START, CLASS_FWDLINK, CLASS_PROCEDURE, CLASS_SPACE, CLASS_SQL, CLASS_SUBROUTINE, CLEVEL_LEN, CLEVEL_POS, COMMENT_POS, CONDIND_LEN, CONDIND_POS, CONTINUATION_INDENT, DECPOS_LEN, DECPOS_POS, DIRECTIVE_POS, EOLCOMMENT_POS, EXTFACTOR2_LEN, EXTFACTOR2_POS, FACTOR1_LEN, FACTOR1_POS, FACTOR2_LEN, FACTOR2_POS, FIELDDEF_LEN, FIELDDEF_POS, FIELDLEN_LEN, FIELDLEN_POS, FONT_COMMENT, FONT_DEFAULT, FREE_LEN, FREE_POS, IND_LEN, INDENT_LIMIT, LENGTH_C_OPCODE, MAX_NEST, NUM_OF_OPCODES, OPCODE_LEN, OPCODE_POS, PAGE_INDEX_ILE_C_Calculation, PAGE_INDEX_ILE_C_Calculation_Extended_Factor_2, PAGE_INDEX_ILE_C_Calculation_Extended_Factor_2_Continuation, PAGE_INDEX_ILE_C_Calculation_Free_Form, PAGE_INDEX_ILE_Comment, PAGE_INDEX_ILE_D_Definition, PAGE_INDEX_ILE_D_Definition_Continuation, PAGE_INDEX_ILE_D_Definition_Continued_Name_Line, PAGE_INDEX_ILE_F_File_Description, PAGE_INDEX_ILE_F_File_Description_Continuation, PAGE_INDEX_ILE_Full_Line, PAGE_INDEX_ILE_H_Control, PAGE_INDEX_ILE_I_Input_Field_Description, PAGE_INDEX_ILE_I_Input_Field_Description_Externally_Described_File, PAGE_INDEX_ILE_I_Input_Record_Identification, PAGE_INDEX_ILE_I_Input_Record_Identification_Externally_Described_File, PAGE_INDEX_ILE_I_Input_Record_Identification_Logical_Relationship, PAGE_INDEX_ILE_O_Output_Field_Description, PAGE_INDEX_ILE_O_Output_Field_Description_Continuation, PAGE_INDEX_ILE_O_Output_Record_Identification, PAGE_INDEX_ILE_O_Output_Record_Identification_AND_OR, PAGE_INDEX_ILE_O_Output_to_Disk, PAGE_INDEX_ILE_P_Procedure, PAGE_INDEX_ILE_P_Procedure_Continued_Name_Line, PREF_COLUMN_CFIXED_MAX, PREF_COLUMN_CFREE_MAX, PREF_COLUMN_CFREE_MIN, PREF_COLUMN_CFREE_START, PROMPT_C, PROMPT_CF, PROMPT_CFE, PROMPT_CFS, PROMPT_CFSQL, PROMPT_CM, PROMPT_D, PROMPT_DATA, PROMPT_DC, PROMPT_DX, PROMPT_F, PROMPT_FC, PROMPT_H, PROMPT_IF, PROMPT_IFX, PROMPT_IR, PROMPT_IR2, PROMPT_IRX, PROMPT_LAST, PROMPT_MACRO, PROMPT_NONE, PROMPT_OD, PROMPT_OF, PROMPT_OFC, PROMPT_OR, PROMPT_OR2, PROMPT_P, PROMPT_PC, PROMPT_SPACE, PROMPT_SQL, PROMPT_XF2, PROMPT_XF2C, RESINDEQ_POS, RESINDER_POS, RESINDNR_POS, RESINDS_LEN, RESINDS_POS, RESULTFIELD_LEN, RESULTFIELD_POS, RPGSPEC_C, RPGSPEC_CF, RPGSPEC_D, RPGSPEC_E, RPGSPEC_F, RPGSPEC_H, RPGSPEC_I, RPGSPEC_L, RPGSPEC_O, RPGSPEC_P, RPGSPEC_U, SIGNIFICANT_LEN, SLASHSLASHEOL_POS, SPECTYPE_POS, SRCRECLEN, STRING_HELP_DOC_PLUGIN_ID, STRING_HELP_TABLE_FILENAME, STRING_HELP_TABLE_PLUGIN_ID, STRING_MESSAGE_HELP_DOC_PLUGIN_ID, STRING_MESSAGE_HELP_TABLE_FILENAME, STRING_MESSAGE_HELP_TABLE_PLUGIN_ID, XACQ, XADD, XADDDUR, XALLOC, XANDEQ, XANDGE, XANDGT, XANDLE, XANDLT, XANDNE, XBEGSR, XBITOFF, XBITON, XBLANK, XCAB, XCABEQ, XCABGE, XCABGT, XCABLE, XCABLT, XCABNE, XCALL, XCALLB, XCALLP, XCAS, XCASEQ, XCASGE, XCASGT, XCASLE, XCASLT, XCASNE, XCAT, XCHAIN, XCHECK, XCHECKR, XCLEAR, XCLOSE, XCOMMIT, XCOMP, XDEALLOC, XDEFINE, XDELETE, XDIV, XDO, XDOU, XDOUEQ, XDOUGE, XDOUGT, XDOULE, XDOULT, XDOUNE, XDOW, XDOWEQ, XDOWGE, XDOWGT, XDOWLE, XDOWLT, XDOWNE, XDSPLY, XDUMP, XELSE, XELSEIF, XEND, XENDCS, XENDDO, XENDFOR, XENDIF, XENDMON, XENDSL, XENDSR, XEVAL, XEVAL_CORR, XEVALR, XEXCEPT, XEXFMT, XEXSR, XEXTRCT, XFEOD, XFOR, XFORCE, XGOTO, XIF, XIFEQ, XIFGE, XIFGT, XIFLE, XIFLT, XIFNE, XIN, XITER, XKFLD, XKLIST, XLEAVE, XLEAVESR, XLOOKUP, XMHHZO, XMHLZO, XMLHZO, XMLLZO, XMONITOR, XMOVE, XMOVEA, XMOVEL, XMULT, XMVR, XNEXT, XOCCUR, XON_ERROR, XOPEN, XOREQ, XORGE, XORGT, XORLE, XORLT, XORNE, XOTHER, XOUT, XPARM, XPLIST, XPOST, XREAD, XREADC, XREADE, XREADP, XREADPE, XREALLOC, XREL, XRESET, XRETURN, XROLBK, XSCAN, XSELECT, XSETGT, XSETLL, XSETOFF, XSETON, XSHTDN, XSORTA, XSQRT, XSUB, XSUBDUR, XSUBST, XTAG, XTEST, XTESTB, XTESTN, XTESTZ, XTIME, XUNLOCK, XUPDATE, XWHEN, XWHENEQ, XWHENGE, XWHENGT, XWHENLE, XWHENLT, XWHENNE, XWRITE, XXFOOT, XXLATE, XXML_INTO, XXML_SAX, XZ_ADD, XZ_SUB
 
Fields inherited from interface com.ibm.etools.iseries.editor.IISeriesEditorConstantsRPG
_straSQLWords, _straSQLWordsWithComment, CMD_SETFORMATLINETEXT, CMD_SETTABS, COLUMN_C_FREE, COLUMN_C_OPCODE, COLUMN_COMMENT, COLUMN_FACTOR1, COLUMN_FACTOR2, COLUMN_KEYWORDS, COLUMN_PROC_NAME_BEGIN, COLUMN_PROC_NAME_END, COLUMN_PROC_SPEC, COLUMN_SPEC, FIELD_FACTOR1, FIELD_FACTOR2, FIELD_FROM, FIELD_OPCODE, FIELD_TOLENGTH, OPM_COLUMN_FACTOR1
 
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.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.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
ISeriesEditorRPGILEParser(LpexView view)
          Constructor
 
Method Summary
 void blockMarkWord()
          Marks blocks of text for C-Free specifications.
protected  int checkForFixFormType(int iElement, String strElement, boolean needToUpdateClasses)
           
 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 menuRoot)
          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 determineElement(int iElement)
          Sets the line class bits, and returns the opcode type.
protected  int determineElement(int iElement, boolean needToSetCFreeAndSQLClasses)
          Sets the line class bits, and returns the opcode type.
protected  int determineLine(int iLine)
          Deprecated.  
 void documentChanged(LpexView lpexView, int type, int line, int position, int len)
          Used by the parser to determine the element where the compile data is
 void doRefresh()
          Remove block nesting in the prefix area
 void finishedSaving(ITextEditor editor)
          Method finishedSaving Does nothing for the ILE RPG Parser
 void focusGained(FocusEvent event)
          when focus is gained, reset the tabs
 long get_lClassProcedure()
           
 long get_lClassSubroutine()
           
 int getBeginCFREE(int iElement)
          retrives the begin of Free from statement
protected  String getCFreeString(String text)
          Removes all irrelevant parts to a c free string (ie columns 1-7
 String getCommentStyleCharacters()
          Returns the style characters used for styling comments ("cs").
 int getElementSpecType(int iElement)
          Returns the spec type of an element.
 int getElementSpecType(int iElement, boolean needToTagLineClasses)
          Returns the spec type of an element D62355 - the flag needToTagLineClasses to determine if we need to update the CFree or CFreeSQL related tabs for in the range of line for this statement.
protected  int getElementSpecTypeAndUpdateClasses(int iElement)
          Returns the spec type of an element D62355 - the flag needToSetSQLType to determine if we need to update the CFreeSQL related tabs for in the range of line for this SQL statement.
protected  int getElementSpecTypeOnly(int iElement)
          Returns the spec type of an element D62355 - the flag needToSetSQLType to determine if we need to update the CFreeSQL related tabs for in the range of line for this SQL statement.
protected  int getElementSpecTypeWhenFileLoading(int iElement)
          Returns the spec type of an element D62355 - the flag needToSetSQLType to determine if we need to update the CFreeSQL related tabs for in the range of line for this SQL statement.
 IQSYSFile getFieldFile()
          Method getFieldFile.
 LpexFieldsProvider getFieldsProvider()
          Retrieves the fields provided for the parser.
 IISeriesEditorFormatLine getFormatLine()
          Returns the format line ruler.
 ISeriesEditorRPGILEFreeFormConverter getFreeFormConverter()
          Returns the Conversion tool.
 SystemTextEditorHelpHandler getHelpHandler()
          Returns the help handler for this parser.
 IQSYSMember getIncludeMember()
          Subclasses should override if implementing the action ActionOpenInclude
 String getLanguage()
          Declared in ISystemEditorParser
protected  long getLineClassTypes(String strLine, int iSpecType)
          Port of evfrilda.c, ClassOfLine.
protected  int getLineSpecType(int iLine)
          Deprecated. see getElementSpecType
protected  int getLineSpecTypeC(String strLine)
           
protected  int getLineSpecTypeD(String strLine)
           
protected  int getLineSpecTypeF(String strLine)
           
protected  int getLineSpecTypeH(String strLine)
           
protected  int getLineSpecTypeI(String strLine)
           
protected  int getLineSpecTypeO(String strLine)
           
protected  int getLineSpecTypeP(String strLine)
           
 LanguageModel getModel(boolean bUpdate)
          Returns the element tree model for the outline view.
protected  int getNextFreeFormBoundaryElement(int iElement)
          Finds the start or end free form boundary beginning with the line after the given line.
protected  int getNextFreeFormBoundaryLine(int iLine)
          Deprecated. see getNextFreeFormBoundaryElement
 String getPopupItems(int popupLocation)
          56708 Return the popup menu items
 ResourceBundle getProfile()
           
 IISeriesEditorProgramVerifier getProgramVerifier()
          Returns the program verifier.
 IISeriesEditorPromptAdapter getPromptAdapter()
          Method declared on ISeriesEditorParser.
 ISeriesEditorRPGILEPrompter getPrompter()
           
 String getPromptFormatLine(int iSpecType)
          Returns the format string of the spec type.
 LpexSourceViewerConfiguration getSourceViewerConfiguration()
          Returns the source viewer configuration.
 int getStatementEndElement(int iElement)
          retrives the statement end element number.
protected  int getStatementEndElement(int iElement, int iSpecType)
          retrives the statement end element number.
 int getStatementStartElement(int iElement)
          retrives the statement start element number.
protected  int getStatementStartElement(int iElement, int iSpecType)
          retrives the statement start element number.
 IISeriesEditorSyntaxChecker getSyntaxChecker()
          Returns the syntax checker.
 void initializeColors(LpexView view)
          Initializes the display colors.
 void initializeElementClassTypes()
          Registers the element class types with Lpex
 void initializeLpexView(LpexView lpexView)
          Declared in IISeriesEditorParser Update lpex profile with tabbing support.
protected  void initParser()
          initialize parser
protected  boolean isElementEndingInSemicolon(int iElement)
          Determines whether or not an element ends in a semocolon, after comments have been stripped.
protected  boolean isElementHaveBeginStatement(int iElement)
          Determines whether or not the element contains a BEGIN statement, after blanks have been stripped.
protected  boolean isElementHaveEndStatement(int iElement)
          Determines whether or not the element contains an END statement, after blanks have been stripped.
protected  boolean isElementStartingWithSlash(int iElement)
          Determines whether or not an element starts with a / (slash), but isn't a comment line.
protected  boolean isElementStartSQLStatement(int iElement)
          Determines whether or not an element has an EXEC SQL statement, assuming C free format, after comments have been stripped.
 boolean isLineDebuggable(int iLine)
          Returns true to let the super class know that this parser supports debugging.
 boolean isTokenDelimiter(char c)
          Query whether the specified character is a token delimiter.
 boolean isValidFieldAction()
          Method isValidFieldAction.
 boolean isValidIncludeAction()
          Method isValidIncludeAction.
protected  LpexDocumentLocation matchToken(LpexDocumentLocation loc)
          Match tokens Matches the token that the location specifies.
 boolean modelBuiltAsynchronous()
          Whether or not the parser supports building of the model asynchronously.
 void parseElement(int iElement)
          Declared in LpexCommonParser.
protected  void parseElementAfterDelete(int iElement)
          This method will handle the case for parseElement, where its previous element is deleted.
 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)
          Port of evfripp.c, LineParse This really parses an element and not a line......
protected  void parseRegion(int iElementFirst, int iElementLast, IProgressMonitor progressMonitor)
          Parses a contiguous set of Elements given the first and last Element numbers.
protected  int parseRegionForElement(int iElement, int iSpecType)
          D62355 - This method will do the parse region job for one particular element The type of this element is known already.
protected  void postParseLineCleanUp(int iElement, int iSpecType)
           
protected  void printLineClasses(int iElementFirst, int iElementLast)
           
 void promptRequest()
          Called when the shift-F4 key was just pressed, before the focus is given to the prompter.
protected  String stripComments(String text)
          Removes the comments from a supplied string.
protected  boolean supportsOutlineView()
          Returns false by default.
 void terminateParser()
          When parsing is disabled, turn off document listeners
protected  boolean withinContextOfCFree(int iElement)
          This method check if the input line is within the context of CFree D62355
 
Methods inherited from class com.ibm.etools.iseries.parsers.ISeriesEditorParser
addCompileError, addError, cleanupPopupMenu, copyCompileErrorInfo, createOutlineView, doLpexAction, doPromptAction, elementChanged, focusLost, getAdapter, getAS400, getAutoUppercase, getEditor, getIFile, getImage, getISeriesConnection, getISeriesMember, getLocalFileName, getLpexLanguageHelpHandler, getLpexView, getLshToken, getProperty, getPropertySheet, getSpecialChars, getTextLimit, hasSequenceNumbers, isDebugMode, isElementAboveDataRegion, isLineAboveDataRegion, isLocal, isReadOnly, match, parseAll, prompt, queryDataLine, removeErrors, removeErrors, resetOutlineView, saving, selectionLinesChanged, selectionLinesChanged, selectionLinesChanged, setAS400, setCompileErrorInfo, setDebugMode, setEditor, 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

copyright

public static final String copyright
See Also:
Constant Field Values

_bundle

protected static ResourceBundle _bundle

_store

protected static final IPreferenceStore _store
the preference store with the ILE RPG preferences


_tokenizer

protected ISeriesEditorRPGILETokenizer _tokenizer

_ruler

protected ISeriesEditorRPGILEFormatLine _ruler

_prefixer

protected ISeriesEditorRPGILEPrefixProcessor _prefixer

_programVerifier

protected IBMiEditorRPGILEProgramVerifier _programVerifier

_prompter

protected ISeriesEditorRPGILEPrompter _prompter

_configuration

protected ISeriesEditorRPGILESourceViewerConfiguration _configuration

_syntaxChecker

public ISeriesEditorRPGILESyntaxChecker _syntaxChecker

_freeFormConverter

protected ISeriesEditorRPGILEFreeFormConverter _freeFormConverter

_helpHandler

protected SystemTextEditorHelpHandler _helpHandler

_helpMessageHandler

protected SystemTextEditorHelpHandler _helpMessageHandler

_bInCF

protected boolean _bInCF

_bInCFSQL

protected boolean _bInCFSQL

_model

protected ISeriesEditorRPGILEModel _model

_lineClassChangedFlag

protected int _lineClassChangedFlag

_alreadyParseAll

protected boolean _alreadyParseAll

_needToAutoSyntaxCheck

protected boolean _needToAutoSyntaxCheck

_lClassComment

protected long _lClassComment

_lClassControl

protected long _lClassControl

_lClassMask

protected long _lClassMask

_lClassProcedure

protected long _lClassProcedure

_lClassSpace

protected long _lClassSpace

_lClassSql

protected long _lClassSql

_lClassSubroutine

protected long _lClassSubroutine

_lClassForwardLink

protected long _lClassForwardLink

_lClassBackwardLink

protected long _lClassBackwardLink

_lClassError

protected long _lClassError

_lClass_CFreeDirective

protected long _lClass_CFreeDirective

_lClass_EndCFreeDirective

protected long _lClass_EndCFreeDirective

_lClass_CFree

protected long _lClass_CFree

_lClass_FixSQLStart

protected long _lClass_FixSQLStart

_lClass_FixSQLEnd

protected long _lClass_FixSQLEnd
Constructor Detail

ISeriesEditorRPGILEParser

public ISeriesEditorRPGILEParser(LpexView view)
Constructor

Method Detail

initParser

protected void initParser()
initialize parser

Overrides:
initParser in class ISeriesEditorParser

blockMarkWord

public void blockMarkWord()
Marks blocks of text for C-Free specifications. If not a C-Free, the super class' method is called. Some of this code is taken from LpexCommonParser.blockMarkWord().


isTokenDelimiter

public boolean isTokenDelimiter(char c)
Query whether the specified character is a token delimiter. Used for blockMarkWord

Parameters:
c -
Returns:
Since:
6.0 58357 - for debugger team

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 menuRoot)
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

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)

createActions

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


documentChanged

public void documentChanged(LpexView lpexView,
                            int type,
                            int line,
                            int position,
                            int len)
Used by the parser to determine the element where the compile data is

See Also:
com.ibm.lpex.core.LpexDocumentListener#documentChanged(LpexView, int, int, int, int)

determineLine

protected int determineLine(int iLine)
Deprecated. 

Sets the line class bits, and returns the opcode type. Port of evfrilda.c, DetermineLine


determineElement

public int determineElement(int iElement)
Sets the line class bits, and returns the opcode type. D62355


determineElement

protected int determineElement(int iElement,
                               boolean needToSetCFreeAndSQLClasses)
Sets the line class bits, and returns the opcode type. D62355 - we will call the getElementSpecType() to get the element type and depending on the flag needToSetCFreeAndSQLClasses, the getElementSpecType() method will update the classes related to CFree or CFreeSQL


finishedSaving

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

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

focusGained

public void focusGained(FocusEvent event)
when focus is gained, reset the tabs

Overrides:
focusGained in class ISeriesEditorParser
See Also:
FocusListener

getCommentStyleCharacters

public String getCommentStyleCharacters()
Returns the style characters used for styling comments ("cs"). This is used by compare sessions when the compare.ignoreComments option is in effect.


getFieldFile

public IQSYSFile getFieldFile()
Method getFieldFile. returns an ISeriesFile object if the cursor is on a line with an F spec, 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()

getFormatLine

public IISeriesEditorFormatLine getFormatLine()
Returns the format line ruler.

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

getHelpHandler

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

Specified by:
getHelpHandler in interface IISeriesEditorParser

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()

getLanguage

public String getLanguage()
Declared in ISystemEditorParser

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

getLineClassTypes

protected long getLineClassTypes(String strLine,
                                 int iSpecType)
Port of evfrilda.c, ClassOfLine.


getLineSpecType

protected int getLineSpecType(int iLine)
Deprecated. see getElementSpecType

Returns the spec type of a line. Port of evfrilda.c, SpecTypeOfLine. Macros /free and /end-free are now returned as CFS and CFE rather than as MACRO.


getElementSpecType

public int getElementSpecType(int iElement)
Returns the spec type of an element. D62355 - Override to call getElementSpecType(int iElement, boolean needToSetSQLType) instead.


getElementSpecType

public int getElementSpecType(int iElement,
                              boolean needToTagLineClasses)
Returns the spec type of an element D62355 - the flag needToTagLineClasses to determine if we need to update the CFree or CFreeSQL related tabs for in the range of line for this statement.


getElementSpecTypeOnly

protected int getElementSpecTypeOnly(int iElement)
Returns the spec type of an element D62355 - the flag needToSetSQLType to determine if we need to update the CFreeSQL related tabs for in the range of line for this SQL statement.


getElementSpecTypeAndUpdateClasses

protected int getElementSpecTypeAndUpdateClasses(int iElement)
Returns the spec type of an element D62355 - the flag needToSetSQLType to determine if we need to update the CFreeSQL related tabs for in the range of line for this SQL statement.


getElementSpecTypeWhenFileLoading

protected int getElementSpecTypeWhenFileLoading(int iElement)
Returns the spec type of an element D62355 - the flag needToSetSQLType to determine if we need to update the CFreeSQL related tabs for in the range of line for this SQL statement.


getLineSpecTypeC

protected int getLineSpecTypeC(String strLine)

getLineSpecTypeD

protected int getLineSpecTypeD(String strLine)

getLineSpecTypeF

protected int getLineSpecTypeF(String strLine)

getLineSpecTypeH

protected int getLineSpecTypeH(String strLine)

getLineSpecTypeI

protected int getLineSpecTypeI(String strLine)

getLineSpecTypeO

protected int getLineSpecTypeO(String strLine)

getLineSpecTypeP

protected int getLineSpecTypeP(String strLine)

supportsOutlineView

protected boolean supportsOutlineView()
Description copied from class: ISeriesEditorParser
Returns false by default. Subclass that do support an outline view should override to return true

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

modelBuiltAsynchronous

public boolean modelBuiltAsynchronous()
Description copied from class: ISeriesEditorParser
Whether or not the parser supports building of the model asynchronously.

Overrides:
modelBuiltAsynchronous in class ISeriesEditorParser

getNextFreeFormBoundaryLine

protected int getNextFreeFormBoundaryLine(int iLine)
Deprecated. see getNextFreeFormBoundaryElement

Finds the start or end free form boundary beginning with the line after the given line. A data area is recognized as a boundary. Port of evfripp.c, findNextCFBound


getNextFreeFormBoundaryElement

protected int getNextFreeFormBoundaryElement(int iElement)
Finds the start or end free form boundary beginning with the line after the given line. A data area is recognized as a boundary. Port of evfripp.c, findNextCFBound


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()

getProgramVerifier

public IISeriesEditorProgramVerifier getProgramVerifier()
Returns the program verifier.

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

getPromptAdapter

public IISeriesEditorPromptAdapter getPromptAdapter()
Method declared on ISeriesEditorParser. Returns an adapter used to communicate between the editor and a prompt view.

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

getPromptFormatLine

public String getPromptFormatLine(int iSpecType)
Returns the format string of the spec type.


getSourceViewerConfiguration

public LpexSourceViewerConfiguration getSourceViewerConfiguration()
Returns the source viewer configuration. Default implementation returns null.

Specified by:
getSourceViewerConfiguration in interface ISystemTextEditorSourceViewerConfigurationContributor
Overrides:
getSourceViewerConfiguration in class ISeriesEditorParser

getSyntaxChecker

public IISeriesEditorSyntaxChecker getSyntaxChecker()
Returns the syntax checker.

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

getFreeFormConverter

public ISeriesEditorRPGILEFreeFormConverter getFreeFormConverter()
Returns the Conversion tool.


initializeElementClassTypes

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


initializeLpexView

public void initializeLpexView(LpexView lpexView)
Declared in IISeriesEditorParser Update lpex profile with tabbing support.

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

initializeColors

public void initializeColors(LpexView view)
Initializes the display colors.


matchToken

protected LpexDocumentLocation matchToken(LpexDocumentLocation loc)
Match tokens Matches the token that the location specifies.

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

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 an f spec with a filename on it, false otherwise
See Also:
com.ibm.etools.iseries.editor.IISeriesEditorParser#isValidFieldAction()

isValidIncludeAction

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

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

isLineDebuggable

public boolean isLineDebuggable(int iLine)
Returns true to let the super class know that this parser supports debugging.

Specified by:
isLineDebuggable in interface ISystemTextEditorDebugContributor

parseElement

public void parseElement(int iElement)
Declared in LpexCommonParser. Parses an element if it is not a show element. It is for the inclemental parsing. D62355: Override for SQL tokenization support. This function will do the followings: 1. Find out the range of elements need to be parsed 2. For the line in the range of elements need to be parsed, we need to update their CFree/CFreeSQL classes to make sure they are up-to-dated 3. Parse those elements.

Overrides:
parseElement in class ISeriesEditorParser

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)
Port of evfripp.c, LineParse This really parses an element and not a line......

Specified by:
parseLine in class ISeriesEditorParser

parseRegion

protected void parseRegion(int iElementFirst,
                           int iElementLast,
                           IProgressMonitor progressMonitor)
Parses a contiguous set of Elements given the first and last Element numbers. Port of evfripp.c PartParse

Specified by:
parseRegion in class ISeriesEditorParser

parseRegionForElement

protected int parseRegionForElement(int iElement,
                                    int iSpecType)
D62355 - This method will do the parse region job for one particular element The type of this element is known already. input: iElement - element to parse iSpecType - the type of the element returns: last element been parse.


checkForFixFormType

protected int checkForFixFormType(int iElement,
                                  String strElement,
                                  boolean needToUpdateClasses)

promptRequest

public void promptRequest()
Called when the shift-F4 key was just pressed, before the focus is given to the prompter. Parse and tokenize the line and notify the prompter. This is done in case the user has changed the line.

Specified by:
promptRequest in class ISeriesEditorParser

terminateParser

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

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

getBeginCFREE

public int getBeginCFREE(int iElement)
retrives the begin of Free from statement

Parameters:
iElement - The element to search for its start statement
Returns:
The starting element for Free Form
Since:
6.0.1

getStatementStartElement

public int getStatementStartElement(int iElement)
retrives the statement start element number. If one cannot be determined, then the first non-show element in the doc is returned.

Parameters:
iElement - The element to search for its start statement
Returns:
The starting element of the statement containing iElement
Since:
6.0.1

getStatementStartElement

protected int getStatementStartElement(int iElement,
                                       int iSpecType)
retrives the statement start element number. If one cannot be determined, then the first non-show element in the doc is returned.

Parameters:
iElement - The element to search for its start statement
Returns:
The starting element of the statement containing iElement
Since:
6.0.1

getStatementEndElement

public int getStatementEndElement(int iElement)
retrives the statement end element number. If one cannot be determined, then the last non-show element in the doc is returned.

Parameters:
iElement - The element to search for its end statement
Returns:
The end element of the statement containing iElement
Since:
6.0.1

getStatementEndElement

protected int getStatementEndElement(int iElement,
                                     int iSpecType)
retrives the statement end element number. If one cannot be determined, then the last non-show element in the doc is returned.

Parameters:
iElement - The element to search for its end statement
Returns:
The end element of the statement containing iElement
Since:
6.0.1

isElementEndingInSemicolon

protected boolean isElementEndingInSemicolon(int iElement)
Determines whether or not an element ends in a semocolon, after comments have been stripped.

Parameters:
iElement - the element to check
Returns:
true if the element ends in a semi-colon, false otherwise.
Since:
6.0.1

isElementStartingWithSlash

protected boolean isElementStartingWithSlash(int iElement)
Determines whether or not an element starts with a / (slash), but isn't a comment line.

Parameters:
iElement - The element to check
Returns:
True if the line isn't a comment line but starts with /
Since:
6.0.1

isElementStartSQLStatement

protected boolean isElementStartSQLStatement(int iElement)
Determines whether or not an element has an EXEC SQL statement, assuming C free format, after comments have been stripped.

Parameters:
iElement - the element to check
Returns:
true if the element contains EXEC SQL, false otherwise.
Since:
6.0.1

isElementHaveBeginStatement

protected boolean isElementHaveBeginStatement(int iElement)
Determines whether or not the element contains a BEGIN statement, after blanks have been stripped.

Parameters:
iElement - The element to check
Returns:
true if the element contains BEGIN, false otherwise.
Since:
6.0.1

isElementHaveEndStatement

protected boolean isElementHaveEndStatement(int iElement)
Determines whether or not the element contains an END statement, after blanks have been stripped.

Parameters:
iElement - The element to check
Returns:
true if the element contains END, false otherwise.
Since:
6.0.1

stripComments

protected String stripComments(String text)
Removes the comments from a supplied string.

Parameters:
text - The string to remove comments from.
Returns:
The string minus comments.
Since:
6.0.1

getCFreeString

protected String getCFreeString(String text)
Removes all irrelevant parts to a c free string (ie columns 1-7

Parameters:
text - The text to get the c free string from
Returns:
The c free string minus any text to ignore
Since:
6.0.1

getFieldsProvider

public LpexFieldsProvider getFieldsProvider()
Retrieves the fields provided for the parser. Returns null if there is no fields provider

Specified by:
getFieldsProvider in interface IISeriesEditorParser
Overrides:
getFieldsProvider in class ISeriesEditorParser
Since:
6.0.1 //SE23218

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)

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()

withinContextOfCFree

protected boolean withinContextOfCFree(int iElement)
This method check if the input line is within the context of CFree D62355


parseElementAfterDelete

protected void parseElementAfterDelete(int iElement)
This method will handle the case for parseElement, where its previous element is deleted. D62355

Parameters:
iElement -

postParseLineCleanUp

protected void postParseLineCleanUp(int iElement,
                                    int iSpecType)

printLineClasses

protected void printLineClasses(int iElementFirst,
                                int iElementLast)

getPrompter

public ISeriesEditorRPGILEPrompter getPrompter()

get_lClassProcedure

public long get_lClassProcedure()

get_lClassSubroutine

public long get_lClassSubroutine()

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.