Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.parsers
Class ISeriesEditorRPGOPMSyntaxChecker

java.lang.Object
  extended by com.ibm.etools.iseries.parsers.ISeriesEditorSyntaxChecker
      extended by com.ibm.etools.iseries.parsers.ISeriesEditorRPGOPMSyntaxChecker
All Implemented Interfaces:
IISeriesEditorSyntaxChecker

public class ISeriesEditorRPGOPMSyntaxChecker
extends ISeriesEditorSyntaxChecker
implements IISeriesEditorSyntaxChecker

This class interfaces to the OPM syntax checker proxy which is written in 'C'.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.ibm.etools.iseries.parsers.ISeriesEditorSyntaxChecker
ISeriesEditorSyntaxChecker.RunnableSyntaxChecker
 
Field Summary
protected  boolean _isAvailable
           
protected  ISeriesEditorRPGOPMParser _parser
           
protected  byte[] _specialCharByteArray
           
protected  String _strFilename
           
protected  String _strSpecialChars
           
static String Copyright
           
 
Fields inherited from class com.ibm.etools.iseries.parsers.ISeriesEditorSyntaxChecker
_aEmpty, _bIsPrimaryLpexView, _disableSyntaxCheckAuto, _invokedAuto, _progressMonitor, _ptRange, _strAutoPreferenceName, _strEmpty, _vectorSyntaxErrors, _view, copyright
 
Constructor Summary
ISeriesEditorRPGOPMSyntaxChecker(LpexView lpexView, ISeriesEditorRPGOPMParser parser)
          Constructor.
 
Method Summary
 ISeriesEditorSyntaxError[] checkSyntax(int iElementStart, int iElementEnd)
          Syntax checks the given Element number.
 ISeriesEditorSyntaxError[] checkSyntax(String strLine)
          Invokes the syntax checker proxy if available.
 void checkSyntaxOfRange(int iElementStart, int iElementEnd)
          Syntax checks the specified line
static byte[] getRPGSpecialCharBytes(String strSpecialChars)
          This API is a workaround for RPG NL variant chars problem in syntax checker and verifier.
 boolean isAvailable()
          Returns whether syntax checking is available.
 boolean isCancelable()
          Returns whether the syntax checker is cancelable before the operation is complete.
 
Methods inherited from class com.ibm.etools.iseries.parsers.ISeriesEditorSyntaxChecker
callbackAddSyntaxError, callbackGetLineText, callbackGetNextLine, callbackGetPreviousLine, callbackIsCanceled, callbackIsShowLine, checkSyntaxAuto, checkSyntaxAuto, checkSyntaxOfCurrentLine, checkSyntaxOfDocument, checkSyntaxOfRangeWithProgress, checkSyntaxOfSelection, displaySyntaxErrors, getHostCommunicationsPort
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.etools.iseries.parsers.IISeriesEditorSyntaxChecker
checkSyntaxOfCurrentLine, checkSyntaxOfDocument, checkSyntaxOfSelection
 

Field Detail

Copyright

public static final String Copyright
See Also:
Constant Field Values

_parser

protected ISeriesEditorRPGOPMParser _parser

_strSpecialChars

protected String _strSpecialChars

_strFilename

protected String _strFilename

_isAvailable

protected boolean _isAvailable

_specialCharByteArray

protected byte[] _specialCharByteArray
Constructor Detail

ISeriesEditorRPGOPMSyntaxChecker

public ISeriesEditorRPGOPMSyntaxChecker(LpexView lpexView,
                                        ISeriesEditorRPGOPMParser parser)
Constructor.

Method Detail

checkSyntax

public ISeriesEditorSyntaxError[] checkSyntax(int iElementStart,
                                              int iElementEnd)
Syntax checks the given Element number.

Specified by:
checkSyntax in interface IISeriesEditorSyntaxChecker
Specified by:
checkSyntax in class ISeriesEditorSyntaxChecker

checkSyntax

public ISeriesEditorSyntaxError[] checkSyntax(String strLine)
Invokes the syntax checker proxy if available. The proxy is given the instance to this class. The proxy calls this instance's addSyntaxError method for each syntax error string.


checkSyntaxOfRange

public void checkSyntaxOfRange(int iElementStart,
                               int iElementEnd)
Syntax checks the specified line

Specified by:
checkSyntaxOfRange in interface IISeriesEditorSyntaxChecker
Specified by:
checkSyntaxOfRange in class ISeriesEditorSyntaxChecker
See Also:
com.ibm.etools.iseries.editor.ISeriesEditorSyntaxChecker#checkSyntaxOfRange(int, int)

isAvailable

public boolean isAvailable()
Returns whether syntax checking is available.

Specified by:
isAvailable in interface IISeriesEditorSyntaxChecker
Specified by:
isAvailable in class ISeriesEditorSyntaxChecker

isCancelable

public boolean isCancelable()
Returns whether the syntax checker is cancelable before the operation is complete.

Specified by:
isCancelable in class ISeriesEditorSyntaxChecker

getRPGSpecialCharBytes

public static byte[] getRPGSpecialCharBytes(String strSpecialChars)
This API is a workaround for RPG NL variant chars problem in syntax checker and verifier. Internal use only. Declare as public The special chars array is organized as @, $, # in ISeriesEditorParser. In some encoding, a variant char is converted to multiple bytes. For example, in Chinese GB18030, the $ special char is converted to 4 bytes. There is a bug on Syntax checker DLL and Verifier DLL right now which only takes the first 3 bytes and treat them as @, $, #. Because a variant char converts to multiple bytes, the byte for the variant char after that variant char is not used by syntax checker and verifier. Thus, this variant char will be flagged as invalid. For GB18030, both Chinese $ and # are flagged as invalid. To workaround this problem, rearrange the byte array so that it contains a complete byte for variant chars as many as possible. For example, in GB18030 case, the #'s byte and $' bytes will be switched so that #'s byte is the second element in specialchar's byte array. As a result, # will not be flagged as invalid. $ sign in GB18030 is still flagged as invalid as before.


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.