Package gnu.ecmascript
Class Lexer
java.lang.Object
java.io.Reader
gnu.text.Lexer
gnu.ecmascript.Lexer
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Readable
Reads EcmaScript token from a InPort.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Char
static final Char
static final Char
static final Char
static final Reserved
static final Object
static final Object
static final Char
static final Char
static final Char
static final Char
static final Reserved
static final Char
static final Char
static final Char
static final Char
static final Char
static final Char
Fields inherited from class gnu.text.Lexer
nesting, port, tentative, tokenBuffer, tokenBufferLength
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Object
checkReserved
(String name) getIdentifier
(int ch) getNumericLiteral
(int c) getStringLiteral
(char quote) getToken()
Returns the next token.static Object
getToken
(gnu.kawa.io.InPort inp) static void
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, isTentative, mark, peek, popNesting, pushNesting, read, read, readCodePoint, readDelimited, readDigits, readDigitsInBuffer, readIntDigits, readOptionalExponent, readUnicodeChar, reset, seenErrors, setInteractive, setMessages, setTentative, skip, skip_quick, tokenBufferAppend, tokenBufferString, unread, unread, unread_quick
Methods inherited from class java.io.Reader
mark, markSupported, nullReader, read, read, ready, skip, transferTo
-
Field Details
-
lparenToken
-
rparenToken
-
lbraceToken
-
rbraceToken
-
lbracketToken
-
rbracketToken
-
dotToken
-
condToken
-
commaToken
-
colonToken
-
equalToken
-
tildeToken
-
notToken
-
semicolonToken
-
eolToken
-
eofToken
-
elseToken
-
newToken
-
-
Constructor Details
-
Lexer
public Lexer(gnu.kawa.io.InPort port)
-
-
Method Details
-
checkReserved
-
getNumericLiteral
- Throws:
IOException
-
getStringLiteral
- Throws:
IOException
SyntaxException
-
getIdentifier
- Throws:
IOException
-
maybeAssignment
- Throws:
IOException
SyntaxException
-
getToken
Returns the next token. Returns:- end-of-file
- Sequence.eofValue
- end-of-line
- eolToken
- reserved word
- ???
- identifier
- a java.lang.String
- punctuator
- ???
- 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:
IOException
SyntaxException
-
getToken
- Throws:
IOException
SyntaxException
-
main
-