Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.parsers
Class ISeriesEditorRPGILESQLParser

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

public class ISeriesEditorRPGILESQLParser
extends ISeriesEditorRPGILEParser
implements ISQLParser


Nested Class Summary
protected  class ISeriesEditorRPGILESQLParser.SQLCompondStatement
          Used to record the compond statement (BEGIN<->END) in free form SQL
 
Nested classes/interfaces inherited from class com.ibm.etools.iseries.parsers.ISeriesEditorParser
ISeriesEditorParser.DataLineMarkListener, ISeriesEditorParser.RunnableParseAll
 
Field Summary
protected  ISeriesEditorRPGILESQLSourceViewerConfiguration _configuration
          The source viewer configuration for this parser
protected  boolean _disableFormatting
           
protected  SQLFormatter _formatter
           
protected  boolean _inEnterRPG
           
protected  boolean _inNewLine
           
protected  boolean _inOpenLine
           
protected  long _lClass_CFreeSQL
           
protected  long _lClass_CFreeSQLEnd
           
protected  long _lClass_CFreeSQLEndReal
           
protected  long _lClass_CFreeSQLStart
           
protected  long _lClassMaskAll
           
protected  boolean _removeFromParsePending
           
protected  int _thisSQLEndStatement
           
static String Copyright
           
protected  int lastSQLLineParsed
           
 
Fields inherited from class com.ibm.etools.iseries.parsers.ISeriesEditorRPGILEParser
_alreadyParseAll, _bInCF, _bInCFSQL, _bundle, _freeFormConverter, _helpHandler, _helpMessageHandler, _lClass_CFree, _lClass_CFreeDirective, _lClass_EndCFreeDirective, _lClass_FixSQLEnd, _lClass_FixSQLStart, _lClassBackwardLink, _lClassComment, _lClassControl, _lClassError, _lClassForwardLink, _lClassMask, _lClassProcedure, _lClassSpace, _lClassSql, _lClassSubroutine, _lineClassChangedFlag, _model, _needToAutoSyntaxCheck, _prefixer, _programVerifier, _prompter, _ruler, _store, _syntaxChecker, _tokenizer, 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.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
ISeriesEditorRPGILESQLParser(LpexView view)
          The constructor for the ILE RPG SQL parser
 
Method Summary
 void contributeToMenu(ITextEditor editor, IMenuManager menuRoot)
          Contributes menu bar items.
protected  void createActions(ITextEditor editor)
          Creates menubar and toolbar actions.
 int cursorIndent(int iElement)
           
 int endOfSQL(int iElement)
          Find the end of the SQL statement
protected  void enterRPG()
          Method enterRPG enhanced version which handles formatting appropriately
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.
protected  int getFreeFormSQLEndElement(int startElement)
          Get the end of the SQL statement.
protected  int getFreeFormSQLEndElementByTaggedClass(int iElement)
          Get the end of the SQL statement using the classes information of the elements.
protected  int getFreeFormSQLStartElement(int iElement)
          Get the start of the SQL statement for an free form embedded SQL statement.
protected  int getFreeFormSQLStartElementByTaggedClass(int iElement)
          Get the start of the SQL statement using the classes information of the elements.
 SystemTextEditorHelpHandler getHelpHandler()
          Returns the help handler for this parser.
 String getLanguage()
          Declared in ISystemEditorParser D62355 - the language for this parser is "RPGLESQL", which is used to retrieve the portion of the samples
protected  int getLastElementInThisCFreeBlock(int iElement, boolean updateCFreeSQLFlag)
          This element will find the last element in a CFree block.
protected  long getLineClassTypes(int iElement, String strLine, int iSpecType)
          Set the line classes of the current element.
 ResourceBundle getProfile()
           
 SqlLexer getRPGLEFixedSqlLexer(LpexCharStream stream)
          Returns the SqlLexer for fixed form RPG.
 SqlLexer getRPGLEFreeSqlLexer(LpexCharStream stream)
          Returns the SqlLexer for free form RPG.
 LpexSourceViewerConfiguration getSourceViewerConfiguration()
          Returns the source viewer configuration.
 int getStatementEndElement(int iElement)
          retrives the statement end element number.
 int getStatementStartElement(int iElement)
          retrives the statement start element number.
 String getTextIndent(int iElement)
           
 void initializeColors(LpexView view)
          Initializes the display colors for tokens.
 void initializeElementClassTypes()
          Registers the element class types with Lpex D62355
protected  void initParser()
          initializes the parser
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 isSQLElement(int iElement)
          Indicates whether or not the element is part of an SQL statement
protected  void newLine()
          Method newLine.
protected  void openLine()
          Method openLine.
protected  int parseAndAddLinesCFreeClasses(int iElement)
          This method will parse and tag the lines starting at the input line as CFree, until it reach non-blank column 6 or 7, or data spec After parsing and updating the CFree class of those lines, it also makes sure the CFreeSQL related classes are also been tagged to those line properly.
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 printLineClasses(int iElementFirst, int iElementLast)
           
protected  void split()
          Method split.
protected  void splitLine()
          Method splitLine.
 int startOfSQL(int iElement)
          Find the beginning of the SQL statement
protected  int updateFreeSQLRelatedClass(int iElementPrevious, int iElementLast)
          This element will find the last element in a CFree block.
 
Methods inherited from class com.ibm.etools.iseries.parsers.ISeriesEditorRPGILEParser
blockMarkWord, checkForFixFormType, cleanupMenu, cleanupToolBar, contributeMenuItems, contributeToPopupMenu, contributeToToolBar, determineElement, determineElement, determineLine, documentChanged, doRefresh, finishedSaving, focusGained, get_lClassProcedure, get_lClassSubroutine, getBeginCFREE, getCFreeString, getCommentStyleCharacters, getElementSpecType, getElementSpecType, getFieldFile, getFieldsProvider, getFormatLine, getFreeFormConverter, getIncludeMember, getLineClassTypes, getLineSpecType, getLineSpecTypeC, getLineSpecTypeD, getLineSpecTypeF, getLineSpecTypeH, getLineSpecTypeI, getLineSpecTypeO, getLineSpecTypeP, getModel, getNextFreeFormBoundaryElement, getNextFreeFormBoundaryLine, getPopupItems, getProgramVerifier, getPromptAdapter, getPrompter, getPromptFormatLine, getStatementEndElement, getStatementStartElement, getSyntaxChecker, initializeLpexView, isElementEndingInSemicolon, isElementHaveBeginStatement, isElementHaveEndStatement, isElementStartingWithSlash, isLineDebuggable, isTokenDelimiter, isValidFieldAction, isValidIncludeAction, matchToken, modelBuiltAsynchronous, parseElement, postParseLineCleanUp, promptRequest, stripComments, supportsOutlineView, terminateParser, withinContextOfCFree
 
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

_configuration

protected ISeriesEditorRPGILESQLSourceViewerConfiguration _configuration
The source viewer configuration for this parser


_lClass_CFreeSQLStart

protected long _lClass_CFreeSQLStart

_lClass_CFreeSQL

protected long _lClass_CFreeSQL

_lClass_CFreeSQLEnd

protected long _lClass_CFreeSQLEnd

_lClass_CFreeSQLEndReal

protected long _lClass_CFreeSQLEndReal

_lClassMaskAll

protected long _lClassMaskAll

lastSQLLineParsed

protected int lastSQLLineParsed

_thisSQLEndStatement

protected int _thisSQLEndStatement

_formatter

protected SQLFormatter _formatter

_disableFormatting

protected boolean _disableFormatting

_inOpenLine

protected boolean _inOpenLine

_inNewLine

protected boolean _inNewLine

_inEnterRPG

protected boolean _inEnterRPG

_removeFromParsePending

protected boolean _removeFromParsePending
Constructor Detail

ISeriesEditorRPGILESQLParser

public ISeriesEditorRPGILESQLParser(LpexView view)
The constructor for the ILE RPG SQL parser

Parameters:
view -
Method Detail

initParser

protected void initParser()
initializes the parser

Overrides:
initParser in class ISeriesEditorRPGILEParser
See Also:
com.ibm.etools.iseries.editor.ISeriesEditorRPGILEParser#initParser()

getProfile

public ResourceBundle getProfile()
Overrides:
getProfile in class ISeriesEditorRPGILEParser

getLanguage

public String getLanguage()
Declared in ISystemEditorParser D62355 - the language for this parser is "RPGLESQL", which is used to retrieve the portion of the samples

Specified by:
getLanguage in interface ISystemTextEditorParser
Overrides:
getLanguage in class ISeriesEditorRPGILEParser

createActions

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

Overrides:
createActions in class ISeriesEditorRPGILEParser

getSourceViewerConfiguration

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

Specified by:
getSourceViewerConfiguration in interface ISystemTextEditorSourceViewerConfigurationContributor
Overrides:
getSourceViewerConfiguration in class ISeriesEditorRPGILEParser
See Also:
com.ibm.etools.iseries.editor.ISeriesEditorRPGILEParser#getSourceViewerConfiguration()

contributeToMenu

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

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

initializeColors

public void initializeColors(LpexView view)
Initializes the display colors for tokens. D62355 - add the tokenization colors for embedded SQL statement.

Overrides:
initializeColors in class ISeriesEditorRPGILEParser

initializeElementClassTypes

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

Overrides:
initializeElementClassTypes in class ISeriesEditorRPGILEParser

getLineClassTypes

protected long getLineClassTypes(int iElement,
                                 String strLine,
                                 int iSpecType)
Set the line classes of the current element. D62355


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

Specified by:
parseElements in interface ISQLParser
Overrides:
parseElements in class ISeriesEditorRPGILEParser
Parameters:
iElementFirst - the first element to parse
iElementLast - the last element to parse
iElementCurrent - the current element in the view
See Also:
D62355 - this method will parse each line in the iElementFirst <-> iElementLast range.

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.

Overrides:
getElementSpecTypeOnly in class ISeriesEditorRPGILEParser

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.

Overrides:
getElementSpecTypeAndUpdateClasses in class ISeriesEditorRPGILEParser

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.

Overrides:
getElementSpecTypeWhenFileLoading in class ISeriesEditorRPGILEParser

parseLine

public void parseLine(int iElement)
Port of evfripp.c, LineParse This really parses an element and not a line...... D62355 - Override to also deal with tokenization for SQL statement.

Overrides:
parseLine in class ISeriesEditorRPGILEParser

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 D62355 - Override to also deal with tokenization for SQL statement.

Overrides:
parseRegion in class ISeriesEditorRPGILEParser

startOfSQL

public int startOfSQL(int iElement)
Find the beginning of the SQL statement

Parameters:
iElementStart -
Returns:
Element number where the SQL statement begins D62355

endOfSQL

public int endOfSQL(int iElement)
Find the end of the SQL statement

Parameters:
iElementStart -
Returns:
Element number where the SQL statement ends D62355

getFreeFormSQLStartElement

protected int getFreeFormSQLStartElement(int iElement)
Get the start of the SQL statement for an free form embedded SQL statement.

Parameters:
iElement - The element to search for its start statement
Returns:
The start element of the SQL statement containing iElement D62355

getFreeFormSQLStartElementByTaggedClass

protected int getFreeFormSQLStartElementByTaggedClass(int iElement)
Get the start of the SQL statement using the classes information of the elements.

Parameters:
iElement - The element to search for its start statement
Returns:
The start element of the SQL statement containing iElement D62355

getFreeFormSQLEndElementByTaggedClass

protected int getFreeFormSQLEndElementByTaggedClass(int iElement)
Get the end of the SQL statement using the classes information of the elements.

Parameters:
iElement - The element to search for its start statement
Returns:
The start element of the SQL statement containing iElement D62355

getFreeFormSQLEndElement

protected int getFreeFormSQLEndElement(int startElement)
Get the end of the SQL statement.

Parameters:
startElement - The start element of this SQL statement
Returns:
The end element of the SQL statement This function will call the SQLLexer#getNextToken method to look ahead of token to detect the end of the an SQL statement. Because the routines in SQL could have multiple statements inside an SQL statement, we could not just use semicolon to detect the end of the SQL statement. D62355

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.

Overrides:
isElementStartSQLStatement in class ISeriesEditorRPGILEParser
Parameters:
iElement - the element to check
Returns:
true if the element contains EXEC SQL, false otherwise. D62355 - We need to call the isCFSQLStart() method, instead of just checking "EXEC SQL"

getRPGLEFreeSqlLexer

public SqlLexer getRPGLEFreeSqlLexer(LpexCharStream stream)
Returns the SqlLexer for free form RPG. This method constructs and returns an SqlLexer object for parsing embedded SQL statements inside free form RPG. D62355


getRPGLEFixedSqlLexer

public SqlLexer getRPGLEFixedSqlLexer(LpexCharStream stream)
Returns the SqlLexer for fixed form RPG. This method constructs and returns an SqlLexer object for parsing embedded SQL statements inside fixed form RPG. D62355


getLastElementInThisCFreeBlock

protected int getLastElementInThisCFreeBlock(int iElement,
                                             boolean updateCFreeSQLFlag)
This element will find the last element in a CFree block. D62355


updateFreeSQLRelatedClass

protected int updateFreeSQLRelatedClass(int iElementPrevious,
                                        int iElementLast)
This element will find the last element in a CFree block. D62355 D63742


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.

Overrides:
parseRegionForElement in class ISeriesEditorRPGILEParser

parseAndAddLinesCFreeClasses

protected int parseAndAddLinesCFreeClasses(int iElement)
This method will parse and tag the lines starting at the input line as CFree, until it reach non-blank column 6 or 7, or data spec After parsing and updating the CFree class of those lines, it also makes sure the CFreeSQL related classes are also been tagged to those line properly. And those CFree SQL line are also parsed at the sametime. D62355


parseElementAfterDelete

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

Overrides:
parseElementAfterDelete in class ISeriesEditorRPGILEParser
Parameters:
iElement -

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.

Overrides:
getStatementStartElement in class ISeriesEditorRPGILEParser
Parameters:
iElement - The element to search for its start statement
Returns:
The starting element of the statement containing iElement D62355 - special treatment for free form SQL

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.

Overrides:
getStatementEndElement in class ISeriesEditorRPGILEParser
Parameters:
iElement - The element to search for its end statement
Returns:
The end element of the statement containing iElement D62355 - special treatment for free form SQL

printLineClasses

protected void printLineClasses(int iElementFirst,
                                int iElementLast)
Overrides:
printLineClasses in class ISeriesEditorRPGILEParser

openLine

protected void openLine()
Method openLine. enhanced version which handles formatting appropriately

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

newLine

protected void newLine()
Method newLine. enhanced version which handles formatting appropriately

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

split

protected void split()
Method split. enhanced version which handles formatting appropriately


splitLine

protected void splitLine()
Method splitLine. enhanced version which handles formatting appropriately

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

enterRPG

protected void enterRPG()
Method enterRPG enhanced version which handles formatting appropriately

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

cursorIndent

public int cursorIndent(int iElement)

getTextIndent

public String getTextIndent(int iElement)

isSQLElement

public boolean isSQLElement(int iElement)
Description copied from interface: ISQLParser
Indicates whether or not the element is part of an SQL statement

Specified by:
isSQLElement in interface ISQLParser
Parameters:
iElement - the element to check
Returns:
true if the element is part of an SQL statement, false otherwise

getHelpHandler

public SystemTextEditorHelpHandler getHelpHandler()
Description copied from class: ISeriesEditorRPGILEParser
Returns the help handler for this parser.

Specified by:
getHelpHandler in interface IISeriesEditorParser
Overrides:
getHelpHandler in class ISeriesEditorRPGILEParser
Since:
7.1
See Also:
com.ibm.etools.iseries.editor.ISeriesEditorRPGILEParser#getHelpHandler()

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.