org.eclipse.ocl.lpg
Class DerivedPrsStream

java.lang.Object
  extended by PrsStream
      extended by org.eclipse.ocl.lpg.DerivedPrsStream

public class DerivedPrsStream
extends PrsStream

This DerivedLexStream will be used in favour of the LpgLexStream for the OCLLexer, so that some customization are introduced and exploited by the generated OCLLexer.

Since:
3.0

Constructor Summary
DerivedPrsStream(BasicEnvironment env, ILexStream iLexStream)
           
 
Method Summary
 ErrorToken getErrorTokenAtCharacter(int offset)
          This function returns the index of the token element containing the offset specified.
 int getErrorTokens()
           
 int getTokenIndexAtCharacter(int offset)
          Overridden to search only the non-Error nodes, which are the only tokens in monotonic order.
 int makeErrorToken(int firsttok, int lasttok, int errortok, int kind)
           
 void reportError(int errorCode, int leftToken, int errorToken, int rightToken, java.lang.String[] errorInfo)
           
 void reportErrorTokenMessage(int error_token, java.lang.String msg)
          Report error message for given error_token.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DerivedPrsStream

public DerivedPrsStream(BasicEnvironment env,
                        ILexStream iLexStream)
Method Detail

getErrorTokenAtCharacter

public ErrorToken getErrorTokenAtCharacter(int offset)
This function returns the index of the token element containing the offset specified. If such a token does not exist, it returns the negation of the index of the element immediately preceding the offset.

Since:
1.3

getErrorTokens

public int getErrorTokens()
Since:
1.3

getTokenIndexAtCharacter

public int getTokenIndexAtCharacter(int offset)
Overridden to search only the non-Error nodes, which are the only tokens in monotonic order.


makeErrorToken

public int makeErrorToken(int firsttok,
                          int lasttok,
                          int errortok,
                          int kind)

reportError

public void reportError(int errorCode,
                        int leftToken,
                        int errorToken,
                        int rightToken,
                        java.lang.String[] errorInfo)
Since:
3.0

reportErrorTokenMessage

public final void reportErrorTokenMessage(int error_token,
                                          java.lang.String msg)
Report error message for given error_token.

Parameters:
error_token - the error taken index
msg - the message to report
Since:
1.3

Copyright 2002, 2007 IBM Corporation and others.
All Rights Reserved.