Files
fantaibao-qlexpress4/src/main/java/com/alibaba/qlexpress4/aparser/AliasTokenSource.java
small-red-hat 2dfed7464e
Some checks failed
Reduce Adoc / reduce (push) Failing after 57s
Java Unit Test with Maven / test (push) Failing after 1m42s
first
2025-12-29 13:59:13 +08:00

54 lines
1.3 KiB
Java

package com.alibaba.qlexpress4.aparser;
import org.antlr.v4.runtime.CharStream;
import org.antlr.v4.runtime.Token;
import org.antlr.v4.runtime.TokenFactory;
import org.antlr.v4.runtime.TokenSource;
public class AliasTokenSource implements TokenSource {
private final TokenSource tokenSource;
private final ParserOperatorManager operatorManager;
AliasTokenSource(TokenSource tokenSource, ParserOperatorManager operatorManager) {
this.tokenSource = tokenSource;
this.operatorManager = operatorManager;
}
@Override
public Token nextToken() {
return SyntaxTreeFactory.preHandleToken(tokenSource.nextToken(), operatorManager);
}
@Override
public int getLine() {
return tokenSource.getLine();
}
@Override
public int getCharPositionInLine() {
return tokenSource.getCharPositionInLine();
}
@Override
public CharStream getInputStream() {
return tokenSource.getInputStream();
}
@Override
public String getSourceName() {
return tokenSource.getSourceName();
}
@Override
public void setTokenFactory(TokenFactory<?> factory) {
tokenSource.setTokenFactory(factory);
}
@Override
public TokenFactory<?> getTokenFactory() {
return tokenSource.getTokenFactory();
}
}