com.google.javascript.rhino
Class TokenStream

java.lang.Object
  extended by com.google.javascript.rhino.TokenStream

public class TokenStream
extends Object

This class implements the JavaScript scanner. It is based on the C source files jsscan.c and jsscan.h in the jsref package.

See Also:
Parser

Constructor Summary
TokenStream(Parser parser, Reader sourceReader, String sourceString, int lineno)
           
 
Method Summary
protected  int getChar()
           
protected  int getCharno()
           
protected  int getLineno()
           
 int getToken()
           
 int getTokenno()
           
static boolean isJSIdentifier(String s)
           
static boolean isKeyword(String s)
           
 void setFileLevelJsDocBuilder(Node.FileLevelJsDocBuilder fileLevelJsDocBuilder)
          Set the FileLevelJsDocBuilder on the TokenStream.
protected  void ungetChar(int c)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TokenStream

public TokenStream(Parser parser,
                   Reader sourceReader,
                   String sourceString,
                   int lineno)
Method Detail

isKeyword

public static boolean isKeyword(String s)

isJSIdentifier

public static boolean isJSIdentifier(String s)

getLineno

protected final int getLineno()

getCharno

protected final int getCharno()

getToken

public final int getToken()
                   throws IOException
Throws:
IOException

getTokenno

public int getTokenno()

ungetChar

protected void ungetChar(int c)

getChar

protected int getChar()
               throws IOException
Throws:
IOException

setFileLevelJsDocBuilder

public void setFileLevelJsDocBuilder(Node.FileLevelJsDocBuilder fileLevelJsDocBuilder)
Set the FileLevelJsDocBuilder on the TokenStream. The TokenStream passes the builder on to the JSDocInfoParser if it exists. Otherwise this method is a no-op.

Parameters:
fileLevelJsDocBuilder -