gnu.ecmascript

Class Lexer


public class Lexer
extends Lexer

Reads EcmaScript token from a InPort.

Field Summary

static Char
colonToken
static Char
commaToken
static Char
condToken
static Char
dotToken
static Reserved
elseToken
static Object
eofToken
static Object
eolToken
static Char
equalToken
static Char
lbraceToken
static Char
lbracketToken
static Char
lparenToken
static Reserved
newToken
static Char
notToken
static Char
rbraceToken
static Char
rbracketToken
static Char
rparenToken
static Char
semicolonToken
static Char
tildeToken

Fields inherited from class gnu.text.Lexer

interactive, nesting, port, tokenBuffer, tokenBufferLength

Constructor Summary

Lexer(InPort port)

Method Summary

static Object
checkReserved(String name)
String
getIdentifier(int ch)
Double
getNumericLiteral(int c)
String
getStringLiteral(char quote)
Object
getToken()
Returns the next token.
static Object
getToken(InPort inp)
static void
main(String[] args)
Object
maybeAssignment(Object token)

Methods inherited from class gnu.text.Lexer

checkErrors, checkNext, clearErrors, close, eofError, eofError, error, error, error, fatal, getColumnNumber, getErrors, getLineNumber, getMessages, getName, getPort, isInteractive, mark, peek, popNesting, pushNesting, read, read, readDigitsInBuffer, readOptionalExponent, reset, seenErrors, setInteractive, setMessages, skip, skip_quick, tokenBufferAppend, unread, unread, unread_quick

Field Details

colonToken

public static final Char colonToken

commaToken

public static final Char commaToken

condToken

public static final Char condToken

dotToken

public static final Char dotToken

elseToken

public static final Reserved elseToken

eofToken

public static final Object eofToken

eolToken

public static final Object eolToken

equalToken

public static final Char equalToken

lbraceToken

public static final Char lbraceToken

lbracketToken

public static final Char lbracketToken

lparenToken

public static final Char lparenToken

newToken

public static final Reserved newToken

notToken

public static final Char notToken

rbraceToken

public static final Char rbraceToken

rbracketToken

public static final Char rbracketToken

rparenToken

public static final Char rparenToken

semicolonToken

public static final Char semicolonToken

tildeToken

public static final Char tildeToken

Constructor Details

Lexer

public Lexer(InPort port)

Method Details

checkReserved

public static Object checkReserved(String name)

getIdentifier

public String getIdentifier(int ch)
            throws java.io.IOException

getNumericLiteral

public Double getNumericLiteral(int c)
            throws java.io.IOException

getStringLiteral

public String getStringLiteral(char quote)
            throws java.io.IOException,
                   SyntaxException

getToken

public Object getToken()
            throws java.io.IOException,
                   SyntaxException
Returns the next token. Returns:
Literals are returned a QuoteExp objects, Specifically:

getToken

public static Object getToken(InPort inp)
            throws java.io.IOException,
                   SyntaxException

main

public static void main(String[] args)

maybeAssignment

public Object maybeAssignment(Object token)
            throws java.io.IOException,
                   SyntaxException