eu.cqse.check.framework.scanner.WorkItemStatementOracle Maven / Gradle / Ivy
Show all versions of teamscale-check-api Show documentation
package eu.cqse.check.framework.scanner;
import org.conqat.lib.commons.collections.ILookahead;
import com.teamscale.wia.TeamscaleIssue;
/**
* Statement oracle for token representation of work items ({@link TeamscaleIssue} and subclasses).
*
* Every token, that is not a {@link ETokenType#isLiteral() literal} denotes the end of a statement.
* Literals are the actual values of the fields (e.g. {@link TeamscaleIssue#getSubject()}). This
* results in only the literals being detected as statements, everything else is discarded.
*/
public class WorkItemStatementOracle implements IStatementOracle {
@Override
public boolean isEndOfStatementTokenType(ETokenType tokenType,
ILookahead lookahead) throws X {
return isEndOfStatementToken(tokenType);
}
@Override
public boolean isEndOfStatementToken(ETokenType tokenType, ILookahead lookahead)
throws X {
return isEndOfStatementToken(tokenType);
}
private static boolean isEndOfStatementToken(ETokenType tokenType) {
return !tokenType.isLiteral();
}
}