fr.umlv.tatoo.runtime.lexer
Class Lexer.LexerImpl<R,B extends LexerBuffer>

java.lang.Object
  extended by fr.umlv.tatoo.runtime.lexer.Lexer<B>
      extended by fr.umlv.tatoo.runtime.lexer.Lexer.LexerImpl<R,B>
All Implemented Interfaces:
SimpleLexer
Enclosing class:
Lexer<B extends LexerBuffer>

public static class Lexer.LexerImpl<R,B extends LexerBuffer>
extends Lexer<B>


Nested Class Summary
 
Nested classes/interfaces inherited from class fr.umlv.tatoo.runtime.lexer.Lexer
Lexer.LexerImpl<R,B extends LexerBuffer>
 
Method Summary
 void close()
          Closes the lexing process.
 RuleActivator<? extends R> getActivator()
          returns the RuleActivator used by this Lexer
 LexerErrorRecoveryPolicy<R,B> getLexerErrorRecoveryPolicy()
          Returns the LexerErrorRecoveryPolicy used by this lexer
 LexerListener<? super R,? super B> getLexerListener()
          Returns the LexerListener this lexer notifies events to
 void reset(B buffer)
          Reset the lexer to perform a new analysis.
 void run()
          Does all the lexing in one shot.
 void step()
          Proceed all available characters from the underlying buffer.
 
Methods inherited from class fr.umlv.tatoo.runtime.lexer.Lexer
createLexer, getBuffer, getLifecycleHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

step

public void step()
Proceed all available characters from the underlying buffer. In order to end the lexing, after several calls to SimpleLexer.step() the developer must call SimpleLexer.close().

See Also:
SimpleLexer.close(), LexerBuffer.hasRemaining()

close

public void close()
Closes the lexing process. This method must be called after some calls to SimpleLexer.step(). Note that this method is likely to recognize some supplementary tokens and thus to call LexerListener.ruleVerified(Object, int, Object). during the lexing process, by example, if the lexer states doesn't accept the end of file.

See Also:
SimpleLexer.step()

run

public void run()
Does all the lexing in one shot.


getActivator

public RuleActivator<? extends R> getActivator()
returns the RuleActivator used by this Lexer

Specified by:
getActivator in class Lexer<B extends LexerBuffer>
Returns:
the RuleActivator used by this Lexer

reset

public void reset(B buffer)
Reset the lexer to perform a new analysis. All current states are discarded. The new buffer is the buffer supplied. This implementation calls LifecycleHandler.handleReset(Lexer) after the reset of the lexer.

Specified by:
reset in class Lexer<B extends LexerBuffer>

getLexerListener

public LexerListener<? super R,? super B> getLexerListener()
Returns the LexerListener this lexer notifies events to

Specified by:
getLexerListener in class Lexer<B extends LexerBuffer>
Returns:
the LexerListener this lexer notifies events to

getLexerErrorRecoveryPolicy

public LexerErrorRecoveryPolicy<R,B> getLexerErrorRecoveryPolicy()
Returns the LexerErrorRecoveryPolicy used by this lexer

Specified by:
getLexerErrorRecoveryPolicy in class Lexer<B extends LexerBuffer>
Returns:
the LexerErrorRecoveryPolicy used by this lexer