gnu.ecmascript
Class Lexer
java.lang.Object
java.io.Reader
gnu.text.Lexer
gnu.ecmascript.Lexer
- All Implemented Interfaces:
- java.io.Closeable, java.lang.Readable
public class Lexer
- extends Lexer
Reads EcmaScript token from a InPort.
Fields inherited from class java.io.Reader |
lock |
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_quick, skip, tokenBufferAppend, unread_quick, unread, unread |
Methods inherited from class java.io.Reader |
mark, markSupported, read, read, ready, skip |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
lparenToken
public static final Char lparenToken
rparenToken
public static final Char rparenToken
lbraceToken
public static final Char lbraceToken
rbraceToken
public static final Char rbraceToken
lbracketToken
public static final Char lbracketToken
rbracketToken
public static final Char rbracketToken
dotToken
public static final Char dotToken
condToken
public static final Char condToken
commaToken
public static final Char commaToken
colonToken
public static final Char colonToken
equalToken
public static final Char equalToken
tildeToken
public static final Char tildeToken
notToken
public static final Char notToken
semicolonToken
public static final Char semicolonToken
eolToken
public static final java.lang.Object eolToken
eofToken
public static final java.lang.Object eofToken
elseToken
public static final Reserved elseToken
newToken
public static final Reserved newToken
Lexer
public Lexer(InPort port)
checkReserved
public static java.lang.Object checkReserved(java.lang.String name)
getNumericLiteral
public java.lang.Double getNumericLiteral(int c)
throws java.io.IOException
- Throws:
java.io.IOException
getStringLiteral
public java.lang.String getStringLiteral(char quote)
throws java.io.IOException,
SyntaxException
- Throws:
java.io.IOException
SyntaxException
getIdentifier
public java.lang.String getIdentifier(int ch)
throws java.io.IOException
- Throws:
java.io.IOException
maybeAssignment
public java.lang.Object maybeAssignment(java.lang.Object token)
throws java.io.IOException,
SyntaxException
- Throws:
java.io.IOException
SyntaxException
getToken
public java.lang.Object getToken()
throws java.io.IOException,
SyntaxException
- Returns the next token.
Returns:
- end-of-file
- Sequence.eofValue
- end-of-line>dd>eolToken
- reserved word
- ???
- identifier>
- a java.lang.String
- punctuator
- ???
Literals are returned a QuoteExp objects, Specifically:
- numeric literal
- a QuoteExp of a java.lang.Double value
- boolean literal
- a QuoteExp of java.lang.Boolean.TRUE or FALSE
- null literal
- a QuoteExp whose value is null
- string literal
- a QuoteExp whose value is a String
- Throws:
java.io.IOException
SyntaxException
getToken
public static java.lang.Object getToken(InPort inp)
throws java.io.IOException,
SyntaxException
- Throws:
java.io.IOException
SyntaxException
main
public static void main(java.lang.String[] args)