Class xrx.xpath.Lexer
Defined in: lexer.js.
Constructor Attributes | Constructor Name and Description |
---|---|
xrx.xpath.Lexer(tokens)
Constructs a lexer.
|
Method Attributes | Method Name and Description |
---|---|
back()
Decrements the index by one.
|
|
empty()
Checks whether the lexer is empty.
|
|
next()
Returns the next token from the lexer and increments the index.
|
|
peek(opt_i)
Peeks at the lexer.
|
|
<static> |
xrx.xpath.Lexer.tokenize(source)
Tokenizes a source string into an array of tokens.
|
Class Detail
xrx.xpath.Lexer(tokens)
Constructs a lexer.
- Parameters:
-
{!Array.
} tokens - Tokens to iterate over.
Method Detail
back()
Decrements the index by one.
{boolean}
empty()
Checks whether the lexer is empty.
- Returns:
- {boolean} Whether the lexer is empty.
{string}
next()
Returns the next token from the lexer and increments the index.
- Returns:
- {string} The next token.
{string}
peek(opt_i)
Peeks at the lexer. An optional index can be
used to specify the token peek at.
- Parameters:
- {number=} opt_i
- Index to peek at. Defaults to zero.
- Returns:
- {string} Token peeked.
<static>
{!xrx.xpath.Lexer}
xrx.xpath.Lexer.tokenize(source)
Tokenizes a source string into an array of tokens.
- Parameters:
- {string} source
- Source string to tokenize.
- Returns:
- {!xrx.xpath.Lexer} Essentially an iterator over the tokens.