23 lines
631 B
Java
23 lines
631 B
Java
package io.gitlab.jfronny.muscript.compiler.lexer;
|
|
|
|
import io.gitlab.jfronny.muscript.compiler.*;
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
public interface Lexer {
|
|
CodeLocation location();
|
|
MuScriptVersion version();
|
|
boolean wasNewlinePassed();
|
|
Token getPrevious();
|
|
Token advance();
|
|
|
|
@Nullable String getSource();
|
|
@Nullable String getFile();
|
|
|
|
record Token(String lexeme, io.gitlab.jfronny.muscript.compiler.Token token, int start, int current, char ch, CodeLocation location) {
|
|
@Override
|
|
public String toString() {
|
|
return token + " '" + lexeme + "'";
|
|
}
|
|
}
|
|
}
|