bool.LexerAdapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bool Show documentation
Show all versions of bool Show documentation
Boolean expression evaluator
package bool;
import java.io.IOException;
class LexerAdapter implements Parser.Lexer {
private final Lexer lexer;
public LexerAdapter(Lexer lexer) {
this.lexer = lexer;
}
@Override
public Expr getLVal() {
return new Var(lexer.yytext());
}
@Override
public int yylex() throws IOException {
return lexer.yylex();
}
@Override
public void yyerror(String s) {
throw new SyntaxError(s, lexer.getYyline() + 1, lexer.getYycolumn() + 1);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy