com.google.gwt.dev.js.rhino
Class TokenStream

java.lang.Object
  extended by com.google.gwt.dev.js.rhino.TokenStream

public class TokenStream
extends java.lang.Object

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


Field Summary
static int ADD
          Token types.
static int AND
          Token types.
static int ARRAYLIT
          Token types.
static int ASSIGN
          Token types.
static int BINDNAME
          Token types.
static int BITAND
          Token types.
static int BITNOT
          Token types.
static int BITOR
          Token types.
static int BITXOR
          Token types.
static int BLOCK
          Token types.
static int BREAK
          Token types.
static int CALL
          Token types.
static int CALLSPECIAL
          Token types.
static int CASE
          Token types.
static int CATCH
          Token types.
static int CLOSURE
          Token types.
static int COLON
          Token types.
static int COMMA
          Token types.
static int CONTINUE
          Token types.
static int CONVERT
          Token types.
static int DEBUGGER
          Token types.
static int DEC
          Token types.
static int DEFAULT
          Token types.
static int DELPROP
          Token types.
static int DIV
          Token types.
static int DO
          Token types.
static int DOT
          Token types.
static int DUP
          Token types.
static int ELEMDEC
          Token types.
static int ELEMINC
          Token types.
static int ELSE
          Token types.
static int ENDTRY
          Token types.
static int ENTERWITH
          Token types.
static int ENUMDONE
          Token types.
static int ENUMINIT
          Token types.
static int ENUMNEXT
          Token types.
static int EOF
          Token types.
static int EOL
          Token types.
static int EQ
          Token types.
static int EQOP
          Token types.
static int ERROR
          Token types.
static int EXPORT
          Token types.
static int EXPRSTMT
          Token types.
static int FALSE
          Token types.
static int FINALLY
          Token types.
static int FOR
          Token types.
static int FUNCTION
          Token types.
static int GE
          Token types.
static int GETBASE
          Token types.
static int GETELEM
          Token types.
static int GETPARENT
          Token types.
static int GETPROP
          Token types.
static int GETPROTO
          Token types.
static int GETSCOPEPARENT
          Token types.
static int GETTHIS
          Token types.
static int GETVAR
          Token types.
static int GOSUB
          Token types.
static int GOTO
          Token types.
static int GT
          Token types.
static int GWT
          Token types.
static int HOOK
          Token types.
static int IF
          Token types.
static int IFEQ
          Token types.
static int IFNE
          Token types.
static int IMPORT
          Token types.
static int IN
          Token types.
static int INC
          Token types.
static int INSTANCEOF
          Token types.
static int JSR
          Token types.
static int JTHROW
          Token types.
static int LABEL
          Token types.
static int LAST_TOKEN
          Token types.
static int LB
          Token types.
static int LC
          Token types.
static int LE
          Token types.
static int LEAVEWITH
          Token types.
static int LOOP
          Token types.
static int LP
          Token types.
static int LSH
          Token types.
static int LT
          Token types.
static int MOD
          Token types.
static int MUL
          Token types.
static int NAME
          Token types.
static int NAMEDEC
          Token types.
static int NAMEINC
          Token types.
static int NE
          Token types.
static int NEG
          Token types.
static int NEW
          Token types.
static int NEWLOCAL
          Token types.
static int NEWSCOPE
          Token types.
static int NEWTEMP
          Token types.
static int NOP
          Token types.
static int NOT
          Token types.
static int NULL
          Token types.
static int NUMBER
          Token types.
static int NUMBER_INT
          Token types.
static int OBJLIT
          Token types.
static int ONE
          Token types.
static int OR
          Token types.
static int PARENT
          Token types.
static int POP
          Token types.
static int POPV
          Token types.
static int POS
          Token types.
static int POST
          Token types.
static int PRE
          Token types.
static int PRIMARY
          Token types.
static int PROPDEC
          Token types.
static int PROPINC
          Token types.
static int RB
          Token types.
static int RC
          Token types.
static int REGEXP
          Token types.
static int RELOP
          Token types.
static int RETRY_TOKEN
          Token types.
static int RETSUB
          Token types.
static int RETURN
          Token types.
static int RSH
          Token types.
static int SCOPE
          Token types.
static int SCRIPT
          Token types.
static int SEMI
          Token types.
static int SETELEM
          Token types.
static int SETNAME
          Token types.
static int SETPARENT
          Token types.
static int SETPROP
          Token types.
static int SETPROTO
          Token types.
static int SETVAR
          Token types.
static int SHEQ
          Token types.
static int SHNE
          Token types.
static int SHOP
          Token types.
static int STRING
          Token types.
static int SUB
          Token types.
static int SWITCH
          Token types.
static int TARGET
          Token types.
static int THIS
          Token types.
static int THISFN
          Token types.
static int THROW
          Token types.
static int TRUE
          Token types.
static int TRY
          Token types.
static int TYPEOF
          Token types.
static int TYPEOFNAME
          Token types.
static int UNARYOP
          Token types.
static int UNDEFINED
          Token types.
static int URSH
          Token types.
static int USELOCAL
          Token types.
static int USETEMP
          Token types.
static int VAR
          Token types.
static int VARDEC
          Token types.
static int VARINC
          Token types.
static int VOID
          Token types.
static int WHILE
          Token types.
static int WITH
          Token types.
static int ZERO
          Token types.
 
Constructor Summary
TokenStream(java.io.Reader in, java.lang.String sourceName, int lineno)
           
 
Method Summary
 boolean eof()
           
 java.lang.String getLine()
           
 int getLineno()
           
 double getNumber()
           
 int getOffset()
           
 int getOp()
           
 java.lang.String getSourceName()
           
 java.lang.String getString()
           
 int getToken()
           
 int getTokenno()
           
static boolean isJSSpace(int c)
           
 boolean matchToken(int toMatch)
           
 int peekToken()
           
 int peekTokenSameLine()
           
 void reportSyntaxError(java.lang.String messageProperty, java.lang.Object[] args)
          Positions hold offset of an corresponding token's end.
static java.lang.String tokenToName(int token)
           
 java.lang.String tokenToString(int token)
           
 void ungetToken(int tt)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ERROR

public static final int ERROR
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

EOF

public static final int EOF
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

EOL

public static final int EOL
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

POPV

public static final int POPV
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

ENTERWITH

public static final int ENTERWITH
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

LEAVEWITH

public static final int LEAVEWITH
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

RETURN

public static final int RETURN
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

GOTO

public static final int GOTO
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

IFEQ

public static final int IFEQ
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

IFNE

public static final int IFNE
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

DUP

public static final int DUP
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

SETNAME

public static final int SETNAME
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

BITOR

public static final int BITOR
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

BITXOR

public static final int BITXOR
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

BITAND

public static final int BITAND
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

EQ

public static final int EQ
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

NE

public static final int NE
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

LT

public static final int LT
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

LE

public static final int LE
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

GT

public static final int GT
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

GE

public static final int GE
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

LSH

public static final int LSH
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

RSH

public static final int RSH
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

URSH

public static final int URSH
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

ADD

public static final int ADD
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

SUB

public static final int SUB
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

MUL

public static final int MUL
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

DIV

public static final int DIV
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

MOD

public static final int MOD
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

BITNOT

public static final int BITNOT
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

NEG

public static final int NEG
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

NEW

public static final int NEW
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

DELPROP

public static final int DELPROP
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

TYPEOF

public static final int TYPEOF
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

NAMEINC

public static final int NAMEINC
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

PROPINC

public static final int PROPINC
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

ELEMINC

public static final int ELEMINC
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

NAMEDEC

public static final int NAMEDEC
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

PROPDEC

public static final int PROPDEC
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

ELEMDEC

public static final int ELEMDEC
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

GETPROP

public static final int GETPROP
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

SETPROP

public static final int SETPROP
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

GETELEM

public static final int GETELEM
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

SETELEM

public static final int SETELEM
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

CALL

public static final int CALL
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

NAME

public static final int NAME
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

NUMBER

public static final int NUMBER
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

STRING

public static final int STRING
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

ZERO

public static final int ZERO
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

ONE

public static final int ONE
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

NULL

public static final int NULL
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

THIS

public static final int THIS
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

FALSE

public static final int FALSE
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

TRUE

public static final int TRUE
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

SHEQ

public static final int SHEQ
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

SHNE

public static final int SHNE
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

CLOSURE

public static final int CLOSURE
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

REGEXP

public static final int REGEXP
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

POP

public static final int POP
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

POS

public static final int POS
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

VARINC

public static final int VARINC
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

VARDEC

public static final int VARDEC
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

BINDNAME

public static final int BINDNAME
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

THROW

public static final int THROW
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

IN

public static final int IN
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

INSTANCEOF

public static final int INSTANCEOF
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

GOSUB

public static final int GOSUB
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

RETSUB

public static final int RETSUB
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

CALLSPECIAL

public static final int CALLSPECIAL
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

GETTHIS

public static final int GETTHIS
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

NEWTEMP

public static final int NEWTEMP
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

USETEMP

public static final int USETEMP
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

GETBASE

public static final int GETBASE
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

GETVAR

public static final int GETVAR
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

SETVAR

public static final int SETVAR
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

UNDEFINED

public static final int UNDEFINED
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

TRY

public static final int TRY
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

ENDTRY

public static final int ENDTRY
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

NEWSCOPE

public static final int NEWSCOPE
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

TYPEOFNAME

public static final int TYPEOFNAME
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

ENUMINIT

public static final int ENUMINIT
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

ENUMNEXT

public static final int ENUMNEXT
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

GETPROTO

public static final int GETPROTO
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

GETPARENT

public static final int GETPARENT
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

SETPROTO

public static final int SETPROTO
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

SETPARENT

public static final int SETPARENT
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

SCOPE

public static final int SCOPE
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

GETSCOPEPARENT

public static final int GETSCOPEPARENT
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

THISFN

public static final int THISFN
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

JTHROW

public static final int JTHROW
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

SEMI

public static final int SEMI
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

LB

public static final int LB
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

RB

public static final int RB
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

LC

public static final int LC
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

RC

public static final int RC
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

LP

public static final int LP
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

GWT

public static final int GWT
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

COMMA

public static final int COMMA
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

ASSIGN

public static final int ASSIGN
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

HOOK

public static final int HOOK
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

COLON

public static final int COLON
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

OR

public static final int OR
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

AND

public static final int AND
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

EQOP

public static final int EQOP
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

RELOP

public static final int RELOP
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

SHOP

public static final int SHOP
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

UNARYOP

public static final int UNARYOP
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

INC

public static final int INC
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

DEC

public static final int DEC
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

DOT

public static final int DOT
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

PRIMARY

public static final int PRIMARY
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

FUNCTION

public static final int FUNCTION
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

EXPORT

public static final int EXPORT
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

IMPORT

public static final int IMPORT
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

IF

public static final int IF
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

ELSE

public static final int ELSE
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

SWITCH

public static final int SWITCH
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

CASE

public static final int CASE
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

DEFAULT

public static final int DEFAULT
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

WHILE

public static final int WHILE
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

DO

public static final int DO
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

FOR

public static final int FOR
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

BREAK

public static final int BREAK
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

CONTINUE

public static final int CONTINUE
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

VAR

public static final int VAR
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

WITH

public static final int WITH
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

CATCH

public static final int CATCH
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

FINALLY

public static final int FINALLY
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

NOP

public static final int NOP
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

NOT

public static final int NOT
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

PRE

public static final int PRE
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

POST

public static final int POST
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

VOID

public static final int VOID
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

BLOCK

public static final int BLOCK
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

ARRAYLIT

public static final int ARRAYLIT
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

OBJLIT

public static final int OBJLIT
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

LABEL

public static final int LABEL
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

TARGET

public static final int TARGET
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

LOOP

public static final int LOOP
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

ENUMDONE

public static final int ENUMDONE
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

EXPRSTMT

public static final int EXPRSTMT
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

PARENT

public static final int PARENT
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

CONVERT

public static final int CONVERT
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

JSR

public static final int JSR
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

NEWLOCAL

public static final int NEWLOCAL
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

USELOCAL

public static final int USELOCAL
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

DEBUGGER

public static final int DEBUGGER
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

SCRIPT

public static final int SCRIPT
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

LAST_TOKEN

public static final int LAST_TOKEN
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

NUMBER_INT

public static final int NUMBER_INT
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values

RETRY_TOKEN

public static final int RETRY_TOKEN
Token types. These values correspond to JSTokenType values in jsscan.c.

See Also:
Constant Field Values
Constructor Detail

TokenStream

public TokenStream(java.io.Reader in,
                   java.lang.String sourceName,
                   int lineno)
Method Detail

tokenToName

public static java.lang.String tokenToName(int token)

tokenToString

public java.lang.String tokenToString(int token)

matchToken

public boolean matchToken(int toMatch)
                   throws java.io.IOException
Throws:
java.io.IOException

ungetToken

public void ungetToken(int tt)

peekToken

public int peekToken()
              throws java.io.IOException
Throws:
java.io.IOException

peekTokenSameLine

public int peekTokenSameLine()
                      throws java.io.IOException
Throws:
java.io.IOException

isJSSpace

public static boolean isJSSpace(int c)

getToken

public int getToken()
             throws java.io.IOException
Throws:
java.io.IOException

reportSyntaxError

public void reportSyntaxError(java.lang.String messageProperty,
                              java.lang.Object[] args)
Positions hold offset of an corresponding token's end. So lastPosition holds an offset of char that is next to last token. Use secondToLastPosition for error reporting outside of TokenStream, because usually we want to report beginning of erroneous token, which is end of second to last read token.


getSourceName

public java.lang.String getSourceName()

getLineno

public int getLineno()

getOp

public int getOp()

getString

public java.lang.String getString()

getNumber

public double getNumber()

getLine

public java.lang.String getLine()

getOffset

public int getOffset()

getTokenno

public int getTokenno()

eof

public boolean eof()