public Object visit(ASTLimitOffset node, Object data) {
int child = 0;
if (node.hasOffset) {
Node offsetNode = node.jjtGetChild(child++);
if (offsetNode instanceof ASTParameter) {
ASTParameter param = (ASTParameter) offsetNode;
Class parameterType = getParameterType(param.number);
if (int.class != parameterType && Integer.class != parameterType) {
throw new IllegalStateException("OFFSET parameter must be an int");
}
offsetParam = param.number;
} else {
ASTExactNumericLiteral param = (ASTExactNumericLiteral) offsetNode;
offsetValue = (int) param.value;
}
}
if (node.hasLimit) {
Node limitNode = node.jjtGetChild(child);
if (limitNode instanceof ASTParameter) {
ASTParameter param = (ASTParameter) limitNode;
Class parameterType = getParameterType(param.number);
if (int.class != parameterType && Integer.class != parameterType) {
throw new IllegalStateException("LIMIT parameter must be an int");
}
limitParam = param.number;