openjava.syntax
Class RestorableTokenSource

java.lang.Object
  |
  +--openjava.syntax.RestorableTokenSource
All Implemented Interfaces:
TokenSource

public class RestorableTokenSource
extends Object
implements TokenSource

A TokenSource which can be back-tracked.

Since:
%SOFTWARE% 1.0
Version:
1.0
Author:
Michiaki Tatsubori
See Also:
Object

Field Summary
private  Environment env
           
private  int offset
           
private  int pointer
           
private  TokenSource tokenSource
           
 
Constructor Summary
RestorableTokenSource(TokenSource src)
           
RestorableTokenSource(TokenSource src, Environment env)
           
 
Method Summary
 void assume()
           
 void fix()
           
 Environment getEnvironment()
           
 Token getNextToken()
           
 Token getToken(int i)
           
 void restore()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tokenSource

private TokenSource tokenSource

env

private Environment env

pointer

private int pointer

offset

private int offset
Constructor Detail

RestorableTokenSource

public RestorableTokenSource(TokenSource src,
                             Environment env)

RestorableTokenSource

public RestorableTokenSource(TokenSource src)
Method Detail

getEnvironment

public Environment getEnvironment()
Specified by:
getEnvironment in interface TokenSource

assume

public void assume()

restore

public void restore()

fix

public void fix()

getNextToken

public Token getNextToken()
Specified by:
getNextToken in interface TokenSource

getToken

public Token getToken(int i)
Specified by:
getToken in interface TokenSource

SourceForge.net_Logo