org.eclipse.ocl.parser
Class OCLLexer

java.lang.Object
  extended by org.eclipse.ocl.lpg.AbstractLexer
      extended by org.eclipse.ocl.parser.OCLLexer
All Implemented Interfaces:
lpg.runtime.RuleAction

public class OCLLexer
extends AbstractLexer
implements lpg.runtime.RuleAction


Constructor Summary
OCLLexer(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment)
           
OCLLexer(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment, char[] chars)
           
OCLLexer(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment, char[] input_chars, java.lang.String filename, int tab)
           
OCLLexer(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment, java.io.Reader reader, java.lang.String filename)
           
 
Method Summary
 DerivedLexStream getILexStream()
           
 int[] getKeywordKinds()
          Queries the token kinds, as defined by my keyword lexer, of tokens that are keywords in by grammar.
 int getLeftSpan()
           
 lpg.runtime.ILexStream getLexStream()
          Deprecated. replaced by getILexStream()
 Environment<?,?,?,?,?,?,?,?,?,?,?,?> getOCLEnvironment()
           
 lpg.runtime.LexParser getParser()
           
 lpg.runtime.ParseTable getParseTable()
           
 int getRhsFirstTokenIndex(int i)
           
 int getRhsLastTokenIndex(int i)
           
 int getRightSpan()
           
 int getToken(int i)
           
 void initialize(char[] content, java.lang.String filename)
          Deprecated. function replaced by reset(char [] content, String filename)
 void lexer(DerivedPrsStream prsStream)
          Runs the lexer's with the provided parseStream
 void lexer(DerivedPrsStream prsStream, int start_offset, int end_offset)
          Runs the lexer's with the provided parseStream in specific offset of the input
 void lexer(lpg.runtime.Monitor monitor, DerivedPrsStream prsStream)
          Runs the lexer's with the provided parseStream and the given monitor.
 void lexer(lpg.runtime.Monitor monitor, DerivedPrsStream prsStream, int start_offset, int end_offset)
          Runs the lexer's with the provided parseStream in specific offset of the input
 void reportLexicalError(int startLoc, int endLoc)
          If a parse stream was not passed to this Lexical analyser then we simply report a lexical error.
 void reset(char[] input_chars, java.lang.String filename)
          Resets the lexer's input with the given char's array.
 void reset(char[] input_chars, java.lang.String filename, int tab)
          Resets the lexer's input with the given char's array.
 void reset(java.io.Reader reader, java.lang.String filename)
          Resets the lexer's input with the given Reader
 void resetKeywordLexer()
          Rsets the lexer's keywordLexer
 void ruleAction(int ruleNumber)
           
 
Methods inherited from class org.eclipse.ocl.lpg.AbstractLexer
getEnvironment, getInputChars, initialize, initialize, lexToTokens, lexToTokens
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OCLLexer

public OCLLexer(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment)

OCLLexer

public OCLLexer(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment,
                char[] chars)

OCLLexer

public OCLLexer(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment,
                char[] input_chars,
                java.lang.String filename,
                int tab)

OCLLexer

public OCLLexer(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment,
                java.io.Reader reader,
                java.lang.String filename)
         throws java.io.IOException
Throws:
java.io.IOException
Since:
3.0
Method Detail

getParseTable

public lpg.runtime.ParseTable getParseTable()
Specified by:
getParseTable in class AbstractLexer
Returns:
the lexer's ParseTable

getParser

public lpg.runtime.LexParser getParser()
Specified by:
getParser in class AbstractLexer
Returns:
the lexer's LexParser

getToken

public int getToken(int i)

getRhsFirstTokenIndex

public int getRhsFirstTokenIndex(int i)

getRhsLastTokenIndex

public int getRhsLastTokenIndex(int i)

getLeftSpan

public int getLeftSpan()

getRightSpan

public int getRightSpan()

resetKeywordLexer

public void resetKeywordLexer()
Description copied from class: AbstractLexer
Rsets the lexer's keywordLexer

Specified by:
resetKeywordLexer in class AbstractLexer

reset

public void reset(char[] input_chars,
                  java.lang.String filename)
Description copied from class: AbstractLexer
Resets the lexer's input with the given char's array.

Specified by:
reset in class AbstractLexer
Parameters:
input_chars - the new lexer's input
filename - a file name used for logging when encountering errors/warnings

reset

public void reset(char[] input_chars,
                  java.lang.String filename,
                  int tab)
Description copied from class: AbstractLexer
Resets the lexer's input with the given char's array.

Specified by:
reset in class AbstractLexer
Parameters:
input_chars - the new lexer's input
filename - a file name used for logging when encountering errors/warnings
tab - lexer's tab length.

getOCLEnvironment

public Environment<?,?,?,?,?,?,?,?,?,?,?,?> getOCLEnvironment()

getILexStream

public DerivedLexStream getILexStream()
Specified by:
getILexStream in class AbstractLexer
Returns:
the lexers's lexStream

getLexStream

@Deprecated
public lpg.runtime.ILexStream getLexStream()
Deprecated. replaced by getILexStream()

Specified by:
getLexStream in class AbstractLexer
Returns:
the lexer's lexStream

lexer

public void lexer(DerivedPrsStream prsStream)
Description copied from class: AbstractLexer
Runs the lexer's with the provided parseStream

Specified by:
lexer in class AbstractLexer
Parameters:
prsStream - the associated parseStream

lexer

public void lexer(lpg.runtime.Monitor monitor,
                  DerivedPrsStream prsStream)
Description copied from class: AbstractLexer
Runs the lexer's with the provided parseStream and the given monitor.

Specified by:
lexer in class AbstractLexer
Parameters:
monitor - the Monitor
prsStream - the associated parseStream

lexer

public void lexer(DerivedPrsStream prsStream,
                  int start_offset,
                  int end_offset)
Description copied from class: AbstractLexer
Runs the lexer's with the provided parseStream in specific offset of the input

Specified by:
lexer in class AbstractLexer
Parameters:
prsStream - the associated parseStream
start_offset - the start offset
end_offset - the end offset

lexer

public void lexer(lpg.runtime.Monitor monitor,
                  DerivedPrsStream prsStream,
                  int start_offset,
                  int end_offset)
Description copied from class: AbstractLexer
Runs the lexer's with the provided parseStream in specific offset of the input

Specified by:
lexer in class AbstractLexer
prsStream - the associated parseStream
start_offset - the start offset
end_offset - the end offset

reportLexicalError

public void reportLexicalError(int startLoc,
                               int endLoc)
If a parse stream was not passed to this Lexical analyser then we simply report a lexical error. Otherwise, we produce a bad token.

Specified by:
reportLexicalError in class AbstractLexer
Parameters:
startLoc - the offset the error starts
endLoc - the offset the error ends.

getKeywordKinds

public int[] getKeywordKinds()
Description copied from class: AbstractLexer
Queries the token kinds, as defined by my keyword lexer, of tokens that are keywords in by grammar.

Specified by:
getKeywordKinds in class AbstractLexer
Returns:
my keyword lexer's token kinds

initialize

@Deprecated
public void initialize(char[] content,
                                  java.lang.String filename)
Deprecated. function replaced by reset(char [] content, String filename)


reset

public void reset(java.io.Reader reader,
                  java.lang.String filename)
           throws java.io.IOException
Description copied from class: AbstractLexer
Resets the lexer's input with the given Reader

Specified by:
reset in class AbstractLexer
Parameters:
reader - the new lexer's input
filename - a file name used for logging when encountering errors/warnings
Throws:
java.io.IOException
Since:
3.0

ruleAction

public void ruleAction(int ruleNumber)
Specified by:
ruleAction in interface lpg.runtime.RuleAction