Lexer class
Constructors
- Lexer.tokenize(String content)
-
factory
Properties
- col → int
-
no setter
- content → String
-
final
- curr ↔ int
-
The current token index.
getter/setter pair
-
errors
→ List<
String> -
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- lastLineIdx ↔ int
-
The last line break w.r.t current token index.
col = curr - lastLineIdx.
getter/setter pair
- line ↔ int
-
The current line count.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
tokens
→ List<
Token> -
final
Methods
-
add(
) → void -
addError(
String msg) → void - col and line are base-0 index. Format to base-1.
-
addToken(
Token token) → void -
advance(
) → StreamChar -
advanceWithToken(
TokenType type, {String? lexeme}) → void -
bitAnd(
) → void -
bitNot(
) → void -
bitOr(
) → void -
bumpline(
) → void -
carrot(
) → void -
colon(
) → void -
comma(
) → void -
div(
) → void -
dot(
) → void -
dropComments(
) → void -
dropSemicolons(
) → void - TODO: semicolons are needed to disambiguate grammar
-
end(
StreamChar char) → void -
eof(
) → bool -
eq(
) → void -
function(
StreamChar char) → void -
goto(
StreamChar char) → void -
gt(
) → void -
hashtag(
) → void -
lbracket(
) → void -
lcurly(
) → void -
local(
StreamChar char) → void -
lparen(
) → void -
lt(
) → void -
mod(
) → void -
mult(
) → void -
newline(
) → void -
nil(
StreamChar char) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parseDoubleBracketStr(
) → Token -
parseNumber(
) → Token -
parseRawName(
) → StreamChar -
peek(
{int? offset}) → StreamChar -
raw(
) → void -
rbracket(
) → void -
rcurly(
) → void -
read(
String expected) → StreamChar -
repeat(
StreamChar char) → void -
rparen(
) → void -
self(
StreamChar char) → void -
semicolon(
) → void -
str(
{required String start, required String end}) → void -
sub(
) → void -
termAnd(
StreamChar char) → void -
termBreak(
StreamChar char) → void -
termDo(
StreamChar char) → void -
termElse(
StreamChar char) → void -
termElseIf(
StreamChar char) → void -
termFalse(
StreamChar char) → void -
termFor(
StreamChar char) → void -
termIf(
StreamChar char) → void -
termIn(
StreamChar char) → void -
termNot(
StreamChar char) → void -
termOr(
StreamChar char) → void -
termReturn(
StreamChar char) → void -
termThen(
StreamChar char) → void -
termTrue(
StreamChar char) → void -
termWhile(
StreamChar char) → void -
toString(
) → String -
A string representation of this object.
inherited
-
until(
StreamChar char) → void
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited