org.eclipse.ocl.lpg
Class DerivedLexStream

java.lang.Object
  extended by lpg.runtime.LexStream
      extended by lpg.runtime.LpgLexStream
          extended by org.eclipse.ocl.lpg.DerivedLexStream
All Implemented Interfaces:
lpg.runtime.ILexStream, lpg.runtime.ParseErrorCodes, lpg.runtime.TokenStream

public abstract class DerivedLexStream
extends lpg.runtime.LpgLexStream

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

Field Summary
protected static int ECLIPSE_TAB_VALUE
           
 
Fields inherited from class lpg.runtime.LexStream
prsStream
 
Fields inherited from interface lpg.runtime.ParseErrorCodes
BEFORE_CODE, DELETION_CODE, EOF_CODE, ERROR_CODE, ERROR_RULE_ERROR_CODE, ERROR_RULE_WARNING_CODE, errorMsgText, INSERTION_CODE, INVALID_CODE, INVALID_TOKEN_CODE, LEX_ERROR_CODE, MERGE_CODE, MISPLACED_CODE, NO_MESSAGE_CODE, SCOPE_CODE, SECONDARY_CODE, SUBSTITUTION_CODE
 
Constructor Summary
DerivedLexStream()
           
DerivedLexStream(BasicEnvironment environment, char[] input_chars, java.lang.String filename, int tab)
           
DerivedLexStream(BasicEnvironment environment, java.lang.String filename, int tab)
           
 
Method Summary
protected  int computeErrorCode(int leftToken, int rightToken)
           
 void initialize(char[] inputChars)
          Define the input text as a given array of characters.
 void reportLexicalError(int errorCode, int leftLoc, int rightLoc, int errorLeftLoc, int errorRightLoc, java.lang.String[] errorInfo)
          Errors generated within the lexer are redirected to the error handler if there is one.
 
Methods inherited from class lpg.runtime.LpgLexStream
getKind, orderedExportedSymbols
 
Methods inherited from class lpg.runtime.LexStream
afterEol, badToken, computeLineOffsets, getCharValue, getColumn, getColumnOfCharAt, getEndColumn, getEndLine, getFileName, getFirstErrorToken, getFirstRealToken, getInputChars, getIntValue, getIPrsStream, getLastErrorToken, getLastRealToken, getLine, getLine, getLineCount, getLineNumberOfCharAt, getLineOffset, getLineOffsets, getLocation, getMessageHandler, getName, getNext, getPrevious, getPrsStream, getStreamIndex, getStreamLength, getTab, getToken, getToken, initialize, initialize, initialize, makeToken, peek, reportError, reportError, reportError, reportError, reportLexicalError, reset, reset, setFileName, setInputChars, setLineOffset, setLineOffsets, setMessageHandler, setPrsStream, setStreamIndex, setStreamLength, setTab, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ECLIPSE_TAB_VALUE

protected static final int ECLIPSE_TAB_VALUE
See Also:
Constant Field Values
Constructor Detail

DerivedLexStream

public DerivedLexStream(BasicEnvironment environment,
                        java.lang.String filename,
                        int tab)
                 throws java.io.IOException
Throws:
java.io.IOException

DerivedLexStream

public DerivedLexStream(BasicEnvironment environment,
                        char[] input_chars,
                        java.lang.String filename,
                        int tab)

DerivedLexStream

public DerivedLexStream()
Method Detail

computeErrorCode

protected int computeErrorCode(int leftToken,
                               int rightToken)

initialize

public void initialize(char[] inputChars)
Define the input text as a given array of characters.

Parameters:
inputChars - the characters

reportLexicalError

public void reportLexicalError(int errorCode,
                               int leftLoc,
                               int rightLoc,
                               int errorLeftLoc,
                               int errorRightLoc,
                               java.lang.String[] errorInfo)
Errors generated within the lexer are redirected to the error handler if there is one. Note that other variants of reportLexicalError and reportError either feed this one, are fed from a default implementation of this one or originate in the parser, where a ParserErrorHandler can intercept them.

Specified by:
reportLexicalError in interface lpg.runtime.ILexStream
Overrides:
reportLexicalError in class lpg.runtime.LexStream
Since:
3.0